-
Notifications
You must be signed in to change notification settings - Fork 0
Loading a game doesn't load which units were recycled #251
Comments
Buginator commented This is a savegame limitation. Would require a new savegame format to fix. |
Buginator changed milestone from |
anonymous commented But the new format wouldn't be incompatible, would it? It just needs a new block "experience for new units", and if that doesn't exist (in old saves) just go on without it. It's quite annoying, so a fix for 2.2 would be very nice. |
Buginator commented We can't change the structure, if we do, it will break the savegame. It does a binary blob dump... |
cybersphinx commented What exactly breaks? Newer Warzone can load older saves, right? But older Warzone cannot load new saves? |
Buginator commented Replying to Warzone2100/old-trac-import#251 (comment:5):
That would be correct. |
cybersphinx changed blocking which not transferred by tractive |
Zarel commented WAIT. We already have the savegame structure in place!
We can do this without a new savegame version! |
stiv changed status from |
stiv commented Unsupported version. |
cybersphinx changed status from |
cybersphinx changed operating_system which not transferred by tractive |
cybersphinx set resolution to |
cybersphinx changed milestone from |
cybersphinx commented Replying to Warzone2100/old-trac-import#251 (comment:9):
So? The problem still exists. |
cybersphinx changed status from |
cybersphinx changed resolution from |
Zarel commented We should really only be closing "unsupported version" bug tickets if they are difficult to reproduce. |
stiv commented Feel free to add a test case showing the problem in a current version. |
cybersphinx uploaded file |
cybersphinx commented Load the savegame, recycle unit, save game, reload the new save, build unit. Unit doesn't get experience. |
cybersphinx commented I've looked at the code a bit, and it looks at least like it should work, I've put some printfs in the save routine and those show some non-zero values (9 and 7 for the two units near the command center in the above save). But reloading then shows all as 0... (Putting a watch on the experience array in gdb to see where it is accessed delayed startup somewhat, I think it ran for over an hour when I noticed my CPU load and killed it...) The savegame is for trunk, btw, not sure if it works in 2.3, but the same happens there. |
cybersphinx commented My debug printfs were wrong, actually the experience is reloaded correctly. But then, we use buildDroid to construct droids when loading a game, and that eats up the saved experience. |
cybersphinx uploaded file |
cybersphinx commented Ok, so we used buildDroid() both in game and for loading, and it used up recycled experience when loading a game. Above patch fixes that, by checking if the game time is running (which it isn't when loading a game, but maybe there's a better indicator for that). There's one strange thing in src/game.c:2297 (trunk), where game time is started when loading a saved game fails (was already that way in the original source). If time isn't stopped somewhere before loading a game again, this might lead to this fix not working after a failed load. |
Per commented So the experience was not lost, it was just distributed to random other units while loading the game? |
cybersphinx commented And then it was overwritten by the loaded experience, so effectively lost after all. |
Zarel commented Okay, so: Load the experience after calling buildDroid on all the droids? |
Zarel commented i.e. instead of this:
do this:
|
Buginator commented Replying to Warzone2100/old-trac-import#251 (comment:17):
With my rather limited testing, it looks like that patch works. |
the_cybersphinx changed status from |
the_cybersphinx changed resolution from `` to |
the_cybersphinx commented (In [10584]) Don't use recycled experience when game time is stopped. Should fix #251. The problem was that buildDroid() is used both for loading and This could lead to other problems, if there is a valid reason why buildDroid() |
Git SVN Gateway <gateway@...> commented (In [a044ab3e6fbacf0038846b2e016560f58d9bd3c4]) Don't use recycled experience when game time is stopped. Should fix #251. The problem was that buildDroid() is used both for loading and This could lead to other problems, if there is a valid reason why buildDroid() git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@10584 4a71c877-e1ca-e34f-864e-861f7616d084 |
the_cybersphinx commented (In [10604]) 2.3: Don't use recycled experience when game time is stopped. Should fix #251. The problem was that buildDroid() is used both for loading and This could lead to other problems, if there is a valid reason why buildDroid() src/droid.c | 5 ++++- |
Git SVN Gateway <gateway@...> commented In [a044ab3e6fbacf0038846b2e016560f58d9bd3c4]:
|
keyword_Saving_Units_Experience_in_Recycle
resolution_fixed
type_bug
| by goku75703@...I started a campaign game with the Grim's GFX mod, played for a bit, and send 3 units to be recycled. I then setup an order to build 3 more units (to get the experienced units back), after 1 unit was build I saved the game and quit.
When I loaded the game back and the next 2 units came out, they did not have any kills (the previous were all ranked). The one that came out before I quit was set properly though.
Vista 32-Bit Home Basic
Email me if you have any need for further information.
Issue migrated from trac:251 at 2022-04-15 17:54:59 -0700
The text was updated successfully, but these errors were encountered: