widelands does not accept zipped maps with name != dirname

Bug #536189 reported by Nasenbaer
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
widelands
Fix Released
High
Timowi

Bug Description

Current Widelands engine can only read zipped files, if the first directory inside the zip is exactly named like the zip file.
So for example if the top directory of a map is DFT.wmf, the zip file must be named DFT.wmf as well, else widelands won't accept the file.

This can be seen as bug, as the map files can't be renamed by the user without making it unusable

Tags: savegame

Related branches

Timowi (timo-wingender)
Changed in widelands:
status: New → Confirmed
tags: added: savegame
Revision history for this message
Timowi (timo-wingender) wrote :

This is a annoying bug. This affects every zipped file; savegames and maps.

The problem is the redundancy in the zip files: the directory name is saved in the filename and as the folder name inside the zip. How should this be fixed? Which string should be taken? How should new zip files saved?

I think the cleanest solution is to store the content directly in the root of zip files and only take the zip file name as path. For old files the first directory must be stripped away then. This throws the redundancy away completely and this is the way how most zip files are (as far as I know). But this has one disadvantage: Files saved with releases after the change cannot be opened with versions before the change.

A dirty but more compatible solutions is to keep the structure as it is but ignore the directory name while reading zip files. I personally do not like the idea of saving this redundancy just to ignore it later.

I solution in between could be to implement the reading changes first (possibility to load files with directory name or files with content in the root of the zip) and change the storing functions one or two releases later.

opinions?

Changed in widelands:
status: Confirmed → Opinion
Revision history for this message
SirVer (sirver) wrote :

This annoyed me too plenty of time. In fact I wrote a little script to ease renaming of replays for Kristin for the current tournament.

+1 for your first option. I feel backwards compatibility are only important for maps and it will not happen too often that maps of a newer released will be opened with maps of an older release. Obviously newer versions should still understand the old structure of older files.

Revision history for this message
Nasenbaer (nasenbaer) wrote :

I agree with SirVer!

+1 for first option.

Timowi (timo-wingender)
Changed in widelands:
status: Opinion → In Progress
assignee: nobody → Timowi (timo-wingender)
Timowi (timo-wingender)
Changed in widelands:
status: In Progress → Fix Committed
Revision history for this message
SirVer (sirver) wrote :

Released in build16-rc1

Changed in widelands:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.