Multiple polylines vs one big, static image

Hi guys,

here is something I’ve been wondering about. I am making a strategy, turn based game with units that move on hexagonal tiles.

The grid is 10 x 7 tiles.

I can think of two approaches to draw it.

  1. What I currently have. I created one static image in Photoshop with all the tiles and simply rendered it into the scene.

  2. Generate procedurally 70 polyline hexagonal shapes and display them all.

The plan is to have highlighted tiles, tiles of different colour and so on. With the 1. solution I would have to draw, for example, blue polyline over the static image in a particular position and then animate it. In the 2. solution I would simply animate that shape.

So in general I think it would be more handful to use hexagonal shapes BUT I’ve been thinking about performance. Will 70 6-sided shapes make a significant performance overhead?

Sorry for a trivial question like this but I am completely new to the aspect of memory optimization (you know how it is in B2B software; doesn’t matter how as long as it works :wink: ).

Thanks! [import]uid: 133145 topic_id: 24426 reply_id: 324426[/import]

If the shapes are the same, as in not 70 different image files, it wont be so bad at all.

Easy way to test for sure though, try this code with both methods and compare results;

[lua]local function monitorMem(event)
collectgarbage(“collect”)

print( “\nMemUsage: " … (collectgarbage(“count”)/1000) … " MB”)
print("Texture Usage " … system.getInfo( “textureMemoryUsed” ) / 1000000)

return true
end

Runtime:addEventListener(“enterFrame”, monitorMem)[/lua]

Peach :slight_smile: [import]uid: 52491 topic_id: 24426 reply_id: 98967[/import]