Wintermute Engine Forum

Wintermute Engine => Technical forum => Topic started by: Mihulik on August 30, 2010, 02:14:55 PM

Title: The game crashes when changing to the specific scene
Post by: Mihulik on August 30, 2010, 02:14:55 PM
Hi,
I have a weird problem.
The game crashes when I want the game to be changed to the scene B.
However, it occurs only if the game is changed to the specific scene B. If the game is changed to another scene, it works well.
(http://img830.imageshack.us/img830/305/theproblem.jpg)

The script that changes to the scene B is:
Code: [Select]
#include "scripts\base.inc"


on "LeftClick"{
actor.GoToObject(this);
if(Game.IsItemTaken("flaming torch")){
Game.ChangeScene("scenes\Obzorye_Island-Svitava_Complex-Underground_corridor\Obzorye_Island-Svitava_Complex-Underground_corridor.scene");
}
else{
actor.Talk("inventory-08-special-04");
}
}

The scene-init script of the scene B is:
Code: [Select]
#include "scripts\base.inc"

Game.Interactive = false;

if(Game.PrevScene == "Obzorye_Island-Svitava_Complex-Main_hall"){
actor.SkipTo(458, 762);
actor.Direction = DI_UP;
actor.Active = true;
actor.Talk("inventory-08-special-02");
}
else if(Game.DebugMode){
actor.SkipTo(516, 723);
actor.Direction = DI_DOWN;
actor.Active = true;
actor.Talk("The scene has been chosen as the startup scene in the debug mode...");
}


Game.Interactive = true;


Moreover, when I set the scene B as the debug startup scene, it works well too.


I'm really confused. I'll be very glad if anyone give me advice :)
Title: Re: The game crashes when changing to the specific scene
Post by: maze on September 01, 2010, 09:17:59 AM
Hi,

I can't see anything wrong. Have you looked up the "wme.log" file in your game directory? Maybe the information there helps you to track down the failure.

Cheers, maze
Title: Re: The game crashes when changing to the specific scene
Post by: Mnemonic on September 01, 2010, 09:58:39 AM
Can you isolate the crash in some minimal project so that I can test it?
Title: Re: The game crashes when changing to the specific scene
Post by: Mihulik on September 01, 2010, 11:45:45 AM
maze: The log is empty:-/ Nothing strange is written there respectively.

Mnemonic: When I go through the game in the normal (non-debug) mode, it works well. However, when I set the scene A as the debug startup scene and then I try to go to the scene B, it crashes. ???
Title: Re: The game crashes when changing to the specific scene
Post by: odnorf on September 01, 2010, 12:16:58 PM
Please do as Mnemonic said. Send him a minimal project that exhibits this behavior otherwise he can't test or reproduce it.
Title: Re: The game crashes when changing to the specific scene
Post by: Mihulik on September 01, 2010, 03:25:54 PM
Well, I'll ask my teammates whether it'll mind them if I provide you a part of the game.
I don't know any reason why it should mind them but to be sure I'll ask them.
Then, if they don't mind, I'll provide you a test project :)
Title: Re: The game crashes when changing to the specific scene
Post by: Prote1n on September 01, 2010, 03:57:03 PM
I found a almost systematic crash on Game.changeScene on my side. Perhaps it is similar

In my first scene, I have a very simple Window that I use to display the text on the top of the screen. There is only one control : a static

When I quit this Scene for another Scene. I unload the window ( either manually with Game.UnLoad before Game.Change Scene, either on Scene.ShutDown).

The result is that works perfectly under Windows XP. But under Windows 7 64 bits, sometimes the Game.ChangeScene crashed but not systematically. After several tests I've discovered that I can remove the crash foreever just while adding a comment before Game.LoadWindow .....

 
Title: Re: The game crashes when changing to the specific scene
Post by: Mihulik on September 02, 2010, 02:43:08 PM
Well, I've asked my teammates and they've agreed. I could upload you the entire project but it'd be too uncomfortable for you to go through it.
So, I'll isolate the problem in a new project that will be as small as possible. Unfortunately, I'm quite busy today and tomorrow so, I should do it at the weekend :)
Title: Re: The game crashes when changing to the specific scene
Post by: Mihulik on September 04, 2010, 09:09:40 AM
I've sent Mnemonic a PM with a link to download the project. So, we'll see :)
Title: Re: The game crashes when changing to the specific scene
Post by: Mnemonic on September 04, 2010, 09:21:42 AM
Oh that's a rather silly bug. It's caused by the debug display ("Scene: xxx (prev: yyy)"). This debug line is limited to 100 characters and your scene names are too long...
Title: Re: The game crashes when changing to the specific scene
Post by: Mihulik on September 04, 2010, 10:32:08 AM
Oh :)
I thought it could be the reason of the problem but then I refused it because when I set the scene B as the debug startup scene, it was working...However, now I see why. Beucase the previous scene is an empty string then :)
Title: Re: The game crashes when changing to the specific scene
Post by: Mihulik on November 23, 2010, 11:39:01 AM
I'm sorry for awaking this old topic but I'm wondering whether there is a way around the problem.
For example recompiling the engine with longer debug line...I could rename my scenes but I really do not want to.:-)
Title: Re: The game crashes when changing to the specific scene
Post by: Mnemonic on November 24, 2010, 07:57:14 AM
Yes, it needs to be recompiled. Can't think of any workaround other than renaming the scenes.
Title: Re: The game crashes when changing to the specific scene
Post by: Mihulik on November 24, 2010, 11:02:53 AM
So, if I ask you for the sources because of changing that, will it by possible?:)
Title: Re: The game crashes when changing to the specific scene
Post by: odnorf on November 24, 2010, 11:35:01 AM
Sources are available to all (http://forum.dead-code.org/index.php?board=28.0) under LGPL3. Please read the license before you redistribute your own compile.
Title: Re: The game crashes when changing to the specific scene
Post by: Mihulik on November 25, 2010, 07:13:41 PM
Thanks:-)
Mnemonic could you tell me which file affects the length of the debug text line?
Thank you:-)
Title: Re: The game crashes when changing to the specific scene
Post by: Mnemonic on November 25, 2010, 07:18:22 PM
AdGame.cpp, line 2270
Title: Re: The game crashes when changing to the specific scene
Post by: Mihulik on November 25, 2010, 07:19:37 PM
Thanks for your so quick reply:)