Port maps to a text-based format for easier editing
Right now editing maps can be tedious as it has to be done either via the in-game editor (which is relatively limited) or by editing the binaries directly with hexedit (which is very tedious and error-prone).
We should split maps into two files, one binary (the map model exported from Blender) and one text-based (ideally the same text format as we would use for #50), e.g. Lugaru1
could become Lugaru1.map
(the model) and Lugaru1.cfg
(the text-based map metadata). It can be other extensions of course :) (typically .json
for the text-based if we used JSON).
The text-based metadata would be stuff like:
- Map objectives
- Skybox, light
- View distance, fading
- Objects, with their type, position, size (scale), tilt and rotation
- Characters (player and NPCs), with their position, clothes (texture + tint), weapons, attribute modifiers, dialogue triggers
- Dialogue texts, with their ID referring to the character triggers (or whatever system is used currently to match them) - if we could also start thinking about internationalization while designing it, it would be a plus
- Hotspots
- Waypoints
- Other stuff I might be missing? It should all be listed sequentially in the map loading and saving code anyway
When loading a map, we would thus load the model and then the metadata. As far as I understand, the map editor would from there on only impact the .cfg file, the binary mesh would no longer be modified by the engine, only by Blender.
At first we should keep the two map systems, so that we can e.g. load a current binary map and save it to the new format to do the conversion.