You´re right. My code is just uncleaned^^.You really need to add some formatting to that.
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
Here´s my project. The .love file didn´t run so i simply zip the project folder. Please draw the project folde on your love.exe
Last edited by Wombat on Fri Oct 07, 2011 8:18 pm, edited 1 time in total.
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: Performance questions
You probably zipped the project folder, am I right?Wombat wrote:The .love file didn´t run so i simply zip the project folder.
The way to make a .love file is not creating a .zip file from the project folder, but the from the contents of the project folder (main.lua and the gfx directory in this case).
Help us help you: attach a .love.
Re: Performance questions
Yes, i already know.
But it didn´t worked when i do the main.lua in the top-level.
But it didn´t worked when i do the main.lua in the top-level.
- tentus
- Inner party member
- Posts: 1060
- Joined: Sun Oct 31, 2010 7:56 pm
- Location: Appalachia
- Contact:
Re: Performance questions
I think its because you have some case inconsistencies. If a folder has a capital letter in it, the code has to also have a capital letter (myBlaster vs myblaster)Wombat wrote:Yes, i already know.
But it didn´t worked when i do the main.lua in the top-level.
Kurosuke needs beta testers
Re: Performance questions
I have another question: How can i generate a constant framerate in my programs?
Somenone said it´s good to use love.timer.step() others say that it´s better multiplie all counters with dt.
And i think there are a lot of other possibilities...
Do you know a good and testet way to make a constante framrate in .love programs?
Somenone said it´s good to use love.timer.step() others say that it´s better multiplie all counters with dt.
And i think there are a lot of other possibilities...
Do you know a good and testet way to make a constante framrate in .love programs?
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: Performance questions
Simply put, you can't.Wombat wrote:How can i generate a constant framerate in my programs?
There are certain tricks you can use, but they are all imperfect. Instead it is a good idea to anticipate the variability of the world. This means using dt, among other things.
Help us help you: attach a .love.
Re: Performance questions
The easiest way is like :Wombat wrote:I have another question: How can i generate a constant framerate in my programs?
Somenone said it´s good to use love.timer.step() others say that it´s better multiplie all counters with dt.
And i think there are a lot of other possibilities...
Do you know a good and testet way to make a constante framrate in .love programs?
Code: Select all
local Timer0 = 0
local SOMENUMBER = 1
function love.update(dt)
Timer0 = Timer0+dt
if Timer0 > SOMENUMBER then
--do things here
Timer0 = 0
end
end
Last edited by GijsB on Thu Oct 06, 2011 1:44 pm, edited 1 time in total.
Re: Performance questions
Unfortunately this doesn´t work for me. But thanks for your helpThe easiest way is like :
Code: Select all
local Timer0 = 0 local SOMENUMBER = 1 function love.load(dt) Timer0 = Timer0+dt if Timer0 > SOMENUMBER then --do things here Timer0 = 0 end end
this way you have a somewhat constant update every 1(SOMENUMBER) second
I found a solution that works for me:
Code: Select all
function load()
fps_buffer = 0
factor = 0.01
max_frame = 60
end
function update(dt)
fps = love.timer.getFPS( )
love.timer.sleep(fps_buffer)
if fps < max_frame then
fps_buffer = fps_buffer - factor
elseif fps > max_frame then
fps_buffer = fps_buffer + factor
end
end
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: Performance questions
He should have said love.update(dt) when he said love.load(dt).Wombat wrote:Unfortunately this doesn´t work for me. But thanks for your help
Are you using LÖVE 0.5.0?Wombat wrote:I found a solution that works for me:
Help us help you: attach a .love.
Re: Performance questions
thanks for clearing out my horrible mistakeRobin wrote:He should have said love.update(dt) when he said love.load(dt).Wombat wrote:Unfortunately this doesn´t work for me. But thanks for your helpAre you using LÖVE 0.5.0?Wombat wrote:I found a solution that works for me:
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot] and 6 guests