Dangers using higher defaut game speed?

Started by StillInThe90s, Sun 28/10/2012 01:38:35

Previous topic - Next topic

StillInThe90s

Good evening everyone.
I'm experimenting with a top down scroller and found that it scrolls much smoother if game speed is set to somewhere above 55. Are there any draw backs using a higher speed than 40?
Thanks.

Khris

If the game is played on a lame/old computer, it might not be able to keep up the necessary FPS and thus the game will slow down.
Basically, the game speed determines how often per second the repeatedly_execute functions are ran and the screen is redrawn.

Increasing that number will of course make things go much smoother, but the price is that the necessary hardware performance requirement goes up as well.

StillInThe90s

But there is no risk of glitches like skipping functions and such?

Khris

No, that won't happen at all.
Only an artificial intelligence could decide what functions it's safe to skip in order to maintain program integrity but there's no AI included in AGS yet. Maybe in the next version.

Crimson Wizard

#4
;)

Well, yes, skipping functions because of high speed is technically impossible, since the code is run strictly in one order, no matter what.
This means that it will run all the code still even if it won't be making it "in time" (that's why game slows down on weaker computers).

StillInThe90s

Quote from: Crimson Wizard on Sun 28/10/2012 16:28:29
Well, yes, skipping functions because of high speed is technically impossible, since the code is run strictly in one order, no matter what.
This means that it will run all the code still even if it won't be making it "in time" (that's why game slows down on weaker computers).
Thanks! That answered my question.

Quote from: Khris on Sun 28/10/2012 15:43:53
No, that won't happen at all.
Only an artificial intelligence could decide what functions it's safe to skip in order to maintain program integrity but there's no AI included in AGS yet. Maybe in the next version.
That was not really about my question. But thanks for making an effort.  :-D

RickJ

As a side note ... You may find that using a "Wait(1)" in cpu intensive scripts will keep it from hogging the cpu. This will return control to the engine so it can do other stuff.  On a fast computer it should not have a negligible affect while on a slower computer it may help distribute scarce cpu cycles more evenly.  Experiment to see what works best for you. It's a technique I have found useful in non-AGS RTOS applications.

StillInThe90s

It sounds a bit counter intuitive, but I will certainly give it a go.
Thanks Rick.

Crimson Wizard

To elaborate a bit, - adding Wait command lets engine to process drawing and mouse/keyboard controls (as well as making game window respond to operation system).
Otherwise the game may appear to "hang" at some moments.

This is not related directly to game speed setting though, but rather for scripts that take much time to execute (such as long loops, complex calculations, raw drawing, etc).

StillInThe90s

Quote from: Crimson Wizard on Mon 29/10/2012 10:26:04
This is not related directly to game speed setting though, but rather for scripts that take much time to execute (such as long loops, complex calculations, raw drawing, etc).
I'm not quite there on this project yet.  (laugh)
My other project has lots of messy loops, but the 320x200 res will surely weigh out that.

SMF spam blocked by CleanTalk