Jump to content
  • Advertisement
Sign in to follow this  
thedodgeruk

game object loop?

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

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!