Has anyone made anything turn based?
I've literally never touched C# before a week ago. My only experience in programing is some PHP I did in high school several years ago. But I think I'm generally getting the hang of it in conjunction with the Unity engine. However, I'm finding implementing a turn based UI driven battle system more difficult to write than a shooty real time game---contrary to my initial expectations---and was wondering if anyone had any pointers or outright guides. There is a surprising lack of such resources on the Unity forums/tutorial sections.
More specifically, I'm having trouble with two sections: Taking away control from whoever's turn it isn't (which is fairly important in a turn based game, it turns out) and determining turn order when it can change during battle.
Turns aren't player vs AI like XCOM style, but based on individual units on either side. Currently, that order is determined by a Speed stat. The number of individual unit turns * unit Speed = when they next move.
So a unit with a speed of five would move at intervals 5, 10, 15, 20, 25, etc.
A unit with a speed of seven would move at intervals 7, 14, 21, 28.
Empty intervals are passed over.
If there is a tie, (4 speed and 5 speed both tie at 20), the unit with the lower speed goes first. Additional ties are determined alphabetically by the Unit's name, then finally randomly if it is still tied.
However, not only is this unintuitive with a lower Speed being better, but it has complications with Haste type abilities that modify the speed. Depending on the interval, a player could end up going twice in a row despite being slowed down. For example, if their speed was 5 on interval 25, slowed down to a speed of 9, their next turn would be on interval 27, only two away and 3 faster than their next natural turn at interval 30.
Anyway, this comment is too long; I think I've explained enough to maybe get some pointers towards a better direction, so I'll just say thanks in advance?