File tree Expand file tree Collapse file tree 2 files changed +35
-0
lines changed
Expand file tree Collapse file tree 2 files changed +35
-0
lines changed Original file line number Diff line number Diff line change 7474 - [ Town Hall Details] ( ./patches/town-hall-details.md )
7575- [ File Formats] ( ./file-formats.md )
7676 - [ CPR] ( ./file-formats/cpr.md )
77+ - [ Trade Routes (.rou)] ( ./file-formats/rou.md )
7778 - [ Navigation Matrix] ( ./file-formats/navigation-matrix.md )
7879 - [ Navigation Vector] ( ./file-formats/navigation-vector.md )
7980 - [ Navpoint Matrix] ( ./file-formats/navpoint-matrix.md )
Original file line number Diff line number Diff line change 1+ # Trade Routes (.rou)
2+ The saved trade routes are stored in ` ./Save/AutoRoute ` .
3+ An uncomporessed trade route is an array of route stops, 220 bytes each.
4+ The rou file format is defined as:
5+ ```
6+ | 00 01 02 03 04 05 06 07 |
7+ 00000000 | Output Length | Data |
8+ ```
9+
10+ If the output length is bigger than ` 0 ` the file is compressed.
11+ Otherwise the absolute value of the negative output length denotes the length.
12+
13+ ## Compression
14+ The compression algorithm has not been identified, but the decompression was [ reproduced] ( https://github.com/P3Modding/p3-lib/tree/master/p3-rou ) .
15+
16+ ## Trade Route Stops
17+ A trade route stop is defined as:
18+ ```
19+ | 00 01 02 03 |
20+ 00000000 | Unused | Town Index | Action |
21+ 00000004 | Ware Order Array |
22+ ...
23+ 0000001c | Ware Price Array |
24+ ...
25+ 0000007c | Ware Amount Array |
26+ ```
27+ The "direction" of a transaction is encoded in the price and amount:
28+
29+ | Price| Amount| Direction|
30+ ||||
31+ | 0| Negative| Ship -> Office|
32+ | 0| Positive| Office -> Ship|
33+ | Positive| Positive| Ship -> Town|
34+ | Negative| Any| Town -> Ship|
You can’t perform that action at this time.
0 commit comments