MantisBT - VCMI
View Issue Details
0002890VCMIAI - Adventure Mappublic2018-02-24 18:422018-02-28 07:23
AVS 
AVS 
immediateblockalways
closedfixed 
0.next 
0.next 
0002890: Savegame backward compatibility is broken
In VCAI::registerGoals type registration is performed during save operation itself, so all newly added registrations (in RegisterTypes.h) considered safe actually break AI state loading.
No tags attached.
child of 0002891new  Find proper solution for AI goals serialization. 
Issue History
2018-02-24 18:42AVSNew Issue
2018-02-25 06:38SXXNote Added: 0007425
2018-02-25 06:44AVSNote Added: 0007426
2018-02-25 06:53SXXNote Added: 0007427
2018-02-25 07:34AVSNote Added: 0007428
2018-02-25 07:35AVSAssigned To => AVS
2018-02-25 07:35AVSStatusnew => assigned
2018-02-25 07:40AVSNote Added: 0007429
2018-02-25 07:43AVSRelationship addedparent of 0002891
2018-02-25 07:44AVSRelationship replacedchild of 0002891
2018-02-27 18:22WarmongerNote Added: 0007430
2018-02-28 07:23AVSStatusassigned => resolved
2018-02-28 07:23AVSFixed in Version => 0.next
2018-02-28 07:23AVSResolutionopen => fixed
2018-02-28 07:23AVSStatusresolved => closed

Notes
(0007425)
SXX   
2018-02-25 06:38   
I suppose we can avoid the problem by simply reseting VCAI state on loading for now. While this will make saves for debugging a bit less useful it's should still keep compatibility for gameplay.

How can we prevent this from happening in future?
(0007426)
AVS   
2018-02-25 06:44   
Resetting state is not enough. Serializer itself crashes.
We have to disable VCAI::lockedHeroes serialiazation completely.
To re-enable this in future we could ensure that goal classes registration do not mess with other registrations.
(0007427)
SXX   
2018-02-25 06:53   
If it crashes on deserialization, how exactly we can skip bogus data?
(0007428)
AVS   
2018-02-25 07:34   
Already done, will push in a moment
(0007429)
AVS   
2018-02-25 07:40   
Fix pushed to https://github.com/vcmi/vcmi/pull/420 [^]
(0007430)
Warmonger   
2018-02-27 18:22   
Oh crap.

Good thing AI doesn't need much debugging right now.