Search Unity

MapMagic 2 - infinite procedural land generator

Discussion in 'Assets and Asset Store' started by Wright, Apr 24, 2020.

  1. Chusuk

    Chusuk

    Joined:
    Apr 19, 2021
    Posts:
    43
    Hi Stigmamax, you're probably using URP or HDRP in your scene but the demo objects including with MapMagic2 have a standard shader associated with the materials. If you change the material shader from standard to URP->Lit (if you are using URP for example), they should stop looking pink. You can also go the route of Edit->Render Pipeline->Universal Render Pipeline->Upgrade Project Materials to URP materials.

    Hope this helps.
     
    Wright likes this.
  2. stigmamax

    stigmamax

    Joined:
    Jun 30, 2014
    Posts:
    312
    thank you Chusuk, you helped me a lot!
     
  3. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,277
    Could you please check that you have the Gizmos toggle in Scene View window enabled? Tile and pin frames are gizmos, and like all the other gizmos they could be disabled to not interfere the scene view.

    (stealing this answer for FAQ)
     
    Last edited: Feb 1, 2022
    Chusuk likes this.
  4. MoosaNasir

    MoosaNasir

    Joined:
    May 24, 2021
    Posts:
    33
    Hello, I have a quick question about the erosion feature in MapMagic 2. Can the erosion be done on an infinite terrain at runtime? Or can it only be done in the editor? Thanks in advance!
     
  5. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,277
    Erosion works in runtime. All of the nodes do.

    PS: just in case - MM generates terrain with erosion, but it won't smoothly erode existing terrain under player.
     
    MoosaNasir likes this.
  6. MoosaNasir

    MoosaNasir

    Joined:
    May 24, 2021
    Posts:
    33
    If you don't mind me asking, how does the erosion work at runtime? I have only ever seen erosion algorithms for a finite area.
     
  7. Tim-Wiese

    Tim-Wiese

    Joined:
    Jul 7, 2012
    Posts:
    77
    Does Terrain Blending from MicroSplat work with MapMagic2? I've tried everything I could to get this to work in MapMagic2 and it only seems to pull one layer instead of the splat. I've tested this on a vanilla Unity Terrain and it works just fine.
    Is there something I need to have turned on/off with MapMagic2 for this to work properly?

    MapMagic2 MicroSplat node with Terrain Blending turned on with object only blending what seems to be a random texture.


    MicroSplat working fine in normal Unity Terrain.
    upload_2022-2-1_14-11-20.png

    Thanks for any help with this!
     
  8. stigmamax

    stigmamax

    Joined:
    Jun 30, 2014
    Posts:
    312
  9. CornerCase_Studio

    CornerCase_Studio

    Joined:
    Nov 17, 2016
    Posts:
    15
    Hello Denis,

    Sorry to bother you, but I've been pulling my hair out today: I have been unable to get Microsplat's tesselation working with MM2 in HDRP.

    I've done all the troubleshooting steps you would suspect: isolating things, simplifying... started a new test project and blank scene, just to make sure.

    The end result is: HDRP tesselation is working on non-terrain objects using other shaders, and Microsplat's tesselation is working with Unity terrain, but once I apply the exact same Microsplat material to a MM2 graph using the Microsplat node, the tesselation stops working. Any ideas?
     
    Last edited: Feb 2, 2022
  10. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,277
    It works per-tile. Tile is a finite area, but you can have infinite number of tiles :)

    Seems that splat map is needed for this. Try setting Apply Type: Both in MicroSplat output -> Advanced

    You should create Mask from Objects -> Modifiers (not Maps). Or you can just right-click and type "mask" in search - and choose the green one.

    I'm not sure that it's working, but I would try enabling or disabling Draw Instanced in MapMagic Object -> Terrain Properties.
     
  11. CornerCase_Studio

    CornerCase_Studio

    Joined:
    Nov 17, 2016
    Posts:
    15
    Thanks Denis, that sort of got it working...

    It is very unstable. It works for a single texture, but seemingly breaks the MM2 object without warning, forcing me to recreate it and reassign the graphs.

    I'm still trying to figure out exactly what is working and what isn't... and how to reproduce certain behaviors. I'll let you know.
     
    Last edited: Feb 4, 2022
  12. stigmamax

    stigmamax

    Joined:
    Jun 30, 2014
    Posts:
    312
    thank you very much Wright !
     
  13. CornerCase_Studio

    CornerCase_Studio

    Joined:
    Nov 17, 2016
    Posts:
    15
    Ok, after looking at it again today, it appears everything is working just fine... it's simply that you absolutely must call ApplyTerrainSettings() every time any change is made to the Microsplat output in the graph, or the tessellation and some other things will break.

    I've made a super hacky script that "fixes" the issue for now. I'll leave a permanent fix up to you.


    Code (CSharp):
    1. using MapMagic.Core;
    2. using UnityEngine;
    3.  
    4. [ExecuteInEditMode]
    5. public class MM2TessellationHack : MonoBehaviour
    6. {
    7. #if UNITY_EDITOR
    8.     void Update()
    9.     {
    10.         MapMagic.Terrains.TerrainTile.OnAllComplete -= MM2AllComplete;
    11.         MapMagic.Terrains.TerrainTile.OnAllComplete += MM2AllComplete;
    12.     }
    13.  
    14.     private void MM2AllComplete (MapMagicObject mapMagic)
    15.     {    
    16.         mapMagic.ApplyTerrainSettings();
    17.     }
    18. #endif
    19. }
     
    Last edited: Feb 4, 2022
  14. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,277
    I was going to recommend you subscribing to event when started to read your post, but then saw the code. I guess I will make MS output do this by default to in next version to avoid additional scripts.
     
  15. MoosaNasir

    MoosaNasir

    Joined:
    May 24, 2021
    Posts:
    33
    Thanks! I've seen someone try to do this in a blog once, but they said gaps form between each tile, so I thought it wouldn't be possible.
     
  16. stigmamax

    stigmamax

    Joined:
    Jun 30, 2014
    Posts:
    312
    Hello,
    When I zoom out the trees are ok but if I zoom in they turn pink! Thanks for your help
     
  17. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,277
    That was the issue in MapMagic 1 - it was producing exactly similar results at most of the tile surface, but the edges were different. MM2 generates some extra margins that are not applied to terrain, so erosion generated properly for the whole tile.

    Have you tried this?
    In other words - try assigning the default shader (depends on your render pipeline) to tree materials.
     
  18. whkona

    whkona

    Joined:
    Jul 9, 2018
    Posts:
    10
    Hi There,
    First time posting on this forum. Loving MM so far and have got a pretty solid test world running with a few biomes running nicely. I'm running Nature Renderer and it is working very well but I want to step it up and check out installing Vegetation Studio Pro for many of the other assets I'm placing onto the terrain. But... I can't see the VS node at all in with the rest of the nodes. I have MM2, Biomes and Objects addons and nowhere in the nodes is the VS pro node. Do I need to install VS Pro first and the node magically appears? I've looked through many of the threads regarding VS Pro and it also worries me that I could run into all kinds of issues using it even if I had the VS pro node. Any thoughts on this and where node actually is would be truly appreciated. Thanks.
     
  19. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,277
    Check that you have Vegetation Studio Pro checkbox enabled in Window - MapMagic - Settings. It will enable VEGETATION_STUDIO_PRO keyword in case it's not enabled by default.
     
  20. whkona

    whkona

    Joined:
    Jul 9, 2018
    Posts:
    10
    Thanks, Wright! I hadn't even looked at that settings dialogue box yet. That answers my MicroSplat question as well.
     
    Wright likes this.
  21. stigmamax

    stigmamax

    Joined:
    Jun 30, 2014
    Posts:
    312
    how to fix this error?
    Exception: MapMagic: Graph data is not assigned
     
  22. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,277
    When do you get it?
     
  23. whkona

    whkona

    Joined:
    Jul 9, 2018
    Posts:
    10
    Hey MM Forum Gang,
    I just wanted to leave this note for posterity and for anyone using MM and MicroSplat (MS). I can get it all to work well but there are some steps you may need to know not to run into many of the pitfalls I've read about in this forum. Keep in mind this is anecdotal and you may get different results.
    To do:
    • Start a new project, bring in MM, and get your materials and textures. DO not let this touch your main project yet.
    • For me, I felt you don’t want to make an MM graph with texture layers laid into it and then hope to convert it with a button press. I had little success with that. I found it better to make a copy of that graph and the scene and then put the copied map into the new scene,
    • Follow Wright’s video:
      and then when you add the MS node and the MS Layers just connect the layers appropriately. But beware: Your tiles will disappear a few times at first and on MS material changes it will do all kinds of funky things to your scene. Just hit the MM generate again and usually the terrains will come back. If not then either pin and unpin what you see or delete the terrains themselves and then hit generate again.
    • I could not find any updated docs on the MS node which has a few more features not documented.
      • Under Advanced add: the Protodata generated by MS in your MS folder you created.
      • Check: Set component, Custom Splatmaps, add normals tex.
      • For Apply Type only the “Textures” selection worked for me. The others options caused errors.
    • From this point on things should go smoother. But expect your texture layer workflow to be different as you tweak the shader settings of each MS texture within the splatmap material. Expect the terrains to disappear a few more times but just hit generate to see the changes. It seems when making a global change to the shader you can lose visuals of the terrain. But when changing per layer settings (like: UV Scale, normal strength,..) it updates as expected in the editor.

    Extra bits:
    • Do not accidently bring in the wrong MS version of URP. I'm using a 2020.3 LTS and inadvertenly brought in 2021 URP for MS. Disaster! It seemed to work fine but then froze up the system and even after deleting all the MS files and folders related to the map I struggled to be able to even pin an MM tile. Somehow it disabled the ability to pin and unpin on even the original non-MS scene and map.
    • If you just can’t get the terrains to show try hitting play and that usually reloaded everything for me properly. So when I hit stop everything was in the editor as expected.
    • I ran into the pinning and unpinning ability ceasing to work on my entire project a few times even on the clean MS 2020 URP install. And oddly every scene in the project with MM not even using a graph with MS in it wouldn’t allow for pinning. And yes - gizmos were on. It seems to show the blue highlight around the whole terrain group but not the individual terrains. Then if you click on a terrain it actually selects the terrain rather than unpinning it. I found the only solution that I found was to go to the terrains with MS on them and delete them directly. Then hit generate and magically my terrains were selectable again with pin and unpin.
    So those of you who are reading this and wondering: is it really worth the pain to add MicroSplat? It really is. More efficient terrain shaders on an open world terrain will pay off. Better blending and for me stopping tiling on large cliffs and ground was a must at minimum (we have flying over the terrain as a feature which really shows the tiling). I’m only a couple of days into this integration so maybe it all falls apart with some new change I make. But that is exactly why this terrain is not in my main project. I brought some assets and player controller over to it to confirm the scale and feel. It all seems right but it won’t meet my project until I am certain I have the kinks worked out.

    Anyway… Sorry for the long post. I hope that helps someone in the future until Wright has the time to work directly with Jason at MS to iron out the bugs. I'll edit this if I find any other issues or solutions.

    Edit Feb 16, 2022: I noticed that when playing a build I would get an error that would stop the world from building past my 4 pinned tiles. The error was mentioned here: https://forum.unity.com/threads/rel...al-land-generator.875470/page-35#post-7704772 and when I unchecked Set Component in the MS Node and rebuilt the game the MM tiles would build out as expected. At the moment I don't need the advanced features so unchecking this box was not an issue.
     
    Last edited: Feb 17, 2022
    Wright likes this.
  24. whkona

    whkona

    Joined:
    Jul 9, 2018
    Posts:
    10
    Hey there,
    So i have a few biomes blended together and I have 2 questions I can't quite solve and was hoping someone might know the answer. I made a couple of simple test graphs then added them to a biome set node. Both biomes have the grass growing properly only on the textures designated for grass and not on the cliffs. But when I blend the biomes in a biome set I am guessing the base biome is putting grass on the cliff biome walls. Screenshots below:
    cliff.png

    Both the base graph and the Cliff grass use this same setup.
    textures-and-grass.png

    Top 2 Graphs are cliff biomes and bottom is the meadow biome.
    BIome-set.png

    If anyone has any idea how to prevent the grass from growing on the cliffs I would appreciate it.
     
  25. whkona

    whkona

    Joined:
    Jul 9, 2018
    Posts:
    10
    I figured I should make a separate post for the second question. I am making the world endless and procedural mixing 5 different biomes repetitively with one base biome in basically a checkerboard fashion. I am trying to get one water level set up for all the graphs so they can share having the sand blend into the water plane and all textures under the water plane to be sand. On each biome individually I can get this to work fairly well but of course when I blend all the biomes together they push each other up and change where the sand and the water will be and it comes out as a mess. Is there some way to have more of a global height dictating that all terrain texture under say 50 meters is sand and so I can just set the water plane at 49 meters in the scene that blends the biomes and I get the results I am looking for? And just an FYI - I start each biome with a noise node that all have the exact same settings to ensure the cleanest blending.

    Any help would be appreciated.
     
  26. AndersonMarquess

    AndersonMarquess

    Joined:
    May 20, 2017
    Posts:
    2
    Hi,
    I Would like to know if there is a way to get the final amount of generated points, after spread the scatter.

    GraficoDeExemplo.jpg

    As you can see in the image, I would like to get the 9349 value.

    Currently, I can get the pool and search for the target and count the amount of instances entries, there is a better way to get the final amount of objects in-game?

    Thanks.
     
  27. matthewhxq

    matthewhxq

    Joined:
    Jul 6, 2015
    Posts:
    21
    Hey,
    Would it be possible to tile this type of river (created from path) to tile it across all tiles in that direction infinitely?
     

    Attached Files:

  28. stigmamax

    stigmamax

    Joined:
    Jun 30, 2014
    Posts:
    312
    I had not placed the graph in the scene.
     
  29. stigmamax

    stigmamax

    Joined:
    Jun 30, 2014
    Posts:
    312
    Hello
    Can we use several RAW files for the terrain?
    Thank you
     
  30. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,277
    Hooray! I want to share grate news.

    MapMagic 2 Brush has been nominated for Unity Awards in category Best Artistic Tool (Asset Store)
    awards.unity.com


    This nomination means a lot to me, and I'd like to thank you for all the support, advice, suggestions and issue reports! I feel that MM improved greatly since it's initial release - and the reason is your feedback! Thank you!
     
    Last edited: Feb 17, 2022
    heartingNinja, whkona and mick129 like this.
  31. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,277
    Yes, you can use several import nodes with different datas and offset. You can use Blend in additive mode to combine them. You can place them in a shape of a square or overlay with different tiling - whatever you like.

    Do you need help on this or you sorted that out?

    Not yet, but I'm working on it. It requires a lot of changes, and will be released in version 2.2. It will be called Cluster mode. No ETA yet, thought.

    Do you want to know the number of objects generated by some specific tile, or number of objects on preview, or in general. Even for the tile - do you want to take margins into account? And do you want it in thread (for a custom node, for example) or after tile has been generated? Some background might come in handy, but it's okay, just clarifying what exactly you are trying to achieve.

    I recommend using functions instead biome set if you want some advanced biome mixing logic. They can work as biomes, and they can recieve inputs - hover they have no masks, so blending final result should be made with MM nodes, not internal magic like in Biome Set. Maybe it complicates the total graph, but it gives you possibilities to blend them the way you want.

    But I can see your use case and from time to time recieve such requests. I can see whether there is a way to improve Biome Set.
     
  32. whkona

    whkona

    Joined:
    Jul 9, 2018
    Posts:
    10
    Hi Wright, Thanks for the response. I'll give that idea a look. That does seem like it will complicate the total graph quite a bit but I wasn't expecting it to be easy ;). It seems like a good time to look into functions anyways since I am producing a few repeating patterns in all the graphs for a few things while I play with the concepts. Btw, I love your product and am amazed at the small size of the footprint when making a truly procedural Open World. I brought it into my testing multiplayer project and had 4 people running and flying seemingly endlessly throughout the map and the terrain generation was solid. I figured for sure we would need to use a SECTR like solution right away but MM seems to be handling it. We didn't push any edge cases of heading into 4 opposing directions endlessly at the same time but I'll keep you up to date on our findings.
     
    Last edited: Feb 17, 2022
    Wright likes this.
  33. mick129

    mick129

    Joined:
    Jun 19, 2013
    Posts:
    228
    It is well deserved, you got my vote.
    Keep up the good work :)
     
    Wright likes this.
  34. stigmamax

    stigmamax

    Joined:
    Jun 30, 2014
    Posts:
    312
    Why is my land tiled. I use 2 psd files.
     
    Last edited: Feb 19, 2022
  35. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,277
    What do you mean by tiled? Could you please describe your use case and what are you trying to achieve - this way I can help you to solve the problem.
     
  36. stigmamax

    stigmamax

    Joined:
    Jun 30, 2014
    Posts:
    312
    instead of having the texture of grass, there is a kind of grid pattern
     
  37. dwilhelmdw

    dwilhelmdw

    Joined:
    Mar 22, 2019
    Posts:
    11
    I think I am missing a basic setting. I was hoping my biome mask would apply to the whole scene but it is just applying to the each tile and repeating for each tile. Any idea on what I need to change?
     
  38. dwilhelmdw

    dwilhelmdw

    Joined:
    Mar 22, 2019
    Posts:
    11
    Ah never mind. The pattern I was using to test the terrain was the same size as one title so it was tiling at the same rate as the tiles
     
    Wright likes this.
  39. Crossway

    Crossway

    Joined:
    May 24, 2016
    Posts:
    509
    Is that possible to upgrade map magic 1 graphs to map magic 2 graphs?
     
  40. marcrem

    marcrem

    Joined:
    Oct 13, 2016
    Posts:
    340
    Hi,

    I have a streamed world, and this world is even loaded partially when doing level design. This means I am able to load some already created terrains I want to work on, and save them before moving on to another part of the world.

    I need a tool that allows me to paint various textures on my terrains according to some rules like MapMagic Brush. That would allow me to paint biomes.

    However, once I'm done painting, I want to be able to press a button and let the system generate grass and spawn objects for the loaded terrains. I'd ideally have a rule that checks for colliders to not spawn grass under my roads, and stuff like that.

    Can the whole MapMagic system allow me to do that? Could I automate some processes to get my "press a button to spawn grass" thing to work? What about GameObjects?

    Thanks in advance, I'm just shopping
     
  41. Rumpelito

    Rumpelito

    Joined:
    Feb 20, 2021
    Posts:
    1
    I have the same problem kinda... I'm certain Gizmos are active in the scene, even checked to see if MapMagic guizmo were checked, but I don't have the option to Pin as Draft or Pin New Tiles. I'm on Unity 2021.2.12f. If I click, it selects nothing, I have no new tile preview when I hover near the terrain!
     
  42. stigmamax

    stigmamax

    Joined:
    Jun 30, 2014
    Posts:
    312
    how to add a sand texture?
     
  43. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,277
    Are you pinning your tiles and these are pinned tiles that disappear?

    Unfortunately it is not possible. Even if nodes have same names and parameters - they produce different results because of different tile system. And some nodes have different principles (like Noise, that has no inputs). When updated graph will generate ridiculously weird results, you will have to re-create this graph anyways.

    In other words, you want to provide height to MM, and let it generate the rest?
    I'm thinking about the way to make it convenient, but these are just ideas. As a workaround you can use terrain-sized Brush preset.

    Do you have first terrain tile borders highlighted in blue visible in a scene view?

    Don't take this the wrong way, but I really believe that you can find a lot of useful information in wiki. For this question you can find some info on how to use Texture Output, create Unity terrain layers and assign them here.
     
  44. psistalk

    psistalk

    Joined:
    Sep 23, 2013
    Posts:
    68
    I love MM2. I was just wondering when you will have the save functions and I am having an issue with the terrains not turning on when i get to the edge of 1. It is probably a setting im missing. Thank you for such a great asset
     
  45. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,277
    Really glad to hear that!

    Could you please clarify what are the save functions?

    Do you get any error in the console when terrain do not appear? Do you have Generate Infinite Terrain enabled in MapMagic object / Infinite Terrain (Playmode)?
     
  46. psistalk

    psistalk

    Joined:
    Sep 23, 2013
    Posts:
    68
    the save is the export tab. This allows exporting and then reimporting groups. Yes generate infinite terrains is on both ranges are set to 2 and around main camera is checked. Ill play with it some more. Thank you for such a great asset.
     
  47. Skellyus

    Skellyus

    Joined:
    Jan 28, 2022
    Posts:
    1
    Hi,
    I have a problem with grass output in HDRP. In Grass mode shows white rectangles in billboard mode nothing at all. No error in console. I saw some issues from 2020 (no support in unity) not sure if the problem is still there. Is it possible to fix the issue or do I need to use different additional tool to workaround the problem?

    TY.
     
  48. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,277
    If you want to copy groups or generators to the other (or the same) graph select the ones you want with Shift, right-click on any selected node, and choose Generators - Copy. Right click on any empty space in graph and press Paste.

    Unity 2021.1 doesn't have grass - it displays warning in terrain inspector window: "Cerrent render pipeline doesn't support detail shaders". Don't have HDRP for 2021.2 at hand, but as far as I remember it had no billboards shaders as well - only detail meshes with their own shader graphs. New 2022 beta was released today - got to find some time to look into it.
     
  49. conlanstewart

    conlanstewart

    Joined:
    Mar 2, 2022
    Posts:
    12
    Hello,

    I've been trying to create a small terrain using a grayscale image at runtime. I'm doing this by setting my desired grayscale image in a Matrix Asset at a resolution of 512 and then regenerating the map magic terrain. This works in the editor, but I can't seem to get it to work in a WebGL build. When I go to regenerate the terrain, I get no error and no terrain shows up, though I can still move around and it doesn't lock up the build.

    I saw in a previous post to disable native C++ code in the settings, Disable multithreading, Disable draft terrains, and I've tried doing this with smaller resolutions, but I'm still getting the same result. Does anybody have any suggestions on other things I can try to get this to work?

    Thanks so much for your time

    UPDATE:
    So I found an additional tip in the documentation about WebGL that recommended to turn auto max threads off, and set it to 999. This gave me a terrain, but it is completely flat no matter what grayscale texture I throw at it in build
     
    Last edited: Mar 2, 2022
  50. MoosaNasir

    MoosaNasir

    Joined:
    May 24, 2021
    Posts:
    33
    Hello, I know it has been a while, but I was still wondering about the erosion system. Could you please elaborate about the "extra margins" that are not applied to the terrain, I didn't quite understand what you had meant.

    My guess of what the extra margins means is that the edges of each chunk are connected once the noise and erosion are applied:

    upload_2022-3-2_19-59-39.png

    If this is or isn't how it works, I would love to know. Thanks in advance!

    Edit: If I'm not mistaken, mapmagic 2 uses the terrain renderer instead of a mesh renderer, so I guess instead of the above example being quads, they would be pixels.
     
    Last edited: Mar 3, 2022