Convert map/savegame files to lua
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
widelands |
Won't Fix
|
Undecided
|
Unassigned |
Bug Description
We should save map files and savegames as lua files. This will make them human-readable and make it possible to edit them manually.
A map or savegame could be one large table with subtables for terrains, resources, immovables etc that map every coordinate point to the desired value.
For scenarios, the lua file could contain a function, and the mapfile-table has an entry that points to the function.
The minimap and other images would have to be stored separately somewhere.
new_map_
name = _"Checkmate",
size = {96, 96},
resources = {
{20, 10} = {"coal", 10},
…
},
terrains = {
{0, 0, "r"} = "summer_water",
{0, 0, "d"} = "summer_meadow2",
…
},
…,
game_data = { -- savegames only
players = {"My Name", "Your Name"},
tribes = {"empire", "atlanteans"},
field_owners = {
{0, 0} = 1,
…
},
binary = {
-- lots of serials for economy state, AI-persistance etc, doesn´t need to be human-readable
},
…
},
scenario = my_main_
minimap = "data/maps/
…
}
A save game is a saved game. Why should it be possible to tweak the saved game?
The only thing in could think of is to manipulate it. Would this be good goal?