Please login or register.

Login with username, password and session length
Advanced search  

News:

IRC channel - server: waelisch.de  channel: #wme (read more)

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - adonf

Pages: 1 ... 7 8 [9]
121
Technical forum / Problems with dual screen
« on: April 11, 2006, 01:56:37 PM »
Hi again !

I have a dual screen configuration (nividia 6800 + 2 screens: one on analog and one on digital output) that seems to be causing troubles in Wintermute.

The "Game settings" dialog box shows 2 display devices, but the second one is always set by default.

If I manually select the first screen then start the game everything is fine, either in windowed mode or full screen. The only minor problem is that when i drag the window into the other screen the frame rate drops a lot, i'll explain that later.

If I keep the second screen as selected by default, it's a whole different story: in windowed mode the game opens on the left screen (aka screen 1) and runs at 20 FPS instead of about 800. when I drag the window into screen 2 then i get 800 FPS. In full-screen mode, the game opens on the right screen (screen 2) but the mouse pointer stays in screen 1 and can only move in a 800x600 area.

So what I'd like to know is how to get the device selection screen to select the first screen by default and not the second.

I'm also surprised that there should be such a big drop in frame rate when the game runs in a window on the wrong screen, because I haven't noticed anything like that in other programs. Any ideas ?

Thanks,
  Olivier

122
Technical forum / Re: WME crashes with Array's and dynamic Object's
« on: April 11, 2006, 11:54:48 AM »
oops, bad cut and paste. i just edited the code

123
Technical forum / Re: WME crashes with Array's and dynamic Object's
« on: April 11, 2006, 10:07:06 AM »
Thanks for the answer and the fix !

By the way, I managed to work around the bug by using a local variable inside the "for" block instead of a variable that is local to the whole function. Hmm, I guess this doesn't make any sense, so here's an example:

Code: Text
  1.         var j;
  2.         var cur_drop;
  3.         for  (j = 0 ; j < drop_array.Length ; j = j+1 )
  4.         {
  5.                 cur_drop = drop_array[j];
  6.                 // do something here
  7.         }
  8.  

Code: Text
  1.         var j;
  2.         for  (j = 0 ; j < drop_array.Length ; j = j+1 )
  3.         {
  4.                 var cur_drop = drop_array[j];
  5.                 // do something here
  6.         }
  7.  

... maybe this will be of some help...



124
Technical forum / WME crashes with Array's and dynamic Object's
« on: April 10, 2006, 05:04:26 PM »
Hi,

First of all, I recently discovered WME and I'm really impressed by the amount of good work that was put into it. You did a truly amazing job, Mnemonic !

I'm working on a simple minigame to be included in an adventure game and I'm getting a crash in wme.exe when my scripts add dynamic game objects to an Array. I made a simple project that documents that, I'll post the code at the end of this message. Actually, adding the dynamic objets seems to work, but when I try to read the array's first element the executable crashes.

I tried it with v. 1.6b2 and 1.5.2, both crash. Is it something that I did wrong ?


I suppose it might have something to do with objects being freed when they're still referenced, which leads me to my next question:

How does object deallocation work in WME ? I couldn't find any documentation about it, is there some kind of garbage management that frees unreferenced objects and kills the scripts that run on them ? I know that nobody really cares about memory management on the PC ;) but still, it would be nice for me to stop the scripts once a minigame has stopped.

Thanks
  Olivier

Code: Text
  1. #include "scripts\base.inc"
  2.  
  3. // here comes the stuff which initializes the scene
  4. actor.SkipTo(400, 400);
  5. actor.Direction = DI_DOWN;
  6. actor.Active = true;
  7.  
  8. // minigame globals
  9. global TestGame;
  10.  
  11. ////////////////////////////////////////////////////////////////////////////////
  12. // scene state
  13. global Statetestcrash;
  14.  
  15. // default values
  16. if(Statetestcrash==null)
  17. {
  18.   Statetestcrash.Visited = false;
  19.  
  20.   TestGame = new Object("scenes\Room\scr\testcrash.script");
  21. }
  22.  
  23. ////////////////////////////////////////////////////////////////////////////////
  24. // run game
  25. while (TestGame.GameState != "end")
  26. {
  27.         TestGame.Update();
  28.         Sleep(50);
  29. }

Code: Text
  1. #include "scripts\base.inc"
  2.  
  3. Initialize();
  4.  
  5. method Initialize()
  6. {
  7.         this.DropObjects = new Array();
  8.         this. frames = 0;
  9. }
  10.  
  11.  
  12. method Update()
  13. {
  14.         this.frames = this.frames + 1;
  15.        
  16.         var drop_array = this.DropObjects;
  17.  
  18.         // create objects at frames 2 and 4
  19.         if (2 == this.frames)
  20.         {
  21.                 Game.LOG("creating toto1");
  22.                 var toto1 = new Object("scenes\Room\scr\bogus.script");
  23.                 drop_array.Push(toto1);
  24.         }
  25.         else if (4 == this.frames)
  26.         {
  27.                 Game.LOG("creating toto2");
  28.                 var toto2 = new Object("scenes\Room\scr\bogus.script");
  29.                 drop_array.Push(toto2);
  30.         }
  31.  
  32.         var j;
  33.         var cur_drop;
  34.         for  (j = 0 ; j < drop_array.Length ; j = j+1 )
  35.         {
  36.                 cur_drop = drop_array[j];
  37.                 // In real life we would do something with cur_drop
  38.                 // but to make the runtime crash we simply need to reference it.
  39.         }
  40.  
  41.         // print the content of drop_array
  42.         Game.LOG("frame num " + this.frames);
  43.         Game.LOG("Size and content of drop_array:");
  44.         Game.LOG(drop_array.Length);
  45.         var i;
  46.         for  (i = 0 ; i < drop_array.Length ; i = i+1 )
  47.                 Game.LOG(drop_array[i]);
  48. }


Code: Text
  1. #include "scripts\base.inc"
  2.  
  3. // object position
  4. this.PosX = 0;
  5. this.PosY = 0;
  6.  

Instructions: just create an default project with a scene called 'Room' and save the files into data\scenes\Room.




Oops, almost forgot the log file:
Code: [Select]
17:58: frame num 1
17:58: Size and content of drop_array:
17:58: 0
17:58: creating toto1
17:58: frame num 2
17:58: Size and content of drop_array:
17:58: 1
17:58: [object]
17:58: frame num 3
17:58: Size and content of drop_array:
17:58: 1
17:58: [object]
17:58: creating toto2
17:58: frame num 4
17:58: Size and content of drop_array:
17:58: 2

and the crash log file
Code: [Select]
---------------------------------------------------------
---------- WME crash report: 10-04-2006, 17:58 ----------
---------------------------------------------------------
wme.exe caused a EXCEPTION_ACCESS_VIOLATION in module wme.exe at 001B:00431CE2
EAX=00000000  EBX=00AE2BF8  ECX=00D6CFB8  EDX=FFFFFFFF  ESI=00D6B5B8
EDI=00579BFC  EBP=00D6CAB0  ESP=0012F598  EIP=00431CE2  FLG=00010246
CS=001B   DS=0023  SS=0023  ES=0023   FS=003B  GS=0000
Stack trace:
001B:00431CE2 (0x00020002 0x010E01F5 0x00D67FF8 0x00AE01B8) wme.exe


Pages: 1 ... 7 8 [9]

Page created in 0.232 seconds with 98 queries.