Big tables and performance with love.graphics.draw.

General discussion about LÖVE, Lua, game development, puns, and unicorns.
User avatar
deströyer
Prole
Posts: 27
Joined: Thu Jun 27, 2013 7:59 pm
Contact:

Re: Big tables and performance with love.graphics.draw.

Post by deströyer » Thu Apr 23, 2015 7:45 pm

I've worked on a very similar problem for my roguelike. I initially had a number of very small maps, where inefficiency wasn't really a problem. Then I generated a world map (768x768 tiles), each tile with several layers (eg. a river running on top of plains). This bogged the game down to an unplayable state. The solution was pretty much the same as what the others suggested - I created a camera-type object which only draws what is on the screen.

An additional optimization was to only create the tile-objects as they were revealed by the camera / player moving around. This reduced the initial loading time from 7 seconds to 0.3 seconds. It also has the added effect of allowing me to track what the player has actually seen, which I use to create the minimap.

I've written in more detail about it here:

http://www.killvore.net/blog/blog/2014/ ... ng-the-map

http://www.killvore.net/blog/2014/8/10/ ... -the-table

Bindie
Party member
Posts: 151
Joined: Fri Jan 23, 2015 1:29 pm

Re: Big tables and performance with love.graphics.draw.

Post by Bindie » Thu Apr 23, 2015 7:56 pm

Your second solution is what I meant, when I'm off this blocked computer I would be interested in comparing our solutions. Thanks.

User avatar
deströyer
Prole
Posts: 27
Joined: Thu Jun 27, 2013 7:59 pm
Contact:

Re: Big tables and performance with love.graphics.draw.

Post by deströyer » Fri Apr 24, 2015 6:04 am

I've sent you a PM with my Skype details. We can do a writeup after we've talked about the design and implementation and post it here!

Post Reply

Who is online

Users browsing this forum: No registered users and 10 guests