Jump to content
  • Advertisement
Sign in to follow this  
Mistro

Organizing Game Structure

This topic is 4813 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Well I was just wondering if there were any decent tutorials on how to organize a game structure. Quite basically, I have all this time been creating little games. Later on I moved on to DX and then created my own little engine of sorts which I use for all my projects. It does things such as managing vertex and index buffers and rendering them in the most efficient way properly internally while in the game, all that needs to be called is a simple "render" function to the handle of the vertex list. The engine then takes the handle, finds the list in memory and adds it to the render list and renders when it thinks it would be efficient to (ie: something using the same texture is being rendered) but anywho, my point is, after doing all this, I have been anxious to create a bit more large scale project other than all this simple stuff like 3d versions of breakout for example. But I find that when starting projects with what knowledge I know, I tend to get un organized in the coding no matter how indepth I try to make my design document. The thing I've noticed is that I don't inclue how the game coding itself is organized (classes etc) since I don't know what a good way of doign that would be. So far, for my latest project, (Just getting a space ship to move to certain points, adding spaceships, and grouping them - similar to basic functions of an RTS) Ive just been doing something like an object manager which has a linked list of base entity objects. The base class for an object is semi abstract in its init, update and release functions but contains functions for everything that I think an object will need such as movement controls, a trans. matrix, and some functions to calculate these easier (using the little engine I made's math objects) The derived objects (in this case, ships of different types) have their own unique functions etc. Now the thing is, this method seems to get really complicated really fast. I mean where do I stick in the rendering functions? how about drawing the HUD displays? Do i create a manger for that too and update it? Many questions about how to organize it since the only "working" thing I have is the object manager. But I don't know how to integrate it with the rest of the game such as input etc. Should each object have its own controller? or should the manager iterate through the list to see which object has a being "controlled" flag and do that? This is why I'm asking for some tutorials on how to structure games. -Mistro

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by Mistro

I try to make my design document. The thing I've noticed is that I don't inclue how the game coding itself is organized (classes etc) since I don't know what a good way of doign that would be.


-Mistro



welcome to software engineering, software engineerinhg is more about how the game works from a coding point of view, than what the game itself does...

Some people divide things into resources, ie, bitmaps meshes etc, renderer, ie, how things should be drawn, and (as far as I know), users, ie things that use resources this could be anything from a particle engine to units (in an rts for instance). If you have already started to sort by texture etc, then you're probably already on the right tracks.

Share this post


Link to post
Share on other sites
Actually the game itself dosn't sort by texture and stuff. The game simple calls a Render of the game engine and gives it a handle to the vertex list stored in the engine. The engine takes care of adding the fact that this has to be rendered but not right away. It then renders them whenever it is efficent to do so (ie another calls i made to render with a large amount of vertecies using the same texture. Then the engine just sends all the vertecies down to be rendered using that texture)

Well I guess this does sound like software engineering but the articles on this site seem to be a bit too vague or advanced. Are there any "simple joe" type tutorials out there? I'm still a high school student so those papers seem to be a bit over my head at the moment and seem to be aimed at more advanced programmers.

Share this post


Link to post
Share on other sites
If you haven't seen it already check out the series of articles here on Enginuity.

I'm somewhat at the same point where you are, i've done some small projects, but attempts at larger projects have been very educational in terms of bad design decisions. Anyways, right now i'm going through 3D Game Engine Programming by Stefan Zerbst, and have been very happy with it so far. Despite that it largely uses Direct3D, the interfaces are designed so that creating an implementation with SDL and OpenGL (I run linux on my main dev machine) shouldn't be that tough.

Share this post


Link to post
Share on other sites
Yea Ive read that book and actually its one of the best and most informative I've read since it only gives you a basic idea of code instead of handing it to you on a silver platter like some other books, but thanks for the suggestion :)

Well the thing is, I'm not really looking into how to build an engine but more into how to organize the game itself. More of the higher level stuff instead of the nitty gritty the engine handles since the game shouldn't have to deal with all that.

I read this article on Gamasutra called The Guerrilla Guide to Game Code, <http://www.gamasutra.com/features/20050414/rouwe_01.shtml> which is a pretty good article. What interested me the most was the whole entity/entity representation bit of it with that picture. Ive tried implementing all that but I get bogged down when I get to details about the messaging system and stuff. What do I use as a messaging system? A LIFO type list? or something more like the windows msg proc? And which takes precedance over another? the Entity manager? or the Representation manager? Should the rep manager call the update for the corresponding entity or vice versa? or should the game loop itself call two seperate things which update all the items attached to the entity/rep list whih is basically a double handle linked list type thing?


I'm looking for tutorials on how to code things like that and not really the nitty gritty rendering stuff since thats already been taken care of.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!