Minimap performance question

Discussion and feedback on Construct 2

Post » Thu Jan 09, 2014 3:25 pm

Hello,

I am doing a mini-map that represent connected levels. I was wondering what would be best for performance between..

1- Creating a single sprite that show all the possibilities of connection. A level can have from 1 to 4 levels connected (left, right, top, bottom) so i though i could use 14 animation and then each frame would be the type of level showed on mini-map. This would take less objects in the screen at the price of maintenance. (Total of 144 minimum objects created for a 16x9 grid)

2- Creating a sprite connector (1x4 pixels) for left-right and top-bottom and create one if the level have a connection with another level. So that mean that basically for each level 4 sprites connectors can be created for a total of 16x9x4 (576 objects created generated each time i draw the mini-map, i normally do it once the level is loaded and each time the mini-map change or the window is resized). This take less maintenance but at the price of performance... however.. does this will reduce a lots the performance ? (Total of 576 possible objects created for a 16x9 grid, minimum still 144 but with the connectors that can be up to 576)

Thanks!
B
16
S
5
G
1
Posts: 190
Reputation: 2,489

Post » Thu Jan 09, 2014 4:48 pm

could the 16x9 grid be just one sprite, or tiledbackground - showing all the connections open, then add the connectors to close the ones that aren't open. Or if the map has more close connections than open ones then reverse that (have them all closed and only add the open ones).

If the connectors are wide enough and centered between two levels, then one could do the job for both sides of the connection, cutting the number needed in half...

I made a calendar app that could show up to 12 months at once, each month had 40 cells, each cell was a sprite and a text box. In total I had well over 1000 objects on screen and performance was fine.
B
99
S
35
G
20
Posts: 438
Reputation: 17,910

Post » Thu Jan 16, 2014 1:00 am

Alright thanks! Nah it couldnt be just one sprite but i what i did is put 4 connectors as one sprite through reducing the amount of objects needed.

Thanks!
B
16
S
5
G
1
Posts: 190
Reputation: 2,489


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 11 guests