ROUTES.DAT

From UFOpaedia
Jump to navigation Jump to search

This file is only used by tactical saves.

It is a collection of all nodes on the map, and uses much the same format as the .RMP files in the routes folder. Aliens and civilians are placed randomly amongst these nodes when combat begins, and (prior to spotting your units) patrol between them.

If a unit cannot be placed because you've run out of appropriate nodes, it'll use a non-appropriate node instead. This means that sometimes alien leaders won't be inside their ships.

X-Com units don't spawn according to these nodes if you use an Avenger. Need to test the other craft, and base offense/defense missions. - BB

After a new tactical map has been generated from the small map sections, the records are read from the corresponding .RMP files in order of left to right, top to bottom. However the X-Com and Alien craft nodes are always saved until last, and so appear at the end of the file.

Each record is 24 bytes, so the total file size is equal to that times the amount of records in the entire map. Decimal/Hex offsets:

Structure

0/00 - X position of node.

1/01 - Y position of node.

2/02 - Z position of node.

3/03 - Map section counter. All nodes from the first map segment will have this flagged as 0, the nodes from the next map segment as 1, the next segment 2, and so on.

4/04 - 18/12 - Each node can connect to multiple other nodes. These 15 bytes contain 5 records of 3 bytes each, detailing those connections:

  • 0 - The record number of the connected node. 255/FF if unused. When the game engine pieces the small map segments together, if an external node can't be connected, the spare connection record will be disabled. A common example is a connection that would make a unit walk off the playing field. For external node connections this number is FE:North, FD:East, FC:South, FB:West.
  • 1 - The distance to the connected node. If the connected node was not originally in the same .RMP file, this is calculated by adding the two connection distances together.
  • 2 - The type of unit that can travel along this connection.
0 = Any
1 = Flying
2 = Flying Large
3 = Large
4 = Small

Check the discussion page for these values, because they are probably wrong

19/13 - The type of unit that can spawn at this node.

0 = Any
1 = Flying Small
2 = Small
3 = Flying Large
4 = Large

Check the discussion page for these values, because they are probably wrong

At least, modulo 8. The above is exhaustive only for reference data in the routes folder, and non-UFO nodes in Battlescape saves.

Bit 3 (value 8) Spawn point used flag. Set so another unit can't spawn here at the start.

Bit 4 (value 16) may be set for nodes sourced from UFO reference data...and furthermore is sometimes changed by processing during the alien turn for these nodes. Presumed (needs more testing): in patrol mode nodes sourced from UFO reference data, the AI explicitly prefers (but is not guaranteed to) to stop moving on nodes with bit 4 set.

Bits 5-7 are uniformly 0 for medium scouts. Other UFO types have not been verified yet. Neither have terror sites or alien bases.

20/14 - The rank, or the team, of unit that can spawn at this node. (Misc1 is only used on TFTD, Misc2 appears on both games)

0 = Civilian / "Scout"
1 = X-Com
2 = Alien Soldier
3 = Alien Navigator
4 = Alien Leader / Commander
5 = Alien Engineer
6 = "Misc1"
7 = Alien Medic
8 = "Misc2"

21/15 - Ranges from 0 to 8, Daishiva calls this the "flags" byte. Governs whether an alien will attempt to destroy a base module. Apparently, the higher the number, the greater the chance the aliens will start shooting. So far, this has only been tested on an X-COM base defense mission but seems to hold. No other maps or modules have been tried.

An alternative explanation is that the number indicates the 'importance' of the node when the aliens are conducting their patrols. Using Bomb Bloke's graphics I've superimposed on the Battleship map the values for this flag on all the nodes:

Ufo 160 0 flags.gif Ufo 160 1 flags.gif Ufo 160 2 flags.gif

According to this theory the aliens will choose a node with the higher value 'flag' when their AI is set for patroling/guarding, unless it is already occupied. The Battleship schematics above show some proof of this, specially on the bridge area (the aliens that start on the bridge room usually never come out except to have a look outside the door). Now look at the plants for the Supply Ship:

Ufo 170 0 flag.gif Ufo 170 1 flag.gif Ufo 170 2 flag.gif

The ground and first level almost contains nodes with a 1 value, with a single exception - the 3 and 2 of the engine room. This should explain the aliens' behaviour of only using 1 of the UFO's 2 doors - when an alien moves into the node outside the door, it chooses instead to go to the node with the 3 value, and then to the 2 value, diverting the aliens from the 2nd outside door.

Ufo 140 0 flag.gif Ufo 140 1 flag.gif

Next one is the Abductor. Usually the aliens don't come out much and you find a large number of them on the main chamber on the ground, due to the concentration of 3/4s that acts as a bottleneck.

Finally here's the remaining medium/large UFOs. Usually the higher value of this byte also corresponds to a high value on 23/17 (which makes sense due to the importance of the node to increase the probability of units spawned there - Hobbes 19:05, 27 January 2012 (EST))

Ufo 120 0 flag.gif Ufo 150 0 flag.gif Ufo 150 1 flag.gif

Ufo 130 0 flag.gif Ufo 130 1 flag.gif Ufo 130 2 flag.gif

22/16 - Always seems to be set to 0. (the exception is also seen in TFTD, with a few maps having different values) (there are also maps on UFO that contain this flag, such as 2 nodes on the Skyranger map that have a value of 10, 1 node on the Battleships that has a 1 value, etc. - some of those look more like coding errors though)

23/17 - Ranges from 0 to 10, Daishiva calls this the "spawn" byte. A value of 0 makes it impossible for a unit to spawn there.

See Also