Highest level order:
- xcom first
- then aliens
- then civilians
If "civilianSpawnNodeRank" > 0 for a deployment, then the order changes to:
- xcom first
- then civilians
- then aliens
During alien deployment, aliens are deployed in the order they are defined in "data" attribute... usually commanders first, leader next, soldier last... but it's up to you to define that.
Each alien then uses its rank to find a corresponding node, using the following table.
If alien rank > 7, then it is treated as alien rank = 7.
/* following data is the order in which certain alien ranks spawn on certain node ranks */
/* note that they all can fall back to rank 0 nodes - which is scout (outside ufo) */
const int Node::nodeRank[8][7] = {
{ 4, 3, 5, 8, 7, 2, 0 }, //commander
{ 4, 3, 5, 8, 7, 2, 0 }, //leader
{ 5, 4, 3, 2, 7, 8, 0 }, //engineer
{ 7, 6, 2, 8, 3, 4, 0 }, //medic
{ 3, 4, 5, 2, 7, 8, 0 }, //navigator
{ 2, 5, 3, 4, 6, 8, 0 }, //soldier
{ 2, 5, 3, 4, 6, 8, 0 }, //terrorist
{ 2, 5, 3, 4, 6, 8, 0 } }; //also terrorist
For example alien rank 0 (commander), will use the first line:
{ 4, 3, 5, 8, 7, 2, 0 }, //commander
and will first look for node rank 4... if there is no such node free, it will look for node rank 3.... if not found, it will look for node rank 5... and so on.
If it doesn't find any node, it will not be generated.... unless on Superhuman difficulty where it will spawn anyway, next to some other already placed alien.