Ticket #2825 (closed patch (an actual patch, not a request for one): fixed)
Load maps last, so data in them doesn't break things
| Reported by: | cybersphinx | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | unspecified |
| Component: | other | Version: | unspecified |
| Keywords: | Cc: | ||
| Blocked By: | Blocking: | ||
| Operating System: | All/Non-Specific |
Description (last modified by cybersphinx) (diff)
As the subject says. Since we treat all the search paths equal, a new loop is needed, so maps really get loaded fast (similar to the videos, only those need to be first). Also attached a revert of the mapmod patch on which the other patch is based. Patches are for master, I have them for 2.3 as well though.
Attachments
Change History
Changed 7 months ago by cybersphinx
- Attachment 0002-Load-maps-last-so-files-in-them-don-t-override-game-.patch added
comment:2 Changed 7 months ago by vexed
I tested this, and it works. Ran out of time, or I would have stuck it in for the next release build we do.
This also prevented bad map/mods from crashing master.
comment:3 Changed 7 months ago by Iluvalar
Unzip the mods in the next release. And just tell peoples to do so when they want to save on another "unsupported" mod. That fix it on my side. I agree it's not optimal, our code should be wise enough to check for .wz files himself, but There is no need to brake map-mod support for that.
Anyway the only complaint we heard about for now is for "old-1.10-balance" and unzipping the file will solve it.
Changed 7 months ago by cybersphinx
- Attachment 0004-Don-t-remove-file-extensions-from-mod-names.patch added
comment:4 Changed 7 months ago by cybersphinx
Patch #3 redoes the mapmod support in an imo cleaner way. Mod savegames are still broken with that though.
Patch #4 removes the code that removes extensions from mod names. That way, the whole filename is saved in savegames, and loading them works whether the mod is explicitly loaded or not.
That doesn't work if people expand their mod between saving and loading, and old savegames without .wz in the name won't work with the .wz mod.
comment:5 Changed 7 months ago by Zarel
Patch 4 seems a weird solution. The mod loader is supposed to automatically add ".wz" when searching for mods that match a savegame - what happened to that functionality?
comment:6 Changed 7 months ago by cybersphinx
No idea. Since fiddling around with rebuildSearchPath wasn't successful, I tried a different approach, and grepping the source for ".wz", the only seemingly useless place it turned up was addLoadedMod. If it ever worked, nobody noticed when it broke.
comment:7 Changed 7 months ago by Zarel
Patch 4 and bug #2735 seem entirely unrelated to my map-mod patch, so something nefarious seems to be going on, and I feel like patch 4 is just a hack that's covering up a different problem.
I'm going to spend some time looking for a better solution today.
comment:8 Changed 7 months ago by cybersphinx
Your patch removes the .wz mod somehow from the loaded mods (as does my patch 3 btw, by calling rebuildSearchPath with force=true). So, the solution is simple: just don't bother with trying to match names with/without .wz, but use the string we have directly.
comment:9 Changed 7 months ago by Zarel
Hmm. If both our patches do the same thing, why did you rewrite it? o_O
I also don't understand how matching names has anything to do with removing mods from the loaded mods list.
comment:10 Changed 7 months ago by cybersphinx
Because I only found that out after having rewritten it. (And as mentioned, I find it simpler than your version.)
Me neither, I assume that's somewhere in your mod code. All that I know is, everything regarding mod saves and mapmods that I've tried works with my patches.
comment:11 follow-up: ↓ 14 Changed 7 months ago by zydonk
Actually, several other mods are failing in v238, for instance, the v1.04AI mod and the scav mod. So far, only the aivolution mod works. If someone can discover why that works, then perhaps a solution will be found.
comment:12 Changed 7 months ago by cybersphinx
Fail the same way as the 1.10 mod, i.e. are not reloaded from savegames? Also, links to the mods would be nice.
comment:13 Changed 7 months ago by zydonk
Yes, exactly the same. Links to the mods - for early mods: http://forums.wz2100.net/download/file.php?id=9055; and for the scav mod: http://forums.wz2100.net/download/file.php?id=9102
comment:14 in reply to: ↑ 11 Changed 7 months ago by cybersphinx
Replying to zydonk:
So far, only the aivolution mod works. If someone can discover why that works, then perhaps a solution will be found.
Aivolution doesn't work for me here either. Have you done anything to it, like unzip it, or rename it from Aivolution.wz to Aivolution?
comment:15 Changed 7 months ago by zydonk
Checked again - not so. Looks as tho' I opened a 238 aiv savegame with 236 aiv. There's a gaggle of these shortcuts on the desktop.
So it seems - without undertaking an exhaustive test - that no mod savegame will open in 238.
comment:16 Changed 7 months ago by cybersphinx
Revert the mapmod support.
Revert "Merge remote-tracking branch 'zarel/topic/mapmodloader'"
This reverts commit aed2474ae511c1b49c041f85e5dfd793549725f6, reversing changes made to 8934dfd527941c52bb4d31a02f7a5d77527d0101.
Revert "Merge remote-tracking branch 'zarel/topic/mapmodloader'"
This reverts commit 460d7c005b601aaab8ccc510a12ab166c6fcb448, reversing changes made to db46f369200365e5cc6459b0fe71c0f4b6444972.
Conflicts:
src/main.cpp
comment:17 Changed 7 months ago by cybersphinx
Load maps last, so files in them don't override game data.
Refs #2825.
comment:18 Changed 7 months ago by cybersphinx
Redo mapmod support.
Based on Zarel's earlier patch. Also adds support for unzipped maps in their own subdirectory.
Refs #2825.
comment:19 Changed 7 months ago by cybersphinx
Don't remove file extensions from mod names.
Fixes loading of savegames with a mod, whether the mod is loaded from the command line or not.
Old savegames won't work unfortunately, and savegames started with a .wz mod won't continue if that mod gets expanded later.
comment:20 Changed 7 months ago by cybersphinx
Load maps last, so files in them don't override game data.
Refs #2825.
comment:21 Changed 7 months ago by cybersphinx
Redo mapmod support.
Based on Zarel's earlier patch. Also adds support for unzipped maps in their own subdirectory.
Refs #2825.
Conflicts:
src/main.c
comment:22 Changed 7 months ago by cybersphinx
- Status changed from new to closed
- Resolution set to fixed
Don't remove file extensions from mod names.
Fixes loading of savegames with a mod, whether the mod is loaded from the command line or not.
Old savegames won't work unfortunately, and savegames started with a .wz mod won't continue if that mod gets expanded later.
Fixes #2735, closes #2825, #2610.
Conflicts:
src/main.c
