Search Unity

DMMap Minimap System 2.0! Procedural, Multilayer & Vector-like maps, uGUI! NOW FREE and OPEN SOURCE

Discussion in 'Assets and Asset Store' started by DMeville, Aug 8, 2014.

  1. Hamesh81

    Hamesh81

    Joined:
    Mar 9, 2012
    Posts:
    405
    Hi @DMeville , I've noticed an issue with the position of the icons on the minimap compared to their position in the world. There seems to be a difference of several meters between the two and I cannot work out why. For example, when the character moves towards the edge of a platform, when they are several meters away in the world, in the minimap it shows that they are already at the edge. If I decrease the zoom this effect lessens until at a zoom of 1there is no distortion and the distances are correct. But the more the zoom is increased the more this distortion occurs. The camera is set to orthographic so it shouldn't be happening. Any ideas what this could be?

    I did move the minimap gamobjects to the bottom right corner of the canvas (since that is where I need it to be), but I'm not sure if I misaligned something during this.
     
  2. DMeville

    DMeville

    Joined:
    May 5, 2013
    Posts:
    418
    @Hamesh81 What zoom levels do you notice this distortion at?

    I just tested this in the TopDown_Demo scene included and I can't seem to reproduce this. Everything appears to show the correct locations, on every zoom level from 1 to 100.

    How did you move the minimap to the bottom right corner? The correct way to do this is to position the "Minimap-RectTransform" on the DMMap>Canvas prefab. I tested this with anchor position to the bottom right.
     
  3. Hamesh81

    Hamesh81

    Joined:
    Mar 9, 2012
    Posts:
    405
    It happened above a zoom of 1. I moved the mnimap by selecting the "Image", "Icons", "Overlay" and "Minimap-RectTransform" gameobjects in the canvas and dragging them to the bottom corner manually. I also changed the anchor position to bottom right on all of them.

    By default the icons were showing slightly low in relation to the minimap (eg. the player's icon was slightly below center). So I adjusted the Y pivot of the "Icons" go from 0.5 (default) to 0.6 to get all of the icons centered. But doing this caused the distortion. If I change this back to 0.5 everything is correct and there is no distortion at any zoom level. Is there a way that I can center the icons without causing this, or do I need to crop the image and overlay textures I'm using so that their center is the center of the minimap?
     
  4. DMeville

    DMeville

    Joined:
    May 5, 2013
    Posts:
    418
    Hmm, that's odd. I'm not sure actually. You mentioned that the more you increase the zoom the more this distortion happens, but I'm not sure there's anything going on that *should* be doing this internally. Especially if it's just from changing an offset, I would make sure that all the images have their visual center matched up to the actual center.

    But I guess the best I can suggest is try it out and see if it changes anything? Sorry I can't be more help!
     
  5. Hamesh81

    Hamesh81

    Joined:
    Mar 9, 2012
    Posts:
    405
    Yeah you were right. Once I cropped the image and overlay so that their center matched the minimap-recttransform's center everything is working fine now. Thanks ;)
     
    DMeville likes this.
  6. CHOPJZL

    CHOPJZL

    Joined:
    Dec 5, 2016
    Posts:
    55
    Hi, @DMeville I found that it has been 2 years since last update, is DMMap still supported? How about the compatibility with recent unity version?
     
    Last edited: Dec 3, 2017
  7. DMeville

    DMeville

    Joined:
    May 5, 2013
    Posts:
    418
    Yes, DMMap is still supported, and I offer (limited) support with the asset still. I'm not aware of any issues with DMMap and the most recent version of Unity. If you have any questions let me know!
     
  8. bigdaddio

    bigdaddio

    Joined:
    May 18, 2009
    Posts:
    220
    Layers for map shapes cannot be negative? My procedural dungeons only go down. And how about updating the docs its ben two years and it took me a while to find out how to change the line widths in the map.
     
  9. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,702
    I just wanted to add that I recently tested DMMap in Unity versions 5.3.6 through 2017.1 when adding DMMap support into Quest Machine 1.0.1, and it worked great in all versions that I tested. It's still one of the best map assets on the store.
     
    CHOPJZL and DMeville like this.
  10. DMeville

    DMeville

    Joined:
    May 5, 2013
    Posts:
    418
    Additive/Subtractive is set per shape, not per layer. Dungeons only going down should work the same was as the multi-layer demo, shouldn't they?

    Line widths are explained in the quickstart guide included with the project!
     
  11. Galahad

    Galahad

    Joined:
    Feb 13, 2012
    Posts:
    72
    Can't make the Fullscreen map work. When I activate it, it only paint the minimap with background color and change de zoom level.
     
  12. jasonoda

    jasonoda

    Joined:
    Sep 7, 2012
    Posts:
    67
    Hey Dylan, hope all is well. I am trying to make a build for the Windows Store Platform. When using DMMap, I get the following errors. I am creating a blank project and exporting only one of the demo scenes. Any idea how to fix them?

    Assets\DMMap\Lib\Triangle.NET\Triangle\IO\DebugWriter.cs(84,44): error CS1503: Argument 1: cannot convert from 'string' to 'System.IO.Stream'

    Assets\DMMap\Lib\Triangle.NET\Triangle\IO\TriangleWriter.cs(42,59): error CS1503: Argument 1: cannot convert from 'string' to 'System.IO.Stream'

    Assets\DMMap\Lib\Triangle.NET\Triangle\IO\TriangleWriter.cs(151,59): error CS1503: Argument 1: cannot convert from 'string' to 'System.IO.Stream'

    Assets\DMMap\Lib\Triangle.NET\Triangle\IO\TriangleWriter.cs(193,59): error CS1503: Argument 1: cannot convert from 'string' to 'System.IO.Stream'

    Assets\DMMap\Lib\Triangle.NET\Triangle\IO\TriangleReader.cs(168,59): error CS1503: Argument 1: cannot convert from 'string' to 'System.IO.Stream'

    Assets\DMMap\Lib\Triangle.NET\Triangle\IO\TriangleWriter.cs(271,59): error CS1503: Argument 1: cannot convert from 'string' to 'System.IO.Stream'

    Assets\DMMap\Lib\Triangle.NET\Triangle\IO\TriangleWriter.cs(351,59): error CS1503: Argument 1: cannot convert from 'string' to 'System.IO.Stream'

    Assets\DMMap\Lib\Triangle.NET\Triangle\IO\TriangleWriter.cs(425,59): error CS1503: Argument 1: cannot convert from 'string' to 'System.IO.Stream'

    Assets\DMMap\Lib\Triangle.NET\Triangle\IO\TriangleReader.cs(279,59): error CS1503: Argument 1: cannot convert from 'string' to 'System.IO.Stream'

    Assets\DMMap\Lib\Triangle.NET\Triangle\IO\TriangleReader.cs(501,59): error CS1503: Argument 1: cannot convert from 'string' to 'System.IO.Stream'

    Assets\DMMap\Lib\Triangle.NET\Triangle\IO\TriangleReader.cs(585,59): error CS1503: Argument 1: cannot convert from 'string' to 'System.IO.Stream'

    Assets\DMMap\Lib\Triangle.NET\Triangle\IO\TriangleWriter.cs(477,59): error CS1503: Argument 1: cannot convert from 'string' to 'System.IO.Stream'

    Assets\DMMap\Lib\Triangle.NET\Triangle\IO\TriangleReader.cs(638,59): error CS1503: Argument 1: cannot convert from 'string' to 'System.IO.Stream'

    Assets\DMMap\Lib\Triangle.NET\Triangle\IO\TriangleWriter.cs(580,59): error CS1503: Argument 1: cannot convert from 'string' to 'System.IO.Stream'
     
  13. DMeville

    DMeville

    Joined:
    May 5, 2013
    Posts:
    418
    Hey @jasonoda

    Not sure what that error is all about. Taking a look at the source it seems like those methods are related to saving and loading triangle data to a custom file format to disk, which is something that is included in the Triangle.NET lib DMMap uses - however DMMap doesn't make use of this functionality. (Unless Triangle.NET uses it internally).

    I'm not familiar with Windows Store Platform, but it sounds like that platform doesn't support the Stream Writer maybe? I'd first and foremost recommend trying to just comment out the offending methods body blocks of code and see if things still work with those methods removed. It looks like all the methods are static with void return-types, so commenting out the bodies shouldn't give you any errors complaining about not returning anything.

    Give that a shot and let me know what happens!
     
  14. jasonoda

    jasonoda

    Joined:
    Sep 7, 2012
    Posts:
    67
    Hey Dylan, Thanks for the quick reply! That seems to have worked! I just assumed this code was essential. Windows Store is how you get things on XBOX, and it has many strange quirks in the way you need to write things. Keep up the good work!
     
    DMeville likes this.
  15. ScourgeGames

    ScourgeGames

    Joined:
    Aug 22, 2017
    Posts:
    239
    Howdy, can the mapping work using an angled camera? All of the screen shots show a strictly top down view, and I'm wondering if it can instead show an angled view.
     
  16. DMeville

    DMeville

    Joined:
    May 5, 2013
    Posts:
    418
    Do you have an example of what you're trying to accomplish? I'm not sure I understand.

    The way DMMap works is you draw your map shapes to define the "rooms" that will be rendered on the minimap. These shapes generate a mesh which is overlaid on your geometry in the scene view. A second (orthographic) camera renders only this generated mesh to a render texture for you to display in a UI element. There are default configurations are for axis-aligned maps.

    I'm sure with a little work you could use a perspective camera to render the generated mesh to a render texture if you wanted, but that might cause some issues with other features (camera following, worldspace and mapspace conversions, etc).
     
  17. ScourgeGames

    ScourgeGames

    Joined:
    Aug 22, 2017
    Posts:
    239

    I guess what I am wondering is if I offset the ortho camera, will it allow me to render an overlay type camera sort of like a Diablo style. See these screenshots here:

    https://vignette.wikia.nocookie.net/diablo/images/5/57/Cc06.jpg
    http://firsthour.net/screenshots/diablo-2/diablo-2-rogue-encampment-overlay-map.jpg


    How much work would it take to get something like that? I'm a programmer, so I'm not afraid of altering the code to make it work.
     
  18. DMeville

    DMeville

    Joined:
    May 5, 2013
    Posts:
    418
    @GamifyTheWorld I just did a quick test and it looks like DMMap should be able to support this pretty easily. You'll have to disable minimap rotation (so the camera doesn't rotate with the player my default) or override it with some custom code to maintain the correct angle the camera views the map at to keep the isometric view.

    You'll also need to modify the near/far planes of the camera to make sure parts of the minimap isn't getting clipped. Minimap icons appear to work even with the different camera perspectives, but the mapspace->world space conversion doesn't appear to work.

    When the game is in play mode I think the camera might snap to the view direction set in the config (top down), you might need to modify that to set it to your custom view direction (isometric) or just disable it entirely and set the angle in the editor and don't have it reset on play.

     
  19. ScourgeGames

    ScourgeGames

    Joined:
    Aug 22, 2017
    Posts:
    239
    Thank you very much for taking some time to look at this. This looks reasonably easy to work with. If you ever do an update in the future, this would be one feature I would pay extra for.
     
  20. DMeville

    DMeville

    Joined:
    May 5, 2013
    Posts:
    418
    I've been playing with this a little bit today to see if any major code changes would be needed, and was going to send you a sample but I found a pretty easy way to make this work, and it works with rotations too. There might be some things I'm missing, as I haven't actually looked at this codebase for a long time, but it seems like it's working well.

    Replace your DMMap.cs code with this: https://pastebin.com/TSm1yYKL
    There's a new property "useCustomOrientation". When disabled it sets the cameras pos/rotation directly to control the following and rotation like normal, when enabled it sets the cameras parent, which if we change the hierarchy to have the camera in an empty game object this acts as a container. Setting the cameras parent means we can change the angle the camera uses without affecting the following behaviour, and allows us to set any angle for the camera view directly in the editor (or at runtime if you wanted to write a script to transition the camera angle from topdown to isometric or anything fancy)

    See this image: https://i.imgur.com/kitwtuK.png
    I've created an empty gameobject named "Camera Container", and moved the DMMapCamera to be a child of this object. I then adjust the rotation on the camera object to get a nice isometric view. You might have to adjust the position of the camera manually to make sure the visual center (the player icon) is in the center of the minimap with whatever rotation angle you choose.

    You'll also have to adjust the near/far planes of the camera.
     
    Last edited: May 27, 2018
  21. olistan

    olistan

    Joined:
    Jan 5, 2018
    Posts:
    4
    Hi! This asset looks cool, but I haven't been able to find the licence. What can we legally do with it? Is the price per project, per user...? Do we get the source code?

    Also would it be possible to use it to create a medieval-looking map (e.g. like parchment) or is it really more adapted to a flat sci-fi look?

    Thanks!

    Edit: I see in the package preview that we do get the source code. But another question: is it cross-platform linux/mac/windows/switch/xbox one/ps4?
     
    Last edited: Sep 5, 2018
  22. DMeville

    DMeville

    Joined:
    May 5, 2013
    Posts:
    418
    You can use this in as many projects of yours as you want, like most asset store packages.
    It works on win/mac/linux, some users have reported using it on mobile. I have not tried it on any console platforms.

    Depends on exactly what you're looking for in terms of look, you do have access to the shaders so you can write your own to get a desired look, but you may need to be creative to get a specific look. If you have an image I can help suggest ways to get a specific look if it is possible.
     
  23. olistan

    olistan

    Joined:
    Jan 5, 2018
    Posts:
    4
    Thank you for your quick answer. For now we have decided to develop the minimap system from scratch as it doesn't seem too difficult and we can do exactly what we want.
     
  24. IsntCo

    IsntCo

    Joined:
    Apr 12, 2014
    Posts:
    146
    Is there a way to see what the current Active Layer is?
    I have a multi-floor dungeon and if you use the code in your MapHeightController, it will loop endlessly in Update because there is no check to see if CurrentActiveLayer already equals the SetActiveLayer you're trying to change.

    Basically, I'm trying to do:

    If (DMMap.instance.CurrentActiveLayer != 1)
    DMMap.instance.SetActiveLayer(1);

    Or something similar.

    Thanks!
     
  25. Deleted User

    Deleted User

    Guest

    hello ,if i wanner to make a func that minimap split to many areas,and player to show minimap by areaId.
     
  26. Deleted User

    Deleted User

    Guest

    how to do with this plugin? thx
     
  27. Shadex

    Shadex

    Joined:
    Dec 18, 2013
    Posts:
    89
    I got a problem. I am using R.A.M., which uses Triangle.NET as well. I'm getting duplicate files when both are in the same project. Removing the duplicate files leaves this with a reference error.
    Code (CSharp):
    1.  //point 3
    2.                     p = tMesh[i].vertices[tMesh[i].Triangles.ElementAt(j).P2];
    3.                     p3 = new Vector3((float)p.x / triangulationScale, 0f, (float)p.y / triangulationScale);
    this happens with all 3 "Points".

    How do i get both working at the same time? At the moment i had pretty much had to comment out a ton just to get it to compile. Any way to make this work with RAM?
     
  28. cyberhak95

    cyberhak95

    Joined:
    Mar 27, 2018
    Posts:
    8
    the map is not showing on android. When testin in unity it works ? Why
     
    Pixelith likes this.
  29. bigdaddio

    bigdaddio

    Joined:
    May 18, 2009
    Posts:
    220
    The included shaders do not work with Universal Render Pipeline. Anyone have any Ideas on how to convert them?
     
  30. Pixelith

    Pixelith

    Joined:
    Jun 24, 2014
    Posts:
    580
    I also have this issue recently. It worked at first and I did a recent build just to find it doesn't anymore. Anyone have a clue why?
     
  31. Pixelith

    Pixelith

    Joined:
    Jun 24, 2014
    Posts:
    580
    Anyone? It worked on the first couple of android builds but now it isn't working. I even switched the Raw Image to a normal image and it still wouldn't work. The player icon shows up so I know it isn't the canvas having an issue. I'm pretty sure it's the render texture not working properly but I have no idea what the issue could be.
     
  32. Rusted_Games

    Rusted_Games

    Joined:
    Aug 29, 2010
    Posts:
    135


    Hello Shiro_Rin, could you please include in the description:
    Unity Engine Version
    Render Pipeline
    Texture Compression used (
    Android SDK version

    Right now I'm trying to convert the existing Shaders to be compatible with the URP, but I'll try to build a project to reproduce your issue

    Cheers
     
  33. Pixelith

    Pixelith

    Joined:
    Jun 24, 2014
    Posts:
    580
    Version: 2020.1.4f1 & 2020.2.0b4
    Pipeline: Standard
    Compression: Default
    SDK Version: Tools installed with Unity (Open JDK 1.8.0_152)

    I've reduced the problem strictly to the Render Texture. I don't know what setting is messed up or causing it to not show up. I've switched shaders, made update scripts to make sure the Render Texture file is getting assigned, used different canvas's, switched Unity Versions, nothing. Crazy thing is I got it to work in earlier builds but now it won't.

    The only thing I can think of that changed was the addition of the asset "Easy Performant Outline." I've already removed those components from my cameras though and render textures are still broken. It's only render textures too. Everything else loads up fine.
     
  34. Pixelith

    Pixelith

    Joined:
    Jun 24, 2014
    Posts:
    580
    Here's what happens on my builds

    Screenshot_20201001-124426.png

    Here's how it looks in Editor

    Capture.PNG
     
  35. DMeville

    DMeville

    Joined:
    May 5, 2013
    Posts:
    418
    @Shiro_Rin Are you getting any errors logged when it's built? I'm not familiar with android, nor do I have an android device to test with, unfortunately. If it was working before but not now I have a few suggestions to try if you haven't already:

    You could create a new empty project with just DMMap, run the demo. Build this project to android to see if the "clean" version works. This might help rule out if it is another package causing conflicts, a local modification you've made, or if it's something internal to DMMap.
     
    Last edited: Oct 1, 2020
  36. Pixelith

    Pixelith

    Joined:
    Jun 24, 2014
    Posts:
    580
    So just as soon as I was about to give up, I found this page from Stackoverflow

    Someone suggested it was the depth and an old camera. I haven't upgraded this project at all, but I have been building prefabs and nesting them.

    I undid any prefabs, add "renderText.depth = 24", and made a new camera for the scene. It actually works now. So my advice to anyone having the same issue is make a new main camera. The DMMap camera, and system as a whole, is fine.
     
  37. Rusted_Games

    Rusted_Games

    Joined:
    Aug 29, 2010
    Posts:
    135
    I'm glad you nailed it!
    I managed to install Unity 2020.1.6f1 with Android Support, then installed DMMap package, made a few changes in the build and graphic settings and exported the APK to Nox Player (I don't have android device) and the minimap is working right out of the box.

    DMMap_BuildSettings.jpg

    APK running in NoxPlayer

    DMMap_APK_Unity2020.1.6.jpg

    DMMap_GraphicSettings.jpg
     
  38. Rusted_Games

    Rusted_Games

    Joined:
    Aug 29, 2010
    Posts:
    135
    Hi Dylan, do you have any plans on adding shader support for URP or HDRP?
     
  39. DMeville

    DMeville

    Joined:
    May 5, 2013
    Posts:
    418
    No plans at the moment! Although I could look at it, I'm still on the legacy deferred pipelines in my own projects and I haven't even looked at those "new" pipelines even.

    I don't know if it would require too much work though tbh. The actual minimap "shapes" just get meshed into an actual regular old mesh (with some magic to the normals to work with proper outlines). I assume you should be able to just swap to the new pipline, and give it a new shader (or make with one Shadergraph/ASE), the regular outline node should work should you want outlines and the camera should just pick up that stuff and render it to the minimap render texture.

    The next other shader is the one that just displays the render texture in a UI image. Not sure how URP/HDRP handles UI, but it's just pulling in the RT and using a texture for alpha to mask it to any shape you input, and then another layer ontop of everything for the overlay.

    Then there's the UI icons, which are all just built in UI shaders.

    So it shouldn't be all that difficult to convert it to URP/HDRP if you want to tackle it yourself, especially if you're familiar with how those pipelines work, I don't think there's anything tricky or special going on with the shaders DMMap uses.
     
  40. lhadlum

    lhadlum

    Joined:
    Jun 26, 2012
    Posts:
    9
    +1 for URP shaders please! I imagine most new projects are using the new pipeline and DMMap needs to stay current. Just purchased and it's useless for me atm.
     
  41. lhadlum

    lhadlum

    Joined:
    Jun 26, 2012
    Posts:
    9
    I've done a quick crash course in shader graph and hacked around to get URP shaders working(ish). It may help as a starter for 10 to get your URP projects up and running with DMMap.

    It appears the only shader which is not working is the 2DPolygonOutline shader

    This is because the outline requires a second pass, and shader graph does not support multiple passes.

    So first we need to split the shader into 2. I have attached the split shaders below - Due to the file type limitations on this forum YOU MUST RENAME THE FILES TO *.SHADERGRAPH instead of *.shader

    Once you have imported the shaders, right click each one and create a new material.

    There is a bit of a hack which is not an ideal solution, but it works for my project and should be a starter to help you get DMMap working

    Open up DMMap.cs

    On line 55 add
    public Material outlineMaterial;


    Ctrl+F and find
    defaultMaterial


    Change the first result (should be line 282) to
    meshLayers[i].GetComponent<Renderer>().materials = new Material[2] { outlineMaterial, defaultMaterial};


    Change the 2nd result (should be line 867) to
    meshrenderer.materials = new Material[2] { outlineMaterial, defaultMaterial };


    Save and close the document.

    In your scene hierarchy, browse to DMMap
    Copy your materials you made to the inspector:

    upload_2020-10-8_17-22-49.png

    I've only made amendments to deal with 1 generic layer as its all I need for my project, so you will need to remove any materials in additional materials in configs so they will use the default:

    Set the Size to 0 to remove any additional config materials:

    upload_2020-10-8_17-26-30.png


    The minimap should now work a little better in URP :)

    Like I say this isn't a complete solution, but should do until URP is supported by the dev.
     

    Attached Files:

  42. Pixelith

    Pixelith

    Joined:
    Jun 24, 2014
    Posts:
    580
    I was wondering if anyone could hep me out with this. I'm trying to make my map "discoverable" so I'm trying to make it so that only area's the player has visited appear on the minimap. It's all flat, no elevation. I'm very lost on how to approach this.
     
  43. Pixelith

    Pixelith

    Joined:
    Jun 24, 2014
    Posts:
    580
    I've made my own solution. While a bit hacky, it serves its purpose. I added a stencil buffer to the 2d outline shader, and on each tile I place an object that will reveal that section of made, then hide it. I use OnTriggerEnter to detect if I collider with these gameobjects, and activate them which reveals that block of map. It's not as streamlined of a solution as I was looking for, but it works.
     
  44. Rusted_Games

    Rusted_Games

    Joined:
    Aug 29, 2010
    Posts:
    135
    Hello @DMeville , now that DMMap has been removed from the AssetStore do you have plans of making it Open Source? I still believe DMMap is the best solution and I had plans to include it on my video tutorials.
     
  45. DMeville

    DMeville

    Joined:
    May 5, 2013
    Posts:
    418
    Oh actually I didn't even realize it was removed from the asset store! I guess because it was been so long (and submitted with such an old version without any updates) it was automatically removed. Weird that I didn't get any notification about this, but I don't really offer support with it these days anyways so I guess that's ok...

    I'll probably throw up the project on github. I'll try and get to it over the next day or two and post the link!
     
    Pixelith and SugoiDev like this.
  46. DMeville

    DMeville

    Joined:
    May 5, 2013
    Posts:
    418
    DMMAP IS NOW OPEN SOURCE!!
    Get it on github here: https://github.com/DMeville/DMMap

    It's been brought to my attention that DMMap was removed (or depreciated) out of the asset store. I guess this is because of the new asset store changes, along with the fact that DMMap was submitted with a rather old version of Unity. Because of this, I've decided to open-source the project and put it on github! Happy mapping!

    I'm not sure how long it has not been available to purchase, so apologies if you've recently purchased the asset and it is now free, but thank you all for supporting the asset!! If there are any issues going forward, please use either this thread, or the post an issue on the github repo directly. Thanks!!
     
  47. Rusted_Games

    Rusted_Games

    Joined:
    Aug 29, 2010
    Posts:
    135
    Awesome!! thank very much