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
Big tables and performance with love.graphics.draw.
Re: Big tables and performance with love.graphics.draw.
Your second solution is what I meant, when I'm off this blocked computer I would be interested in comparing our solutions. Thanks.
Re: Big tables and performance with love.graphics.draw.
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!
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot], Semrush [Bot] and 2 guests