Skip to content

Commit 8b53614

Browse files
Add documentation about technology tree file format
1 parent 3ddbb14 commit 8b53614

File tree

1 file changed

+76
-0
lines changed

1 file changed

+76
-0
lines changed

docs/TechTreeJson.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Tech Tree File Format
2+
3+
The tech tree for Generals Zero Hour is built from the information in the `TechTree.json` file, rather than from the game`s ini files, due to the simplification of information retrieval and data loading.
4+
5+
The tech tree description file is a JSON structure containing a list of factions called `TechTree`, each of which consists of the following fields: `ShortName`, `DisplayName`, `DisplayNameDescription`, and the following lists: `Buildings`, `Infantry`, `Vehicles`, `Aircraft`. Each element in these lists is also a structure with fields `Name` (defines which .webp file should be loaded from the `Resources\Icons` directory), `IngameName` (defines which string from the .csf file should be taken as the object name) and a list of lists `KeyboardLayouts`. These layouts represent the possible combinations of the GUI for a unit or building. Each element in a layout is a structure with two fields: `IconName` (which defines which .webp file should be loaded from the `Resources/Icons` directory) and `HotkeyString` (which defines which string from the .csf file should be used for the hotkey of the action).
6+
7+
Example:
8+
9+
```json
10+
{
11+
"TechTree" :
12+
[
13+
{
14+
"ShortName" : "USA",
15+
"DisplayName" : "USA",
16+
"DisplayNameDescription" : "United Stated Of America",
17+
18+
"Buildings" :
19+
[
20+
{
21+
"Name" : "USAColdFusionReactor",
22+
"IngameName" : "OBJECT:ColdFusionReactor",
23+
"KeyboardLayouts" :
24+
[
25+
[
26+
{"IconName" : "USAControlRods", "HotkeyString" : "CONTROLBAR:UpgradeAmericaAdvancedControlRods"},
27+
]
28+
]
29+
}
30+
],
31+
32+
"Infantry" :
33+
[
34+
{
35+
"Name" : "USARanger",
36+
"IngameName" : "OBJECT:Ranger",
37+
"KeyboardLayouts" :
38+
[
39+
[
40+
{"IconName" : "USAFlashbangs", "HotkeyString" : "CONTROLBAR:FlashBangGrenadeMode"},
41+
]
42+
]
43+
}
44+
],
45+
46+
"Vehicles" :
47+
[
48+
{
49+
"Name" : "USADozer",
50+
"IngameName" : "OBJECT:Dozer",
51+
"KeyboardLayouts" :
52+
[
53+
[
54+
{"IconName" : "USAColdFusionReactor", "HotkeyString" : "CONTROLBAR:ConstructAmericaPowerPlant"},
55+
]
56+
]
57+
}
58+
],
59+
60+
"Aircrafts" :
61+
[
62+
{
63+
"Name" : "USAChinook",
64+
"IngameName" : "OBJECT:Chinook",
65+
"KeyboardLayouts" :
66+
[
67+
[
68+
{"IconName" : "USACombatDrop", "HotkeyString" : "CONTROLBAR:CombatDrop"},
69+
]
70+
]
71+
}
72+
],
73+
}
74+
]
75+
}
76+
```

0 commit comments

Comments
 (0)