Topic: Editor keeps game changes after ending the player

I'm in the editor, then I play the game, then I press ESC to return to the editor. Sometimes the editor keeps the player changes (e.g. entities position after collisions), sometimes not (how it should be). I would like to understand more about this.

Re: Editor keeps game changes after ending the player

What platform are you in ? are you using a custom game plugin ?

The first possibility is that Maratis is not able to save a temporary level when you press play,
but I'm surprised that it's variant, it could be a authorization problem or so.

Second possibility, if you are using a custom plugin, is that you have a behavior that run during editor mode,
if it is the case, ensure the behavior call this on top of update :

MGame * game = engine->getGame();

// check if the game is running, removing this test will enable In-Editor update (like for the lookAt behavior)
if(! game->isRunning())
    return;

Re: Editor keeps game changes after ending the player

About the plugin, this is what I initially thought, but the same happened with the joint demo.
I'm on Windows 7 and I have Maratis on C:\ and I'm not administrator for security reasons, so it could be permission stuff, I'll check that.

Re: Editor keeps game changes after ending the player

normally you don't need to be administrator,
but I'm not sure how the permissions works in all cases,
Maratis asks windows for a temporary directory and create a temp file there that is used to reload the level.

Can you check if you see a level in C:\users\username\AppData\Local\Temp, where username is your user account name ?
Check just after you started the game because the temp level is then deleted when you go back to editor.

(The dir could be something different than AppData\Local\Temp thought)

Re: Editor keeps game changes after ending the player

Yes I've found "temp.level" file.
I have problems reproducing the bug consistently though, it doesn't happen very often, so it's a bit tricky to do tests.

Last edited by 255 (2013-10-06 10:34:26)

Re: Editor keeps game changes after ending the player

did you run multiple instances of Maratis at the same time by any chance ?
or was the system lagging or something when the bug occurred ?

Re: Editor keeps game changes after ending the player

anael wrote:

did you run multiple instances of Maratis at the same time by any chance?

No but I loaded another project from the editor menu. The previous project was mine, which uses a game plugin. The second project was the joint demo.

anael wrote:

or was the system lagging or something when the bug occurred ?

No.

Last edited by 255 (2013-10-08 12:40:50)