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

Before I asked a question on how to make a minimap. I saw @badcc do it for Jailbreak.

The raycasting scripting part of it and getting part/terrain color is sort of easy. I just don’t know how to turn it into an image file now. What kind of format or program or other fancy stuff do I have to do?

6 Likes

If it’s low-res (under 300p or so) you can reasonably create the image out of individual frames them photoshop the edges out.

What I do is have it export through HTTP locally and the end result is a file on my desktop.

1 Like

Http? Through a external service?

Yeah I’m not really good at node.js or stuff like that

1 Like

Me neither but I kept improving the renderer and exporting through frames in studio and eventually people helped me out when I asked for it. If people see you’re working hard on something they’ll be more likely to help themselves.

1 Like

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.(http://netpbm.sourceforge.net/doc/ppm.html), 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?