• Advertisement
Sign in to follow this  

How to put it together

This topic is 4678 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

Hi gamedevS: I've read some books, articles, and stuff like that, and I've got to know and understand a little bit about all the parts of a game (graphics, sound, physics, ai, etc.) obviously at a basic level. In all this kind of writing authors explain "oh, yes the basic game loop" (input, logic, updating), but it's not like you'll only call functions within functions (only if it's pure C with a lot of global values) but there must be a whole classes relations, uses, and so, that need to be well planned. What I'd like to know is if any of you know where can I find a good reference (preferably online) on how should a game engine (not only the engine, but the game itself) be designed, the classes design, and all that stuff; not only in a general way, but also in a more detailed level, and not only in one way to do things, but also how to apply different scopes in the design to achieve different things. Thanks for your time and good luck!!

Share this post


Link to post
Share on other sites
Advertisement
best reference I can possibly imagine to give you:

http://www.gamedev.net/reference/programming/features/enginuity1/

This is a series of articles written by the moderator superpig. In it he discusses how to design a game engine (ie:the game loop).

Share this post


Link to post
Share on other sites
Maybe the Cone3D tutorials would be good for you. They use SDL, which is a great graphics library when you're learning..

Share this post


Link to post
Share on other sites
Those that know me know I absolutely love this article. It's very simplistic and once it clicks, you'll understand exactly how the objects in your game loop will function on their own. All you do is define their behaviors, intiialize them, and boom! Off they go.

It's such a simple idea, and it works really well. You basically just call an update function and an (optional) draw function for each object per frame and let time do the rest.

So for any basic game, you're going to define the environment (can be as simple as a 2D quad for the ground and a skybox), define the actors (how they draw and how they act), add utilities (camera, GUI, etc.), a little sound, and there's your engine. Set up whatever game states you'll need (opening screen, main world, combat, whatever), and then just script away. It's like magic, baby!

Seriously, the best way to learn all the basics of a game is to make a very simple one. Try pong or tetris. You'd be amazed at how much you can learn from a simple game like that.

Here's a great article on how to get a real simple game up using java.

Once you've gotten a simple project like that up and running, you can just slowly build on the various areas and enhance them all. You'll have a great project up in running in no time (and of course by no time I mean a several weeks/months).

Hope this helps!

EDIT:
Initially when I read your post I thought you were asking how the overall game comes together. Upon re-reading it, it seems like you might be asking how to do each of those little parts. Is that the case?

If so, I'd still recommend the pong demo to get an idea of how a game works overall, and then moving on to the various areas. Most people have the greatest interest in graphics and AI, so maybe pick an API (I'd recommend OpenGL) and roll with that. Once you get a good understanding of graphics, try some simple AI (A* is pretty fun). Whatever interests you, really, just read all you can about it and play.

If you really want to see it all in action, download a free 3D engine like Ogre and just pick it apart. There are a ton of articles here on gamedev as well as gamasutra and flipcode (if you can tolerate navigating it).

Just pick a piece at a time and start hacking away at it. Read allf that you can and ask specific questions as you think of them and it'll come together quickly.

If you have any questions or there's a particular topic you're interested in, don't hesitate to ask (you can PM me if you'd like, or just post here).

Share this post


Link to post
Share on other sites
My question isn't about how to do every part (AI, physics, etc) but on how to to get them to work together in a well designed and ordered way.

For example, I can do a Pong demo, but it keeps just being a few objects (the ball, paddle, table) which only interact by colliding, and then drawin everything. In this case, the behavior only comes to each simple object. In more complex games, there may be shared behavior, more complex, interactions, events, and even drawing is not only drawing, but may require other tasks. In this kind of games, I suppose there must be a more complex interaction between all classes, like passing messages, triggering events, checking states, and so for every aspect of the game (logic, physics, graphics, etc). I know just a little about OO Design, and as I understand a good design must be clear, must caracterize pretty good every class, must allow a good encapsulation and isolation of the code.

So my question is more about the classes architecture design, and the classes relations for a well designed software.

For instance, I don't even know what kind of relation should exist between a game object (character or so) and the renderer. Should the renderer use the game object? or should the game object use the renderer?

I don't know if my question is clearer that way or more confusing.

Thanks to everyone for your help

Share this post


Link to post
Share on other sites
Well, I don't know of any online resources other than what's been mentioned already. Maybe check out this thread which I just recently posted in. It's on the same topic, and got some interesting responses which may be worth your while.

Share this post


Link to post
Share on other sites
One question cef, what brought you to game dev (CS courses, gaming interest, boredom, whatever?) and how long have you been learning? I'm sooo itching to get past the learning stage and program MY games.

Sorry, that is a pair of questions. :)

Share this post


Link to post
Share on other sites
What brought me to gamedev was the will to learn to make games, and solve problems I can't solve myself.

I've been studing - leaving - studing again - leaving again.... for about 2 years or so.

I've just programmed small games like the pong clone and a sidescrolling beat em up! kind of game. But whenever I try to do another game, I think of some aspect, then another, then another, and when I try to put it all together I don't know where to start from, and get all the ideas revolved.

I think that's becaus most books and articles focus on code, and there's not much about the design. I've read a little about OO Desgin, but I don't get to apply it for games.

By the way I didn't study CS, I've just studied by myself and somethings with help of a friend who has a master in computer graphics. But he left to L.A. so I haven't had the chance to learn more from him.

Share this post


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

  • Advertisement