Game Loop in Turn Based Game

Started by
2 comments, last by gibson 20 years, 8 months ago
I''m working on a conversion of a random board game for fun, and have come to a point where I need to make a decision about how to deal with the game logic. I know the typical way its done in action or real-time games well enough, with some variation of the "process logic until caught up, and then render until logic needs to be updated" idea. This doesn''t seem the best way to approach things for a turn-based game however, since things on the screen are not constantly changing. Currently I have logic execute until user input is required, at which point it renders the game until input is recieved, and then proceeds to process the game logic until input is required again. It seems to work fine, but I was curious if there exists a better or widely-used game loop paradigm for turn-based games.
Advertisement
What I usually do is to have mutiple threads running. One thread is totally devoted to drawing, the other does input and game logic. This is also useful for background sound/music.
quote:Original post by gibson
... since things on the screen are not constantly changing.


Well I''d like to note that in one of the few turn based games i played, Civilization 3, there was infact animation going on constantly. One example i remember is the workers doing their animations while building roads and mines. I bet alot of the other retail games have animations going on just to let the user know the game hasnt crashed or loading or to make the game more visually appealing. I think it would probably be best to do it this way so if you add any enviornmental effects or any other animations they will be able to play constantly (waves hitting the shores, fires burning, ect.). Of course if you want to keep it simple, then maybe forgoing the game loop would be easier, but i dont know Im definatly not a professional .
For games, everything is real-time because you''d generally want animation (at least) to happen constantly. Keep a game loop going but make any turn based elements work like any other event driven application, act when the click happens.

Mark
Cornutopia Games
http://www.cornutopia.net

This topic is closed to new replies.

Advertisement