Page 1 of 1
Unit Ids
Posted: 30 Nov 2005, 21:45
by submarine
Does anybody know how the id a unit gets in the game is determined?
is it just an integer between 1 and MAX_UNITS?
Posted: 01 Dec 2005, 02:09
by Kuroneko
In a two player game, the commanders are IDs 1 and 2, the next thing built is 3, and so forth. This is a departure from how TA did it. TA made it so that with a 500 unit cap, commander 1 was 1, and commander 2 was 501.
Posted: 01 Dec 2005, 02:20
by jcnossen
Actually it maintains a list of free unit ids, FILO style. It begins with the 4999 as unit id.
Posted: 01 Dec 2005, 02:37
by Kuroneko
Zaphod wrote:Actually it maintains a list of free unit ids, FILO style. It begins with the 4999 as unit id.
Really? I coulda sworn it was the other way...
Posted: 01 Dec 2005, 14:10
by submarine
ok thats what i wanted to hear :) it means that a unit id can never be higher than the max. number of units, right?
Posted: 01 Dec 2005, 17:34
by krogothe
yes zaph is right, and following his logic then the answer is yes. But what happens if theres a lot of players and the unit limit is higher than 500?
Posted: 01 Dec 2005, 19:15
by SJ
It will set unitlimit to 5000/number of teams if its higher than that.
Posted: 01 Dec 2005, 20:23
by krogothe
I could swear i saw somewhere the unitlimit was 10k
then again 5k units is more then enough!
Posted: 01 Dec 2005, 20:29
by AF
All our AI's use arrays of 10,000 to store returned arrays of untis, with the expectation that the engien ahs a maximum of 10000. I knew this was true in version 0.4 but I wasnt aware ti had changed.