Limited Updates per Seconds

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.
Post Reply
User avatar
Sharkinmytea
Prole
Posts: 11
Joined: Wed Sep 30, 2015 6:03 pm

Limited Updates per Seconds

Post by Sharkinmytea »

Hi, I wanted to make sure that love could handle the game i wanted to do, so I checked how many times love would update per second.
I ran that code into it:

Code: Select all

function love.load()
        updates = 1
	seconds = 0
	updatepersec = 0
end
 
function love.update(dt)
	updates = updates + 1
	seconds = seconds + dt
	updatepersec = (updates / seconds)
	
end
 
function love.draw()

	love.graphics.setColor(255, 255, 255)
	love.graphics.print( updates, 0, 0)
	love.graphics.print( seconds, 0, (0+20))
	love.graphics.print( updatepersec, 0, (0+40))
end
The results I got was that it could do 44 updates per seconds.
Which i find is really low since my computer has an I3 cpu (not the best) and 8 Gb or ram.
So i was wondering, are these the limits of Love2d, or is it automatically restraining the amount of updates it can do in a single second.
And in the end, can it be boosted?
Hey, i'm not a native english speaker, so if you think the word I used is not the one I meant, please tell me :)
User avatar
undef
Party member
Posts: 438
Joined: Mon Jun 10, 2013 3:09 pm
Location: Berlin
Contact:

Re: Limited Updates per Seconds

Post by undef »

Your update rate and you FPS should be identical if I'm not mistaken,
so you can actually just do this:

Code: Select all

function love.draw()
    love.graphics.print( love.timer.getFPS() )
end
But what kind of game do you want to make anyway?
You shouldn't have any trouble with most 2D games.
twitter | steam | indieDB

Check out quadrant on Steam!
User avatar
Sharkinmytea
Prole
Posts: 11
Joined: Wed Sep 30, 2015 6:03 pm

Re: Limited Updates per Seconds

Post by Sharkinmytea »

The fps could be 10 it wouldn't make such a difference in my game.
I'm making a multiplayer rogue like game. The maps are 100 x 100 and there are 5 layers to them.
Since it's a 4 player game, it has to handle 20 layers which all have to receive calculation for the FOV, collision and multiples other instances.
Adding to that, there is the pathfinding algorithm that eats a lot and quite a few more stuf here and there that eat up ram and cpu usage.

I know i can code it in a way that it uses much less.
But I'm still curious if the Updates Per Seconds will change with that.
Hey, i'm not a native english speaker, so if you think the word I used is not the one I meant, please tell me :)
User avatar
Karai17
Party member
Posts: 930
Joined: Sun Sep 02, 2012 10:46 pm

Re: Limited Updates per Seconds

Post by Karai17 »

LOVE can update at 1000 times per second without modification. Higher if you customize love.run.
STI - An awesome Tiled library
LÖVE3D - A 3D library for LÖVE 0.10+

Dev Blog | GitHub | excessive ❤ moé
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 223 guests