Search Unity

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. stigmamax

    stigmamax

    Joined:
    Jun 30, 2014
    Posts:
    312
    Land from Gaia 2 to Map Magic 2

    What is the best way to import terrain created with Gaia. I exported a Gaia terrain in OBJ format but I don't know how to integrate it into Map Magic.
     
  2. Liminal-Ridges

    Liminal-Ridges

    Joined:
    Oct 21, 2015
    Posts:
    256
    @Wright pathfinding node always gives this error


    Code (CSharp):
    1. Thread failed: System.Exception: Line points number is <= 1
    2.   at Den.Tools.GUI.PolyLine.SetPointsThread (UnityEngine.Vector3[][] points, System.Int32 numPoints) [0x004cf] in C:\Users\User\Desktop\My project (1)\Assets\MapMagic\Tools\SceneEdit\Editor\PolyLine.cs:154
    3.   at MapMagic.Previews.SplinePreview.ExecuteInThread () [0x000ad] in C:\Users\User\Desktop\My project (1)\Assets\MapMagic\Preview\Editor\SplinePreview.cs:94
    4.   at Den.Tools.Tasks.ThreadManager.TaskThreadAction (Den.Tools.Tasks.ThreadManager+Task task) [0x00000] in C:\Users\User\Desktop\My project (1)\Assets\MapMagic\Tools\ThreadManager\ThreadManager.cs:138
    5. UnityEngine.Debug:LogError (object)
    6. Den.Tools.Tasks.ThreadManager:TaskThreadAction (Den.Tools.Tasks.ThreadManager/Task) (at Assets/MapMagic/Tools/ThreadManager/ThreadManager.cs:144)
    7. System.Threading.ThreadHelper:ThreadStart ()
    8.  
     
  3. Pflosch

    Pflosch

    Joined:
    Aug 22, 2021
    Posts:
    5
    Same problem here, I use MM for the first time, very cool asset, even I'm just using the free version for now.
    So far I thought I'm doing something wrong, I use the textures which come with the bundle.
    Reading this, it would be nice to know whether it's general issue in 2022.2 or I'm doing something wrong.
     
    Last edited: Feb 13, 2023
    protopop likes this.
  4. Liminal-Ridges

    Liminal-Ridges

    Joined:
    Oct 21, 2015
    Posts:
    256
    anyone having problem with the grass node?
     
  5. avidwriter

    avidwriter

    Joined:
    Dec 21, 2021
    Posts:
    9
    try increasing the density of the grass to 1000 approximately
     
    Liminal-Ridges likes this.
  6. avidwriter

    avidwriter

    Joined:
    Dec 21, 2021
    Posts:
    9
    EDIT-- traced it back to the experimental Spline components, removing that made a smooth blend

    I'm having an issue with infinite terrains not connecting smoothly, how can I fix this? thanks
     

    Attached Files:

    Last edited: Feb 21, 2023
  7. Liminal-Ridges

    Liminal-Ridges

    Joined:
    Oct 21, 2015
    Posts:
    256
    I saw @Wright you added the move and spline move direction nodes i asked for. Appreciate it alot
     
  8. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,561
    Same for me.

    Grass shows on the original 0,0 terrain generated, but doesn't show on any other tiles.

    I notice the other tiles have something called "coverage mode" on for details, and the main grass covered one has "instance count" instead,
     
  9. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    This is a new thing in 2022. The detail system now has two modes, coverage and instance count. In one mode, the values painted into the system reflect the exact number of instances to spawn in that area, while in the other it's a 'coverage' value, with no explanation of which is the old or new system, what the difference is, etc. This also changes how the new density value it used. I've attempted to match these up as best as I could in MicroVerse, but likely your fix here is to make all your terrains have the same mode as whatever one works..
     
    protopop likes this.
  10. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,561
    thanks for the scoop Jason.

    sonce all the other terrains except the original one have coverage mode and no grass I am guessing in the terrain generation loop it's setting this. Thankfully mapmagic is open (this is exactly why I never use assets with dlls) so I'll look through the code and see if I can figure out what code is setting the remaining "chunks" (terrains in mapmagic) to coverage mode.
     
  11. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,561
    found a link here that seems to lead in the right direction - for another product but still:
    https://forum.unity.com/threads/bug-has-terraindata-setdetaillayer-changed-in-2022-2.1349705/

    "the new option DetailScatterMode changed the meaning of the values I set the detail layer. It was set to CoverageMode where my code assumed InstanceCountMode.The latter was the only mode available in 2019 LTS.

    Fixed for now by adding this:

    Code (CSharp):
    1. _terrain.terrainData.SetDetailScatterMode(DetailScatterMode.InstanceCountMode);"


      I'll try to find something similar in the mapmagic code.
     
  12. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,561
    Ok figured it out, I added this line (in bold) to chunk.cs around line 117 in MapMagic

    terrainData.size = new Vector3(mapMagic.terrainSize, mapMagic.terrainHeight, mapMagic.terrainSize);
    terrain.terrainData.SetDetailScatterMode(DetailScatterMode.InstanceCountMode);

    This sets the detail scatter mode to Instance count mode when the terrains are first generated.
     
    Stardog likes this.
  13. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,561
    A bit more. Unity 2022 (and maybe lower, I don't know who it was introduced) has a new terrain detail value called Affected by Density Scale that is set for each grass detail. We need to edit map magic generator to turn this value to TRUE for each detail grass each time it generates a new terrain.

    Otherwise changing grass density won't affect the density of the terrain grass.


    in OutputGenerators.cs

    on Line 1955 added after

    prototypesList.Add(gen.baseLayers.det);

    add this line, which sets each detail in the detail list to use scaling

    prototypesList[prototypesList.Count - 1].useDensityScaling = true;
     
  14. musmuza

    musmuza

    Joined:
    Oct 23, 2022
    Posts:
    1
    Is it possible to use it to add details on existing terrain and also place interactive points like ore deposits on the existing map?
     
  15. ElevenGame

    ElevenGame

    Joined:
    Jun 13, 2016
    Posts:
    146
    The generation of Mapmagic is based on it's own terrain tiles. A lot of things are possible theoretically, but it is not made for modifying existing terrain.
     
  16. trilstew13

    trilstew13

    Joined:
    Oct 21, 2021
    Posts:
    2
    Why don't other game objects seem to recognize the terrain colliders I put on the mapmagic terrains. I know this because anytime I check it with debug.log to check and still nothing. I've used OnTriggerEnter and the other collider is already set to IsTrigger the problems seems to only lie with the terrain detection itself.