Page 1 of 2

when does your game slow down?

Posted: Fri Nov 13, 2009 9:53 am
by hertzcastle
hi!
just getting my first couple of demos going and planning some bigger projects. i was wondering if anyone could provide me with an example of a game that pushes love too far, as in it's too power hungry for love to deal with. anything with slowdown etc. i basically want to see where the ceiling is in terms of power. im from a blitzmax background and would really appreciate any help in seeing what the difference between the two is speed-wise. i understand that every computer's different, but if anyone has anything that slows down their computer, id really love to see it.
thanks!x

Re: when does your game slow down?

Posted: Fri Nov 13, 2009 10:36 am
by napco
I use a computer with only 1 GB RAM to program with LOVE, in order to optimize my code. It slows down when displaying more then 750 32x32 tiles per frame or, obiviously when a load function (es newFont or newImage) is running continuously inside the update callback.

Re: when does your game slow down?

Posted: Fri Nov 13, 2009 1:13 pm
by bartbes
The biggest slowdowns are when you either send a lot to the GPU (newFont, newImage, etc) or use huge loops. (i.e. draw pixel-by-pixel)

EDIT: and.. moved.

Re: when does your game slow down?

Posted: Sat Nov 14, 2009 12:20 pm
by hertzcastle
ah cool ok! thanks for the advice!
my computers only got 1gb ram as well. doing most of my tiles at 64 x 64 and i guess i'll be drawing them to an 800 x 600 window. been using 640 x 480 up till now. 800 x 600 should be ok tho right? i mean, as long as i dont have too many layers to my map(i dont plan on having more than 2 or 3).
thanks again!x

Re: when does your game slow down?

Posted: Sat Nov 14, 2009 1:56 pm
by napco
It should be ok, but remember to draw only visible tiles (using this method you can load very large maps). Another answer is Mode7. Mode7 slows down a lot my game (it's unplayable)...

Re: when does your game slow down?

Posted: Sat Nov 14, 2009 3:17 pm
by hertzcastle
how would you go about setting up a loop that only draws visible tiles? so far ive just been using

Code: Select all

 for y = 1, hMapIn do
	for x = 1, wMapIn do
		sheetIn:seek(mapIn[y][x])
		love.graphics.draw(sheetIn, (x * wTileIn) + xOffIn, (y * wTileIn) + yOffIn)
	end
end

Re: when does your game slow down?

Posted: Sat Nov 14, 2009 3:43 pm
by hertzcastle
is that what scissor() is for?

Re: when does your game slow down?

Posted: Sat Nov 14, 2009 4:39 pm
by bartbes
That is what setScissor does, yes.

Re: when does your game slow down?

Posted: Sat Nov 14, 2009 4:55 pm
by hertzcastle
so, do you just use setScissor(args) once, or do you have to use setScissor(no args) every draw call? probably sounds like a stupid question but with bmax you had to use Cls every loop.
thanks guys.x
x

Re: when does your game slow down?

Posted: Sat Nov 14, 2009 6:26 pm
by bartbes
Once, doc page. The no argument version is only to clear the scissor (draw everything again)