Realtime minimap using EditableImage & Parallel Luau

Kinda late to making this since EditableImage was announced like a month ago, but also kinda early because it’s still in beta as of this writing :joy:. Someone probably already beat me to making this, but this is my own take!11!!11!1

Essentially, how it works is I’m raycasting a whole bunch of points relative to the player and the camera. The raycasting is multithreaded via Parallel Luau v2. I just get the color/material color of whatever it hits and then render it with an EditableImage.

Performance wise, it’s pretty decent on my PC (Ryzen 5 2400G) at 8 threads and total ~6 milliseconds. That’s more than enough to sustain 60 fps at 64x64 resolution updating every frame. You can still extract more performance by cheating and having the render be spread across several frames. Just know that it’s impossible to get a pixel-accurate minimap because that would fry your CPU with millions of raycasts per frame.

Older screenshot on the top, newer one on the bottom:

There’s depth perception too, things below you will get darker until it becomes 100% black (which is when it escapes the raycast scan distance.) I also added a bit of noise to the rendering so it doesn’t look so flat.

Video recording:

7 Likes

I won’t really say that its suuuper good becuase of how jittery and pixelated it looks but not a bad job on this.

4 Likes

Bottlenecked by raycasts. This is quite literally the best you can do. The EditableImage itself can definitely update every frame, but not so much with the thousands of raycasts.

2 Likes

You can hover over the minimap to temporarily zoom in at full res at the cost of performance. Not really supposed to move around with it, it’s for you to take a quick look when it’s too blurry by default

2 Likes