game object loop?

Started by
1 comment, last by rip-off 13 years, 10 months ago
im not after the general code game loop .

im after a good game object loop

i.e


each object would go through these , from the player, to wall and enemys etc


AI();
movement();
collision()
collisionOutCome();
other();
render();

this is all i have come up with , is there something better
Advertisement
Well, it depends. The first thing that came to my mind is: "each object would go through these , from the player, to wall and enemys etc" is IMHO not the way to go at all.

I tend to hint at the following gamasutra article of a book excerp:
Game Engine Architecture: 14.6 "Updating Game Objects in Real Time"

On the official website of that book there are also some course materials, especiall "Multiprocessor Game Loops". Although it describes more than needed, up from slide 17 or so there are IMHO some insights general enough to be useful in the sense of the OP.

However, I don't think that there is an all-valid game loop out there.
Rule #1 in programming, there is no one true way. There are the requirements and the constraints, and the technologies and techniques that fulfill both.

Your game loop will probably suffice for a large set of games. Smaller games might merge collision and collision response, some games might omit AI. Networked games might handle networking separately from "other".

The right game loop is one that is short and concise yet does everything your game needs to do.

That said, decoupling render frequency from all the other game logic is important. Most games will want to do this.

This topic is closed to new replies.

Advertisement