I fixed the Problem. Thanks for your help.
I use love.update(dt) and love.draw() seperately now. And it works.
At first it was too fast. But now i use love.timer.sleep(10) and the framerate is as i want it.
But isn´t the framerate different on every PC? Do i have to edit the love.timer.sleep() number for every PC?
Or should the framerate familiar on every Computer?
Is there any other way to control the framerate?
Thanks for your help You definitely helped me
Performance questions
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Performance questions
rather than changing the framerate, you should use dt to control the speed that things occur, that way it will be the same speed on any computer
Re: Performance questions
If another wrapper is SDL-based, there is no reason why it could be slower in Love.Wombat wrote:Hi there,
i am new in working with LÖVE. But i work with LUA since 4 years.
I wanted to edit a game i made with another Lua-wrapper to run it on LÖVE.
But unfortunately it runs very very slow .
Surely it is the problem.Wombat wrote:
Maybe the problem exist, ´cause of i do the love.draw() in the love.update(dt).
Please try to understand the Love architecture:
http://love2d.org/wiki/Tutorial:Callback_Functions
Then modify your code according to that.
My lovely code lives at GitHub: http://github.com/miko/Love2d-samples
Re: Performance questions
Another, worse, solution to things moving to fast, is to use vsync. It doesn't work on all setups though, and the speed will still vary depending on the screen's update frequency (which is 60 per second usually but not always).
The best solution is to multiply all speeds with 60*dt or something.
The best solution is to multiply all speeds with 60*dt or something.
My game called Hat Cat and the Obvious Crimes Against the Fundamental Laws of Physics is out now!
Re: Performance questions
I tested my Programm on 3 PC´s: 2 Dual Core and 1 Single Core One.
I found out that my game runs always very, very smoothie on the 2 dual core pc´s and always bad on the single core.
And it made NO difference when i used this code structure:
or this code structure:
Thanks for your help until now. I only have to set the Timestep correctly, so that the game has an equal speed on every PC. I hope it works when i add (60*dt) on every counter variable^^.
I found out that my game runs always very, very smoothie on the 2 dual core pc´s and always bad on the single core.
And it made NO difference when i used this code structure:
Code: Select all
function love.load()
--code
end
function love.update()
function love.draw()
--all the code
end
end
Code: Select all
function love.load()
--code
end
function love.update()
--all the code
end
function love.draw()
--all the code
end
- tentus
- Inner party member
- Posts: 1060
- Joined: Sun Oct 31, 2010 7:56 pm
- Location: Appalachia
- Contact:
Re: Performance questions
I hate to say it, but that simply cannot be true. Something is horribly wrong in the method of your testing if putting draw inside of update gives you the same results as having them separate.Wombat wrote: And it made NO difference when i used this code structure:
...Code: Select all
function love.update() function love.draw() --all the code end end
Kurosuke needs beta testers
Re: Performance questions
but it´s still running with an extrem high rate of FPS . And that´s what worth.
And to my "method" of testing: I only look what looks faster. That´s it. Sure there is a difference between the 2 code structures. But my eye can´t see it .
Furthermore i can´t understand why this engine prefer to seperate these two things when so many programming languages have one main loop... It´s very difficult to seperate the most of my code ´cause maths and drawings are mixed.
And to my "method" of testing: I only look what looks faster. That´s it. Sure there is a difference between the 2 code structures. But my eye can´t see it .
Furthermore i can´t understand why this engine prefer to seperate these two things when so many programming languages have one main loop... It´s very difficult to seperate the most of my code ´cause maths and drawings are mixed.
Re: Performance questions
I.. I..... I'll leave this to someone else.Wombat wrote:but it´s still running with an extrem high rate of FPS . And that´s what worth.
And to my "method" of testing: I only look what looks faster. That´s it. Sure there is a difference between the 2 code structures. But my eye can´t see it .
Furthermore i can´t understand why this engine prefer to seperate these two things when so many programming languages have one main loop... It´s very difficult to seperate the most of my code ´cause maths and drawings are mixed.
Re: Performance questions
? Now i delete the love.update() loop and the framerate is even higher...
I don´t know what´s going on here? First the IMPOSSIBLE results with this:
and now this with HIGHER framerate:
I think i missunderstand this engine
I don´t know what´s going on here? First the IMPOSSIBLE results with this:
Code: Select all
love.update(dt)
love.draw()
--code
end
end
and now this with HIGHER framerate:
Code: Select all
love.draw()
--code
end
Sorry, I am new hereI.. I..... I'll leave this to someone else.
Last edited by Wombat on Tue Oct 04, 2011 9:54 pm, edited 5 times in total.
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot], Google [Bot] and 2 guests