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

    RobsonFMaciel

    Joined:
    Jan 12, 2013
    Posts:
    187
    Thank you, @Wright :D
     
  2. kain_vinosec

    kain_vinosec

    Joined:
    Jan 25, 2016
    Posts:
    9
    Fixed it. Thank you so much!
     
  3. RobsonFMaciel

    RobsonFMaciel

    Joined:
    Jan 12, 2013
    Posts:
    187
    upload_2018-7-21_20-57-42.png

    Whenever i try to import my work, it happens! Why ??? :(:(
     
  4. secondsight_

    secondsight_

    Joined:
    Mar 2, 2014
    Posts:
    163
    Whatever works works, right :)
    If I remember correctly I have used the same method for something similar a while back. My terrain was a little smaller, though. Haven´t experienced and problems. I also used this method to apply overlay colormaps for each terrain. So you want to have one texture output per terrain and then also use an offset to map the textures. Sadly the screenshots for this are gone :/ I also wasn´t sure if this is the way how I should do it but in the end it worked.
     
  5. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,277
    That's absolutely okay to use blend node this way. But, to be honest, do you really need raw THAT detailed? You'll get pixel every 3.75 units, there's nothing left for MM to detail. I guess the overall effect will not suffer from lowering raw resolution and adding some detail with noise or other generators.

    I'm not aware of this issue. Is there any way I could reproduce it?

    Yes, each time the new tile is generated it's processing all of the nodes in the graph. The generate time is bigger for the bigger graphs. But it does not affect smoothness - all of the tiles are generated in separate threads, so the FPS remains the same - it just takes a bit more time for the new tile to appear.

    Some FPS drop could be noticed on tile appearing: when the tile is generated and it applies generated results to terrain - this should be done in main thread. This drop does not depend on the graph complexity, it applies the results no matter of how long the node chains are.

    Yes, you can cache the generated tiles by increasing the generate range (leaving enable range the same). This way it will generate more tiles in reserve in separate thread, but will not enable them.
     
    jeromeWork likes this.
  6. Bodyclock

    Bodyclock

    Joined:
    May 8, 2018
    Posts:
    172
    Thanks for confirming. I understand what your saying pixel unit ratio. At the moment I'm just playing around trying to find the sweet spot with the combination of raw resolution, terrain size and terrain resolution (I think I have the height sorted).

    There's definitely an art to getting a combination that looks good and is playable in VR. It's very different in the headset :)

    Cheers

    Chris
     
  7. RobsonFMaciel

    RobsonFMaciel

    Joined:
    Jan 12, 2013
    Posts:
    187
    It took me a long time, but I was able to find the reason for the error. I am participating in the Beta of VegetationStudioPro and did all the configuration that @LennartJohansen asks for in this script below.
    https://www.awesometech.no/index.php/setting-up-vegetation-studio-pro-beta/

    And whenever I do a ".Nodes" import into the MM, the system stops working and generates the image above.

    I think it's because of ".Net4".
    :(
     
  8. MrIconic

    MrIconic

    Joined:
    Apr 5, 2013
    Posts:
    239
    How do you get MM 2.0?
     
  9. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,277
    NET 4.x compatibility should not bring this effect - at least it does not for me. Maybe the problem is in VS node? Are you using it?

    You can take part in MM 2 beta test by emailing me your order number - and I will provide an access to MM repository on GitLab.
     
    MrIconic likes this.
  10. RobsonFMaciel

    RobsonFMaciel

    Joined:
    Jan 12, 2013
    Posts:
    187
    No, I'm not using the VS node. I just followed the steps of VSPRO and got this problem.
    I tested with several different versions and on two different machine, the same problem always occurs.
     
  11. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,277
    As far as I can say the problem is that nodes located too far from each other on the graph. I have no doubt that opening this graph on a different machine will give the same result, I just want to find out why these nodes were suddenly placed this way. Is this issue reproducible with the new graph?
     
  12. RobsonFMaciel

    RobsonFMaciel

    Joined:
    Jan 12, 2013
    Posts:
    187
    Yes, I can reproduce on each new chart.
     
  13. RobsonFMaciel

    RobsonFMaciel

    Joined:
    Jan 12, 2013
    Posts:
    187
    Go to Player settings and change the following settings.
    • Scripting Runtime Version to .Net 4.x Equivalent
    • Api compability level to .net 4.x
    • Check Allow unsafe code

    "Scripting Define Symbols" may be clean, or only with MAPMAGIC

    And the problem wil appear.
     

    Attached Files:

  14. kilik128

    kilik128

    Joined:
    Jul 15, 2013
    Posts:
    909
    Hi got biome like this and nothing happen

     
  15. kilik128

    kilik128

    Joined:
    Jul 15, 2013
    Posts:
    909
  16. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,277
    Tried this in Unity 2018.1, still cannot reproduce this issue with the new graph. Maybe there is a chance you could record the video of how the new graph becomes corrupted?

    Could you please quote the post with an issue?

    If you got no output generator of some kind (height, textures, grass, etc) in "check" biome then only the remaining biome (island) outputs will be used.
     
  17. SSL7

    SSL7

    Joined:
    Mar 23, 2016
    Posts:
    349
    How are the splines going for MapMagic 2? :D is the 1 feature I really wait for :)
     
  18. shedworksdigital

    shedworksdigital

    Joined:
    Nov 7, 2016
    Posts:
    40
    Hello,

    I'm currently working on a system that allows scripts to read information from the MapMagic graph at runtime. The solution I can think of is to have a component on the terrain with a list of structs like this:

    Code (CSharp):
    1. [Serializable]
    2.     public struct Map
    3.     {
    4.         public Texture2D Map;
    5.         public string RedLabel;
    6.         public string GreenLabel;
    7.         public string BlueLabel;
    8.         public string AlphaLabel;
    9.     }
    10.  
    11.     public Map[] Maps;
    and then have a custom OutputGenerator that outputs the information I need the to the rgba channels of the Texture2D. I read through the custom generators guide on the wiki, but it looks like OutputGenerators work slightly differently. I was wondering if you could give an explanation of the Process, Apply and Purge methods.

    Thanks!
     
  19. RobsonFMaciel

    RobsonFMaciel

    Joined:
    Jan 12, 2013
    Posts:
    187
    I used 2018.2 for the test.
    Yes, i'll rec a video.
     
  20. mmaclaurin

    mmaclaurin

    Joined:
    Dec 18, 2016
    Posts:
    244
    Has anyone documented the process for packaging up a MM graph and bringing it into a new project? All the references to "data" and "graph" in the doc are confusing, and the buttons like "release" next to the data reference have no docs at all. Trying to start a clean 2018 project....
     
  21. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,277
    Still the same. Got a spline system but have not implemented it in generators. Working on the other features now.

    As far as I understand you are trying to output 4 inputs into the channels of per-terrain texture, right? That is what Custom mode of Custom Shader Output does. You will need no scripts, but a material with _ControlTexture0 (by default) texture property. If you are going to output the texture to use it in the terrain material then it's exactly your use case.

    You can create an asset file by pressing "Save as Copy", copy this file to the new project, and then just drag-and-drop asset to MM's data field.
    Release button duplicates the graph so it is no longer bound to the asset file and saved with the scene.
    Or you can click on the empty graph space and export graph as a .nodes file anywhere, and then import this file in a new project.
     
  22. shedworksdigital

    shedworksdigital

    Joined:
    Nov 7, 2016
    Posts:
    40
    I don't want the data for rendering purposes, but gameplay ones (ie. what biome is the player currently in). I picked apart the CustomShaderOutput class and worked out my solution, which looks like this:

    Code (CSharp):
    1. using System;
    2. using System.Collections;
    3. using System.Collections.Generic;
    4. using UnityEngine;
    5.  
    6. namespace MapMagic
    7. {
    8.     [Serializable, GeneratorMenu(menu = "Output", name = "Output Map", disengageable = false)]
    9.     public class CustomMapOutput : OutputGenerator
    10.     {
    11.         private class OutputMap
    12.         {
    13.             public string RedLabel;
    14.             public readonly Input RedInput = new Input(InoutType.Map);
    15.  
    16.             public string GreenLabel;
    17.             public readonly Input GreenInput = new Input(InoutType.Map);
    18.  
    19.             public string BlueLabel;
    20.             public readonly Input BlueInput = new Input(InoutType.Map);
    21.  
    22.             public string AlphaLabel;
    23.             public readonly Input AlphaInput = new Input(InoutType.Map);
    24.         }
    25.  
    26.         private OutputMap[] _maps = new OutputMap[1];
    27.  
    28.         private int _mapCount = 1;
    29.  
    30.         private void ConfigMaps()
    31.         {
    32.             if (_maps == null)
    33.             {
    34.                 _maps = new OutputMap[_mapCount];
    35.                 for (var i = 0; i < _maps.Length; i++)
    36.                     _maps[i] = new OutputMap();
    37.             }
    38.             else if (_maps.Length != _mapCount)
    39.             {
    40.                 var oldLength = _maps.Length;
    41.                 Array.Resize(ref _maps, _mapCount);
    42.  
    43.                 for (var i = oldLength; i < _maps.Length; i++)
    44.                     _maps[i] = new OutputMap();
    45.             }
    46.         }
    47.  
    48.         public override IEnumerable<Input> Inputs()
    49.         {
    50.             ConfigMaps();
    51.  
    52.             for (var i = 0; i < _maps.Length; i++)
    53.             {
    54.                 if (_maps[i] == null)
    55.                     _maps[i] = new OutputMap();
    56.  
    57.                 yield return _maps[i].RedInput;
    58.                 yield return _maps[i].GreenInput;
    59.                 yield return _maps[i].BlueInput;
    60.                 yield return _maps[i].AlphaInput;
    61.             }
    62.         }
    63.  
    64.         public override void OnGUI(GeneratorsAsset gens)
    65.         {
    66.             layout.Field(ref _mapCount, "Map Count", min: 1, max: 10);
    67.             ConfigMaps();
    68.  
    69.             for (var i = 0; i < _maps.Length; i++)
    70.             {
    71.                 var map = _maps[i];
    72.  
    73.                 layout.margin = 0;
    74.                 layout.Par(20);
    75.                 layout.Label($"Map {i + 1}");
    76.                 layout.margin = 15;
    77.  
    78.                 layout.Label("Red Channel:");
    79.                 layout.Field(ref map.RedLabel);
    80.                 map.RedInput.DrawIcon(layout);
    81.  
    82.                 layout.Par(5);
    83.  
    84.                 layout.Label("Green Channel:");
    85.                 layout.Field(ref map.GreenLabel);
    86.                 map.GreenInput.DrawIcon(layout);
    87.  
    88.                 layout.Par(5);
    89.  
    90.                 layout.Label("Blue Channel:");
    91.                 layout.Field(ref map.BlueLabel);
    92.                 map.BlueInput.DrawIcon(layout);
    93.  
    94.                 layout.Par(5);
    95.  
    96.                 layout.Label("Alpha Channel:");
    97.                 layout.Field(ref map.AlphaLabel);
    98.                 map.AlphaInput.DrawIcon(layout);
    99.             }
    100.  
    101.             layout.Par(10);
    102.         }
    103.  
    104.         public override Action<CoordRect, Chunk.Results, GeneratorsAsset, Chunk.Size, Func<float, bool>> GetProces()
    105.         {
    106.             return Process;
    107.         }
    108.  
    109.         private struct ProcessedMap
    110.         {
    111.             public Color[] Colors;
    112.             public string RedLabel;
    113.             public string GreenLabel;
    114.             public string BlueLabel;
    115.             public string AlphaLabel;
    116.         }
    117.  
    118.         private static void Process(CoordRect rect, Chunk.Results results, GeneratorsAsset gens, Chunk.Size size,
    119.             Func<float, bool> stop)
    120.         {
    121.             var finalResults = new List<ProcessedMap[]>();
    122.  
    123.             foreach (var gen in gens.GeneratorsOfType<CustomMapOutput>())
    124.             {
    125.                 if (stop != null && stop(0)) return;
    126.  
    127.                 var processedMaps = new ProcessedMap[gen._mapCount];
    128.  
    129.                 for (var i = 0; i < gen._mapCount; i++)
    130.                 {
    131.                     if (stop != null && stop(0)) return;
    132.  
    133.                     var map = gen._maps[i];
    134.  
    135.                     var processedMap = new ProcessedMap
    136.                     {
    137.                         Colors = new Color[rect.size.x * rect.size.z],
    138.                         RedLabel = map.RedLabel,
    139.                         GreenLabel = map.GreenLabel,
    140.                         BlueLabel = map.BlueLabel,
    141.                         AlphaLabel = map.AlphaLabel
    142.                     };
    143.  
    144.                     var redMatrix = (Matrix) map.RedInput.GetObject(results);
    145.                     var greenMatrix = (Matrix) map.GreenInput.GetObject(results);
    146.                     var blueMatrix = (Matrix) map.BlueInput.GetObject(results);
    147.                     var alphaMatrix = (Matrix) map.AlphaInput.GetObject(results);
    148.  
    149.                     var colorsIndex = 0;
    150.  
    151.                     for (var x = rect.offset.x; x < rect.offset.x + rect.size.x; x++)
    152.                     {
    153.                         for (var z = rect.offset.z; z < rect.offset.z + rect.size.z; z++)
    154.                         {
    155.                             processedMap.Colors[colorsIndex] =
    156.                                 new Color(
    157.                                     redMatrix?[x, z] ?? 0,
    158.                                     greenMatrix?[x, z] ?? 0,
    159.                                     blueMatrix?[x, z] ?? 0,
    160.                                     alphaMatrix?[x, z] ?? 0);
    161.  
    162.                             colorsIndex++;
    163.                         }
    164.                     }
    165.  
    166.                     processedMaps[i] = processedMap;
    167.                 }
    168.  
    169.                 finalResults.Add(processedMaps);
    170.             }
    171.  
    172.             results.apply.CheckAdd(typeof(CustomMapOutput), finalResults);
    173.         }
    174.  
    175.         public override Func<CoordRect, Terrain, object, Func<float, bool>, IEnumerator> GetApply()
    176.         {
    177.             return Apply;
    178.         }
    179.  
    180.         private static IEnumerator Apply(CoordRect rect, Terrain terrain, object dataBox, Func<float, bool> stop)
    181.         {
    182.             var results = (List<ProcessedMap[]>) dataBox;
    183.             var terrainHelper = terrain.GetComponent<MapMagicTerrainHelper>() ??
    184.                                 terrain.gameObject.AddComponent<MapMagicTerrainHelper>();
    185.  
    186.             var maps = new List<MapMagicTerrainHelper.Map>();
    187.  
    188.             foreach (var mapList in results)
    189.             {
    190.                 foreach (var processedMap in mapList)
    191.                 {
    192.                     var texture = new Texture2D(rect.size.x, rect.size.z, TextureFormat.RGBA32, false);
    193.                     texture.SetPixels(processedMap.Colors);
    194.                     texture.Apply(false);
    195.  
    196.                     var map = new MapMagicTerrainHelper.Map
    197.                     {
    198.                         Texture = texture,
    199.                         RedLabel = processedMap.RedLabel,
    200.                         GreenLabel = processedMap.GreenLabel,
    201.                         BlueLabel = processedMap.BlueLabel,
    202.                         AlphaLabel = processedMap.AlphaLabel
    203.                     };
    204.  
    205.                     maps.Add(map);
    206.                     yield return null;
    207.                 }
    208.             }
    209.  
    210.             terrainHelper.Maps = maps.ToArray();
    211.         }
    212.  
    213.         public override Action<CoordRect, Terrain> GetPurge()
    214.         {
    215.             return Purge;
    216.         }
    217.  
    218.         private static void Purge(CoordRect rect, Terrain terrain)
    219.         {
    220.         }
    221.     }
    222. }
    Code (CSharp):
    1. using System;
    2. using UnityEngine;
    3.  
    4. public class MapMagicTerrainHelper : MonoBehaviour
    5. {
    6.     [Serializable]
    7.     public struct Map
    8.     {
    9.         public Texture2D Texture;
    10.         public string RedLabel;
    11.         public string GreenLabel;
    12.         public string BlueLabel;
    13.         public string AlphaLabel;
    14.  
    15.         public Color this[int x, int z] => Texture.GetPixel(x, z);
    16.     }
    17.  
    18.     public Map[] Maps;
    19.  
    20.     public Vector2 GetLabelKey(string label)
    21.     {
    22.         for (var i = 0; i < Maps.Length; i++)
    23.         {
    24.             if (label == Maps[i].RedLabel) return new Vector2(i, 0);
    25.             if (label == Maps[i].GreenLabel) return new Vector2(i, 1);
    26.             if (label == Maps[i].BlueLabel) return new Vector2(i, 2);
    27.             if (label == Maps[i].AlphaLabel) return new Vector2(i, 3);
    28.         }
    29.      
    30.         return new Vector2(-1, -1);
    31.     }
    32.  
    33.     public float GetMapValue(int x, int z, Vector2 labelKey)
    34.     {
    35.         if (labelKey == new Vector2(-1, -1)) return 0;
    36.         var map = Maps[(int) labelKey.x];
    37.         var color = map[x, z];
    38.         return color[(int) labelKey.y];
    39.     }
    40. }
    41.  
    It's pretty close to what I want, but I'm not totally sure about the biome masks and how those work. An explanation of that would be much appreciated!

    EDIT: Thinking about it a bit more, there's really no reason why I need to save the data into a texture on the helper component. If I just store the colour array then it becomes serializable and I can pin the terrains, so I'll do that. Still need help with the biome stuff though!
     
    Last edited: Jul 26, 2018
  23. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    864
    Hi, I'm using MM with Vegetation Studio, but got a garbage collector disposing issue when multiple terrain tiles are generated in runtime and destroyed for been too far from player:

    GarbageCollector disposing of ComputeBuffer allocated in D:\Project\Assets\AwesomeTechnologies\VegetationStudio\VegetationSystem\VegetationItemModelInfo.cs at line 398. Please use ComputeBuffer.Release() or .Dispose() to manually release the buffer.

    Here are the recreate steps
    Setup a mapmagic infinite terrain using one vegetation package to output all the vegetations.
    Then enter the game without any pinned terrain, let mapmagic generate the terrain in runtime.
    Fly around and let mapmagic create several terrains and destroy some.
    Then stop play mode, right now, there is nothing wrong.
    Go change any script in the project, return to unity and let it recompile. After, you should see a lot of warnings like I mentioned up there.

    I'm not sure if this issue is caused by MM's VS output node or some VS's internal methods, so I'm asking help from both sides, this issue also causes game crash while playing and exit due to the large amount of garbages are not disposed during runtime.
    Hope this does not bother you from your busy developments :)
     
  24. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,277
    I assume that the problem could be in MM, but guess Lennart should look into it first - he is more familiar with his code. I'm willing to change MM the way he'll say or look into it further in MM's code.

    Each of the CustomMapOutputs in '''foreach (var gen in gens.GeneratorsOfType<CustomMapOutput>())''' loop is supposed to be in a biome and use the biome mask. Biome mask is the multiplier of currently used biome - if the value is 0 the biome is not used in this pixel, if 1 it's used at full strength.
    You can get the biome and it's mask the way it's done in CSO or any other output, then multiply your final value with biome value, and blend the values from all generators additively:
    Code (CSharp):
    1.                     for (var x = rect.offset.x; x < rect.offset.x + rect.size.x; x++)
    2.                     {
    3.                         for (var z = rect.offset.z; z < rect.offset.z + rect.size.z; z++)
    4.                         {
    5.                             float biomeFactor = biomeMask[x,z];
    6.  
    7.                             processedMap.Colors[colorsIndex] +=  //note += here
    8.                                 new Color(
    9.                                     redMatrix?[x, z] ?? 0,
    10.                                     greenMatrix?[x, z] ?? 0,
    11.                                     blueMatrix?[x, z] ?? 0,
    12.                                     alphaMatrix?[x, z] ?? 0) * biomeFactor;
    13.                             colorsIndex++;
    14.                         }
    15.                     }
    If you need an array of colors (or maybe the faster structs?) that could be created in thread then why don't use a standard custom node?
     
  25. vampir26

    vampir26

    Joined:
    Mar 29, 2010
    Posts:
    108
    Hello

    I'm wondering if I can add MapMagic to an existing Terrain (2x2), just to create details and trees?

    Thank you in advance!
     
  26. ArkadiuszR

    ArkadiuszR

    Joined:
    Jan 21, 2016
    Posts:
    22
    I cannot find issue but i need to ask about building system on generated terrain. For example if i choose runtime generating terrain is any way to save some terrain around that what is builded by player? Beacuse if i save only building and player go away and go back is chance to find build in terrain.. i think is almost sure
     
  27. DevilCult

    DevilCult

    Joined:
    Jun 24, 2017
    Posts:
    62
    Hello, im trying to add plant as object in the grass generator and when the plant is shown on the map the texture is flickering for some reason. When i place the object directly on the scene tought it work great. What could cause this? Using Ontario plant pbr pack from asset store.

    This is what it look like, when i move the screen around ine ditor all the dark and light flicker in every sense.
     
  28. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,277
    I'm working on that feature for v2. In the upcoming version you can pin existing terrain and use heightmap/textures/objects inputs to read it's data. You can sculpt the terrain manually and then let MM texture it or place objects. Or place objects and automatically create grass around them.

    You need to use a save/load system for that - either your own or third-party. MapMagic does not serialize playmode changes - it's out of the scope of this plugin. But with the playmode serialization you could lock terrain from script and save it the way it's done with any other terrain. A bit more advanced way is to serialize only the changed object without locking (saves take less space), letting MM generate terrain and then apply loaded changes.

    Are you placing an object transform or using it as a grass? Do you see the flickering when manually paint this object as a grass with no MM in scene?
     
  29. GamePowerNetwork

    GamePowerNetwork

    Joined:
    Sep 23, 2012
    Posts:
    257
    Hello @Wright

    I'm switching over from Voxeland to MapMagic for normal Unity terrains and I wanted to know if the vegetation studio worked with the biomes feature as well. I know I can use vegetation studio with MagMagic normally but does the system allow for multiple biomes to have different vegetation studio settings?
     
  30. JasonCG

    JasonCG

    Joined:
    Oct 6, 2012
    Posts:
    29
    I'm using Voxeland with MapMagic, and I'm trying to generate Voxeland Objects within tunnels carved through the terrain with mode: absolute.

    Basically my terrain is generated like this:

    1. Create a bedrock
    2. Add (Mode: Add) a couple layers above the bedrock
    3. Carve (Mode: Absolute) a tube of material through the layers I currently have (so that the cave has the same textured walls regardless of what layers the cave is cutting through)
    4. Carve (Mode: Absolute) a hollow tube through the material generated in step 3

    This gives me tunnels through my terrain that don't impact the ground above since I'm using absolute positioning.

    Next I'm trying to generate Voxeland Objects of things like rocks to fill my tunnels. The issue is the objects are always placed on the ground at the top of Voxeland, not in the tunnels themselves.

    I'm a bit confused on how the Voxeland Object generator works to begin with. I think I understand how it knows the x/z positioning information, it's the y position I'm really confused about. Is there some way to force the Voxeland Objects generator to a specific height?

    I'm starting to think it might not be possible to do it this way. I might have to just add layers and try to cut around the tunnels while adding layers.

    Thanks!
     
    Last edited: Aug 4, 2018
  31. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,277
    Yes, Vegetation Studio works with biomes, but all the Vegetation Studio Output nodes are the same for all the biomes. The reason is that you can blend two or more biomes at one terrain, while cannot mix different VS setups.

    Using MapMagic to place objects inside the caves is tricky, and probably you will need a custom objects generator for that.
    If you have "relative height" feature enabled in Voxeland Objects Output then objects will be placed using the final terrain heightmap, which does not include caves. Disabling this feature will make them use absolute position, which is 0 by default. You can write a custom node that will lift the objects to the caves level (using the height maps from step 3 or 4), but still I don't know how to remove the objects that are scattered in the places where there are no caves.
     
    JasonCG likes this.
  32. DevilCult

    DevilCult

    Joined:
    Jun 24, 2017
    Posts:
    62
    Just tryed and yes i still see the flickering when placing the object without MM using terrain painter... Not sure what is causing this. When i place it manually everything is fine
     
  33. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,277
    Might be some grass atlasing issue.I guess it's worth asking on Unity Answers. But before posting here I'd like to recommend you to take your time and to make a video - right now it's not clear what's flickering and how.
     
    DevilCult likes this.
  34. GamePowerNetwork

    GamePowerNetwork

    Joined:
    Sep 23, 2012
    Posts:
    257
    Anyone know if there's a way to rotate a Simple Form? I have a Z gradient that I want to rotate just a bit sideways.
     
  35. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,277
    While I'm still working more on MM core features like performance and memory usage, there are some MM users that gone far in implementing there own spline system. Very impressive!

    Blend it additively (with opacity) with the other Simple Form with X gradient?
     
    GamePowerNetwork and camta005 like this.
  36. Bodyclock

    Bodyclock

    Joined:
    May 8, 2018
    Posts:
    172
    This looks really nice - and is something I'm really looking for. Is this the sort of implementation of splines you plan for MM2?
     
  37. zeux-n00b

    zeux-n00b

    Joined:
    Nov 4, 2017
    Posts:
    73
    Hello!
    I clueless how to play with Forest Node to the Tree Node.
    I have lots of tree prefabs (in Tree Node_Layers) ready to be spawn but not overlapping.
    Subtract and Split Node is not working anything that goes around Forest Node, nor multiple wires on Other-Trees-input. Today turning my pc on,.. I was able to wire multiple wires on Other-Tree-inputs but with no effect, restarting Unity problem repeats like yesterday. Sry for my bad eng. Im using Unity 2018.2.2f1.
    Any hint ?

    9.8.2018 Im editing this post because today Split Node is working! there is no need to bother, I dont know the reason maybe my pc had to power down instead restart
     

    Attached Files:

    Last edited: Aug 9, 2018
  38. Stardog

    Stardog

    Joined:
    Jun 28, 2010
    Posts:
    1,913
    I have a few questions before I buy.
    • Can it do wrapped/planet terrains, aside from infinite. This would simulate a terrain you could circumnavigate, stitching the outer edge.
    • Is Map Magic 2 close to release, and will it be charged seperately?
    • Anyone know the workflow of using MicroSplat? I tried the free MM demo version to test and the texture array node seems to act strange, but sort of works. I also have to choose Sync All on the terrains after changing things, so is there a 'Changed' event I can listen for to make a custom script that will apply changes to MS, and apply a Monobehaviour when a new terrain is pinned.
     
    Last edited: Aug 9, 2018
  39. Stardog

    Stardog

    Joined:
    Jun 28, 2010
    Posts:
    1,913
    This is good, because I didn't want to buy it then have MM2 released in 1 month :). I will be buying today. Thank you for the reply.

    Also, to any other asset creators out there - it is worth making a demo version!
     
  40. mmaclaurin

    mmaclaurin

    Joined:
    Dec 18, 2016
    Posts:
    244
    @Stardog , microsplat and MM are a match made in heaven. Workflow could be a little more seamless, but it's fast for iteration and the results are spectacular.

    It will even better when we can access things like wetness, snow, and streams in MM.

    What you're missing is this script which will basically press the "sync all" button for you. I got it from the Microsplat thread:

    using UnityEngine;
    using JBooth.MicroSplat;


    namespace MagicSplatSync
    {
    public class MicroSplatMapMagicSync : MonoBehaviour
    {
    public Material MicrosplatMaterial;
    public MicroSplatPropData PropData;

    public void Start()
    {
    MapMagic.MapMagic.OnGenerateFailed -= MapMagic_OnGenerateFailed;
    MapMagic.MapMagic.OnGenerateCompleted -= MapMagic_OnGenerateCompleted;

    MapMagic.MapMagic.OnGenerateFailed += MapMagic_OnGenerateFailed;
    MapMagic.MapMagic.OnGenerateCompleted += MapMagic_OnGenerateCompleted;
    }

    private void MapMagic_OnGenerateCompleted(Terrain terrain)
    {
    MicroSplatTerrain mst = terrain.GetComponent<MicroSplatTerrain>();
    if (mst == null)
    {
    mst = terrain.gameObject.AddComponent<MicroSplatTerrain>();
    }
    mst.templateMaterial = this.MicrosplatMaterial;
    mst.propData = this.PropData;
    MicroSplatTerrain.SyncAll();
    }

    private void MapMagic_OnGenerateFailed(Terrain terrain)
    {
    Debug.Log("Generation failed for terrain: " + terrain.name);
    }

    public void OnDestroy()
    {
    MapMagic.MapMagic.OnGenerateFailed -= MapMagic_OnGenerateFailed;
    MapMagic.MapMagic.OnGenerateCompleted -= MapMagic_OnGenerateCompleted;
    }
    }
    }
     
    camta005 and Stardog like this.
  41. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,277
    It could be simplified a bit. There's no reason to use OnGenerateFailed event.

    Code (CSharp):
    1. using UnityEngine;
    2. using JBooth.MicroSplat;
    3.  
    4. namespace MagicSplatSync
    5. {
    6.     public class MicroSplatMapMagicSync : MonoBehaviour
    7.     {
    8.         public Material MicrosplatMaterial;
    9.         public MicroSplatPropData PropData;
    10.  
    11.         public void Start()
    12.         {
    13.             MapMagic.MapMagic.OnGenerateCompleted -= MapMagic_OnGenerateCompleted;
    14.             MapMagic.MapMagic.OnGenerateCompleted += MapMagic_OnGenerateCompleted;
    15.         }
    16.  
    17.         private void MapMagic_OnGenerateCompleted(Terrain terrain)
    18.         {
    19.             MicroSplatTerrain mst = terrain.GetComponent<MicroSplatTerrain>();
    20.             if (mst == null)
    21.                 mst = terrain.gameObject.AddComponent<MicroSplatTerrain>();
    22.  
    23.             mst.templateMaterial = this.MicrosplatMaterial;
    24.             mst.propData = this.PropData;
    25.             MicroSplatTerrain.SyncAll();
    26.         }
    27.  
    28.         public void OnDestroy()
    29.         {
    30.             MapMagic.MapMagic.OnGenerateCompleted -= MapMagic_OnGenerateCompleted;
    31.         }
    32.     }
    33. }
     
    camta005 and mmaclaurin like this.
  42. Nitrox32

    Nitrox32

    Joined:
    May 9, 2017
    Posts:
    161
    This may be a dumb question, but has anyone had a problem with MM and the new High Definition Rendering Pipeline?
     
  43. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,277
    I had. Not with MapMagic, but with terrains in general - HDRP has no proper shader for them. It's still under development (I mean, by Unity), guess they will fix the terrains sooner or later.
     
  44. Nitrox32

    Nitrox32

    Joined:
    May 9, 2017
    Posts:
    161
    Thanks, I thought I'd ask before starting a new project.
     
  45. Poxican

    Poxican

    Joined:
    Oct 17, 2012
    Posts:
    37
    @Wright Hi Denis, I'm designing a large map with a blend of procedural and authored terrain, something in the range of 200km^2. It'll be a combination of biomes with generated terrain and RAW inputs.

    I can achieve most of what I want in terms of generating the terrain, but I'm struggling to come up with a good workflow for designing it at the macro level. ie., it's not feasible to to pin hundreds of terrains. I have tried pinning a small number of terrains, say 10*10 to design the map at a reduced scale, but then I'm not sure about scaling that up to the required size.

    Can you suggest a good approach?
     
  46. zeux-n00b

    zeux-n00b

    Joined:
    Nov 4, 2017
    Posts:
    73
    Hello every one!
    I use Size information on Noise Generator function as an base height (instead of paintings island and so on...) I have used 4k resolution terrain for 100 km^2 and achieved nice terrain wonders,... I would pay for something like Spline None Generator that would paint for me where and how,.. ...but right now I would need something like to spawn prefab the along the same way as the terrains spawns, (right in this case is an Aqua Waters)(because its unpredictable where the water is on that Size of terrain base). As an object its not working for me because for performance reasons I use bilbords instead. Probably the prefab need just a some script attached or some extra nodes wich I have no problem paying for in this "realm"(MM)...
     
  47. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,277
    Poxican, you can try lowering the resolution and using mass pin. The problem is that you will get only rough results since the noise pattern is changing with resolution change (as well as voronoi and other generators). You can set the noise size, detail and offset, but do not expect exactly the same pattern on different resolutions. Consider it as a seed change.

    In MM2, however, this would not be a problem. All of MM2 generators are resolution independent. You can pin preview (low-resolution terrains) for all of your map, and a couple of terrains to detail and see the global and local effects at the same time.

    sekever-n00b, so you need to spawn a billboard the same way the terrain spawns - does this mean you need only one object per terrain? Did I get it right?
     
  48. zeux-n00b

    zeux-n00b

    Joined:
    Nov 4, 2017
    Posts:
    73
    This is basically my ocean set of Nodes, I though that my problem was with Tree,Details,Grass Settings,... spawning and so on, today I discovered that it has to do something with Aquas Water being spawned with an awkward result: I can not see it (Aqua water) but it is there when I jump in it, and terrain has its caustics. Unity official water plane works fine. Usually I fix more simpl prefabs like some mesh object, but here I dont know
     

    Attached Files:

    Last edited: Aug 13, 2018
  49. zeux-n00b

    zeux-n00b

    Joined:
    Nov 4, 2017
    Posts:
    73
    ah Regard Prefab Scale fix the thing, but now to get that obj.(Aqua) spawned always on the same height independent from terrains hieghts.
    13.8.2018 I gona have to edit post again because the solution was with custom plane position fixed with Blender that now Aqua contain. And my new working ocean Nodes
     

    Attached Files:

    Last edited: Aug 13, 2018
  50. mmaclaurin

    mmaclaurin

    Joined:
    Dec 18, 2016
    Posts:
    244
    Hola Denis;

    Just noticed across this error report in 2018.1 - wonder if this is why I see a gradual FPS drop on mobile? Think this is a chunk going out of range...

    Destroying assets is not permitted to avoid data loss.
    If you really want to remove an asset use DestroyImmediate (theObject, true);
    UnityEngine.Object:DestroyImmediate(Object)
    MapMagic.Chunk:OnRemove() (at Assets/MapMagic/Main/Chunk.cs:152)
    MapMagic.ChunkGrid`1:Deploy(CoordRect[], CoordRect[], Object, Boolean) (at Assets/MapMagic/Main/ChunkGrid.cs:380)
    MapMagic.MapMagic:Update() (at Assets/MapMagic/Main/MapMagic.cs:234)