Search Unity

NJG Minimap [Released]

Discussion in 'Assets and Asset Store' started by hjupter, Apr 23, 2013.

?

Do you need DF-GUI support for this asset?

Poll closed Jun 3, 2015.
  1. Yes

    56 vote(s)
    60.9%
  2. No

    36 vote(s)
    39.1%
  1. hjupter

    hjupter

    Joined:
    Dec 23, 2011
    Posts:
    628
    Hey all, 1.5.3 version is up on the store, here are the changes:

    1.5.3
    - NEW: There is now 2 packages for each version. (NGUI, Mesh)
    - NEW: NGUI 3.0.8 support
    - FIX: Fullscreen functionality has been improved (animated fullscreen, icons position and masking etc.) <- NGUI Only!
    - FIX: Some tweaks to both versions.

    -- DF-GUI support coming soon! --
     
  2. sonicviz

    sonicviz

    Joined:
    May 19, 2009
    Posts:
    1,051
    Hi,
    I sent a couple of emails about some bugs with the latest version.

    The world map is bugged, or maybe it's just the total lack of documentation that I can't figure out how to use it...

    After some further debugging I found the following were needed to get the world map partly working.


    I had to set debug in the inspector to understand why the zoom isn't working on the world map.


    1. Target of UIWorldMap is not being set. Manually setting it to the run time generated _NJGMapRenderer in play mode seems to enable the proper zoom behavior.
    2. Icons showed up (at least in the initial zoom levels ) only by setting the actual world map icon z value to -3 (that is the icon below the Icon parent object) bur icons still disappear beyond a certain zoom level though.

    Also first thing after dragging a prefab into the scene is to "Break prefab instance" otherwise it seems to cause all sorts of issues, such as the camera event layer switching back to nothing.

    Is there a proper guide to getting this working or is it a bug?

    ty!
     
  3. hjupter

    hjupter

    Joined:
    Dec 23, 2011
    Posts:
    628
    Hey, ok let me read your e-mails.

    UIWorldMap use the target from the UIMinimap so sounds like you need to define a target on the minimap you can do that by assigning a tag ("Player" by default) to your player object or set it manually on the inspector, this should make it work properly.

    About the icons and zoom issue that sounds like a weird bug, I'm going to look into it.

    Anyways if you have skype add me: hjupterc
     
  4. mcconrad

    mcconrad

    Joined:
    Jul 16, 2013
    Posts:
    155
    hi,
    i just updated from the OnGui version to the NGUI one, and there are a few issues i am have trouble with.
    1) mouse wheel zooming and panning with mouse is not working
    2) the minimap and world map icons are not displaying, despite being at a higher depth than the background

    i can turn off the world map and minimap backgrounds and see the icons are there, but despite the depth settings, they are being rendered below them
     
    Last edited: Jan 10, 2014
  5. hjupter

    hjupter

    Joined:
    Dec 23, 2011
    Posts:
    628
    1. Mouse wheel zoooming and panning with mouse can be setup on the world map and minimap inspectors, it's weird cuz should be enabled by default. Did you tried with the demo scenes? Are you using one of the prefabs?

    2. This seems like another issue with the latest NGUI version but seems to be fixed easily by changing the depth of the WorldMap on the inspector. I'm looking into this.

    Which version of Unity are you using?

    Thanks and sorry for the troubles.
     
  6. mcconrad

    mcconrad

    Joined:
    Jul 16, 2013
    Posts:
    155
    hi, i already made sure the world map and minimap background depths are at 60, and their icons are in the 70s, so that is not what is causing it unfortunately.

    also the mouse scroll etc is on by default (and is currently checked and on) but it not responding to input. neither are the buttons. I do have raycasting ignores triggers on in physics settings, and have turned off the triggers on the buttons' colliders in order to compensate for that, which works with all my other NGUI buttons to allow input while ignoring raycasting triggers, but not on the maps.
     
  7. mcconrad

    mcconrad

    Joined:
    Jul 16, 2013
    Posts:
    155
    also now i am getting a null ref. error after importing the latest build of NJG map and it is all rendering black with no animations:
    NullReferenceException
    UnityEngine.Component.get_gameObject () (at C:/BuildAgent/work/d3d49558e4d408f4/artifacts/EditorGenerated/UnityEngineComponent.cs:171)
    NJG.UIMapBase.get_isVisible () (at Assets/NinjutsuGames/NJG MiniMap/Common/Scripts/Internal/UIMapBase.cs:412)
    UIMiniMap.UpdateZoomKeys () (at Assets/NinjutsuGames/NJG MiniMap/NGUI Version/Scripts/UI/UIMiniMap.cs:90)
    NJG.UIMapBase.Update () (at Assets/NinjutsuGames/NJG MiniMap/Common/Scripts/Internal/UIMapBase.cs:787)
    NJG.UIMiniMapBase.Update () (at Assets/NinjutsuGames/NJG MiniMap/Common/Scripts/Internal/UIMiniMapBase.cs:296)
    NJG.UIMapBase.Start () (at Assets/NinjutsuGames/NJG MiniMap/Common/Scripts/Internal/UIMapBase.cs:625)
    UIMiniMap.Start () (at Assets/NinjutsuGames/NJG MiniMap/NGUI Version/Scripts/UI/UIMiniMap.cs:64)
     
  8. hjupter

    hjupter

    Joined:
    Dec 23, 2011
    Posts:
    628
    Ah you was using an old version?.. well you need to delete the NJG Minimap folder and re-import the latest version.
     
  9. hjupter

    hjupter

    Joined:
    Dec 23, 2011
    Posts:
    628
    I see.. I forgot to add a null check there, open the class UIMapBase.cs line 412 and replace it with this:

    public bool isVisible { get { return mChild == null ? false : mChild.gameObject.activeInHierarchy; } }

    Let me know.
     
  10. hjupter

    hjupter

    Joined:
    Dec 23, 2011
    Posts:
    628
    Sorry, I must upload another fix, this an issue introduced by Unity 4.3, the NJGMapRenderer camera have occlussion culling enabled by default that needs to be disabled.

    Open up the NJGMapRenderer.cs find the Awake method on line 62 and put this

    camera.useOcclusionCulling = false;

    before the Render(); call.
     
  11. mcconrad

    mcconrad

    Joined:
    Jul 16, 2013
    Posts:
    155
    edit: the black screen was the fog of water being enabled by default, however, after disabling this, the world map is a blank white rect. and the minimap shows the mask texture instead of the map itself.
     
  12. hjupter

    hjupter

    Joined:
    Dec 23, 2011
    Posts:
    628
    Should be unchecked by default on the inspector from the start (Awake) or it wont work, if is not that then checkout your render layers and bound layers.. you should be able to see the red square frame tracing the bounds of your scene if not then you might have something wrong with your layers.
     
  13. mcconrad

    mcconrad

    Joined:
    Jul 16, 2013
    Posts:
    155
    boundry square is fine, turned off fog of water AND texture mask, and the minimap texture now shows (icons rendered below layer, so not visible despite depth settings), but the world map is still blank white (icons below, same as minimap).
     
  14. hjupter

    hjupter

    Joined:
    Dec 23, 2011
    Posts:
    628
    Well thats odd, will need to take a closer look I guess we have talked before on skype right?.. if not could you please add me: hjupterc
     
  15. mcconrad

    mcconrad

    Joined:
    Jul 16, 2013
    Posts:
    155
    OK, all fixed now. thanks, @hjupter!
    summary:
    FOW was on by default causing the black screen, turned it off and fine now.
    UIcamera for maps needs to be at -1 depth or icons render below it and the texture mask above it, no problem now once set to -1.
    UI camera event type needs to be changed to "World" for devs like me who make raycasting ignore triggers in physics (this goes for all NGUI systems).

    still a great and easy to use product and the developer is usually around to help fix any issues. all new bugs are NGUI ones more or less :p
     
  16. sonicviz

    sonicviz

    Joined:
    May 19, 2009
    Posts:
    1,051
    Hi,
    I was using the camera tagged main camera as a target but it was not being picked up by world map.
    I'm doing a flythrough with the camera on an animation path so the "player" is the main camera, and the map is tracking it.

    I added a cube below the camera and tagged it player and used that as the target and the world map now sets the target correctly.
    ..strange...

    Anyway, the worls map icons still refuse to show up in game view, and the edges of the map texture are on top of the buttons.
    Seems like a layering issue.
    Using the latest NGui and latest map package.

    EDIT:
    I'm using the resizeable world map.
    When you first open the world map the _MapIcons GO is added below WorldMap/Container but its z value is 1
    It's missing the actual icons until you open the map to full screen.
    When you open the map to full screen the actual icon0 , icon 1 GO etc are added.

    I got the icons to show by manually changing the z value of the _MapIcons GO to -0.5 (for ex) the icons now show.
    Also the rotate with player on the world map does not work properly either. It stays fixed not matter what the setting.

    Also, you need to go into debug inspector mode to access some of the settings which look like they should be available in normal mode, like rotate with player.
    Also double resolution I'd like to use as the map looks blocker when zoomed, but it also didn't seem to work properly, giving me a tiled map texture which is kind of useless.

    Not sure if this is Ngui or mini map issues.

    Either way, as pointed out by numerous people, this is a great package (despite the current errors, min map part seems stable) but it is seriously let down by a complete lack of documentation.
    One of the harder packages I've had to work with recently to get a handle on.

    Please spend some more time documenting how to use all the features and setup options.
     
    Last edited: Jan 11, 2014
  17. hjupter

    hjupter

    Joined:
    Dec 23, 2011
    Posts:
    628
    There might be something on the code that makes it ignore the mainCamera for some reason that I don't remember right now lol.. I will take a look on this.

    Regarding the depth issue with the world map all you have to do is select the UIWorldMap inspector and play with th depth there.
     
  18. BossRockers14

    BossRockers14

    Joined:
    Jul 23, 2013
    Posts:
    33
    $Capture.PNG hi i have recently bought your asset from the store i will be happy of you can help me and i can provide the invoice if needed :) i have NGUI v3.0.2 but when i use the NGUI version of the Map i get this error any workaround ?? thanks
     
  19. hjupter

    hjupter

    Joined:
    Dec 23, 2011
    Posts:
    628
    Hi, thanks for your purchase, you need to update your NGUI to the latest 3.0.8f7 to fix that :)
     
  20. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,517
    I have bought this package, and I would like to know more about how fog works.. does map texture need to be in some kind of special format? IE (alpha etc..)

    I have tried fog but it was not straight forward...
     
  21. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,517
    I also have strange behaviour where if I select the NJG Minimap object in the hierachy , dynamic bound is working, but if not, it doesn't work at all. This happens when you start the game. I have item objects generated in run time. If I select NJG object any time during the play, it calculates bounds correctly.

    I wanted to fix the boundary but it won't let me specifiy starting coordinates.. always starts fixed at 0.0.0
     
    Last edited: Jan 18, 2014
  22. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,517
    Another question,

    I would like to set bound to be very specific size and location.. how can i do this? Custom bound only allow size and anchored on 0,0

    My map is set to be small. Like 1 Unity unit is one step in grid side movement. And I can't really understand how does the reveal distance works.. it seems to be different than the unit used in Unity.

    Also, the units that I have spawned in run time , doesn't show on unfogged area. This happens around 70% of the time. So only 30% of the unit shows regardless of the distance. Unit is right front of the player but it doesn't show.
    This only happens if I use fog.

    Also, I could be wrong, but setting 0 for FOG override doesn't seem to work for at least mesh version. (it doesn't use global fog reveal distance.. it could be after setting and then unsetting.. not sure)

    Fog also seems to only work on the map.. not on the items... even if it does, once it is visible then it doesn't go invisible even when item is in the fog area..

    Sorry about posting a lots of questions at once...

    Also, is there way to set my reveal type to square instead of circle? I would like to do a custom shape reveal , (square shape because my game is based on grid)

    Using latest version of Unity. with latest version of NGUI
     
    Last edited: Jan 18, 2014
  23. hjupter

    hjupter

    Joined:
    Dec 23, 2011
    Posts:
    628
    Hi, sorry for the late reply had a busy weekend, its weird the issues you are having, I just created a new project in Unity 4.3.3 imported NJG Minimap, imported NGUI, tried with the fog demo scene and worked fine.

    Regarding the bound specific size and location you can create a cube, hides it renderer set a different layer only for bounds use that layer for bound calculations on the NJG Map settings and there you go.
     
  24. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,517
    Ok, considering that I can get around the bound issue. Let me address my other issues in more constructive manner.

    1. Fog. Once item is visible it doesn't go invisible again when it enters the fog.
    2. For dynamically created items, mini map doesn't show / update them consistently. Meaning sometimes it shows , sometimes it doesn't. And ofcourse I am talking about with the same prefabs.
    3. Dynamic bound calculation doesn't work unless you have the mini map object selected in the inspector. (For the dynamically generated items in run time). So, this will happen after the awake and start functions initially. But this could possibly worked around by creating a cubes like you have suggested and don't use dynamic bound calculation. But this still isn't really working as it intended.
    4. Fog override function on item doesn't work when you set it to zero, after setting it to some value. When set to zero, expected to use global setting, but it doesn't.

    optionally, it would be nice if I can toggle calling update function on items based on the renderer.

    thanks.
     
  25. hjupter

    hjupter

    Joined:
    Dec 23, 2011
    Posts:
    628
    Hi, thanks for your feedback.

    1. This one is not an issue is just how it was coded, I just made it work as you wanted here :)

    2. Never seen this issue before, maybe you can provide me a video or add me to skype so I can see your screen?

    3. Indeed I noticed is not behaving as it should (as it work on Unity 4.2) so this will be another fix for Unity 4.3.

    4. I just double checked in a new project tried with value at 0 and modifying it at runntime seems to be working fine, perhaps I also need to take a look at your project to see whats going on?

    Toggle calling update on items based on renderer sounds like a good optimization, I will take a look.

    For the next upcoming version I've optimized the code even more so it math take less processing also I modified the shaders to use alpha mask instead of transparency for performance on mobile devices :)
     
  26. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,517
    For this issue :

    I will try to make a simple example scene tomorrow and send it to you.

    Will this feature be available on the next update? As an option or will it always behave it like how I wanted? It is just that Fog naturally means to me that it will hide item when it is inside fog , otherwise not... So I thought it was a bug. But maybe it is just me? I think if items shows inside Fog, it can sort of give away player what under lying Fogged area may look like...( for instance going around obstacles) But if you think it is more natural to behave like how it currently is, then can you please add it as an option?

    For this, can you actually try to set it to something, like 6 initially before you start the game, and then set it to zero in runtime? I can't remember how exactly it went, but I am sure I tried to set it to zero after setting it to 6 or something, but it was still using 6 instead of global value of 10.. But then again, other things weren't working as intended (like a bound) so it could be related.. I will try to use placing cube work around for now to force - work around bound issue and see if it still does it.

    Thanks for listening. Any planned date for next update?
     
    Last edited: Jan 21, 2014
  27. hjupter

    hjupter

    Joined:
    Dec 23, 2011
    Posts:
    628
    Yes it will be on the next update and it will always behave like that as you said that should be natural way.

    I just tried setting it to 6 hit play then at runtime set it to 0 and its working fine.

    I will fix the automatic bounds behavior then I will submit it to the store, probably this week. I still need to finish other updates like the inspectors on Unity 4.3 and DF-GUI support.

    You can send me your invoice # so I can verify you and I will send you the updated version.
     
  28. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,517
    Unfortunately Fog is still not really working for me...

    Sometimes items do not appear on the map even it is right front of the player. (very near) The same prefab "sometimes" appear but sometimes not.
    It only happens when fog is enabled, without fog it seems to work well. How does the detection work? Maybe function that checks if an item is inside fog or not is not working as well as it should. Or maybe because my scale in unit is small? (one world unit is one space my character moves)

    I also don't understand how "distance" works for the fog. Is that a unity world unit distance? or some relative distance depends on size of bound and texture etc.? There isn't any doc explaining any of this.

    Is there way to make reveal shape non circular? (eg square, rect)

    let me know your skype id so I can add you.

    thanks.
     
  29. hjupter

    hjupter

    Joined:
    Dec 23, 2011
    Posts:
    628
    Here is my skype: hjupterc
     
  30. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,517
    added you but can't seem to get to you.
     
  31. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,517
    My observation tells me that, maybe... just maybe reveal doesn't work for the objects spawning inside the player's reveal range? It is really frustrating... What is the distance of fog exactly mean???? is it unity world space range??? or something else?

    I have also confirm weird fog issue with the NGUI example Fog of War scene.

    In this scene try the following:

    1. disable NPC demo script so they dont move. (easier to track the issue)
    2. Set fog distance like 6
    3. Set the blur to 0. (easier to see). Also set 0 for blend time.
    4. set zoom in so that even with range 6 you can see the player and decent revealed space around the player.

    Now start play and move player towards the npc

    Now, when you are really close to the npc, you should be able to clearly see red dot item on your minimap , but there is no item in the minimap except the player even when you are so close that you can bump into them.

    So my initial obervation was that this got something to do with the fog distance.

    But, when I change the zoom (ie zoom out) then suddenly "pop" shows the item. So zoom level also contributes to the weird behaviour.

    Please take look at it.. I would happy to show you the issue over the Skype but obvious time difference, I was not able to connect to you today.

    For my custom scene, I can only make it work right with the fog when my zoom is at 1 (lowest) but then this means my map doesn't move centered on the player
     
    Last edited: Jan 25, 2014
  32. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,517
    $minimap_bug.jpg
    Here is quick example of fog not working.

    This is simple straight example from fog scene. Just did some zoom first and navigated to the death item. Doesn't show on the mini map.
     
    Last edited: Jan 25, 2014
  33. hjupter

    hjupter

    Joined:
    Dec 23, 2011
    Posts:
    628
    Hey, sorry I've been very sick these days, I will try what said so I can reproduce it and fix it for you. I just accepeted you on skype.
     
  34. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,517
    Any news on this?
     
  35. rpg_gamer

    rpg_gamer

    Joined:
    Nov 28, 2012
    Posts:
    214
    any updates on when df gui support is coming?
     
  36. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,517
    hjuptor, any news on the issues ? Fixes? or are you still sick? :p
     
  37. hjupter

    hjupter

    Joined:
    Dec 23, 2011
    Posts:
    628
    Hey, sorry for the late reply I was still sick I got dengue but fortunately I'm out of risk now and better, I've been unable to check out the issue Iwill try to reproduce it and find a fix I must be probably sending an update next week either way I will let you know and send the update to you.
     
  38. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,517
    Still nothing?
     
  39. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,517
    ugh..... this is taking tooo long... *PAIN*

    Maybe author has given up on the support. This is not good.
     
    Last edited: Mar 3, 2014
  40. mkgame

    mkgame

    Joined:
    Feb 24, 2014
    Posts:
    592
    Hello,

    i only imported your project on Unity free version 4.3.4f1 in an empty project. Cannot start your demo projects (Mesh Version).

    Error:

    NullReferenceException: Object reference not set to an instance of an object
    NJG.NJGMapBase.SetTexture (UnityEngine.Texture2D tex) (at Assets/NinjutsuGames/NJG MiniMap/Common/Scripts/Internal/NJGMapBase.cs:655)
    NJG.NJGMapInspectorBase.OnInspectorGUI () (at Assets/NinjutsuGames/NJG MiniMap/Common/Scripts/Editor/NJGMapInspectorBase.cs:239)
    NJGMapOnGUIInspector.OnInspectorGUI () (at Assets/NinjutsuGames/NJG MiniMap/Mesh Version/Scripts/Editor/NJGMapOnGUIInspector.cs:24)
    UnityEditor.InspectorWindow.DrawEditors (Boolean isRepaintEvent, UnityEditor.Editor[] editors, Boolean eyeDropperDirty) (at C:/BuildAgent/work/d3d49558e4d408f4/Editor/Mono/Inspector/InspectorWindow.cs:850)
    UnityEditor.DockArea:OnGUI()

    What's wrong?
     
  41. mkgame

    mkgame

    Joined:
    Feb 24, 2014
    Posts:
    592
    Solved myself, just because i imported the NGUI version, the mesh version was broken. So, if you don't have the NGUI (95$), do not import the NGUI sources, because it will destroy somehow the mesh version.
     
  42. mkgame

    mkgame

    Joined:
    Feb 24, 2014
    Posts:
    592
    Can you check please your Mesh Scenes? E.g. the Mesh Version, BigTerrain.unity is broken. Somehow i would like to have the 'http://www.ninjutsugames.com/unityassets/njgminimap/nongui/' scene as example demo, because i bought this module for that reason. The BigTerrain.unity example is the closest one to the 'nongui' demo, but the minimap shows the side of the map, the GUI is much more worser than that in the 'nongui' and, scrolling with the mouse on the minimap does not work, World Map with key 'M' does not appear.....
     
  43. Iron-Oxide

    Iron-Oxide

    Joined:
    Nov 20, 2013
    Posts:
    34
    Hello,

    Hoping you can help. I get the following screenshot:

    $screenshot.png

    also the documentation link in the readme file doesnt work.

    Please could you advise, thanks.
     
  44. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,517
    I am getting the feeling that dev has given up on this product. Or really don't have time to support it anymore.
     
  45. mkgame

    mkgame

    Joined:
    Feb 24, 2014
    Posts:
    592
    Fine, i have now to hack it together by myself... But the demo looks well in the minimap version 1.4...

    Probably you could restore the latest stable release of the minimap, i don't care about the new features. We just need a stable start, the code will be changed anyway.
     
  46. hjupter

    hjupter

    Joined:
    Dec 23, 2011
    Posts:
    628
    Hey guys sorry for the late reply for some reason I was not getting email notifications about this thread. These last months I've been between sick and on vacations with my family I apologize for the very slow support, I'm still working on updates and fixes for the new version.

    Caster sorry for not being able yet to test and fix what you told me before. I'm doing it right now.

    Which version of Unity are you using? did you check if your scene bounds are being calculated fine?

    I'm checking the mesh scenes on the latest version of Unity 4.3.4, very few people use this version thats why I did not made a UI for it.
     
  47. Iron-Oxide

    Iron-Oxide

    Joined:
    Nov 20, 2013
    Posts:
    34
    Hi hjupter,

    Thanks. Sorted. The boundries were slightly off, but i had to click to generate the map. Seems with fps kit, theres an issue with autogeneration.

    [EDIT]
    hm no thats no good, i need auto generation to work. Is there a bug to create the map? In unity (newest one) i have to click a couple of times to get it to generate. Any ideas please?
     
    Last edited: Mar 7, 2014
  48. mkgame

    mkgame

    Joined:
    Feb 24, 2014
    Posts:
    592
    Hi,

    - the WorldMap was disabled, for that reason 'M' faild
    - on MiniMap under the General tab the Oriantation was set to the side
    - clicking on the map cause an error in the script
    - scrolling the minimap scroll the first person camera too (this is just a demo bug, i guess)
    - under the Icons-Tab the icons-folder was empty, i added the correct icon folder, but still no icons on the map

    And here is my question, are the icons (independently of bad settings in the projects) visible under the free Unity?
     
  49. hjupter

    hjupter

    Joined:
    Dec 23, 2011
    Posts:
    628
    Maybe are you using OcclusionCulling? because there is an issue introduced by Unity 4.3 when I create the camera to render the scene it does have "useOcclusionCulling" checked by default if you are using occlusion the camera wont render unless you uncheck that. Let me know if this is your case.

    Yes after I saw your posts I started testing and found some of those issues I'm fixing right now.
     
  50. Iron-Oxide

    Iron-Oxide

    Joined:
    Nov 20, 2013
    Posts:
    34
    Hi hjupter.
    occlusion culling was on, but even turning it on and applying doesnt auto generate the map :'(

    Also I cant see any player icons on the main map, I can only see them on the minimap. Any help would be appreciated.