Maps and Minimaps Code Plugin

New video Jan 2nd, 2017:
https://youtube.com/watch?v=RNL05JY5h1c

Hello everyone,

I’m working on a code plugin that provides map and minimap functionality and will be simple to integrate into any UE4 project from 4.13 and up. My intention is to release this to the marketplace. I realize there is already one map and one minimap solution on the marketplace, but both of them are built in blueprint. The plugin I’m making is aimed at people who highly value the run-time performance of their game and want to avoid losing performance to computations in blueprint. To that end the plugin provides the option to render maps with UMG or drawing directly to the HUD’s Canvas. The design of the plugin is also component driven such that making an actor appear on the minimap is as simple as slapping a component on it and setting a texture. The same goes for making an actor the center point of a minimap. Furthermore in this day and age UIs are expected to be highly interactive, so the icon components fire events such as OnMouseOverStart/End, OnViewEntered/Left and OnClicked that you can bind functions to in C++ or BP, icon appearances can be changed on the fly and icons can play material animations.

Here are the features that are currently working. Please let me know what you all think of these and whether there is anything that you think is missing.

Maps

  • are rendered using UMG or Canvas. All features are compatible with either method.
  • are circular or rectangular. Icons will seamlessly slide into and out of the minimap, rather than popping in.
  • are rendered full screen or in a corner of the screen.
  • show a fixed area or follow any actor such as the player
  • can be zoomed, panned and rotated
  • background can be clicked. The click position will be converted to a world coordinate and an event will be fired that you can bind functions to in C++ or BP.
  • background can be auto-generated or a hand drawn texture can be specified
  • background can be composed from multiple areas each with their own texture, in case it would be wasteful to represent your map with one huge texture
  • background texture and material can be changed on the fly for ‘undiscovered’ or ‘fog of war’ type effects

Icons

  • can be tied to any actor by adding an icon component to it
  • can use any texture or material
  • have a ZOrder value to give you control over which icon should appear on top
  • can be clicked and mouse-overed, firing events that you can bind functions to in C++ or BP
  • can be animated by having the material make use of a supplied “Time” parameter. Plugin comes with two animations: a flashing icon and a pulse/ping as common in multiplayer RTS and top-down MOBAs
  • can rotate to show the actor’s rotation
  • can show a different icon that stays at the edge when the actor is outside the minimap’s range
  • can have any of the above properties changed during gameplay and their appearance will immediately update in all of the exsting (mini) maps

Please see the video of the plugin in action and let me know what you think! :slight_smile:

This is awesome - will this be a paid plugin or a free one?

Thanks! This will be a paid plugin. I haven’t decided on a price yet but it will be around the same as the ones on the marketplace currently.

Would you guys buy a plugin for full screen maps or minimaps? What kind of features would you like from one?

I’m currently wrapping up on documenting and cleaning the code for the features listed in the first post, but I am hoping to get some more perspective from potential users for what kind of features would be desired that may be missing. Any feedback is welcome!

nice project, including nearly all essential features (the customizable texture based background sounds great), but imo it is very useful in RTS games when you see on the minimap the actual visible area onscreen, represented by a trapezoid.

Do you mean to have the minimap show the entire map, like in this screenshot from StarCraft 2 (I think):
4-Minimap.jpg

You will be able to make a minimap with a static view point. In the video you see this at 0:40. Although in the video it is a large map, you can render that to a minimap as well. Is there any specific reason why you want to render it to a trapezoid? Thanks for the feedback!

The white trapezoid in the screen you posted represents the part of the map you can see in the game at the moment.

Yes this is what I would need. And the trapezoid is a good approximation, when camera angle and FOV can change freely

Oops, I didn’t even notice the white trapezoid in the screenshot I posted myself, hah. I can see how you would want that in your RTS game so I’ll add this feature.

ha-ha, cool :slight_smile:

I got the white trapezoid working. :slight_smile:

Currently I’m computing a point 1000 units in the camera direction and store its Z coordinate. Then I compute camera rays through the four corners of your screen and intersect that with a plane at that Z coordinate to obtain the four world points that are then converted into map space. Using this approach, how far you tilt your camera down affects the shape of the trapezoid and it will always represent exactly what part of the world you’re seeing. If you look directly down the trapezoid turns into a rectangle. Also, your screen’s aspect ratio is automatically accounted for. All in all I’m happy with how it works but if you have more suggestions let me know!

Hello everyone. Please check out the video I made to showcase the minimap’s features:

https://youtube.com/watch?v=RNL05JY5h1c

I’m submitting the plugin to the marketplace this week. Please let me know any thoughts and feedback you have. :smiley:

This is really impressive!

The only question I have is how would I use it with a randomly generated dungeon layout? That respawns several times within the same game session?

Hi Yun-Kun, thanks for the kind words! :smiley:

To use this with a randomly generated layout that can respawn, this is perfectly doable! How this will work in the plugin is like this:

In the plugin there is an actor type, called MapVolume, that covers a square part of the world and causes a texture or a snapshot to be rendered in the minimap for that part of the world. The plugin is made so that you can have any number of MapVolumes. For your randomly generated dungeon, you can either spawn a MapVolume for every generated room or spawn one MapVolume for multiple rooms together. If you don’t specify an imported background texture, it will automatically take a snapshot. You can manually trigger retaking the snapshot at any time you want, for example if the layout changes. When a room despawns, you can remove the MapVolume so its outdated snapshot doesn’t contribute to the minimap’s background. I hope that answers your question. If you have any more, let me know!

Personally, if I were generating a dungeon procedurally, I would also generate the background texture using a render target for the minimap at the same time.

The plugin also allows you to render those generated textures to the minimap by placing a MapVolume actor over a cubic volume (square when viewed top down) and using the render target as if its an imported background texture. Of course, if your method of generating the background texture is by rendering the scene top down to the render target, you would be doing work that the plugin can do for you.

I wouldn’t render the scene, I would handle the drawing manually. Using a scene capture doesn’t tend to generate very useful minimaps in a lot of use-cases (and scale is always an issue), but you can manually splat textures into a render texture to get pretty decent stylised minimaps that are much more useful to the player.

I’m quite interested in how that could look. Do you have any screenshots of minimap backgrounds generated that way that you would be willing to share?

Great! If the 1000 unit max. distance can be tweaked it is perfect!

Thank for your answer and the explanations. I’ll definitely keep track of this thread and of the plugin.

I have trouble making Minimaps because I’m terrible in mental space projection and maths in general.