Because I know nothing about programming, I've made some mistakes in my scripts.
Thanks to HCDaniel's help
on this topic, I'm starting to understand that I should pay more attention to FPS.
I used to script scrolling scenes this way:
// set the horizontal scrolling speed
Most of the time the scrolling speed was OK but sometime it was incredibly faster!
HCDaniel explained:
What makes me sceptical are the settings you use. You want the engine to scroll one pixel at a time, every 1ms. That would in theory result in 1000 pixels/second. Maybe with regular WME you use full screen, and it could be that the frames per second are limited (maybe to 100 or 60 I'm not sure), so there you'll get only 60 pixels per second at max.
I was thinking that, every 1ms, the scene would move by 1px.
But if I understand well, it all depends on FPS.
So if the game is played in 60FPS, my scene will scroll by 1px every 16ms. Am I right?
I've changed the script and wrote:
// set the horizontal scrolling speed
And I have no problem with scrolling speed anymore.
After this revelation, I started to search for more infos on the WME Forums.
On this topic, I've read this comment from metamorphium:
it's quite usually bound to bad scripting. Constructions like Sleep(1); and the likes. You should always count with some FPS to boot and adjust wait cycles accordingly. Then you don't have this problem.
And
on this topic, this other comment from metamorphium:
It's quite easy to set the Delays or Sleeps to desired framerate. If you are targeting for example your desired animation for 30fps, you know that every frame would take 1/30s so Delay or Sleep would be 33.
WME (unlike some other engines) doesn't limit you to certain fps, it rather lets you choose what suits you the best.
So if the game is played is 60FPS, when I write:
Or
it won't be OK because the screen is only refreshed every 16ms.
So I should write instead
Or
Am I right?
Or do I misunderstand something?
So here are my questions:
1- Should I design my game with a frame rate in mind?
Per exemple by using only multiples of 16 (16ms, 32ms, 48ms, 64ms,...)
If yes, what is the best value to use for having an homogeneous results on most of the computers?
2- When I write a Sleep(); command in ms, will this exact duration be used in all computers?
Or may it vary because of the computer frame rate, or any other factor?
Per example, let's imagine I want an animation to start during a dialogue when a character say one specific word.
I listen the dialogue and measure the length: the word is said 1400ms after the beginning.
So I write this script:
actor.
TalkAsync ("subtitle text",
"filename.ogg",
3000);
// the following node contains the animation sprite
// then the game wait for the dialogue to end
Is there a risk for the animation to start too late or too early?
Is there a risk for the 2nd Sleep command to end before the end of the dialogue or too long after?
Should I trust the milliseconds?
I am sorry for asking so many questions those days.
Wintermute is very simple to understand and to use. And it's a real pleasure for a beginner like me to create a game with this tool.
Most of my problems come from the fact I know little about computers and how they work.
Thank you for reading me!