The way I get it to work with huge world and level streaming:
Let CaptureCam follow own character. Can be set outside MiniMap.
Select FOV 10 of CaptureCam.
In MiniMap_Math::GetLandscapeEdges, get the size of LevelBounds and calculate BottomLeft/TopRight from character location. The box returned will follow character. The box can be scaled dependent of zoomout and capcam fov.
In MiniMap::AdjustZoom, set zoom range from 0.25 to 0.55. Depends on capcam fov and zoomout we allow.
Ah, you talk about the link in my signature, I thought you talked about the link in the first post of this thread I forgot about the one in my signature, I have also fixed it now, thanks for making me aware of that!
Hey man, I’ve been using this for some time now while prototyping, and it’s always come at quite a performance cost. Any tips for how to lower the performance impact?
Hey there, I know I messaged you but I thought for the sake of others maybe we could discuss it on here too.
Performance wise, like the guy above, im trying to optimize abit.
Iv removed zoom and rotation but is there any other aspects I can lower/remove without it affecting the function of the mini map?
The best thing you can do is to use a custom texture for the background of the minimap. The most expensive thing is the Capture Cam, thats a SceneCapture2D so it’s basically rendering a whole image of the scene again. Once you use a custom texture that cost is no longer there and you should not notice the minimap at all regarding the performance
A custom texture also usually looks way better than what the Capture Cam provides since you can manually stylize it. It just won’t work if you need something like a dynamically changing landscape.
I’ve been doing some work on my own system so I haven’t tested to confirm this in John’s radar, but I think running “Get All Actors Of Class” every tick for actors we want displayed is a probably a bit of a resource sink too. It’s really convenient for just getting it all set up plug and play so in terms of the marketplace I don’t disagree with this choice.
Instead of getting everything each tick, a more efficient solution would be getting point locations from a reliable array of objects that only updates when a new thing is spawned. So if you’re marking characters say, rather than just getting every actor in the scene every tick, make the character let the radar know it exists on construction, and that it’s gone when it’s destroyed.
Yes, that’s right. I assume many people already have the data for the actors in some array so they can just use that array. Using the “Get All Actors Of Class” node in the example is just for making it a bit easier to understand. I think the cost isn’t too high though, I would consider it negligible compared to the scene capture. Especially since most games are usually limited by the GPU and not by the game thread
What is the correct way to go about using a custom texture instead of capture cam?
I have removed capture cam from the scene and replaced the mapimage material (inside of MovePanel) with my own image
Is there more I need to turn off/change to improve performance?
As without the UI i get about 80fps in editor and with the UI i get about 45fps
Yeah I was getting about the same kind of hit. Are you using the radar just in a screen-space hud type setup out of curiosity? We had it in a scene widget component.
The way you did it is almost right, instead of replacing the whole material in the MovePanel it’s easier to just open the Material and switch the texture in there from the render target to your own one, but this should not make any difference regarding performance.
For performance, never test in editor. The editor is doing a lot of stuff in the background and a lot of code is way slower in the editor than it will be in the game, so either test in standalone, or for best results compare it in packaged. If you still get such a huge difference in performance there then something is wrong, but I would guess the performance difference is gone there
I just thought of another quick and easy way.
Put a CaptureCamera in your map, give a slight delay so it has time to capture your map and then destroy it.
So it saves an image of the map you currently have and doesnt take up much more performance!
You see any issue with that?
You don’t need to destroy the Capture Cam for that. If you disable “Capture Every Frame” on the Capture Cam then it will only capture the map once on begin play and then use that image the whole time. You can then also manually call the “UpdateImage” function from the Capture Cam to update the image at any time