Skip to main content
gamedev.net
🔒 Locked

Basic Game Engine Design

Started by mgavan 0 replies 400+ views
Original Post
mgavan
mgavan
Hi, I know I''ve also posted this message in the "Game Programming" forum, for this I apologize, but that was acceidental and I thought this would be a more fitting place for this type of question. Anyway ... on with the question ... I''m looking to start writing my very first game in the not to distant future. Its going to be be small and simple, but at the same time I want to learning something about designing a game/graphics engine. My initial plan is to design a "Support" layer for math stuff, lists and file reading, etc. Followed by the creation of a "System" layer with a number of sub-systems classes that will be used to interact with: 1) The OS 2) Graphics - DirectX Graphics 3) Input - DirectInput 4) Sound 5) Other stuff Next, I was planning to implement the rendering layer and it is here where I''m struggling! I would like to know how I should go about implementing the "Rendering" layer in terms of How should I store the world objects? Where should the transformations happen? When should I apply the BSP/Portal etc algorithms? What should go in this layer? ..... you get the picture?!? Can someone please provide me with some "Best Practices" or articles that will be useful in my little adventure?!?!? Many Thanks, Michael
ZeroEffect
ZeroEffect
First, I begin by saying that this is only my own personal approach and it''s what I''ve found best that works for me. But by no means should you be limited by one "strict" technique. Experiment and find out what works best for you.

I like to use an Object-Oriented approach (bending the rules where I need to). Almost everything is broken down into base classes and from there I''ll make more complex classes composed of those base classes. From a graphics perspective there is a:
- Material class
- Texture class
- Light class
- Vertex Buffer class
- WorldPosition class
and others...

These now provide the basis for my Object(.obj) class to load and display Wavefront models. In each model is a vertex buffer, material(s), texture(s) and all the related methods to accurately display the mesh to the screen. The WorldPosition is used to keep track of where the mesh is displayed in world space and this allows many meshs to be displayed at different locations on the screen. So, the transformations are applied on a per object basis.

Again, this is just a personal approach but it keeps thing manageable and modular.

Chris Z.
ZeroFX Interactive
Chris Z. GPU FX

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.