• News

• Industries

• Learning & Support

• Community

• Marketplace

# Minimap Question!

Over the years people have released minimap videos and stuff on the marketplace that you can buy. I am not looking to buy I am looking to merely figure out how to make an image(aka a 2d map layout) move based on the world position of the character to that of the map. Anyone able to help me out with this. I don’t need something super advanced or complex(unless it is a complex thing then by all means) I just need something functional.

Carl

I haven’t figured out how to make the map icons appear only on the mini map and not show up in the game world. But I think to make a mini map its done with a camera attached to the spring arm on the player so the camera moves along with the player and it just captures the 3d world down below and puts it on the mini map widget.

I don’t want it to capture the 3d image of the world. This i already know how to do. What I am looking to do is make an image Pan based on the position of the player with a hand drawn map of the world or something of that nature. Games like Final Fantasy XIV or World of Warcraft to name a few use the feature that I am looking to make.

One of the authors of a marketplace minimap asset here. I can share some of my experience developing the minimap. When you want to render part of the minimap’s background texture based on the player’s position, first of all you need to have a background texture made and know what world XY coordinates it maps to. Then you compute the player’s position in the coordinate space of the background texture. Then you convert that to texture sampling (UV) coordinates.

As a simple case, let’s say that you have a 512x512 background texture and it represents a 1024x1024 area in the world centered around the world origin (0, 0, 0). I’ll call the world area that the background texture maps to the “background volume”. Lets say the player’s world position is (100, 100, 0). Ignoring Z coordinate because it is unimportant, the background volume goes from XY = (-512, 512) to (512, 512). The player’s relative position within that volume is computed via ‘inverse lerp’: U = X - MinX / MaxX - MinX, so:

[table=“width: 200”]

``````U =
100 - (-512)
``````

512 - (-512)
= 0.6

Or the player’s X coordinate is 60% along the background volume’s X range. And we used the same values for Y. In other words, in the background volume’s coordinate space where (0.0, 0.0) corresponds to world (-512,-512) and (1.0, 1.0) corresponds to world (512,512) the player’s position would be (0.6, 0.6).

Now recall that we had a texture that maps exactly to the background volume. Texture sampling (also known as UV) coordinates go from 0.0 to 1.0, so to render the area around the player, we now render around UV coordinate (0.6, 0.6). For example, we could render the minimap with UV coordinates ranging from (0.6 - r, 0.6 - r) to (0.6 + r, 0.6 + r), where r = 0.1 or can be varied to control how far the player can see on the minimap.

Once you understand the simple case, you can try implementing a minimap that rotates or having a background volume that isn’t centered around the world origin and is rotated as well. The most important part is to understand what coordinate spaces you are converting between. I can give an overview:

• World space: Everything’s position relative to the world origin.
• Background space: Everything’s position relative to the background volume’s center (or a corner) and the background volume’s rotation. Distances are the same as in world space.
• Background UV space: Same as background space but all coordinates that are inside the background volume are rescaled to 0.0 - 1.0. These values are usable as texture sampling coordinates.
In the simple case we didn’t have to do anything to obtain background space coordinates from world coordinates, because the background volume has the same origin and rotation.

If you are familiar with the terms view space and projection space, the background space and background UV space are exactly that. There are actually camera calculations in 2D. Hope this helps you out.

Thank you lord, Someone was finally put this up there. Thank you so much Zhi Kang, I will get to work on this and see if i can get it to work.

How do I get the information from the Inverse loops into the Material Editor so that I can update the material that is being displayed?