Minimap extension beta

Hello world,

I’ve been experimenting with a minimap extension: https://github.com/microsoft/arcade-minimap

I extended stream 21 to include a minimap: https://makecode.com/_cfmFVq27UbsL
also added some wind.

It’s useful for having a smaller representation of the tilemap.

Here are the blocks:
image
and in action (notice the scale parameters):

Cheers,
Daryl

10 Likes

cute! Does it actually draw from the same tilemap object?

Yes it’s created from the current tilemap and can be modified by drawing sprites onto it

1 Like

@darzu you should add blocks for setting the colors. Like: draw ‘tile’ as ‘color’

Just discovered this extension and it’s awesome. Thanks for making this @darzu!

1 Like

Hi @darzu! I’ve been searching through all these kinds of chats looking for some chat that talks about this extension. (jk. when i searched it up, this was the first thing that popped up. lol) well…

I’ve been working with the extension and was wondering how to use it.


I wanted to work with the Minimaps but I can’t just figure it out. Can you help me?

Heres the link: https://makecode.com/_UcXCAjEawCa2

It’s been making errors. Is it because I’m using the older version instead of beta?

1 Like

Hey @Dreadmask197, glad you’re interested! It’s one little thing: the myMinimap variable needs to take a “minimap” not the image from the minimap.

Here’s a gif showing the fix:

Here’s a fixed version:

hope that helps!

2 Likes

Yeah it works! I’m going to work out some kinks to make the minimap pop and the tilemap disappearing and when I press A again, I will make the minimap disappear and the tilemap pop

Hey @darzu!!


I figured the minimap stuff and the pop ups!! It took me a while but I got it.

Thanks a million!
Dreadmask197

1 Like

Awesome! Can’t wait to play your game!

I am trying to make it for a 160x120 tilemap with a 1/16 scale to get 1x1 tiles. I know there is a way to get 1x1 tiles in JavaScript, but I am having trouble with it. I am also having trouble with the minimap. Help?

Could you post your code, please? Maybe you’re just missing something.

@GameGod the smallest tile size is 8x8.

Complete list of tile size options is:

  1. 8x8
  2. 16x16
  3. 32x32
2 Likes

The reason it’s limited is because it is much, much, much faster if the tile size is a power of 2.

We could theoretically add support for 4x4 or 2x2 but I’m not sure how bad that would make performance; smaller tiles are always going to require more resources because there are more tiles to be overlapped with and more things to draw to the screen. 8x8 works great though, so maybe 4x4 wouldn’t be too bad.

2 Likes

For what it’s worth, we just pass in an enum mapping 8x8 to 3 and never actually check it / do anything special that I remember; if someone wants they can probably test it pretty easily with the color-coded-tilemaps extension, just pass in 2 instead of the enum for scale here. I’d suspect 4x4 might work, I think I remember adding some bumping logic that expects at least 1 or 2 pixels of space to push players back from walls that might cause weird issues though.

How would I erase the sprite and draw it moving?

Here’s an updated version:

To update the minimap, you need to constantly draw to it in “on game update”. (1)
To reset the minimap, you need to reassign it in on game update. (2)
To show the minimap, you need to get its image every time it changes (in on game update). (3)

If you leave out step 2, then you’ll see a trail where your sprite moved which is sometimes what you want:
2020-10-23 10.13.35
If you change the game update interval, you’ll get dots across a map which is what I originally used the minimap for:
2020-10-23 10.14.27

1 Like

Wow. That’s pretty cool with the letters as well. Do you use an app to make gifs? I don’t know where to download one.

Thinking about it, this scenario of real-time updating a minimap is very common and we could probably add some blocks to make this easier.

Maybe:

  • change “draw mySprite on myMinimap” to say “draw mySprite once on myMinimap”
  • add “track mySrpite on myMinimap”. This block would automatically keep updating the minimap whenever the sprite moves. (https://github.com/microsoft/arcade-minimap/issues/2)

Also I think performance is going to be an issue since it’s redrawing the 160x120 tiles as scaled down versions to the minimap every frame. I can probably add some optimized code to make this very fast in the case where we’re sampling one pixel and/or the whole tilemap is a uniform color. (https://github.com/microsoft/arcade-minimap/issues/3)

On mac I use gifox. Windows folks use ScreenToGif I think

1 Like