Topic: how are map files structured ?
gnarfk Topic Opener |
Posted at: 2019-11-21, 12:45
Hello, i'm interested in map editing, and i would like to try to build / modify algorithmically some maps. In order to create balanced maps (with perfect symmetry or things like that), or geometrically based maps. I could build fully balanced maps for any number of players ... In order to do that, i need to know exactly how the files are made. I tried to find it in the wiki but i could not find anything clear. Thank you Top Quote |
einstein13 |
Posted at: 2019-11-21, 14:14
Hi, I remember few talks about symmetries in Widelands, so first comment to that: Also I was interested in building maps from scratch at starting point (so map will be empty at the beggining and after starting the game, whole will be generated), but it stopped when I realized that it needs:
BUT Maybe you want to create a map on your side only, then upload created map and share with us, then Tibor is the best target person for that idea. He already made a script for such a process. Very good one. https://www.widelands.org/maps/srawerb-ait/ is an example of output of it. einstein13 |
gnarfk Topic Opener |
Posted at: 2019-11-21, 15:52
i know about this.
that is not what i want to do. But do you know if it is possible to do that and to get the map after it, in order to save it in a file and re-use it ?
This was the idea, and if it works i will share maps as well as the tool i would build. I will loot at this link. Top Quote |
Nordfriese |
Posted at: 2019-11-21, 16:38
A savegame file contains the entire map information. So I think you just make a savegame, compare the .wgf folder with some .wmf folder to find which files are extra, delete them, rename .wgf → .wmf, and you have a map file Edited: 2019-11-21, 16:39
Top Quote |
gnarfk Topic Opener |
Posted at: 2019-11-22, 20:59
i've been spending time reading some .wmf files to try to understand it, but i can't get the logic in it. I request just enough information to create a script to create a .wmf file from some heights and terrain arrays ... Top Quote |
gnarfk Topic Opener |
Posted at: 2019-11-23, 15:27
I'm really interested in the script tibor used to create this map ... ps : maybe this topic should be moved to the map editor forum ? Top Quote |
Nordfriese |
Posted at: 2019-11-24, 11:43
The .wmf is a zip-compressed folder containing a number of binary files – one with heights info, one for terrains, one for immovables, etc. Top Quote |
gnarfk Topic Opener |
Posted at: 2019-11-24, 12:43
i just noticed this morning that i could ask the game to save in "not compressed mode" ... in this way it is easier to read the files ! It is why i could not understand anything at first heights, terrain, resources are just arrays ... easy to read/write. mapobjects need still a little work to understand, but i will soon succeed. Top Quote |
gnarfk Topic Opener |
Posted at: 2019-11-24, 22:03
I made a first program, only to create land, with neither resource nor immovables. Here (attached) is the kind of result i have for now ... Top Quote |
gnarfk Topic Opener |
Posted at: 2019-11-25, 11:04
I updated my program, with random forests and rocks. Here is the first result i got with it. Please let me know if you like it or not. (it is still a beginning) Next steps: resources player locations port spaces When all will be finished, a little work on symmetries/translations/rotations .... Do you have some advices on amount of trees,rocks, resources ? i only have to change some parameters ... Top Quote |