Skip to content
This repository has been archived by the owner on Apr 17, 2022. It is now read-only.

Load maps last, so data in them doesn't break things #2825

Closed
wzdev-ci opened this issue Jul 18, 2011 · 28 comments
Closed

Load maps last, so data in them doesn't break things #2825

wzdev-ci opened this issue Jul 18, 2011 · 28 comments

Comments

@wzdev-ci
Copy link
Contributor

resolution_fixed type_patch (an actual patch, not a request for one) | by cybersphinx


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.

See also #2735, #2610.


Issue migrated from trac:2825 at 2022-04-16 08:29:00 -0700

@wzdev-ci
Copy link
Contributor Author

cybersphinx uploaded file 0001-Revert-the-mapmod-support.patch (6.2 KiB)

@wzdev-ci
Copy link
Contributor Author

cybersphinx uploaded file 0002-Load-maps-last-so-files-in-them-don-t-override-game-.patch (1.8 KiB)

@wzdev-ci
Copy link
Contributor Author

cybersphinx edited the issue description

@wzdev-ci
Copy link
Contributor Author

vexed commented


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.

@wzdev-ci
Copy link
Contributor Author

Iluvalar commented


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.

@wzdev-ci
Copy link
Contributor Author

cybersphinx uploaded file 0003-Redo-mapmod-support.patch (3.7 KiB)

@wzdev-ci
Copy link
Contributor Author

cybersphinx uploaded file 0004-Don-t-remove-file-extensions-from-mod-names.patch (1.5 KiB)

@wzdev-ci
Copy link
Contributor Author

cybersphinx commented


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.

@wzdev-ci
Copy link
Contributor Author

Zarel commented


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?

@wzdev-ci
Copy link
Contributor Author

cybersphinx commented


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.

@wzdev-ci
Copy link
Contributor Author

Zarel commented


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.

@wzdev-ci
Copy link
Contributor Author

cybersphinx commented


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.

@wzdev-ci
Copy link
Contributor Author

Zarel commented


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.

@wzdev-ci
Copy link
Contributor Author

cybersphinx commented


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.

@wzdev-ci
Copy link
Contributor Author

zydonk commented


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.

@wzdev-ci
Copy link
Contributor Author

cybersphinx commented


Fail the same way as the 1.10 mod, i.e. are not reloaded from savegames? Also, links to the mods would be nice.

@wzdev-ci
Copy link
Contributor Author

zydonk commented


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

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Jul 28, 2011

cybersphinx commented


Replying to Warzone2100/old-trac-import#2825 (comment:11):

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?

@wzdev-ci
Copy link
Contributor Author

zydonk commented


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.

@wzdev-ci
Copy link
Contributor Author

cybersphinx commented


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

Refs #2610, #2825.

  • Changeset: [/changeset/9d7e54337961f6e8d966a56f35218c732bb57ed2 9d7e54337961f6e8d966a56f35218c732bb57ed2]
  • URL: [9]d7e54337961f6e8d966a56f35218c732bb57ed2

@wzdev-ci
Copy link
Contributor Author

cybersphinx commented


Load maps last, so files in them don't override game data.

Refs #2825.

@wzdev-ci
Copy link
Contributor Author

cybersphinx commented


Redo mapmod support.

Based on Zarel's earlier patch. Also adds support for unzipped maps in
their own subdirectory.

Refs #2825.

  • Changeset: [/changeset/46d716a20ca80c1460556339ae88a017dbc0d733 46d716a20ca80c1460556339ae88a017dbc0d733]
  • URL: [46]d716a20ca80c1460556339ae88a017dbc0d733

@wzdev-ci
Copy link
Contributor Author

cybersphinx commented


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, refs #2825.

  • Changeset: [/changeset/5216760744be407deece8d90d4a755dd5f1e421f 5216760744be407deece8d90d4a755dd5f1e421f]
  • URL: [5216760744]be407deece8d90d4a755dd5f1e421f

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Aug 8, 2011

cybersphinx commented


Load maps last, so files in them don't override game data.

Refs #2825.

  • Changeset: [/changeset/1838d20c1db487f3e03a5cf8e0f4f3a668b20a5c 1838d20c1db487f3e03a5cf8e0f4f3a668b20a5c]
  • URL: [1838]d20c1db487f3e03a5cf8e0f4f3a668b20a5c

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Aug 8, 2011

cybersphinx commented


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 

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Aug 8, 2011

cybersphinx changed status from new to closed

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Aug 8, 2011

cybersphinx changed resolution from `` to fixed

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Aug 8, 2011

cybersphinx commented


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 
  • Changeset: [/changeset/5886695119364b59f94aa81c3db8d0952dcf59b9 5886695119364b59f94aa81c3db8d0952dcf59b9]
  • URL: [5886695119364]b59f94aa81c3db8d0952dcf59b9

@wzdev-ci wzdev-ci closed this as completed Aug 8, 2011
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant