Please login or register.

Login with username, password and session length
Advanced search  

News:

This forum provides RSS feed. To query recent posts use this url. 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.

Topics - ronin

Pages: [1]
1
Technical forum / Theora video doesn´t run smooth in fullscreen mode
« on: January 13, 2009, 10:43:10 PM »
I converted a video into an ogg-videofile using ffmpeg2theora and created a testgame which simply plays the video using the PlayTheora()-method.

When i start the game in windowed mode the video is played nice and smooth. But if i start it in fullscreen mode some of the frames seem to be skipped. The displayed frame rate is ~3200 fps on my computer while running the game in windowed mode but is limited to ~60 fps while running in fullscreen mode.

Is the framerate limitation in fullscreen mode responsible for this problem?
Or do i have to set certain parameters in ffmpeg2theora? (I used the following parameters for the conversion: -v 10 --optimize.)

By the way: i tested a commercial game based on the Wintermute Engine called "1 1/2 Ritter" which also seems to use the video playback functions of the engine. I noticed the same behavior as in my testgame when playing the film trailer.

2
During evaluating version 1.8.8 (Beta) of the WME i made some tests with the actor movement/animation and tried some things a player probably never would do, but can do.
I noticed that if the player continuously clicks at the same position the actor's animation always restarts from beginning while walking to this position. This also happens if the player clicks on another position while the actor is already walking but does not change the direction.

The first problem can be dealt with for example by extending the "scene.script" like this
Code: WME Script
  1. #include "scripts\base.inc"
  2. actor.LastX = -1000; // an init value which is different from a valid position value
  3. actor.LastY = -1000; // an init value which is different from a valid position value
  4. ////////////////////////////////////////////////////////////////////////////////
  5. on "LeftClick"
  6. {
  7.     // when the scene is left-clicked, just send the actor to the specified point
  8.     // if the actor is not already walking to it.
  9.     if (actor.LastX != Scene.MouseX || actor.LastY != Scene.MouseY)
  10.     {
  11.         actor.LastX = Scene.MouseX;
  12.         actor.LastY = Scene.MouseY;
  13.         actor.GoTo(Scene.MouseX, Scene.MouseY);
  14.     }
  15. }
  16.  

The second problem can be weakend by defining a dead zone
Code: WME Script
  1. #include "scripts\base.inc"
  2. var diff;
  3. actor.LastX = -1000; // an init value which is different from a valid position value
  4. actor.LastY = -1000; // an init value which is different from a valid position value
  5. ////////////////////////////////////////////////////////////////////////////////
  6. on "LeftClick"
  7. {
  8.     // when the scene is left-clicked, just send the actor to the specified point
  9.     // if the actor is not already to a point near it.
  10.     diff.x = Math.Abs(actor.LastX - Scene.MouseX);
  11.     diff.y = Math.Abs(actor.LastY - Scene.MouseY);
  12.     if ( diff.x > 50 ||  diff.y > 20) // experimental values for the dead zone
  13.     {
  14.         actor.LastX = Scene.MouseX;
  15.         actor.LastY = Scene.MouseY;
  16.         actor.GoTo(Scene.MouseX, Scene.MouseY);
  17.     }
  18. }
  19.  

But this solution looks a bit dirty to me. Therefore it might be helpful if the engine itself could take care of these cases.

3
Bug reports / Bugs concerning the switch statement
« on: January 07, 2009, 01:14:37 PM »
During evaluating version 1.8.8 (Beta) of the WME i found two bugs concerning the switch statement. I have added two simplified code examples for better understanding.

1. If two switch statements are nested the outer break-command causes an error (Fatal: Invalid instruction -557797922).
Example: Left clicking on a scene object (a chair) after the "Look At" Button has been pressed. Depending on how often the player has looked at the chair the actor speaks different lines.
Code: WME Script
  1. global StateChair;
  2.  
  3. on "LeftClick"
  4. {
  5.     actor.GoToObject(this);
  6.     Game.Interactive = false;
  7.        
  8.     switch (GUIInterfaceButton)
  9.     {
  10.         case BUTTON_LOOKAT:
  11.         {
  12.             switch (StateChair.LookedAt)
  13.             {
  14.                 case 1:
  15.                 {
  16.                     actor.Talk("Looking the second time at the chair.");
  17.                     StateChair.LookedAt = StateChair.LookedAt + 1;
  18.                     break;
  19.                 }
  20.                                
  21.                 case 2:
  22.                 {
  23.                     actor.Talk("Looking the third time at the chair.");
  24.                     StateChair.LookedAt = StateChair.LookedAt + 1;
  25.                     break;
  26.                 }
  27.                                
  28.                 case 3:
  29.                 {
  30.                     actor.Talk("Looking at the chair again and again.");
  31.                     break;
  32.                 }
  33.                                
  34.                 default:
  35.                 {
  36.                     actor.Talk("Looking the first time at the chair.");
  37.                     StateChair.LookedAt = 1;
  38.                 }
  39.             }
  40.             break; // This break causes an error!
  41.         }
  42.                
  43.         case BUTTON_TAKE:
  44.         {
  45.             // some code
  46.             break;
  47.         }
  48.                
  49.         case BUTTON_TALK:
  50.         {
  51.             // some code
  52.             break;
  53.         }
  54.                
  55.         case BUTTON_USE:
  56.         {
  57.             // some code
  58.             break;
  59.         }
  60.     }
  61.  
  62.     Game.Interactive = true;
  63. }
  64.  

2. If a while loop is used inside a case the break-command at the end of the case causes the same error.

Example: Hold the script while playing a certain soundfile.
Code: WME Script
  1. on "LeftClick"
  2. {
  3.     actor.GoToObject(this);
  4.     Game.Interactive = false;
  5.  
  6.     switch (GUIInterfaceButton)
  7.     {
  8.         case BUTTON_LOOKAT:
  9.         {
  10.             // some code
  11.             break;
  12.         }
  13.                
  14.         case BUTTON_TAKE:
  15.         {
  16.             Game.PlaySound("sfx/soundeffect.ogg");
  17.             while (Game.IsSoundPlaying("sfx/soundeffect.ogg"))
  18.             {
  19.                 Sleep(1);
  20.             }
  21.             break; // This break causes an error!
  22.         }
  23.                
  24.         case BUTTON_TALK:
  25.         {
  26.             // some code
  27.             break;
  28.         }
  29.                
  30.         case BUTTON_USE:
  31.         {
  32.             // some code
  33.             break;
  34.         }
  35.     }
  36.        
  37.     Game.Interactive = true;
  38. }
  39.  

I also tested the equivalent if/else if/else-constructions and they worked perfectly.

Pages: [1]

Page created in 0.054 seconds with 18 queries.