How to get from raycasting -> to a image file of a minimap

Another way to do it?

If you are merely trying to get a data stream out of Roblox and into a file I reckon making it a Roblox plugin and writing the output to the .Source property of a Script is somewhat convenient, especially with the output adding all kinds of unwanted characters. Alternatively if you want to show the image on a GUI you could convert each pixel into a 2D grid of GUI ImageLabel objects and simply take a screenshot of it if the resulting GUI otherwise takes too long to load in-game.

1 Like

I want to generate a rather large minimap, but every script has a limited amount of characters.

From the top of my head I say 150k characters, however making more than one script should work. The better question would be what format you are storing it in, which is why I would recommend trying to render it in a GUI directly rather than having to store it as ascii anywhere.

Was just wondering how to put it into a PPM format, base64 and program a node.js program to parse and concat scripts, then decode and save as ppm file.

PPM is an ascii-based storage method for images.(PPM Format Specification), base 64 is an encoding which likely is used to eliminate errors when splitting and sharing the data, converting rbxmx model files I have never done before but I reckon they are xml-like structures containing a section for the script source. Reading file contents can be done in many ways though, maybe Node.js has a particular package to read Roblox file formats.

In general it seems easier to screenshot a manually generated GUI, because if you want to do the aforementioned without experience in it… (that is, file formats, I/O, encoding)

1 Like

I’m not really a fan of screenshotting and stuff like that.

It tackles the problem of making a file incorruptable and splittable (base64), using a standarized storage method for the pixels (PPM) and the I/O operations required to read a rbxmx file all in one (Node.js or similar). Not sure why you wouldnt be a fan. :man_shrugging:

In cases like generating a minimap larger than your screen resolution, of course there’s people who wouldn’t be a fan.

Could piece that together. You asked for an alternative to the list you mentioned; of course if you can not do the best and neatest solution then the next best alternative is not gonna be equally good. Not stopping you from learning all the required methods, I guess I would be a fan of doing that.

I no longer do it this way fyi,

I wrote a program in Go that acts as a web server that I send pixel data to. It saves on tons of memory compared to the in-Lua PPM way. My Lua script sends a final request telling the Go server it’s done, and it saves the image to file. Very elegant.

3 Likes

Jeez, wish I knew how to.

I just wish I knew a way to make a minimap without ROBLOX UI.

If only there was a way to have another camera outputting in a 2D UI item on your screen… Possible feature suggestion?

If you mean dual rendering of a top down view of the map, that’s already been requested. Even if something like that came to production, I’m pretty sure that people with lower graphics settings wouldn’t even render the map from so far up.

Maybe badcc could make a video tutorial for us all to see. That is, if you’re willing to show your method off.

I think quite a lot of people would find it really handy.

3 Likes

OK, so I just made this.

Problem is, it’s skewed and ended up like this.

I don’t really know well about raycasting, I raycasted 1080x1080 times from top left corner to bottom right corner.

How did this end up? How would you raycast to get the camera pointing straight down and not cut in half in the side of the screens?

Not really what you are looking for, but I made a 3D minimap.

8 Likes

@Iiau

I attached a roblox place that I made & then gave to vetexR for his arcane adventures game, to make a simple minimap out of frames

It’s just so you can take a quick screencap of the resulting frames and edit it in paint.net or something so it’s just 1 image instead of a bajillion.

Your minimap came out slanted cuz you messed up your iterating loop, I’m guessing

map aa raycast final.rbxl (13.1 KB)

3 Likes

I pack my pixel data into a binary format, and then I use HttpService to send it to PHP on my local machine (not sure of the exact terminology here but hopefully you get the idea). If the resolution is fairly high then I send it over in several chunks, and then I use another PHP file to create the PNG.

Feel free to DM me if you want a hand setting something like this up for yourself!

3 Likes

Tbh What I did was I set the camera’s FOV to 1 or something SUPER low then zoomed out all the way on top. After that, I just took a screenshot. That made a nice looking minimap. and it kept the shading & terrain if there were any.

Here’re the results:

If you’re planning on using this method though, I’d recommend setting your camera type to scriptable & then making the CFrame the same as a part that’s already above where your camera will go because that way there will be no imperfect rotation (Fixed cameras can’t look straight down.)

Edit: I made a plugin to help with this. Here’s a link:

4 Likes