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

Each node record is 24 bytes, so the file size is equal to that times the amount of records in the entire map.

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.

Structure

0/00 - Y position of node.

1/01 - X 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.
  • 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.
  • 3 - The type of unit that can travel along this connection.
0 = Any
1 = Flying
2 = Flying Large
3 = Large
4 = Small

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

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

20/14 - The rank, or the team, of unit that can spawn at this node.

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? Exact use unknown.

22/16 - Always seems to be set to 0.

23/17 - Ranges from 0 to 10, Daishiva calls this the "spawn" byte? A value of 0 makes it almost impossible for an alien to spawn there (although not impossible if there are more aliens than nodes with a value higher than 0)

See Also