Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

Possible Duplicate:
How to implement turn-based game engine?

I am considering making a game like Master of Orion but I don't know how to start with turn-based systems. If any of you played this game they know what I mean, same system is used in Civilization. 1. You give orders to your units and production queues 2. Click End Turn. 3. Everything moves, go to 1.

I know that some form of state machine is used, but maybe you could point me into some book or manual on the matter.

share|improve this question

marked as duplicate by Tetrad Jul 19 '11 at 15:43

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
"How do I create a game of this genre?" is a rather broad question - do you have a specific question about the development of this type of game? I would say, just go try creating one, and come back here when you get stuck. –  BlueRaja - Danny Pflughoeft Jul 18 '11 at 20:08
    
It seems that you posted pretty much an identical question to what you had before. If you have a specific question feel free to ask that, but as the above comment stated, this is also overly broad. –  Tetrad Jul 19 '11 at 15:47

1 Answer 1

up vote 18 down vote accepted

It's worth pointing out that there are really two kinds of "turn-based" systems. There's the true turn-based system, and there's the immediate-mode hybrid.

In a true turn-based system, you come up with a set of orders, but nothing actually happens until you push the "end turn" button. There's no combat, there's no production, there's just you laying out orders for what you think should happen during that turn. For examples, look at the PC game Dominions III, and the classic board game Diplomacy. In games like this you never have to ask questions like "which unit should attack first this turn" because there is no "attack first" concept - everything occurs simultaneously. This is also the genre that's amenable to play-by-email. Every player makes their orders, every player hits "go", every player looks at the new turn with dismay as their entire plan collapses due to everyone else interfering.

In the weird hybrid mode, generally unit movements and combat happen "immediately". Generally you can buy units, and that also happens immediately. You can say things like "I'll attack this force, and if I lose, I'll buy reinforcements before the next turn". Eventually you run out of action points and you have to hit end-turn, at which point it does end-of-turn effects like healing, resource gathering, and also lets other players take their turn. This is often known as "hot-seat play" because each person can do their turn in a row, but has to sit there waiting for the other players.

In the first case, it's pretty simple. Each unit, building, and city keeps information about what its next move is. When you hit end turn everyone carries out their orders - you just run the simulation, in whatever manner your simulation requires to run.

In the second case it's also pretty simple. Some units (generally buildings) have orders, but most units just do what you say, immediately, often with a pretty little animation. You'll need to keep track of when they have to stop doing things.

If you want more than that, you'll have to tell us what you're having trouble with. :)

share|improve this answer
2  
+1 for a wonderful overview of these two types of games. –  Randolf Richardson Jul 18 '11 at 21:07

Not the answer you're looking for? Browse other questions tagged or ask your own question.