Opened 2 years ago

Closed 2 years ago

#6391 closed defect (fixed)

Crashes during game save. Cannot serialize NaN values

Reported by: nwtour Owned by: Freagarach
Priority: Must Have Milestone: Alpha 26
Component: Simulation Keywords: regression
Cc: Patch: Phab:D4352

Description

Crashes during game save:

ERROR: Cannot serialize NaN values.
ERROR: Script component Player of entity 6 failed to serialize: Serialize_InvalidScriptValue
Serializing:
({playerID:4, name:"\u0427\u0430\u043D\u0434\u0440\u0430\u0433\u0443\u043F\u0442\u0430 \u041C\u0430\u0443\u0440\u044C\u044F", civ:"maur", color:{r:0.9058823529411765, g:0.7843137254901961, b:0.0196078431372549, a:1}, diplomacyColor:(void 0), displayDiplomacyColor:false, popUsed:NaN, popBonuses:0, maxPop:100, trainingBlocked:false, resourceCount:{food:190, wood:175, stone:262, metal:339}, resourceGatherers:{food:0, wood:0, stone:0, metal:0}, tradingGoods:[{goods:"food", proba:0}, {goods:"wood", proba:0}, {goods:"stone", proba:70}, {goods:"metal", proba:30}], team:1, teamsLocked:false, state:"active", diplomacy:[-1, -1, 1, 1, 1, 1], sharedDropsites:false, formations:["special/formations/null", "special/formations/box", "special/formations/column_closed", "special/formations/line_closed", "special/formations/column_open", "special/formations/line_open", "special/formations/flank", "special/formations/battle_line", "special/formations/skirmish", "special/formations/wedge"], startCam:(void 0), controlAllUnits:false, isAI:true, cheatsEnabled:true, panelEntities:[], resourceNames:{food:"Food", wood:"Wood", stone:"Stone", metal:"Metal"}, disabledTemplates:{}, disabledTechnologies:{}, spyCostMultiplier:1, barterEntities:[], barterMultiplier:{buy:{food:"1.0", metal:"1.0", stone:"1.0", wood:"1.0"}, sell:{food:"1.0", metal:"1.0", stone:"1.0", wood:"1.0"}}})
terminate called after throwing an instance of 'PSERROR_Serialize_InvalidScriptValue'
  what():  Serialize_InvalidScriptValue
Аварийный останов

Attachments (1)

savegame-0022.0adsave (472.8 KB ) - added by nwtour 2 years ago.
Save file. After loading, you need to wait a minute and try to save for the error call

Download all attachments as: .zip

Change History (3)

by nwtour, 2 years ago

Attachment: savegame-0022.0adsave added

Save file. After loading, you need to wait a minute and try to save for the error call

comment:1 by Freagarach, 2 years ago

Component: UI & SimulationSimulation
Keywords: regression added
Owner: set to Freagarach
Patch: Phab:D4352
Priority: Should HaveMust Have

I forgot to serialise the population of an item. -_-'

Steps to reproduce:

  • Queue units (and wait for it to have progressed).
  • Quicksave and -load.
  • Stop the queued units.
  • Notice the NaN in the pop counter.

comment:2 by Freagarach, 2 years ago

Resolution: fixed
Status: newclosed

In 26015:

Some fixes after the ProductionQueue split.

r26000 / rP2600 introduced a serialisation error (#6391).
Also the templates and the code could be improved.

Differential revision: https://code.wildfiregames.com/D4352
Comments by: @Silier, @Stan
Fixes: #6391

Note: See TracTickets for help on using tickets.