2

I was wondering if anybody had any good sources for a game structure. I know this is very vague, so i'll try to explain more of what i'm talking about. I'm curious about a 3d game by the way, specifically using directx or opengle, although i know 2d games can probably use similar structures.

There are many many books and sources on the net for doing specific things like collision detection, using directx or opengl, rendering, using shaders, and all that, but there really is a lack of sources for an actual game structure.

Mainly i'm wondering how modern games organize the objects in their scene, when to update them, like what order to update them, how animation interacts with phsycis and rendering for example. also where to send events and how to initialize all of this. I'm sure they put all of this into lists, but how do they keep it organized?

Of course i know there are a million ways to do things, and all games do things differently depending on what exactly they need. but i'm curious about how some of them go about doing it, keeping their scene, objects, and events organized and know when to update the systems and objects and in what order.

EDIT: What i'm looking for is more of a diagram of the layout of systems and classes and whatever, just a general idea of the flow of a game loop if that makes sense. I know how to do most of the technical things. I know how to make simple games in 3d and in 2d. i'm just wondering about how big-league games go about initializing all the components of the game, then going through the game loop. I just think it's really hard to keep it all organized, so all the objects update and send events efficiently. of course, i could do a brute force method and just update every single object in the scene, but that's not right. I guess most games make use of a scene graph, but even then, how should the objects in the scene be organized in the scene graph, and when should they update? hope that's more clear of what i'm asking. But thanks for the comments

iedoc
  • 2,266
  • 3
  • 30
  • 53
cody
  • 61
  • 1
  • 4
  • what you seek can be found in game engines ! i suggest you to look at some 2d game engines because of their simplicity ! with some digging you should understand the structure beneath – Duke Jun 09 '12 at 09:57
  • look at here... it is stackoverflow.com , you can ask for help, when you have a simple code or something that you done. anyway, ocelot (i like snake more) right, start with 2d engines, after understanding the basics and rules go for 3d... – Hosein Jun 09 '12 at 10:00
  • 3
    This question suits http://gamedev.stackexchange.com/ or programmers.stackexchange.com – Ozair Kafray Jun 09 '12 at 10:02
  • @OzairKafray: No it does not. It's not welcome on *either site*. They're not a dumping ground for these kinds of questions. It's a bad question period. – Nicol Bolas Jun 09 '12 at 12:07

2 Answers2

1

I recommend you to read "How to layout the code of a simple game" answer from here.

But if you interesting in Game Engine Layouts, just go to gamedev.net - there are a lot of cool links and topics to read out, for example "Game engine layout".

Community
  • 1
  • 1
Sergei Danielian
  • 4,938
  • 4
  • 36
  • 58
0

Check out Fabien Sanglard's website, it's absolutely AWESOME for any game developer.

He's doing reviews of the opensourced IDtech game engines, which are some of the most advanced ones, and some other gaming/rendering related engines.

http://fabiensanglard.net/

He just published a code review of the Doom3 engine.

Gui13
  • 12,993
  • 17
  • 57
  • 104