AI Data needs to write remaining buildings as strings

Bug #1734199 reported by GunChleoc
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
widelands
Fix Released
High
Unassigned

Bug Description

GamePlayerAiPersistentPacket writes the list of remaining_basic_buildings as IDs. This is unstable, since the identity if the IDs is not guaranteed during saveloading.

Save player.tribe().get_building_descr(index)->name() as a string instead.

cf. https://bugs.launchpad.net/widelands/+bug/1705950/comments/39

Tags: ai crash savegame

Related branches

GunChleoc (gunchleoc)
description: updated
Revision history for this message
hessenfarmer (stephan-lutz) wrote :

did some testing here are my results:

It was definitly one of the changes in r8493 as I tested the provided test game in 8492 and it is loading fine. So I doubt that the issue is about writing the data.
Bug is reproducible in the empire 4 scenario. I did a quick test on a normal map (Einschlag) and there it was not reproducible (saved 3 times, all savegames were loadable).
It is not related to Vesta (aka Player 3) as the game will crash while loading player 2 if player 2 has not achieved basic economy.
I am not sure if this is related to my changes in tribes init.lua and empire.lua will try to port the mission to the new custom load mechanism and try again.

Revision history for this message
TiborB (tiborb95) wrote :

oh, I am bit surprised....

Revision history for this message
GunChleoc (gunchleoc) wrote :

Well, I overlooked it too when I worked on the code.

Revision history for this message
hessenfarmer (stephan-lutz) wrote :

did another test without using my datadir (using the normal datadir of the installation. I tried it with the empire mission 3 --> same behaviour there.
so it seems this is scenario related. It seems to be not related to my empire 4 branch then and not related to normal games

Revision history for this message
hessenfarmer (stephan-lutz) wrote :

In my opinion this bug should be rated as important as it prevents saving a scenario game.

GunChleoc (gunchleoc)
Changed in widelands:
importance: Undecided → High
TiborB (tiborb95)
Changed in widelands:
assignee: nobody → TiborB (tiborb95)
status: Confirmed → In Progress
GunChleoc (gunchleoc)
Changed in widelands:
status: In Progress → Fix Committed
assignee: TiborB (tiborb95) → nobody
Revision history for this message
GunChleoc (gunchleoc) wrote :

Fixed in build20-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.