I’m trying to find a more efficient way of making a map with a viewport frame with my last script. I made the viewport frame camera positioned above the player looking down, but the drawback is that it reduces the frame rate and efficiency of the gameplay. So I am searching for a way to do this without any consequences.
Can you please show us your last script and I might be able to help the framerate by checking for bugs/unrequired scripting.
What you want to do is make a image of your games map by pre rendering it and saving it as a image, then make the image x times bigger depending on what range you want on it. Then you move the map image depending on the players position relative to 0,0,0
This is the script if you want to see for yourself and also I’m new to the forums so I don’t know how to send images of the script.
LocalScript.lua (840 Bytes)
It has slightly improved but its still reducing the performance of the game.
When making a minimap I suggest using simplified parts to make the map. I would not suggest you make a 1 for 1 clone of the map to use it in the minimap. You basically are rendering the workspace twice, so obviously performance will drop.
I would recommend looking into using CollectionService to tag important features in the map that should be added into the mini-map. Things like paths, roads, simplified versions of buildings (aka use the bird’s eye view/floorplan of the building). But the main idea is that whatever you include is simplified. Ideally it should look something like Google Maps.
I will try this and update you on it, thanks for the tip though!
Another tip to mention is you should be preloading the image
Can you give an example? like tell me how to do it or give clear instructions.
Use preload async from content provider to load the image before the player gets in then upscale it depending on how big you want the range to be then move the image depending on the players position.
ok so i get the reload async thing but how do i scale it depending on the players position, I’ve tried and failed many times.
The idea is that we apply an offset of the image relative to the origin (0,0,0) suppose the players location is current 500,0,300. Suppose our zoom in is 10. We only focus on the x and z since it is top down and in our case we would apply an offset of 50, 30. Now however we need to scale this to work on all resolutions. To do this we simply apply a global constant. Suppose 1 unit is equal to .01 percent of the screen resolution. Using aspect ratio constraint and ssetting this to 1 we avoid stretching. Simply do .01 * 50 for the x offset and .01 * 30 for the y offsest.