Page 1 of 1

XML Q: autodeploys

PostPosted: Wed Aug 25, 2010 6:49 am
by natty dread
Is there a limit to positive/negative autodeploys?

ie. what type is the autodeploy variable... I would assume it to be an int32, but idk...

I just thought it'd be neat to make a different kind of "killer" territories, ones which will in practice always leave you just 1 troop on the territory... so you can theoretically hold them but can't stack any troops on them.

So to make this work within a reasonable scale (I've seen games with 10:s of thousands of troops) the decay should be set somewhere around -100000. Will it work?

Re: XML Q: autodeploys

PostPosted: Thu Aug 26, 2010 9:55 am
by ender516
Clever idea. If they are in fact int32, then you want -2147483648, which will reduce any positive number to a negative value, which would presumably be converted to a 1. Knowing the actual code would help avoid weird occurrences (underflows and whatnot). For example, if the code ever negates this value, it will still be the same! So, if the code checks for a negative autodeploy, then negates it to check if it is larger than the current troop value before trying to subtract it, things could get quite weird. If it simply adds the autodeploy, positive or negative, then checks for a value less than one which would be restored to one, then everything is kosher.