Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

MapMagic 2 - infinite procedural land generator

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

  1. nobluff67

    nobluff67

    Joined:
    Nov 3, 2016
    Posts:
    338
    Using standard, but I think maybe you not understanding my issue, Ill try with a few more images.

    The highlighted area in the image below is related to the position of the transform (correct?)

    Screenshot 2021-01-27 174212.png

    As you can see, in the second image, the character has moved, so the highlighted box has moved with the character (or camera, once again this is standard MM2, correct?)

    Screenshot 2021-01-27 174312.png

    Now for my issue, if you are between the blue and red line and the highlighted box has not moved, you see a definite line on the terrain (scene view and game view).

    At the end of the day my question is:

    1. Should the highlighted box move with the "Around Objects Tagged" setting?

    Screenshot 2021-01-27 175322.png
     
  2. FlightOfOne

    FlightOfOne

    Joined:
    Aug 1, 2014
    Posts:
    659
    Nice!
    I am using 2048. I am not sure what you mean by channel numbers?
     
  3. ysundawa

    ysundawa

    Joined:
    Mar 2, 2020
    Posts:
    33
    Thanks a lot, it will be very useful.

    And please allow me to report some weird behavior with MapMagic 2 Spline (I know it's still BETA).
    The problem is, when we generate spline for multiple Terrain, the Spline generated for the surrounding will be misplaced, as if it's skip 1 terrain.. please see below image.
    I wonder if this is only happened to me, or is there some one else addressed this issue already?

    upload_2021-1-28_11-51-43.png
     
  4. Refeas

    Refeas

    Joined:
    Nov 8, 2016
    Posts:
    192
    Hey @Wright,
    downloaded latest master from your GitLab to test the new functions/expose setup beforehand. Here is some feedback:
    1. Unexposing values doesn't remove them from the function node sometimes.
    2. When I expose some value and don't override it, it is considered as 0. For example, I exposed Cell Size in Voronoi which value vas 20. I left the exposed value as 20 without change but I got errors in the console that the cell size is zero. As soon as I updated the exposed value to say 21, or back to 20 again, it started working.
    3. I can't change the default value after I expose it - for example, I expose Size in Noise which was 200. Once I expose it, I can't change the default value. There shoudl also be a way in the Function node to reset a specified value to its default.
    4. When I right click into some field, it shows default context menu with Cut and Copy, which si fine, but it also opens the MM2 Add node menu.
    5. The search field in Add node menu is nice, but it has white text on white background when Unity is running in dark mode.
    6. When I create a simple setup with 1 main graph and 2 biomes in BIome Set, I get these exceptions upon generation:
    Code (CSharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. MapMagic.Products.TileData.AllOutputsReady (MapMagic.Nodes.Graph graph, MapMagic.Nodes.OutputLevel level, System.Boolean inSubs) (at Assets/mapmagic-master/Products/TileData.cs:213)
    3. MapMagic.Terrains.TerrainTile.SwitchLod () (at Assets/mapmagic-master/Terrains/TerrainTile.cs:144)
    4. MapMagic.Terrains.TerrainTile.StartGenerate (MapMagic.Nodes.Graph graph, System.Boolean generateMain, System.Boolean generateLod) (at Assets/mapmagic-master/Terrains/TerrainTile.cs:582)
    5. MapMagic.Core.MapMagicObject.StartGenerate (System.Boolean main, System.Boolean draft) (at Assets/mapmagic-master/Core/MapMagicObject.cs:283)
    6. MapMagic.Core.GUI.MapMagicInspector.DrawGUI () (at Assets/mapmagic-master/Core/Editor/MapMagicInspector.cs:188)
    7. Den.Tools.GUI.UI.Draw (System.Action drawAction, System.Boolean inInspector, UnityEngine.Rect customRect) (at Assets/tools-master/GUI/Editor/UI.cs:246)
    8. MapMagic.Core.GUI.MapMagicInspector.OnInspectorGUI () (at Assets/mapmagic-master/Core/Editor/MapMagicInspector.cs:95)
    9. UnityEditor.UIElements.InspectorElement+<>c__DisplayClass58_0.<CreateIMGUIInspectorFromEditor>b__0 () (at <1b64b06f536e44ebb2ace8cd6da8538a>:0)
    10. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
    Now some feedback not related to 2.1.0 directly. Would it be possible to align MM2's workflow with other node based tools, as in:
    1. Let us rectangle-select nodes without having to hold shift.
    2. Clicking a single node should highlight it without needing to hold shift. Holding shift and clicking nodes could stay as is.
    Etc.

    You could check ShaderGraph for example. But other node-based tools follow the same principles, it would be nice if MM did the same. :)

    Thanks!
     
  5. lj_jl

    lj_jl

    Joined:
    Dec 18, 2020
    Posts:
    2
    Hi @Wright , i dont know if it's a bug or a logical limitation, but i found that when using MapMagic with VS PRO MapMagic can only write to a single RGBA-Texture buffer.

    If i add a new Texture buffer in VS PRO, MapMagic uses the new one to write to - even if the VS PRO MAP-node in the graph still has the first one selected.

    This limits texture based spawning rules to 4 rules and i would like to know if it's intended or if i am doing something wrong or if its a bug i should talk to the VS PRO guys about it?
     
  6. rillani

    rillani

    Joined:
    Dec 16, 2020
    Posts:
    6
    In Spline, I keep getting the error "WeldCloseLines reached maximum iterations"

    Thread failed: System.Exception: WeldCloseLines reached maximum iterations​
    at Den.Tools.Splines.SplineSys.WeldCloseLines (System.Single threshold) [0x00109] in F:\Unity\MapMagicEnviro HDRP\Assets\MapMagic\Tools\Spline\SplineSys.cs:243
    at MapMagic.Nodes.SplinesGenerators.WeldClose200.Generate (MapMagic.Products.TileData data, MapMagic.Products.StopToken stop) [0x0003a] in F:\Unity\MapMagicEnviro HDRP\Assets\MapMagic\Generators\Splines\Runtime\SplinesGenerators.cs:670
    at MapMagic.Nodes.Graph.GenerateRecursive (MapMagic.Nodes.Generator gen, MapMagic.Products.TileData data, MapMagic.Products.StopToken stop) [0x00143] in F:\Unity\MapMagicEnviro HDRP\Assets\MapMagic\Nodes\Graph.cs:778
    at MapMagic.Nodes.Graph.GenerateRecursive (MapMagic.Nodes.Generator gen, MapMagic.Products.TileData data, MapMagic.Products.StopToken stop) [0x00035] in F:\Unity\MapMagicEnviro HDRP\Assets\MapMagic\Nodes\Graph.cs:750
    at MapMagic.Nodes.Graph.GenerateRecursive (MapMagic.Nodes.Generator gen, MapMagic.Products.TileData data, MapMagic.Products.StopToken stop) [0x00077] in F:\Unity\MapMagicEnviro HDRP\Assets\MapMagic\Nodes\Graph.cs:757
    at MapMagic.Nodes.Graph.Generate (MapMagic.Products.TileData data, MapMagic.Products.StopToken stop) [0x00039] in F:\Unity\MapMagicEnviro HDRP\Assets\MapMagic\Nodes\Graph.cs:732
    at MapMagic.Nodes.Biomes.Function200.Generate (MapMagic.Products.TileData data, MapMagic.Products.StopToken stop) [0x000e0] in F:\Unity\MapMagicEnviro HDRP\Assets\MapMagic\Generators\Biomes\Runtime\Function.cs:211
    at MapMagic.Nodes.Graph.GenerateRecursive (MapMagic.Nodes.Generator gen, MapMagic.Products.TileData data, MapMagic.Products.StopToken stop) [0x00143] in F:\Unity\MapMagicEnviro HDRP\Assets\MapMagic\Nodes\Graph.cs:778
    at MapMagic.Nodes.Graph.GenerateRecursive (MapMagic.Nodes.Generator gen, MapMagic.Products.TileData data, MapMagic.Products.StopToken stop) [0x00035] in F:\Unity\MapMagicEnviro HDRP\Assets\MapMagic\Nodes\Graph.cs:750
    at MapMagic.Nodes.Graph.GenerateRecursive (MapMagic.Nodes.Generator gen, MapMagic.Products.TileData data, MapMagic.Products.StopToken stop) [0x000bf] in F:\Unity\MapMagicEnviro HDRP\Assets\MapMagic\Nodes\Graph.cs:763
    at MapMagic.Nodes.Graph.GenerateRecursive (MapMagic.Nodes.Generator gen, MapMagic.Products.TileData data, MapMagic.Products.StopToken stop) [0x00077] in F:\Unity\MapMagicEnviro HDRP\Assets\MapMagic\Nodes\Graph.cs:757
    at MapMagic.Nodes.Graph.Generate (MapMagic.Products.TileData data, MapMagic.Products.StopToken stop) [0x00039] in F:\Unity\MapMagicEnviro HDRP\Assets\MapMagic\Nodes\Graph.cs:732
    at MapMagic.Terrains.TerrainTile.Generate (MapMagic.Nodes.Graph graph, MapMagic.Terrains.TerrainTile tile, MapMagic.Terrains.TerrainTile+DetailLevel det, MapMagic.Products.StopToken stop) [0x0004b] in F:\Unity\MapMagicEnviro HDRP\Assets\MapMagic\Terrains\TerrainTile.cs:679
    at MapMagic.Terrains.TerrainTile+<>c__DisplayClass39_0.<StopEnqueueTask>b__0 () [0x00000] in F:\Unity\MapMagicEnviro HDRP\Assets\MapMagic\Terrains\TerrainTile.cs:632
    at Den.Tools.Tasks.ThreadManager.TaskThreadAction (Den.Tools.Tasks.ThreadManager+Task task) [0x00000] in F:\Unity\MapMagicEnviro HDRP\Assets\MapMagic\Tools\ThreadManager\ThreadManager.cs:133
    UnityEngine.Debug:LogError (object)
    Den.Tools.Tasks.ThreadManager:TaskThreadAction (Den.Tools.Tasks.ThreadManager/Task) (at Assets/MapMagic/Tools/ThreadManager/ThreadManager.cs:136)
    System.Threading.ThreadHelper:ThreadStart ()
     
  7. nobluff67

    nobluff67

    Joined:
    Nov 3, 2016
    Posts:
    338
    I have a question about splines that you can hopefully help me with.

    I am struggling to combine both stamp and stroke into the same graph, is this possible? If yes can you give a quick explanation, written example is fine e.g. node a into node b, into stamp, etc

    Edit: I think I have it, just not sure if this is the recommended way:

    Screenshot 2021-01-29 150202.png
     
    Last edited: Jan 29, 2021
  8. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,227
    I really don't know what it is. If it's moving with the camera then it's probably not related with MM tiles, but I can't say for sure. Could you please email me a scene, a graph and it's meta file so I could look into it?

    (A description of the issue in email will also come in handy - more handy than mentioning post on forums. I will need only 3 files. There's no need to send models or other assets. I will appreciate if you don't compile the unity package with the dependencies).

    Checking "Around Objects Tagged" will treat objects with these tags as a camera and will generate the terrain around them. Using MM here will always keep tiles around MM position itself, zero in most cases. It doesn't make much sense of doing it.

    It will take 8 Mb to store a heightmap, and 4 Mb for each of the control maps channels - i.e. the splat texture masks. The same amount for grass/types, and can't say for sure for trees. If you are using 4 terrain textures and 4 grass types you'll get 8+16+16Mb.

    Thanks for downloading and testing the upcoming version! I really appreciate you could find these issues, and I'm adding your entire post to my to-do list.

    I'll think of switching to single-click selection in graph settings, however can't promise it in 2.1.0.

    I remember I was already fixing this... Are you sure that you are using the latest version (2.0.8)? If so I've got to look into it once again.

    I plan to completely switch the splines engine for splines final version, so I'm not sure it will be reproducible here, but thanks for reporting it anyways!

    Yes, it is exact way the demo graph, SimpleGraphSplines is made:
    SplineStrokeStamp.jpg
     
    protopop and nobluff67 like this.
  9. nobluff67

    nobluff67

    Joined:
    Nov 3, 2016
    Posts:
    338
    @Wright

    I am not sure if I am misunderstanding what this code is used for, but I cant get it to work as I don't know what the mm reference should be?

    What is mm in the code below?
    e.g. public MapMagic mm ?

    What using reference do I need?

    Code (CSharp):
    1. void Start()
    2. {
    3. mm.seed = newSeed;
    4. mm.enabled=true;
    5. }
    6.  
    All I want to do is randomize the seed in the starting noise for a map:

    Screenshot 2021-01-31 171039.png
     
  10. mrnas

    mrnas

    Joined:
    Jan 13, 2018
    Posts:
    15
    hey

    Can anyone give me a quick hint of
    how to best to start using Map Magic to spawn Voxelland Maps?
     
  11. zrocweb

    zrocweb

    Joined:
    Dec 19, 2016
    Posts:
    43
    Was wondering, @Wright Dennis, or anyone else that has tried and/or using @jimmygladfelter 's zonemanger tool, that might have a solution to get zoneinfo for pinned terrains. Currently, if you pin one or more terrains, even though both zonemanager and zonetile executeineditmode, the zoneinfo created in editor is not saved with the scene or terrain object (zoneTile) with the terrain data. So if you spawn a player or traverse a player onto a pinned terrain it will resort to a "Default" zone as it's zonename when in fact it's not. I've done extensive testing and re-working of the code to try to get the pinned info, but to no avail have not been able to get it. Anyone?
     
    Last edited: Feb 3, 2021
  12. MauriceM

    MauriceM

    Joined:
    Jul 23, 2015
    Posts:
    6
    Good day,

    I was wondering if there is a way to use splines from outside the generator for the spline nodes inside the generator, or if the splines have to be created within the generator?
    Alternatively, can I feed the generator a series of Vector3 points to create a spline?

    Have a nice day.
     
  13. nobluff67

    nobluff67

    Joined:
    Nov 3, 2016
    Posts:
    338
    @Wright I am getting this error after I upgraded to 2020.2 from 2019.4

    It ONLY happens after second time I press play on my scene. In order to remove error I have to "initialize persistent storage" (using Veg Pro), however on the second play the error returns.

    EDIT: I started a new scene, all is ok so it seems like its something in my original scene that is the issue.

    EDIT EDIT: After reloading scene, everything working. I just don't understand Unity sometimes.
     
    Last edited: Feb 2, 2021
    zrocweb likes this.
  14. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,227
    Where this code comes from? Probably `mm` might mean a MapMagic object, but v2 has no `seed` value, it's stored in graph.

    If you want to change the seed at starting a game it's better use this in Start/Awake/OnEnable:
    Code (CSharp):
    1.  
    2. mapMagic.graph.random = new Noise(seed, permutationCount:32768);   //32768 is initial permutation num for MM noise
    3.  
    Keep no tiles pinned (otherwise they won't connect with new tiles with new seed).
    This script is changing your graph (seed value) every start, this value is stored in graph asset.
    Make sure that 'MapMagic' and 'Den.Tools' namespaces are used.
    Here is the example script.

    I don't recommend changing the generator values while playmode. Can't guarantee that it will work in build.

    Wait until newer Voxeland version :) I have some files, but yet can't even estimate on when it will be released. Unfortunately currently MM2 is not compatible with Voxeland.

    Just answering because you've mentioned me: unfortunately I can't help with that, I haven't looked into ZoneManager system yet.

    Yes, you can use Positions generator to scatter objects with manually set coordinates. Don't know about the splines - it depends on what exactly do you mean under the splines and in what format do you have them.

    If you reproduce this issue again I will appreciate if you let me know of how to do that. I'm up for looking into it.
     
  15. MauriceM

    MauriceM

    Joined:
    Jul 23, 2015
    Posts:
    6
    I have generated a list of Vector3 points in an external script at runtime and wanted to use this set of points to generate a path on the terrain.
    I just haven't figured out whether external scripts can pass variables to an MM2 generator.
     
  16. arturmandas

    arturmandas

    Joined:
    Sep 29, 2012
    Posts:
    240
    Is it possible to import an entire height map and color maps for full terrain or as stamps?
     
  17. topofsteel

    topofsteel

    Joined:
    Dec 2, 2011
    Posts:
    999
    Image Mask

    Similar to the previous post, I'd like to be able to start with a black and white image as a mask to define the general shape of the map. I believe there was a node for that in Map Magic 1. Is this possible? Thanks.
     
  18. Padawaan

    Padawaan

    Joined:
    Feb 3, 2019
    Posts:
    7
    Wright and topofsteel like this.
  19. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,227
    You can get a generator by it's number in graph array:
    mapMagicObject.graph.generators[42]

    However it's hard to say what node number has the node you are going to change - at least if it's not the first node ()or the last one). And it's not a reliable way - this number might change on generator remove.

    I'll think of adding a special function to get it by it's id (in 2.1.0 each node will have a unique number) or something. There really should be a reliable and convenient way to access the nodes.

    Anyways, if you could get a node this way you can change the `positions` variable to assign your own array.

    Exactly. You can use Matrix Asset to import texture or RAW heightmap and Import node in a graph.
     
  20. daspete01

    daspete01

    Joined:
    Aug 19, 2015
    Posts:
    14
    Hi there,

    thank you for your nice asset, it makes my development of a nearly endless map very easy.

    I came from MM1 and starting now with MM2 and i have a strange behaviour...

    I am using the Universal Render Pipeline.

    When i build the game, all (in the editor) pinned tiles are looking good. But when i get into regions, which were pinned as a draft tile, or which weren't pinned, then the grass is getting weird, they are just white planes....

    also, in the built version, when i run into previously pinned as draft regions, there is no generation of grass, objects or trees... there is just the plain terrain...

    What can i do here?

    2021-02-05 08_49_38-A way to light [Prototype-URP].png
     
  21. topofsteel

    topofsteel

    Joined:
    Dec 2, 2011
    Posts:
    999
    I'm getting grid artifacts from an imported RAW image. The image is set up per the specs indicated on inspector. How can I resolve this? Thank you.

    Map-Magic-2-grid.png
     
  22. RakNet

    RakNet

    Joined:
    Oct 9, 2013
    Posts:
    313
    If I already have biomes setup with map magic 1, can I use them with map magic 2?
     
  23. valentinwinkelmann

    valentinwinkelmann

    Joined:
    Nov 3, 2014
    Posts:
    186


    Nice try to kill me by epeleptic seizures lol....

    MicroSplat works beautifully on normal Unity terrain. Error only occurs ( as always so far ) with MapMagic. Seems like the integration to MicroSplat has significantly degraded.

    The product description of course still says: "Out of the box compatibility with: CTS, MegaSplat, MicroSplat, Vegetation Studio Pro."

    The documentation entry is still blank.
    https://gitlab.com/denispahunov/mapmagic/-/wikis/MatrixGenerators/MicroSplat

    I'll send the test project to you as a PM.

    MapMagic 2.0.8
    MicroSplat 3.64
    MicroSplat HDRP 3.611
    Unity 2020.2.3f1 HDRP
    HDRP 10.3.1

    Edit:
    If I deactivate Draw Instanced in "Terrain Properties" the error disappears. However, this is not a solution, because this goes heavily on the performance. I will temporarily use it in Non Instanced mode, please fix this.
     
    Last edited: Feb 8, 2021
  24. jessejarvis

    jessejarvis

    Joined:
    Aug 9, 2013
    Posts:
    303
    Lmfao I guess Unity should come with a warning. Bugs may cause events leading to but not limited to epileptic episodes.
     
    valentinwinkelmann likes this.
  25. topofsteel

    topofsteel

    Joined:
    Dec 2, 2011
    Posts:
    999
    I'm getting an error when publishing to WebGL. What are the steps necessary to publish to WebGL? Thanks.

    Screenshot 2021-02-08 061027.png
     
  26. ElevenGame

    ElevenGame

    Joined:
    Jun 13, 2016
    Posts:
    143
    @topofsteel I think you have to disable the MM2 native plugin in the Options window. That one cannot run in WebGl.
     
    topofsteel likes this.
  27. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,227
    When you were trying MicroSplat on a standard Unity terrain, did it have Draw Instanced enabled in terrain settings?

    Anyways, MicroSplat has changed recently, maybe there's something that causes this kind of issue. I'll look into it.

    Thanks for sharing your project. I will appreciate if you could just mention what modules are you using, so I could reproduce it in a work project and downloaded yours just if it's not possible.

    That's right, on some platforms native code is not supported - try disabling it in MM by turning off C++ Native Code in Window - MapMagic - Settings.
     
  28. moltke

    moltke

    Joined:
    Apr 28, 2019
    Posts:
    109
    anyone know why I might be getting these errors when i download map mapgic? upload_2021-2-8_22-45-33.png
     
  29. Mauri

    Mauri

    Joined:
    Dec 9, 2010
    Posts:
    2,658
    Check your
    API Compatibility Level
    (Edit > Project Settings, under Player), maybe?

    I've had read about other people fixing these errors by using ".NET 4.x" instead of ".NET Standard 2.0".
     
  30. slythethieve

    slythethieve

    Joined:
    Aug 2, 2019
    Posts:
    3
    Hi guys, I'm planning to use this asset for my RTS Game / City Builder. Is it possible to make parts of the terrain (below/above a certain height) completely flat? So I could have mountains and the rest of the terrain to be flat. I have tried doing it myself but I'm not quite sure how.
     
  31. RakNet

    RakNet

    Joined:
    Oct 9, 2013
    Posts:
    313
    If I already have biomes setup with map magic 1, can I use them with map magic 2?
     
  32. RakNet

    RakNet

    Joined:
    Oct 9, 2013
    Posts:
    313
    I mean if I want to upgrade to Map Magic 2 from Map Magic 1, do I need to update/redo my prior work or is it compatible without changes?
     
  33. slythethieve

    slythethieve

    Joined:
    Aug 2, 2019
    Posts:
    3
    Don't worry I've done it.
     
  34. slythethieve

    slythethieve

    Joined:
    Aug 2, 2019
    Posts:
    3
    Another question, how does the Whittaker node work exactly? Let's say I want to mimic the biomes found in the USA. How could I achieve this? Thx.
     
  35. mick129

    mick129

    Joined:
    Jun 19, 2013
    Posts:
    228
    Just reporting a bug.

    I crash 100% of the time when I use an imported heightmap and try to raise the resolution to 1025. The crash always happen when I'm near to finish the loading.

    You can reproduce it on creating a new import using an image (either average or greyscale) then build the map at this resolution.

    upload_2021-2-9_14-56-4.png
     
  36. moltke

    moltke

    Joined:
    Apr 28, 2019
    Posts:
    109
    thank you for the advice but i still get errors upload_2021-2-9_19-11-47.png
     
  37. valentinwinkelmann

    valentinwinkelmann

    Joined:
    Nov 3, 2014
    Posts:
    186

    Okay I tested it. you are right with your assumption, the error also occurs with MicroSplat without MapMagic when the terrain is instantiated. I had overlooked this because the Unity Terrain is set by default as not instantiated. I will ask Jason what it is all about.
     
  38. JohnnyFactor

    JohnnyFactor

    Joined:
    May 18, 2018
    Posts:
    343
    I thought the Adjust node would rotate objects on all 3 axis but that doesn't seem to be the case. How can I distribute objects like rocks and randomize orientation?
     
  39. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,227
    Odd thing, I'm using .NET Standard 2.0 and it seems to be working. What is your OS, Unity version and build platform?

    Yes, Adjust node modifies only yaw. I can make a 'uniform' checkbox in it, that works when Random Range is enabled - unchecking it will use new random numbers for each rotation and scale axis. Will it do the trick?
     
  40. JohnnyFactor

    JohnnyFactor

    Joined:
    May 18, 2018
    Posts:
    343
    Ideally, everything should be broken out to 3 separate axis at all times. I know it looks like a lot but there's no functional reason to hide things or limit choices. Maybe collapse each transform group so it's not a huge jenga tower but otherwise, this would fulfill all current and future needs.

    In the meantime, I wrote a script that fulfills this same functionality so I'm in no hurry but this should be considered for the future, unless it gets pushback from other users.

    adjust.jpg
     
    Wright likes this.
  41. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,227
    Hmm, good idea. However what if user wants rotation to be non-uniform, but wants uniform scale (like in the case you've mentioned with the stones)? He will probably set the scale ranges to be the same, but it won't make the same values since each channel will be generated randomly. Is there any way to solve this?
     
  42. JohnnyFactor

    JohnnyFactor

    Joined:
    May 18, 2018
    Posts:
    343
    I'm a bit confused by this and maybe I'm misunderstanding so I made an example.

    - Rotation is random from 0-359 on Y and random from -10 to 10 on X and Z. This creates a "wobbling top" sort of look.
    - Scale is random from 0.8 to 1.2 on all axis to give some variation.
    - Position is locked to 0 on X and Z but random from 3.0 to 4.5 on Y to give it extra height variation.
    - I'm assuming local transform for rotation and scale, and global transform for position.

    adjust2.jpg adjust_current.jpg
     
  43. RakNet

    RakNet

    Joined:
    Oct 9, 2013
    Posts:
    313
    Why is it so hard to get an answer to this question?
     
  44. ElevenGame

    ElevenGame

    Joined:
    Jun 13, 2016
    Posts:
    143
    @RakNet you would have to redo things. There are a couple of differences between the two versions which make them incompatible..
     
    Wright and RakNet like this.
  45. nobluff67

    nobluff67

    Joined:
    Nov 3, 2016
    Posts:
    338
    Does anyone use next-gen-soft-shadows with MM2? Asked the developer and they say it should be fine as long as If MapMagic does not modify shadows, or need LightShadowsData. Does MM2 do or need any of that?
     
  46. JohnnyFactor

    JohnnyFactor

    Joined:
    May 18, 2018
    Posts:
    343
    I tried it and it seemed to work. I couldn't get very soft shadows but that was probably user error.
     
    nobluff67 likes this.
  47. jskentzos

    jskentzos

    Joined:
    Jan 1, 2021
    Posts:
    1
    is there an easy way to generate a navmesh from a MM generated terrain? I'm trying to use MM to create some nicer maps for an RTS game where all the units move via navmesh agents.
     
    MasonWheeler and Giantsmall like this.
  48. Giantsmall

    Giantsmall

    Joined:
    Apr 28, 2019
    Posts:
    17
    How can i get any generator output?
    Here is how i tried it:
    var randomGens = mmo.graph.generators.Where(g => g.GetType() == typeof(Random207)).ToList().ConvertAll(g => (Random207)g).ToList();
    var data = mmo.tiles.grid.First().Value.main.data.products[randomGens.First()];

    Unfortunately most props in DetailLevel objects is null:
    upload_2021-2-13_12-44-9.png
     

    Attached Files:

  49. MasonWheeler

    MasonWheeler

    Joined:
    Apr 2, 2016
    Posts:
    210
    I'm having the same problem. No matter whether I use Unity's built-in Navigation tab or the NavMesh Surface from the Github components, when I go to bake the NavMesh, nothing shows up (it should generate a blue overlay in the Scene view) and when I run, the agent can't find the NavMesh.

    What's going wrong here, and how do I fix it?
     
  50. Padawaan

    Padawaan

    Joined:
    Feb 3, 2019
    Posts:
    7
    I'm not pro, but I guess you'll have to wait for the geometry to be generated before you can create the navmesh. You should try to bake it at runtime, after MapMagic is done generating. (Maybe with the Action<TerrainTile, TileData, StopToken> TerrainTile.OnTileApplied ?)

    Baking navmeshs on the fly along infinite terrain stream would probably be harder. Last time I've used unity's navmesh, it wasn't friendly for runtime operations and functions like baking, merging and updating parts of the navmesh weren't implemented.