Hey guys, I made a game, and fortunately right after releasing the demo, I found out that the game works differently on each computer, do you guys know what the problem is? (it is not canvases, I mean the game's physics are different on each computer.
http://www.gamefront.com/files/22102835/PauZ_Source.zip
Game works differently on each computer
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Game works differently on each computer
you forgot to use delta time, probably. look it up
Re: Game works differently on each computer
Like LaserGuns said, you didn't take the variable update time into account for some things. Disable vsync and you can test it on your system.
For the jump, you set the vertical linear velocity of the body to -2000 every update. If the update happens every millisecond, the physics engine has less time to work the gravity on it than it would if it only happens every 16 milliseconds and the player will go higher.
A simple but somewhat ugly solution would be to accumulate the dt until it reaches the 16 ms and only execute the update stuff if it is equal or over 16 ms. Maybe you even need to to a fixed time step to make sure it's the same for everyone. I never tried platformer physics with Box2D and it's probably not going to work very well unless you know how to work Box2D for it.
Also, don't do this:
You're not supposed to give a path, but just a name which will be used for the directory. Like: t.identity = "PauZ".
For the jump, you set the vertical linear velocity of the body to -2000 every update. If the update happens every millisecond, the physics engine has less time to work the gravity on it than it would if it only happens every 16 milliseconds and the player will go higher.
A simple but somewhat ugly solution would be to accumulate the dt until it reaches the 16 ms and only execute the update stuff if it is equal or over 16 ms. Maybe you even need to to a fixed time step to make sure it's the same for everyone. I never tried platformer physics with Box2D and it's probably not going to work very well unless you know how to work Box2D for it.
Also, don't do this:
Code: Select all
function love.conf(t)
t.identity = "'%appdata%\Love\'"
end
Shallow indentations.
Re: Game works differently on each computer
Thank you very much
Who is online
Users browsing this forum: No registered users and 5 guests