Opened 14 years ago

Closed 12 years ago

Last modified 12 years ago

#641 closed defect (fixed)

Atlas crashes when you "Leave the game" while in the the simulation

Reported by: dee@earlsoft.co.uk Owned by: ben
Priority: Should Have Milestone: Alpha 10
Component: Atlas editor Keywords: editor, simulation, leave game, crash
Cc: Patch:

Description

I know it's a silly thing to do, but as it let me... :p I ran a simulation and let all my units get killed. When it said I was defeated, I clciked Yes to leave the game and it crashed with: Unhandled access violation reading 0x00000004 Location: Unknown:0 (?) Call stack: 0142DF27 0142CE1F 013AB9C1 013AB9D9 013D795E 013D7988 013BA036

OS Error: 487 attempt to access invalid address.

On showing the message, it immediatly crashes and falls back to the installed debugger.

(Alpha 2 on Windows Vista)

Attachments (2)

crashlog.txt (16.0 KB ) - added by dee@earlsoft.co.uk 14 years ago.
crashlog.dmp (56.8 KB ) - added by dee@earlsoft.co.uk 14 years ago.

Download all attachments as: .zip

Change History (7)

by dee@earlsoft.co.uk, 14 years ago

Attachment: crashlog.txt added

by dee@earlsoft.co.uk, 14 years ago

Attachment: crashlog.dmp added

comment:1 by dee@earlsoft.co.uk, 14 years ago

Summary: Atlas crashes when you "exit" after being defeated in a simulationAtlas crashes when you "Leave the game" while in the the simulation

This also happens when you quit from the menu.

comment:2 by Philip Taylor, 13 years ago

I'm not entirely certain what we ought to do here (though I expect it shouldn't involve crashing). Maybe disable the exit buttons in the GUI when running inside Atlas? Maybe work like the stop/reset simulation buttons (i.e. revert to editor mode and initial world state)? I guess the latter would be simpler since we wouldn't need to special-case the GUI scripts for editor mode.

comment:3 by historic_bruno, 13 years ago

Looking at how the simulation buttons work, it can't be that simple because they rely on having the game data intact. It seems shortly after exiting the game that data is deleted, causing the null pointer exception. Running initialization again would be required if we wanted to get back to a playable state in Atlas. Seems more complex than having a global variable or API call for the engine GUI that we can use to determine if we're in editor mode when leaveGame() is called. We could have a dialog that says something to the effect of "You are in editor mode: press reset to end simulation and resume editing".

comment:4 by ben, 12 years ago

Owner: set to ben
Resolution: fixed
Status: newclosed

In 11575:

Handle game ending in Atlas a bit more gracefully, it now continues until the user stops the simulation test. Fixes #641.

comment:5 by historic_bruno, 12 years ago

Milestone: BacklogAlpha 10

Solved this for now by handling the Atlas case in the session GUI. The best solution would be making "leave game" equivalent to pressing the simulation Reset button in Atlas, but I think we need a way to send messages from the engine to AtlasUI to do that properly. At least now it shouldn't crash :)

Note: See TracTickets for help on using tickets.