Unit Ids

Unit Ids

Here is where ideas can be collected for the skirmish AI in development

Moderators: hoijui, Moderators

Post Reply
submarine
AI Developer
Posts: 834
Joined: 31 Jan 2005, 20:04

Unit Ids

Post 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?
User avatar
Kuroneko
Posts: 483
Joined: 03 Jan 2005, 05:32

Post 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.
User avatar
jcnossen
Former Engine Dev
Posts: 2440
Joined: 05 Jun 2005, 19:13

Post by jcnossen »

Actually it maintains a list of free unit ids, FILO style. It begins with the 4999 as unit id.
User avatar
Kuroneko
Posts: 483
Joined: 03 Jan 2005, 05:32

Post 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...
submarine
AI Developer
Posts: 834
Joined: 31 Jan 2005, 20:04

Post 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?
User avatar
krogothe
AI Developer
Posts: 1050
Joined: 14 Nov 2005, 17:07

Post 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?
SJ
Posts: 618
Joined: 13 Aug 2004, 17:13

Post by SJ »

It will set unitlimit to 5000/number of teams if its higher than that.
User avatar
krogothe
AI Developer
Posts: 1050
Joined: 14 Nov 2005, 17:07

Post by krogothe »

I could swear i saw somewhere the unitlimit was 10k
then again 5k units is more then enough!
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post 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.
Post Reply

Return to “AI”