Some other computer...

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
User avatar
Gromlick
Prole
Posts: 16
Joined: Thu Oct 09, 2008 8:39 pm

Some other computer...

Post 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?
User avatar
nightvenom
Prole
Posts: 36
Joined: Sat Aug 16, 2008 3:07 pm

Re: Some other computer...

Post 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 .
User avatar
Gromlick
Prole
Posts: 16
Joined: Thu Oct 09, 2008 8:39 pm

Re: Some other computer...

Post 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.
User avatar
Merkoth
Party member
Posts: 186
Joined: Mon Feb 04, 2008 11:43 pm
Location: Buenos Aires, Argentina

Re: Some other computer...

Post 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
User avatar
Gromlick
Prole
Posts: 16
Joined: Thu Oct 09, 2008 8:39 pm

Re: Some other computer...

Post 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)
User avatar
Lord Tim
Prole
Posts: 30
Joined: Sun Jul 20, 2008 4:07 am

Re: Some other computer...

Post 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.
User avatar
Gromlick
Prole
Posts: 16
Joined: Thu Oct 09, 2008 8:39 pm

Re: Some other computer...

Post 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...
1stAnd10
Prole
Posts: 22
Joined: Tue Nov 25, 2008 2:09 pm

Re: Some other computer...

Post 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?
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: Some other computer...

Post 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!! ^^ ^^ ^^
User avatar
muku
Prole
Posts: 18
Joined: Wed Aug 20, 2008 11:35 am

Re: Some other computer...

Post 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.
Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 41 guests