Q: Order of moving units with GoTo at start of the turn

Various topics about the game, the website, or anything else Freeciv related that doesn't fit elsewhere.
User avatar
Corbeau
Elite
Posts: 840
Joined: Mon Jan 13, 2014 11:13 pm

Q: Order of moving units with GoTo at start of the turn

Postby Corbeau » Fri Oct 26, 2018 1:27 pm

Does anyone know what is the order in which units with GoTo orders are moved at the start of the turn? Is it random or it has some specific sequence?

cazfi
Elite
Posts: 1559
Joined: Tue Jan 29, 2013 6:54 pm

Re: Q: Order of moving units with GoTo at start of the turn

Postby cazfi » Fri Oct 26, 2018 2:28 pm

Order of players is random, so one does not get advantage by being player #1.
For a player, units are processed in order. This is usually the order in which the units have been acquired (built, bribed, captured). The client may proceed unit focus in the same order, as long as you don't yourself make some unit to w)ait, but I think there's cases where this is not true.

User avatar
Corbeau
Elite
Posts: 840
Joined: Mon Jan 13, 2014 11:13 pm

Re: Q: Order of moving units with GoTo at start of the turn

Postby Corbeau » Fri Oct 26, 2018 2:52 pm

So, the order of players is random? Once a player is on, ALL his GoTo units move, and only after that it's another player's GoTo units turn?

User avatar
Corbeau
Elite
Posts: 840
Joined: Mon Jan 13, 2014 11:13 pm

Re: Q: Order of moving units with GoTo at start of the turn

Postby Corbeau » Thu Nov 08, 2018 10:05 am

cazfi wrote:Order of players is random, so one does not get advantage by being player #1.
For a player, units are processed in order. This is usually the order in which the units have been acquired (built, bribed, captured). The client may proceed unit focus in the same order, as long as you don't yourself make some unit to w)ait, but I think there's cases where this is not true.

Ok, just checking, the order of units is by order of acquiring? Not the ID? (usually both are the same, but I'm just checking).

cazfi
Elite
Posts: 1559
Joined: Tue Jan 29, 2013 6:54 pm

Re: Q: Order of moving units with GoTo at start of the turn

Postby cazfi » Thu Nov 08, 2018 12:16 pm

Corbeau wrote:
cazfi wrote:Order of players is random, so one does not get advantage by being player #1.
For a player, units are processed in order. This is usually the order in which the units have been acquired (built, bribed, captured). The client may proceed unit focus in the same order, as long as you don't yourself make some unit to w)ait, but I think there's cases where this is not true.

Ok, just checking, the order of units is by order of acquiring? Not the ID? (usually both are the same, but I'm just checking).

Yes, the order in which they are added to player's list of units (umh. this can actually be reverse order, haven't checked). This can be different from the order of IDs for example when one bribes enemy unit with lower ID.

User avatar
Corbeau
Elite
Posts: 840
Joined: Mon Jan 13, 2014 11:13 pm

Re: Q: Order of moving units with GoTo at start of the turn

Postby Corbeau » Thu Nov 08, 2018 12:17 pm

Wait, it can be reverse order?

cazfi
Elite
Posts: 1559
Joined: Tue Jan 29, 2013 6:54 pm

Re: Q: Order of moving units with GoTo at start of the turn

Postby cazfi » Thu Nov 08, 2018 2:11 pm

Corbeau wrote:Wait, it can be reverse order?

I'm not sure whether newly acquired units are added to the end or to the beginning of the list. Adding them to the beginning would probably be faster (no need to find end of the list).