Hey guys! Sorry to take an extra day to get back. It was King’s Day in the Netherlands.
I will be investigating rendering the nav mesh to the background texture. Thanks for the suggestion and for the people who seconded that. Expect progress updates on this starting next week.
The plugin tracks all actors with “MapIconComponents” added to them. This tracking is done independently by each game client. All minimaps will display the same world though, so long as the actors’ position is replicated.
As for how the icon appears (texture, size, draw color, visibility, etc), the plugin does not make any effort to synchronize these values. This is the responsibility of the actor that owns the icon. This is by design, as you should know best which attributes to synchronize and which to differentiate per game client. You probably want enemy pawns to appear differently from friendly pawns, which you can do by a texture swap or setting a draw color. Perhaps in your team vs. team game players should only see enemy players if they are in line of sight. Here are snippets that illustrate this, from a project I’m working on:
// Updates minimap draw color
void AMyCharacter::RefreshMinimapTeamColor()
{
const FLinearColor TeamColor = IsLocalPlayerTeam() ? FLinearColor::Blue : FLinearColor::Red;
TeamMapIcon->SetIconDrawColor(TeamColor);
}
// Updates icon visibility based on whether local player can see character and whether character is alive
void AMyCharacter::RefreshMinimapVisibility()
{
const bool bCharacterVisibleLocally = LocalVisibility != EVisionTargetVisibility::Hidden;
const bool bCharacterIsAlive = IsAlive();
const bool bIconVisible = bCharacterVisibleLocally && bCharacterIsAlive;
TeamMapIcon->SetIconVisible(bIconVisible);
}
In my project the above functions are called by OnRep_ functions of any replicated variable that affects the icon’s appearance, like Health.
This works out of the box. You can create a UMG widget that has two Minimap widgets and a Widget Switcher that toggles between the two based on a key press. The two minimap widgets can have different sizes and one can be configured to follow the player, while the other shows the entire map.
This is actually demonstrated in the Example Project, but you do need the plugin to run the project so I’ll paste some screenshots of the relevant bits instead. In the example project you can hold Tab to switch between the two widgets.
Pressing a key to toggle instead of holding it works slightly different, because unfortunately widgets can’t capture key presses directly. But the bottom line is, the plugin supports differently configured minimaps that you can switch between.