Hey, people! First of all, LÖVE is awesome, and thank you all for your time .
So, I've been developing this game that moves in 8 directions, top down. I tried to add acceleration and deceleration (took me a while, I don't know if it's done correctly, it was all made through deduction), tested the prototype on my PC, and everything went smoothly.
Now, today my PC was being used, so I tried to code and test the prototype on my netbook. When I ran the game, I got a totally different speed. Not in the way you may be thinking. The game ran faster on the netbook, a lot faster. A delay that I put for the option selection in the menu became useless, and the acceleration and deceleration were faster too on the character movement.
So, I'm trying to find the problem that's altering my speed. There is different hardware, but I believe the problem is in the way I'm coding, as I find really weird that the game runs faster on the lower end hardware. Anyway, here are the specs of both computers:
Netbook:
Intel Atom N450 1.6Ghz
1GB of RAM DDR2
Windows XP 32bit
PC:
Intel Core i5 750 2.6Ghz
Sapphire AMD Radeon HD 7850 OC Edition
3GB of RAM DDR3
Windows 7 64bit
And I'll attach the love file (be aware: there is a lot of hardcoding, incomplete stuff, and comments are in Spanish).
I'm totally lost on this one. My only experience with game programming was with XNA, and I didn't have any of this problems. I've been trying to find any thread about this, but I completely ignore the origin of this issue, so I don't really know what I should be searching for.
Hope anyone can point out what I'm doing wrong that's making the game unstable, and excuse me for my poor English!
Thanks!
Getting different speeds on different PC's
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Getting different speeds on different PC's
- Attachments
-
- TK02.love
- (4.39 KiB) Downloaded 57 times
Re: Getting different speeds on different PC's
You're not using dt (delta time). There's an article on the löve blogs explaining it. It's a quick read, but basically what you have to do is whenever you're changing the players speed, Multiply it by dt.
like this:
like this:
Code: Select all
self.actualYSpeed=self.actualYSpeed-self.speed*dt
Re: Getting different speeds on different PC's
That seems to be the issue! Thank you very much, veethree!
I'll try to repair this, though I have the suspicion that the prototype will crash and burn the very moment I change something, HAHAHA.
EDIT: managed to do it! Though I had to change some stuff, but everything is going smooth in both computers. Again, thanks!
I'll try to repair this, though I have the suspicion that the prototype will crash and burn the very moment I change something, HAHAHA.
EDIT: managed to do it! Though I had to change some stuff, but everything is going smooth in both computers. Again, thanks!
Who is online
Users browsing this forum: Ahrefs [Bot] and 7 guests