by natty dread on Sat Dec 12, 2009 9:08 pm
It could be done without remembering previous states of troops. You could just make a code for the reinforcement, where it marks every territory for how many of the troops have already been moved, and this would only need to be done for the time of the reinforcement, so it wouldn't take too much server space either.
So, it would work like this:
Usually, each territory has one variable: troop count (well, troop owner too, but that doesn't apply here).
For the time of reinforcement, we'll give each territory another variable: number of troops that have already been moved.
So when you start reinforcing, all troops that are moved will be taken from the troop count numbers and moved to the second variables. And from those you can't move again. The game could show the troops on the screen like: 6+2, 8+11, which means that you still have 6 troops you can move, and 2 you can't move on that first territory. Or they could be shown as 8(6), 19(8) which would mean 8 total, 6 movable and 19 total, 8 movable.
Then when the reinforcement is over, all the extra variables are added together with the troop count variables, and you won't be needing the extra variables again until the next reinforcement. Thus, they won't take server space, they'd only take a bit of server memory during reinforcements.
Last edited by
natty dread on Sat Dec 12, 2009 9:29 pm, edited 1 time in total.