ROUTES.DAT

From UFOpaedia
Revision as of 23:43, 7 February 2007 by Pi Masta (talk | contribs) (→‎See Also: added category)
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

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) is set for nodes where an alien starts. Whether the alien is alive, or dead from power plant explosion, is irrelevant.

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. (Misc 1 and Misc2 are only used on a few maps of TFTD)

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. (there are a few theories regarding what this byte is used for: alien's facing direction; number of turns that it should remain there; the importance of the node when the AI decides the next node that the alien will move to. None have been proven so far)

22/16 - Always seems to be set to 0. (the exception is also seen in TFTD, with a few maps having different values)

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