Return-To-The-Roots / s25client

Return To The Roots (Settlers II(R) Clone)
http://www.rttr.info
GNU General Public License v2.0
477 stars 75 forks source link

Enhanced/New map format #639

Open Flamefire opened 7 years ago

Flamefire commented 7 years ago

As S2 stops reading the map after the 0xFF byte we can add additional data afterwards in any format we like. Things that are requested by now are additional map descriptions (#64) and maybe own map previews or a way not to show any preview (#606)

Question is: Do we want an own map format that only contains useful data (we don't use quite some of the S2 layers)? Or do we want to stick to the S2 format, stay compatible and only add data there?

If we use an own format: Do we want separate files (map, image, description, lua, ...) and put them into 1 archive? Or put everything into one file? Separate files might make it easily expandable.

If we stick to S2 format: I'd add at least a preview img and the map description. I'd also use a key-value format so a keyword (like img, desc) indicates the next section which makes it expandable. We can also drop support silently and ignore those keywords.

MarcusSt commented 7 years ago

I'd go for a single file and I'd prefer our own format.

A single file is easier to copy around and makes it impossible to just "forget" something. The best idea would be to support both: either e.g. zip as an archive format containing the files for easier exchange of files or a folder containing them, so that it is easier to test scripts etc. RTTR would need a library supporting the compression format anyway (e.g. libarchive for zip), so it could just compress it and send it via network to the other players. This also makes extensibility easy and we can load individual parts on demand, i.e. we could have full screen previews, but we don't have to load them if we're just playing.

I'd like it if there was some kind of a converter, maybe built into an editor, to convert what's possible to the native S2 map format, but in my opinion it's more important for us to support the "old" map format than to stay compatible.

Spikeone commented 7 years ago

I'd go for multiple files in an archive and I'd prefer our own format as well.

What I like about multiple files in an archive is, that images (like custom preview with arrows etc.) can be drawn in any application, so we wont need a new editor which supports a new format. Also we could still use original maps (which are compatible then).

I don't think we should add a converter to convert new to old format as there is no reason to do so. We should still load old maps and use them the way we do but new maps with enhanced functions shouldn't be compatible anymore as there is 0 use at all. Just consider that: if you need new features for your map (for whatever reason) you use the new format, thus making it useless in the original game. If you need a normal map, you can still use the old format. Also by using an archive which contains the original map file, we'd still be 100% compatible.

Flamefire commented 7 years ago

Created an etherpad for brainstorming. Maybe we can develop a good format there in a way that will serve as a documentation later before we start any development. (Can't work on that in the near future anyway, so no rush from my side) Etherpad: https://public.etherpad-mozilla.org/p/Settlers2.5__New_map_format Merris S2 docu: https://github.com/Merri/settlers2 MapNode class: https://github.com/Return-To-The-Roots/s25client/blob/master/src/gameTypes/MapNode.h