Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Map Magic World Generator - a node based procedural and infinite game map tool

Discussion in 'Assets and Asset Store' started by Wright, Mar 10, 2016.

  1. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,800
    Does the same happen in editor? Any errors in the console in dev build? Could you try building the demo scene with the same settings, will it have grass everywhere here?

    Thanks for reporting this issue, I plan to submit some fixes this weekend, and I'll look into it then.

    I will look into this issue too, but there's a chance that there's not much I can do about it. MM uses VS methods to calculate cells and place objects, it's not just about using local coordinates instead world ones. So it might be a VSPro + MM integration limitation.

    Glad to hear that :)
     
    w0rmer likes this.
  2. iddqd

    iddqd

    Joined:
    Apr 14, 2012
    Posts:
    429
    Great, thanks!
     
  3. OJDee

    OJDee

    Joined:
    Feb 11, 2014
    Posts:
    52
    @Wright No it all works fine in the editor, both mac and pc.

    I will see if any errors arise in console, is an odd one since all other objects and heightmaps all fine infinitely.

    Thanks
     
  4. JohnnyFactor

    JohnnyFactor

    Joined:
    May 18, 2018
    Posts:
    187
    Is it possible to set terrain height to zero? I want to use a completely flat surface to avoid raycasting from above, and for uniform Y axis spawning.
     
  5. mmaclaurin

    mmaclaurin

    Joined:
    Dec 18, 2016
    Posts:
    244
    Hiya - I am not able to get the built-in Microsplat output working. I've tried adapting my game, and I've also built a minimal demo based on the tutorial video. In both, the end result is that the base map is shown but none others. Before I spend more time building a clean reproduction, are there known issues? Basically following the video instructions exactly does not work in my experience.
     
  6. iddqd

    iddqd

    Joined:
    Apr 14, 2012
    Posts:
    429
    Sounds similar to this perhaps? https://forum.unity.com/threads/map...ite-game-map-tool.390920/page-79#post-4470922
     
  7. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,800
    Yes, it's a known issue, I've already fixed it and just submitted the new version. But thanks for report anyways!

    Sure. Just use Constant node with the value of 0.

    Could you please try building the demo scene to find if the same occurs here?
     
    iddqd likes this.
  8. OJDee

    OJDee

    Joined:
    Feb 11, 2014
    Posts:
    52
    @Wright

    Looks like the same issue with Demo scene. Works fine in editor, travelled over 4000 distance and still saw grass.
    When run as build, after approximately 1300 distance, the grass stops.

    Screenshot 2019-04-27 at 22.10.46.png
     
  9. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,800
    Really weird, so that's not related with the scene. What are your OS, Unity version, build target and build settings? Could you please screen the build window? I'm trying to reproduce the issue, but still grass works fine for me.
     
  10. OJDee

    OJDee

    Joined:
    Feb 11, 2014
    Posts:
    52
    I am using Unity 2019.1.0f2
    MacOS 10.14.4
    PC Windows 10 1803

    Issue the same on both platforms.

    Just to confirm this is with a new unity project, with just mapmagic asset installed. Have made no changes, just built and run.
     

    Attached Files:

    Last edited: Apr 27, 2019
  11. Johnny-Ow

    Johnny-Ow

    Joined:
    Mar 3, 2015
    Posts:
    9
    Since I switched to 2019.1.0.f2, in scenes with a locked or pinned terrain, the scene files are being saved as binary even though Asset Serialization is set to Force Text. Scenes were saving as text in 2018.x. Is this a known issue and/or is there a workaround?
     
  12. Buka

    Buka

    Joined:
    Feb 22, 2013
    Posts:
    47
    Thanks for help about warnings, if anybody wants to get rid of warnings, you can use this as i did,
    this will disable warnings for defined blocks of code:

    #pragma warning disable 0618

    if (lineMembers.Length >= 7)
    k.tangentMode = (int)lineMembers[6].Parse(typeof(int));
    else
    k.tangentMode = 0;

    #pragma warning restore 0618
     
  13. SoloHonk75

    SoloHonk75

    Joined:
    Mar 27, 2016
    Posts:
    18
    Many thanks for implementing of the "Unlock All"-Button. Much (!) better workflow.

    I saw your seams removal video. Is there a problem to implement this in the current version?
     
    Last edited: Apr 30, 2019
  14. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,800
    Thanks, might be related with Unity version, will look into it soon.

    The only thing MM forces to serialize as binary are the RAW input assets. You can try commenting out [PreferBinarySerialization] in line 7 of MatrixAsset.cs, but I guess it's hardly related. Unless you are storing an imported RAW in graph, though - there should be a warning in RAW Import node about it.

    Thanks!

    Unfortunately, yes. It requires changing some core things, and it's one of the reasons I'm started MM2.
     
  15. syscrusher

    syscrusher

    Joined:
    Jul 4, 2015
    Posts:
    1,060
    @Wright I have a suggestion for Map Magic that I think would be easy to implement and really useful for customers.

    What I propose is a Preview Node for the graph, which is a no-op node that simply shows its input in a small window to help the artist see the results of intermediate stages while editing the graph. It would look a little like the Curve node but without the input fields down by "Range" and with the preview window filling as much as possible of the node.

    This suggestion was blatantly inspired by the Preview Node that is in the new Unity Shader Graph: https://docs.unity3d.com/Packages/com.unity.shadergraph@6.5/manual/Utility-Nodes.html

    The output connector isn't strictly necessary but is useful to declutter the graph. I don't know if your node-drawing system could support a resizable node for this, but that would be even better than a fixed preview size, because some preview points might need more detail than others during design.

    Thanks for considering. :)
     
    Ziplock9000 and iddqd like this.
  16. NullKommaNeun

    NullKommaNeun

    Joined:
    Apr 13, 2018
    Posts:
    3
    I am using Map Magic and CTS 2019 with unity 2018.3 and hdrp version 4.8. I created a costum shader output in the MM Editor, assigned the cts Profile and clicked fix until there was no warning left. The only difference to the tutorial is that my MapMagic terrain was pink from the start and that did not change with the setup of cts. Without Map Magic CTS worked for me and both work fine with the build-in render pipeline but with the hdrp the terrain stays pink. What can I do to fix this ? Thanks in advance.
     
  17. 8bitgoose

    8bitgoose

    Joined:
    Dec 28, 2014
    Posts:
    249
    I am not sure if this has been reported, but if I check "draw instanced" on the map magic component, Preview -> On Terrain goes all screwy (as in it is a million black lines and crazy stuff). The normal terrain works fine. Turning it off while editing seems to fix the problem.
     
  18. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,800
    First of all I'd like to mention that MapMagic is currently on sale now, so take a chance to get it for the half-price!

    Yes, I've also thought about a preview in the graph. However, it usually ends up with creating a preview for almost all of the nodes - at first, they are created instead of preview window to see the node results, and then they are left behind and not removed - just in case. So I decided to add a switchable preview to all of the standard nodes for v2:
    Preview2.png
    Two buttons at the top left change the preview mode (heat map / grayscale / relief), and two at the bottom left apply it to terrain and open the preview window.

    As I was surprised to find out, CTS 2019 and CTS are two different assets. Don't know what do they have in common, but as you can see the difference is pretty big to make CTS 2019 incompatible with MM, while the standard CTS still works. Hope CTS 2019 hasn't changed a lot so I could add it's compatibility too, but it will take some time to settle down procedural matters.

    Thanks for reporting the issue! Unfortunately there's no way to use preview on the instanced terrains, but I will add a code that will temporary disable instancing and enable it again after disabling the preview.
     
    AthrunVLokiz and syscrusher like this.
  19. syscrusher

    syscrusher

    Joined:
    Jul 4, 2015
    Posts:
    1,060
    This is perfect! Archimatix does something very similar, and it works great. Thank you! I'm eager to try it out in the new version.
     
  20. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,800
    Sure, any MM user can try the MM2 preview version. Just PM or email me (preferably) your order number and GitLab account name (if any) or email you'd like to register at GitLab and I'll open up an access.
     
    syscrusher likes this.
  21. 8bitgoose

    8bitgoose

    Joined:
    Dec 28, 2014
    Posts:
    249
    @Wright Just wanted to make sure you knew about the instance generator problem. The rest of the program is so error / bug free (as far as I can see) I was surprised. Really looking forward to MM2 when it comes out. I want that weld between terrains benefit! But take your time, only release it when it is ready by your sweet standards!
     
    syscrusher likes this.
  22. Dorian-Dowse

    Dorian-Dowse

    Joined:
    Jun 2, 2016
    Posts:
    94
    I'm having a problem with reflection probes not including a MapMagic terrain in the reflection probe bake. I've set Map Magic/Terrain Settings/Reflection Probes to "Blend Probes and Skybox", and tried lots of other things, all to no avail. It will bake the trees and grass on the terrain, but just not the terrain itself. It will bake a normal Unity terrain no problem.

    Also, the "Export to Terrain" script no longer exports the splatAlpha properly. The texture layers are there, but only a single texture on the exported terrain.
     
  23. camta005

    camta005

    Joined:
    Dec 16, 2016
    Posts:
    302
    It could be something related to the location of the probe, for example it might be below the terrain surface.
     
    Last edited: May 2, 2019
  24. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,800
    I'm really glad to hear that! Thanks!

    Make sure that you've turned on Reflection Probe Static flag on the terrain object - MM generates non-static terrains by default (unless the static flag is enabled on the MM object).
     
  25. Dorian-Dowse

    Dorian-Dowse

    Joined:
    Jun 2, 2016
    Posts:
    94
    Setting the terrain to static worked. :)

    I still have a problem with the Export to Terrain script.
     
  26. Refeas

    Refeas

    Joined:
    Nov 8, 2016
    Posts:
    129
    First of all - thank you @Wright for this amazing tool. It really saved us a lot of time.

    We generate terrain at runtime (no pinned terrain) and recently updated our WIP project to 2019.1 and HDRP 5.13.0. We were able to get the terrain working in editor by using the new HDRP terrain material. However, when I build the project, it says No default terrain shader available in the standalone player and the whole terrain is dark/black. I tried creating new HDRPResource asset file and assigning my terrain material to the Default Terrain Material slot, but that also didn't work. Is there even any working workflow yet?
     
  27. iddqd

    iddqd

    Joined:
    Apr 14, 2012
    Posts:
    429
    Not sure if this is the same issue, but I'm also getting "Missing default terrain shader" error message for runtime terrain.
    I'm using the standard rendering pipeline and Microsplat. The error appears but the terrain is still generated correctly.
     
  28. Refeas

    Refeas

    Joined:
    Nov 8, 2016
    Posts:
    129
    Yeah, I had the same error when using standard render pipeline, you just need to go to Edit -> Project Settings -> Graphics and put the default terrain shader to the Always included shaders list. :)

    On HDRP tho, this is not possible anymore.
     
    iddqd and camta005 like this.
  29. syscrusher

    syscrusher

    Joined:
    Jul 4, 2015
    Posts:
    1,060
    Done. Please expect *two* emails from me, since I forgot to paste my invoice number into the first one. :)
     
  30. iddqd

    iddqd

    Joined:
    Apr 14, 2012
    Posts:
    429
    Great, thanks. I'll give it a try.
     
  31. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,800
    Do you mean the script that was published here a while ago? I already have it built in the MM, so there's no need to install scripts to save terrain asset files, it's available out of the box. In order to export terrain press Save button next to the Pin and Lock. I've just tried it with the new Textures Output, and as far as I can see that all of the terrain layers were exported.

    It's the standard error when using any non-standard terrain material. The thing is Unity assigns the standard material during terrain creation, even if it won't be used and doesn't have a proper shader. There's nothing I can do with it (or just don't know the way), except disregarding the message or including the useless terrain shader in the build.
    However, it should not cause the black terrain. It must be something related with the proper terrain material, the one that is assigned by MM after creation. Try adding it to always included list (however it should be already included since referenced by MM object in scene). Are there any other errors in the build console?

    You just could say your nickname on forums :)
     
    Dorian-Dowse likes this.
  32. Refeas

    Refeas

    Joined:
    Nov 8, 2016
    Posts:
    129
    @Wright Another thing that we encountered is preview not working in HDRP (obviously). When should we expect updated preview shader compatible with HDRP (if it's even planned)? Thanks!

    Edit: As a response to your last post: You can't put compute shaders in the Always Included List. No build errors in the console.
     
    Last edited: May 3, 2019
  33. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,800
    I will look into it this week
     
    Refeas likes this.
  34. w0rmer

    w0rmer

    Joined:
    Jul 12, 2015
    Posts:
    6
    Hi all,

    Any ideas how to fix an expetion as follows?

    Exception: Vegetation System cells number has a different count rather than Persistent Storage./nPlease re-initialize Persistent Storage.
    MapMagic.VegetationStudio.VegetationStudioTile.FlushObjects (UnityEngine.Rect terrainRect, System.Boolean clearCache) (at Assets/MapMagic/Generators/VegetationStudio/VegetationStudioTile.cs:232)
    MapMagic.VegetationStudio.VegetationStudioTile.OnDisable () (at Assets/MapMagic/Generators/VegetationStudio/VegetationStudioTile.cs:81)
     
  35. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,800
    Have you tried re-initializing the persistent storage as the error advises?
     
  36. Disthron

    Disthron

    Joined:
    Aug 21, 2015
    Posts:
    8
  37. Diego_Graphics

    Diego_Graphics

    Joined:
    Nov 3, 2014
    Posts:
    97
  38. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,800
    Glad to see that among all voxel plugins you've chosen Voxeland as an example. That's flattering.

    Yes, MapMagic is compatible with Voxeland, and supports generating both of standard heightmap terrain and some voxel-only features like flying islands (non-movable) or simple cave systems.
     
    syscrusher likes this.
  39. Disthron

    Disthron

    Joined:
    Aug 21, 2015
    Posts:
    8
    ...I think it says something that I chose that as an example and had no idea it was yours. XD
     
  40. Diego_Graphics

    Diego_Graphics

    Joined:
    Nov 3, 2014
    Posts:
    97
    Funny that you mention flying islands. i'm working on one of those right now. and she's moving. i have a static voxeland object. one island and move the whole voxeland object. at first sight it seems to work without FPS break-in. only the voxeland triplanar shader is spinning. because it's designed for worldspace. otherwise something from a performance technical point of view speaks against it?
     
  41. w0rmer

    w0rmer

    Joined:
    Jul 12, 2015
    Posts:
    6
    Many times with no luck)
     
  42. N1warhead

    N1warhead

    Joined:
    Mar 12, 2014
    Posts:
    3,688
    I'll continue trying to figure this out.
    But for some reason I my tree (objects) aren't always spawning in with World Generation.

    Only sometimes.

    Here's the nodes for my trees and the result.
    upload_2019-5-8_22-36-41.png

    I'm quite sure it has to deal with the "Change seed on Playmode Start"
    But that raises the question to how I can - force it to always generate trees. Can't not - have trees lol.

    I'm using Objects instead of trees because the rotation stuff wasn't working with tree's, - objects works.
     
  43. camta005

    camta005

    Joined:
    Dec 16, 2016
    Posts:
    302
    Try changing the density value to 100 in the scatter generator.
     
  44. N1warhead

    N1warhead

    Joined:
    Mar 12, 2014
    Posts:
    3,688
    Wow - that appears to have fixed it!

    Thank you!
     
    camta005 likes this.
  45. syscrusher

    syscrusher

    Joined:
    Jul 4, 2015
    Posts:
    1,060
    I've been using Map Magic with Voxeland myself. There are some differences in the way outputs are generated, because traditional terrains need heightmap and splatmaps, whereas voxel terrains by nature need 3D rather than 2D information. So you can't just take a Map Magic node graph from terrain and switch it over to voxels. But the integration does work as advertised, and I've even found that I'm able to automate some things with the pairing of assets that I was doing by hand in Voxeland alone.

    The difference in output generation is explained in the documentation for Voxeland integration, so definitely read that before you start working with the two together.

    I'm still working out some details of workflow (to be fair, my requirements are a bit unusual), but essentially things are working for me.

    FWIW, I've enjoyed working with Voxeland. In my early experiences, I ran into some bugs, but the developer fixed those in later versions and it's working well for me now. One thing I did find is that Unity's default third-person character controller has difficulty walking on Voxeland terrain due to the irregular collider surface. I solved this very nicely by using Ultimate Character Controller from Opsive, which works flawlessly on Voxeland in both first and third person modes.
     
    mmaclaurin likes this.
  46. syscrusher

    syscrusher

    Joined:
    Jul 4, 2015
    Posts:
    1,060
    Quick question: I know there is either documentation or a tutorial video about using MM to generate caves in Voxeland. I saw it online once, but now that I need it I can't seem to find it again. Pardon my silly question, but could you please post a link here? Thanks.
     
  47. camta005

    camta005

    Joined:
    Dec 16, 2016
    Posts:
    302
    Here it is ;)
     
    syscrusher likes this.
  48. HanAusBerlin

    HanAusBerlin

    Joined:
    Sep 13, 2017
    Posts:
    76
    Hi,
    I am using the basic demo scene in VR. Performance on a 1080TX is aweful. It was ok in the evaluation version. Any ideas for optimization?
     
  49. syscrusher

    syscrusher

    Joined:
    Jul 4, 2015
    Posts:
    1,060
    Thanks! That's exactly the one I needed. For some reason I had it in my head that the cave tutorial was a separate video, so I browsed right past that one. I watched this last night, and I've got caves in my scene.
     
    camta005 likes this.
  50. syscrusher

    syscrusher

    Joined:
    Jul 4, 2015
    Posts:
    1,060
    Good day, all. I wanted to share some comments this morning based on my testing of MM and Voxeland last night. First, some general information for others to use if applicable:
    1. For anyone who needs to create a Voxeland terrain with a boundary of arbitrary shape, I had theorized that one could "trim" outside the boundaries by using a black/white mask to force the height to zero (with a "min" blend node) outside the desired area. This does work.
    2. You can also cut holes all the way through a voxel terrain using the same technique. For my scene, I need a voxel terrain in a perfect circle about 300 meters in diameter, with an approximately 5 meter thick ring wall around it, and an approximately 20 meter diameter circular pit in the center with another 3 meter thick ring wall bounding it. I was able to create all of this last night after watching that very nice tutorial. (Thanks!)
    3. By carefully ordering node blending upstream of the Voxeland output, and carefully ordering the layers of the Voxeland node itself, one can even pierce those ring walls with caves generated as shown in the video. I needed to do this on the inner wall but not the outer one. Success!
    4. If your caves skim too close to the surface, you can get a trench-like effect to make ravines. This is handy because that sort of thing happens in nature when a shallow cave collapses. In my case, however, I had some unfortunately-oversized overhang regions near these ravines. I got rid of those by using a blend node to compute the height of my base terrain minus the thickness of my cave minus the height of my cave, which gives you the distance between the cave ceiling and the base terrain surface. A curve node (inverted) can make a step-like function (inverted) to be a higher value such as 0.8 or 1.0 where that distance is less than a minimum threshold, then you add that computed value to the thickness of the cave (downstream of where you extracted that value for the computation, to avoid a graph loop paradox!). The effect is to blast away very thin cave ceilings and make the ravines a little bigger.
    After I've refined this a little more, I'll post a screen capture of my WIP terrain.

    I also have some questions/suggestions for @Wright. (Please note that I have not yet had time to download the beta, so these are all from the Asset Store released version for now. I will get the beta soon.)
    1. Is there, or could there please be, a tutorial for making flying islands? I think I could adapt my technique using another Empty block type layer to undercut the edges of my bounded terrain, but it would be nice to know how you as the developer envision creating things like this.
    2. During my work last night, I would occasionally get script errors in the console related to UI objects being created but not disposed. This seemed to happen mostly when I was creating and removing nodes or connections in the graph, and they went away with the next regeneration. I didn't bother to capture them because I'd rather have you focus on the new version than fixing non-fatal bugs in the old one. I'll let you know if these recur in the beta, though, and will send a traceback capture if so.
    3. If bounding voxel terrain by forcing the height to zero, sometimes those vertical edges have gaps in the rendered geometry. This is not a problem in my scene, because I will have non-voxeland geometry from another mesh covering those areas, but I thought you should know. If I force the out-of-bounds height to any positive number, such as 0.0001, then the vertical surfaces are fully drawn, but of course I have a thin sheet of unwanted voxels outside my terrain bounds.
    4. It's still possible to get some stray voxels even with the "remove thin layers" option enabled in the Voxeland object. The option does help -- a lot! -- but I saw a few strays anyway.
    5. Please consider some new nodes specifically to help with caves, such as a noise node that makes a wandering web-like pattern with gradient edges. I'll think about any suggestions I might have, as I work further on my scene.
    6. It would also be really useful to have a node that can radially or rectangularly tile the map from other nodes (e.g., turning one cone into a ring of N cones at a specified radius and value of N).
    Overall, I'm really pleased with what I was able to do in just one evening. This is so much nicer than hand-drawing all that geometry and trying to make it look random!
     
    mmaclaurin and Dwight_Everhart like this.
unityunity