Page 1 of 2

Some other computer...

Posted: Mon Dec 08, 2008 4:55 pm
by Gromlick
More newbie questions...

I just recently pulled up my game on someone else's computer and ran into a problem - it's running my game waaaaay too fast. I've run it on a few different desktops with varying speeds, but I haven't had a problem to date... It always seems to run at the same pace. The computer itself was a 64 bit dual core, running on VIsta (Is Vista doing this?)

So I guess my question is, how can I make my game function properly on a platform like this? Is there a good way to gauge the speed a computer will run my game, and adjust accordingly?

Re: Some other computer...

Posted: Mon Dec 08, 2008 6:03 pm
by nightvenom
Was Vista 64 bit or 32 ?

I don't know if that would cause the problem, but it might be a good place to look .

Re: Some other computer...

Posted: Mon Dec 08, 2008 6:23 pm
by Gromlick
I think - THINK - that it was 64 bit Vista... This was a public computer at my college, and I didn't really have time to give it a look. I do know that it had a 64 bit core, though.

Re: Some other computer...

Posted: Mon Dec 08, 2008 9:05 pm
by Merkoth
Blame it on Vista, that's what everyone does :P
Talking seriously, do your game objects move too fast? If that's the problem maybe you're not delta-timing correctly?

What I mean (Patronizing code ahead!):

Code: Select all

player_x = player_x + speed -- this is wrong

Code: Select all

player_x = player_x + speed * dt -- this is right

Re: Some other computer...

Posted: Tue Dec 09, 2008 1:16 am
by Gromlick
Nothing patronizing here, just the first thing on the check list. Check to see if I actually plugged in the computer, try restarting it, yatta etc.

But yeah, that's how I have it coded. Well, basically. I used my dt, I promise. ^_^

Like I said, I've run it on a number of computers before and never really noticed a performance difference - for better or worse. I like the idea of blaming Vista for my problems here. :P

So, um... Any ideas as to what I could do? Or should i just avoid looking at Vista computers for now? (nobody likes them anyway)

Re: Some other computer...

Posted: Tue Dec 09, 2008 2:04 am
by Lord Tim
This is strange.

I've been making my Löve games on my own 64bit Vista computer, and when I play my games on other computers (A 32bit Vista, and the old XP school computers) they all run the game faster. There is a literal increase from steady 60 FPS on my PC to between 200-400 FPS on the other computers (Tested with just the love.timer.getFPS()).

I have been able to slightly fix the problem by doing

Code: Select all

	if(love.timer.getDelta() < 0.0166667) then
		love.timer.sleep(10)
	end
In my main update code, but this is probably a horrible way to go about it, since the love.timer.sleep function is supposedly inaccurate, and I can't think of any other ways of limiting the FPS.

And since I've got all my movement done through the physics engine, it sometimes messes up. Specifically, joints suddenly become super-accurate.

Re: Some other computer...

Posted: Tue Dec 09, 2008 2:25 am
by Gromlick
It's something? I'm going to add something similar to my code, next time I'm there I'll see if I still have a problem. Assuming I'll get a chance to use it anytime soon...

Re: Some other computer...

Posted: Sat Dec 13, 2008 1:32 pm
by 1stAnd10
I'm new to LOVE so this might be a stupid question but is there a way to cap the FPS?

If not can it be added? Does SDL support this type of behavior?

Re: Some other computer...

Posted: Sat Dec 13, 2008 1:48 pm
by bartbes
You can try vsync, and you can check the delta time variable for how much time has passed, however vsync is probably your best option, as it's all driver-handled.

EDIT: Post 100!! ^^ ^^ ^^

Re: Some other computer...

Posted: Sun Dec 14, 2008 7:25 pm
by muku
Lord Tim wrote:I've been making my Löve games on my own 64bit Vista computer, and when I play my games on other computers (A 32bit Vista, and the old XP school computers) they all run the game faster. There is a literal increase from steady 60 FPS on my PC to between 200-400 FPS on the other computers (Tested with just the love.timer.getFPS()).
Nothing strange about that; your video driver probably is set to enable vsync, so the framerate gets capped to 60fps, while on other PCs it runs uncapped. As long as you make sure to take delta time into account everywhere, there should be little difference between running at 60fps and 400fps. It's a nice thing though to still limit the framerate so that you free up some CPU cycles.