SetGameSpeed not working

Started by Shini, Thu 06/04/2006 13:20:51

Previous topic - Next topic

Shini

Hi,

I'm experiencing a very annoying problem with the game I made: the speed of the game depends directly on the power of the computer it runs on. I set my speed to 40 cycles per second at game start, the game runs normally on my computer, but when I try it on a more revent computer, the 'repeatly execute ' function run more that 40 times a second!!  ??? ???
Due to this, my game is totally unplayable on fast computers, and on slow computer it's really really slow, so slow that you have twice more time to think... (it's a tetris like game).

Help me please!

Babar

You could include an option ingame to vary speed using sliders. I believe there is an explanation on how to do that in the manual. Check under "Sliders"
The ultimate Professional Amateur

Now, with his very own game: Alien Time Zone

strazer

#2
Quote from: Shini on Thu 06/04/2006 13:20:51but when I try it on a more revent computer, the 'repeatly execute ' function run more that 40 times a second!!

What (piece of code) makes you think that?
If you put
  Debug(4, 1); // turn fps display on
in the game_start function, what is the number of frames displayed in the lower-left corner?

Edit: Btw, what version of AGS are you using?

Gilbert

Hmmm had you confirmed this using Debug(4, 1)?

I suppose your game might be hi-res 32bit right? This can be quite demanding, that in your original computer it probably couldn't run at full speed, that it's actualy too fast to be playable when it's run full speed on a faster computer.

Since 40FPS is the default speed of AGS games, you may als try commenting all the SetgameSpeed(...) lines in the game and see if it makes any difference (though it probably not).

Also, you may try messing with the variable system.vsync and see if that helps.

Edit: While I was typing some beated me to it, but I'll just post anyway.

m0ds


Shini

#5
I'm using AGS 2.62... and the game is effectively at 32 bit graphics... Just check out, it's called "Cake & Smurphy Puzzle Battle"...  I know I should upgrademy AGS version, but I have porting problems... I didn't check the fps counter, but I know that the is_keypressed function is also more accurate... It means that the whole code is running faster!!!

The last thing I should try is the vsync enabled... But I insist on the fact that the SetGameSpeed should work!!! Why use a speed slider when the main goal of the game is to make the better score at an universal speed??

Edit : on my computer, my friend's best score is about 800... on a slow computer, it's about 1600 !!!!! and on a fast computer, the highscore is about 500... DAMN!!!

Pumaman

Quote from: Shini on Fri 07/04/2006 15:50:11
I didn't check the fps counter, but I know that the is_keypressed function is also more accurate... It means that the whole code is running faster!!!

Then why don't you do as strazer and Gilbot suggested, and check it?

What's most likely happening is that you've done SetGameSpeed(40) but your computer is too slow and so it's actually running at, say, 30 fps. When you try it on a faster computer it does actually run at 40 fps and therefore will run faster.

Shini

-> Pumaman : Yeah i think you're explanation is the right one, but... It means that a 1.8 Ghz computer, with a 128MB graphic card, and 1GB RAM can't run my 2D game at full speed, while Doom 3 runs perfectly!!!!!!!  :o :o :o :o

Is Adventure Game Studio sooo awfully optimized? It's a real scandal! I can't believe it!!!

Gilbert

AGS wasn't originally designed for making games with such high specs, moreover, it's offered as a high level game environment so don't compare it to killer FPS, especially when those FPS games take advantage of acceleraions like from the graphics card, etc. which is a different story.

Shini

Arf sorry...  :-\

The comparison was useless, I know...

But my question was: why is it so slow? I suppose it uses the allegro library, but why doen't it use 2D acceleration? Or maybe I'm wrong, and I can't figure the lot of code it needs...

Scorpiorus

Yes, as far as I'm aware, it's some technical issues behind using graphics card hardware acceleration capabilities, since AGS wasn't initially designed to support it to keep speed at high resolutions/colour depth: remember it was written to create good-old point-&-click adventure games in 320x200x8/16bit mode that can be run in pure DOS (btw, my old 486/50mHz laptop can still run a DOS-compiled version of a game (made with AGS v2.62) at a decent speed).

Pumaman

All of AGS's graphics rendering is done within system RAM, and then once per frame it copies the contents to video memory. This is obviously not the fastest way of doing things, and one day if I get time I'd like to rewrite the rendering system to utilise the copious amounts of VRAM available on modern video cards.

Shini

^^ It would be really great!  I'm actually writing a old-school point & click, but It's in hi-res too... Hope it will run at a good speed ! (the old pascal 7 version of my game(for dos) ran perfectly in 800x600x32 on a 450Mhz CPU...)



SMF spam blocked by CleanTalk