Glad to hear the fog of works now. I haven’t gotten any ideas on what can cause the flickering yet. Increasing the resolution of the fog of texture on the MapFog actor might reduce the issue. If you find out anything else that might hint at what causes the issue, please let me know.
A small update should be coming online soon for engine versions 4.15 and 4.16. This update will also make the plugin compatible with 4.17. Here are the changes:
Minor code changes to compile without issue for 4.17
Fixed circular fog revealer not being a complete circle
Fixed issue causing loading errors after adding minimap components to a blueprint and restarting editor
Fixed issue causing the minimap background texture not to show correctly after manually calling RerenderBackground
Added a MapBackground C++ and blueprint event OnMapBackgroundRendered that fires whenever the background is rerendered with scene capture. Use this event to manually render extra items into the render target.
I have had questions about Mac support. The marketplace page does not list Mac as a supported platform, because I haven’t tested for Mac OS. People have reported that the 4.15 worked fine for development on Mac, but 4.16 didn’t. I’m not sure why this is the case, because the plugin doesn’t do OS specific calls. I will be borrowing a MacBook to ensure that development on Mac will also be supported for 4.15, 4.16 and 4.17. Please look forward to that if you develop on Mac.
This looks like a really well implemented minimap and fog solution!
I’ve read through the documents but am interested to know a little bit more about the Fog of solution - is it easily possible to check Server-side who is visible to whom?
Thanks for the kind words. The data of what fog is cleared is stored and updated client-side. Clients will see the same minimap if they entered the game at the same time and the same fog revealers are enabled i.e. the client-side executed game code marks all team mates of the local player to grant vision and marks all enemies to not grant vision.
I’m afraid the provided implementation does not process fog on the server. This has two consequences that you must be aware of:
A) A later joining client does not automatically receive what fog has been cleared.
B) There is no “true” version of a team’s fog data.
You can implement a manual solution for issue A. For example, when a player joins a team the server requests all fog data from team members’ clients and sends the combined result to the new team member’s client. From there on, all game clients will update the fog locally again.
Issue B can be worked around depending on your requirements. If you simply want all fog maps to look the same to the pixel, you can periodically sync the render target data via RPCs, but the plugin does not do this yet, currently. If you want fog data to only be updated by the server, I’m afraid this is not possible if you plan to run dedicated servers on machines without GPUs. Fog is updated by drawing to render targets, which is great for efficiency (its an ideal task for the GPU) but can’t be run without a GPU.
With code changes, you can let a server track fog data for both teams, but this will only work on servers hosted on machines with a GPU:
Modify the “MapFog” to have render targets for both teams and the fog updating code to pick a render target depending on the fog revealer’s team.
Implement a way to send each team’s fog data to the clients. Since render targets (texture data) can be quite large, it would have to be something smarter than just sending the data every tick. This step isn’t required if the reason you want fog data on the server is not authority, but just as a convenient server-side vision system.
I know some people have used this minimap in combination with another system that checks whether actors are visible to each other. If you have such a system in place, you can make that an additional requirement for showing an icon on the minimap. In that case you can call SetIconFogInteraction( VisibleWhenRevealed ) to only show an icon when its not inside fog and call SetIconVisible( true or false ) based on the result of your own vision system. That vision system can be server authoritative and the icon will only show when not in fog AND deemed visible by the server.
I submitted the 4.17 update on August 14. I’m afraid Epic marketplace staff hasn’t processed it yet despite a reminder I sent. More marketplace sellers seem to be waiting for their 4.17 update to go through.
If it is an option for you, download the 4.16 version of the plugin. It is compatible with 4.17 after you remove the line saying “private_subobject” in MapBackground.h and MapAreaBase.h and recompile. If compiling is not an option for you, know that the update is in Epic’s hands and should be out soon.
Done. If anyone else needs the 4.17 version of the minimap urgently, send me an email (zhikang [dot] shao [at] gmail [dot] com) with:
A screenshot of your Epic Games Receipt for the plugin
A screenshot of the plugin in your Epic Games Launcher > Library > Vault
and I will send a 4.17 compatible version of the minimap to you. It is now exactly one month since this version has been in the hands of the marketplace team. I don’t want this to hold back your development.
Plugin files for UE4.15, 4.16 and 4.17 have received an update.
The update is available via the launcher! It adds the following features.
Support for Mac
Development and packaging have been tested on Mac. This new plugin update is confirmed to work with Mac and Mac is now listed as a supported platform for all engine versions.
NEW: Icon categories
Icons can now be assigned an icon category, for example “resource”, “building”, etc. Per minimap you can toggle the visibility of icon categories.
How to use this feature:
On an actor’s MapIconComponent, fill in a value in its IconCategory field.
On the MapViewComponent that defines the minimap’s view area, access or change a category’s visibility via IsIconCategoryVisible(…) /SetIconCategoryVisible(…)
The icons will automatically update their visibility based on these settings. If you want other UI or world elements reacting to icon category visibility, the MapViewComponent fires an BP and C++ assignable event OnVisibleCategoriesChanged.
NEW: Minimap box selection
Minimap widgets now have an setting to enable box selection. If enabled, the user can click and drag on the minimap to draw a selection box. When the mouse is released, the minimap widget fires an event that supplies a list of icons that was inside the box selection. Only visible icons will be included in the list; icons hidden due to their visibility setting, category setting or fog of won’t be included. Additionally, the event supplies which mouse button was used and whether ctrl and/or shift was pressed when the box selection started.
Minimap events: LMB and RMB
The existing Minimap widget event **OnMapClicked **and MapIconComponent event OnIconClicked now supply a boolean IsLeftMouseButton so that when those events fire, you know whether it was a left mouse or right mouse button click that fired it.
Fix: Regenerated background not appearing correctly
Fixed a bug that was causing the minimap to show a default texture (2x2 grid) after calling the MapBackground function RerenderBackground. This only affected projects in a top-down render was shown on the minimap and this render was refreshed in run-time.
I can get the location fine in multiplayer, but if I change the map icon color I can’t access that value from the client of the other pawns. I want to show the players to be blue who are on the blue team and to show the red players who are on the red team. [USER=“23394”][/USER]
Or in blueprint, whenever the team ID gets replicated (in the RepNotify function) call SetIconDrawColor function in blueprint. Hope that was clear! Let me know if you need more information.
Hi there, I just purchased this plugin and as someone who has been fussing with making my own, it’s really great! Thanks! I’m working on a 2.5D sidescroller. I’m having a bit of trouble getting the minimap to work. I can’t seem to get the map to follow the player in the Z axis. I had to do some tweaking to get the MM to work…nothing major, but here it is.
MapBackground: Rotate in Y by -90 degrees. using render target for now, but I plan on drawing a simplified overlay.
Mapview: parented to spring arm that drives the camera. Set the base yaw to -90 to rotate the map in the correct direction. Also had to move the mapview box to around 4500 in the X(Along with the icon for them to show as centered in the minimap.
MapIcon: Also Parented to the Spring Arm and moved as stated above.
I turned off rotation in everything because the background need not rotate. It would be cool if the player Icon did. Not sure how to achieve that without the map rotating.
My character reavels along the Y axis and jumps along the Z.
Right now, it seems that my only issue is the minimap not working in the Z axis.
Any help on this would be appreciated!!!
Hi.
Your minimap plugin looks great but I have two questions before buying:
is there a buildin way to save and reload players progress to a game slot while using explorable for of ?
I have levels which are randomly generated at runtime out of prebuild rooms/sublevels. Is there a way to use prebuild textures for those rooms/sublevels and use those for the minimap?
Hi fluxist, unfortunately the minimap is made assuming top-down. This decision wasn’t just to make my life easier, but also because some calculations can be simplified (thus more efficient) by making that assumption. For side scrolling, the modifications that you made are certainly in the right direction. However, to make the icons move correctly in Z, you must modify the way that the MapViewComponent C++ class calculates icon coordinates. Unfortunately I can’t look at this right now. If you are savvy in C++, you may look at MapViewComponent::GetViewCoordinates yourself. Otherwise, since more people have requested this feature, I will take a look at it mid-January after the holiday season. I apologize for the wait for that (and for the delay in reply).
Laurentius, I have responded to you in e-mail but for other people that have the same question I’ll paste it here too.
If you work in a C++ project, you can grab the render target that stores what places are currently explored. You can then read or write the pixel into a 1D color array. That color array can be saved and loaded as part of the UE SaveGame or your custom save format. Below is a C++ snippet on how to do that. Unfortunately I don’t know if all this functionality is exposed to blueprint.
Yes! What I would suggest for those kinds of rooms or sub levels is to dynamically spawn a MapBackground actor and make its bounds overlap those rooms/levels. Then you can assign your prebuilt textures to the MapBackground. Placing multiple MapBackgrounds to together form the minimap background is intentional and supported. You can then either:
Give the MapBackgrounds different priorities, for example an in-door background will show once you enter its volume while the outdoor background shows otherwise.
Or give the MapBackgrounds different Z-orders, meaning both will show at the same time and you can control which one shows on top.
This forum post shows how that would work: https://forums.unrealengine.com/unre…014#post991014
Thanks for your answers.
I bought the plugin and integration is very easy - good job!
I’m currently using only blueprints for my game, so I can’t use your c++ approach for saving and reloading the fog rendertarget. Maybe this feature could be made available via blueprint by the plugin, too?
While using the plugin two small problems are visible:
I have a single map where the minimap is rotated by -90 degree. All other maps are working good and north is where it should be. Maybe you have an idea what could go wrong here?
I use scaling for resizing multiple map backgrounds and fog on one map. But this makes aligning them very difficult, because the extent is a multiply of 1024. Is there a better way for resizing them than change the scale?
Other than that it works good - even with levels created at runtime.
I found out that the initial rotation of the PlayerStart was influencing the rotation of the minimap - weired behavior, but at least I found out about it.
So I got my hands wet in C++ and heired from the MapFog class and extended it for blueprint nodes for reading/writing a pixel array in order to make the fog(s) serializable via blueprint.
All is good now but I had to make some modifications to the code as the PixelFormat was different: