Edit: it seems to be an issue with my system, even though it's plenty powerful enough. more info 7 posts down.
Hi all,
I'm new to love development and game development in general. I'm trying to create a tile-based scroller and I'm running into some problems.
I want to create a rather detailed map with several layers of tiles. Here's what I have so far:
-a tile library of ~4200 32x32 tiles loaded as individual images into a table (ie. tile[1] -> tile[4200])
-a 40x30 map with about 16 drawn layers, each layer being a table containing a table for each horizontal line (like the tile based scrolling tutorials)
-code that will draw the map tile by tile, layer by layer
-smooth scrolling of movement
The map draws, but when you move around the game seems to "freeze" when loading new lines, and the freezing seems to get worse as time passes.
I've trimmed down the tiles table so that it will only load tiles that are displayed on the current map (about 300, in the attached example), but that did not help. some of the tiles are still at high indexes though (ie "tile[4000]"). I don't know if that's a problem.
I've cut down the number of layers in the map to 5, but that only seems to stem the tide.
I've checked and rechecked that no newImage or other potentially draining functions are being called in love.draw or love.update.
When sitting still or moving about normally love seems to take about 10-15% CPU and 25 megs of memory. When it "freezes", CPU drops to 0-2% but memory stays constant.
I'm at a loss. I've attached what I have so far, if anyone cares to take a look.
Thanks in advance!
Performance issue running simple love game
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Performance issue running simple love game
Last edited by chute on Tue Jul 17, 2012 8:58 pm, edited 2 times in total.
- josefnpat
- Inner party member
- Posts: 955
- Joined: Wed Oct 05, 2011 1:36 am
- Location: your basement
- Contact:
Re: Performance issue with layered map & lots of tiles
chute wrote:Hi all,
I'm new to love development and game development in general. I'm trying to create a tile-based scroller and I'm running into some problems.
I want to create a rather detailed map with several layers of tiles. Here's what I have so far:
-a tile library of ~4200 32x32 tiles loaded as individual images into a table (ie. tile[1] -> tile[4200])
-a 40x30 map with about 16 drawn layers, each layer being a table containing a table for each horizontal line (like the tile based scrolling tutorials)
-code that will draw the map tile by tile, layer by layer
-smooth scrolling of movement
The map draws, but when you move around the game seems to "freeze" when loading new lines, and the freezing seems to get worse as time passes.
I've trimmed down the tiles table so that it will only load tiles that are displayed on the current map (about 300, in the attached example), but that did not help. some of the tiles are still at high indexes though (ie "tile[4000]"). I don't know if that's a problem.
I've cut down the number of layers in the map to 5, but that only seems to stem the tide.
I've checked and rechecked that no newImage or other potentially draining functions are being called in love.draw or love.update.
When sitting still or moving about normally love seems to take about 10-15% CPU and 25 megs of memory. When it "freezes", CPU drops to 0-2% but memory stays constant.
I'm at a loss. I've attached what I have so far, if anyone cares to take a look.
Thanks in advance!
I'm not having any problems at all :( Can you provide steps to reproduce your issue?
Missing Sentinel Software | Twitter
FORCIBLY IGNORED.
<leafo> when in doubt delete all of your code
<bartbes> git rm -r *
<bartbes> git commit -m "Fixed all bugs"
<bartbes> git push
FORCIBLY IGNORED.
<leafo> when in doubt delete all of your code
<bartbes> git rm -r *
<bartbes> git commit -m "Fixed all bugs"
<bartbes> git push
Re: Performance issue with layered map & lots of tiles
try doing a full run around the edge of the map (don't go off the edge )
Re: Performance issue with layered map & lots of tiles
ok, just tried it on my crappy Craptop(tm) and it works fine there.
I guess it's time for a reboot...
I guess it's time for a reboot...
- josefnpat
- Inner party member
- Posts: 955
- Joined: Wed Oct 05, 2011 1:36 am
- Location: your basement
- Contact:
Re: Performance issue with layered map & lots of tiles
I walked all the way around the edge of the map, and added a fps graph, and still am not having any issue. Perhaps your hardware isn't as up to date as you would like?chute wrote:try doing a full run around the edge of the map (don't go off the edge ;) )
Missing Sentinel Software | Twitter
FORCIBLY IGNORED.
<leafo> when in doubt delete all of your code
<bartbes> git rm -r *
<bartbes> git commit -m "Fixed all bugs"
<bartbes> git push
FORCIBLY IGNORED.
<leafo> when in doubt delete all of your code
<bartbes> git rm -r *
<bartbes> git commit -m "Fixed all bugs"
<bartbes> git push
Re: Performance issue with layered map & lots of tiles
I have an AMD Phenom 2 quad core and a Radeon 5870.
That shouldn't matter though, as I've tried the code on an old laptop running a P3 with intel graphics -- it works fine on that machine.
I've rebooted. I've closed all programs (even dropbox, teamviewer, etc.). I've updated video card drivers. I'm running the latest love.
I will try running some other .love games to see if there are performance issues with them.
any ideas?
That shouldn't matter though, as I've tried the code on an old laptop running a P3 with intel graphics -- it works fine on that machine.
I've rebooted. I've closed all programs (even dropbox, teamviewer, etc.). I've updated video card drivers. I'm running the latest love.
I will try running some other .love games to see if there are performance issues with them.
any ideas?
Re: Performance issue running simple love game
ahhh! I've tried several projects from the demo forum. Mario Kart racing, fruitless, motion blur demo, relentless, TAOTRTWGE, and an unnamed topscrolling shooter.
none of them have any performance problems. Is there anything else i can try?
none of them have any performance problems. Is there anything else i can try?
Re: Performance issue running simple love game
ok, I've tried just running love.exe to get the rubber piggy demo.
I watched it for a while and it freezes too. About once every 10-30 seconds.
I really don't want to reinstall windows :/
I watched it for a while and it freezes too. About once every 10-30 seconds.
I really don't want to reinstall windows :/
Re: Performance issue running simple love game
I have also played several other retail games recently as well (penny arcade 3, quantum conundrum, arkham asylum, braid) with no problem. No freezes, high framerates.
- josefnpat
- Inner party member
- Posts: 955
- Joined: Wed Oct 05, 2011 1:36 am
- Location: your basement
- Contact:
Re: Performance issue running simple love game
See if you can update your video card drivers.
After that, perhaps boot into a Linux liveCD, and see if it really is your hardware?
After that, perhaps boot into a Linux liveCD, and see if it really is your hardware?
Missing Sentinel Software | Twitter
FORCIBLY IGNORED.
<leafo> when in doubt delete all of your code
<bartbes> git rm -r *
<bartbes> git commit -m "Fixed all bugs"
<bartbes> git push
FORCIBLY IGNORED.
<leafo> when in doubt delete all of your code
<bartbes> git rm -r *
<bartbes> git commit -m "Fixed all bugs"
<bartbes> git push
Who is online
Users browsing this forum: Google [Bot] and 3 guests