Creating a minimap using the same tile data as the level

Get help using Construct 2

Post » Wed Jul 16, 2014 7:06 pm

I'm currently attempting to create a minimap that looks something like the one pictured here:
http://wip.warpdoor.com/content/images/ ... n_shop.png

I'd like it to be a 1:1 representation of all of the tiles on my randomly generated map, with each tile taking up a single pixel, which would make it around 160x160 pixels. To accomplish this, I'm using a tilemap where the tiles have a height and width of 1.

The problem: This seems to cause a performance issue. Under the Profiler, I can see that having this minimap on the screen causes my Engine usage and Draw Calls to double or triple, which in turn makes the overall CPU usage much higher-- enough to potentially cause frame rate issues.

If there is some alternative solution to creating this sort of minimap, I'd love to hear it. Considering the minimap is static for the duration of the level, it seems like there must be a more efficient way to accomplish this within Construct 2 than displaying an entire tilemap on the screen.
(M.A.D. are my initials. I'm not the least bit angry, really!)
@madguy90
B
11
S
4
Posts: 41
Reputation: 1,671

Post » Wed Jul 16, 2014 7:47 pm

Are you by any change having the map be created every tick instead of once?
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Wed Jul 16, 2014 7:59 pm

Nope, just once. Having the whole 160x160 tilemap appearing in my GUI layer is enough to cause the performance issue.
(M.A.D. are my initials. I'm not the least bit angry, really!)
@madguy90
B
11
S
4
Posts: 41
Reputation: 1,671

Post » Fri Aug 08, 2014 6:07 am

Hi! May I ask how you made the minimap? @Madguy
B
54
S
16
G
6
Posts: 719
Reputation: 9,207

Post » Fri Aug 08, 2014 7:54 am

As of right now, I haven't found a workaround for this particular issue. It's pretty annoying. You've basically got two options here to produce this sort of minimap-- place a bunch of tiny sprites on the screen, or use a tilemap. And both methods are memory hogs. I'm currently using a Metroid-style minimap, which is a lot more efficient, but also lacks the level of detail I was hoping to have.

It would be great if Construct 2 had some sort of way to just draw pixels to the screen, or create a custom sprite on the fly, or make modifications to an existing sprite.
(M.A.D. are my initials. I'm not the least bit angry, really!)
@madguy90
B
11
S
4
Posts: 41
Reputation: 1,671

Post » Fri Aug 08, 2014 9:26 am

I made a quick example of how you could use Rojo's canvas plugin to show the static minimap. I think I've got the same dimensions as you mentioned in the post.

canvas minimap.capx


And the plugin is HERE
You do not have the required permissions to view the files attached to this post.
B
46
S
23
G
7
Posts: 459
Reputation: 6,763

Post » Fri Aug 08, 2014 4:59 pm

Oh fantastic! I was not aware that this plugin existed-- that's exactly what I was looking for! Thanks so much!
(M.A.D. are my initials. I'm not the least bit angry, really!)
@madguy90
B
11
S
4
Posts: 41
Reputation: 1,671


Return to How do I....?

Who is online

Users browsing this forum: DiabloOvermind, lukewasthefish, Mayfly, tarek2 and 15 guests