Search Unity

  1. Get the latest news, tutorials and offers directly to your inbox with our newsletters. Sign up now.
    Dismiss Notice

[RELEASED] MapMagic 2 - infinite procedural land generator

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

  1. mukki014

    mukki014

    Joined:
    Jul 30, 2017
    Posts:
    148
    Hi thank you for writing the solution. I will try this and let you know.

    Also I know it is off thread topic. But I'm experiencing an error during build 'Unity linker error' in unity 2019.4. My build platform is Android x64 using ilcpp. I used to solve this in unity 2018 by running unity as an administrator but it's not possible in unity 2019 as we use hub now. So are you aware of this build error? I've tried Google. Thank you once again.
     
  2. FlightOfOne

    FlightOfOne

    Joined:
    Aug 1, 2014
    Posts:
    460
    I have yet to build with MM2 also I am PC (not android build) and Unity 2020.x. I might do a build tomorrow though, will share if I get errors.
     
  3. Zoryth

    Zoryth

    Joined:
    Dec 5, 2016
    Posts:
    85
    How do I make a biome that lowers the terrain (So I can put water there basically). I tried every option, intensity negative, etc. Couldn't make it work. The biome adds more height but never substracts. I even put "Substract" in the blend but that didn't work and pretty sure that's how biomes are substracted one from the other not the height of the terrain, right?.
     
  4. mukki014

    mukki014

    Joined:
    Jul 30, 2017
    Posts:
    148
    I've talked about that in its own forum. I had to switched back to mono backend. It work for it. Well I tested your idea about using height map. I just had to duplicate some default MM2 import asset for making my own heightmap. Thank you again.
     
    FlightOfOne likes this.
  5. Antiox

    Antiox

    Joined:
    Jan 27, 2016
    Posts:
    1
    Hi,

    I recently bought the complete bundle and wanted to try out the brush tools.
    I created a terrain, added the Map Magic Brush script on the terrain, and selected one of the brush preset included with the asset.
    The problem is that I have a bunch of exception when selecting any of the included brush preset :


    In addition to that, I can't open the graphs, nothing is happening when clicking on "open" :



    Am I doing something wrong or is that a known bug ?
    Thanks.
     
  6. mukki014

    mukki014

    Joined:
    Jul 30, 2017
    Posts:
    148
    Hi about the build error on Android. I switched back to mono backend. But I'm experiencing a strange bug related to map magic 2. So with same settings everything is same graph and everything. In editor and in playmode. Map magic generate infinite terrain using import node (set as clamp ) but the same scene when build in Android and I play only one tile is present. Other tiles are flat. Do you know the reason? Or should I change the scale and other setting? Thank you anything will help.
     
  7. Roan-Albers

    Roan-Albers

    Joined:
    Jan 28, 2013
    Posts:
    5
    image (2).png

    In code we try to generate 1 main tile and 8 surrounding drafts. But it also happens when we click the drafts quickly in succession before 1 has completed generating.
     
  8. Refeas

    Refeas

    Joined:
    Nov 8, 2016
    Posts:
    184
    Hey @Wright,
    I wanted to ask if it would be possible to add an option to not change the Vegetation Studio Package in all VS Pro Objs/Masks nodes when changin it in a specific node? This would allow us to use multiple VS packages easily, because if you have a lot of different biomes, being forced to have all vegetation in a single package is a nightmare to manage. Maybe add a button "Apply package to all VS nodes" instead of forcing it automatically? This would help a lot and I've seen it requested many times.

    Thanks!
     
  9. FlightOfOne

    FlightOfOne

    Joined:
    Aug 1, 2014
    Posts:
    460
    Sorry can't help you with Android stuff, I have no clue of Android. But the reason the tiles are flat is because you have it set as clamp. Clamp means it clamps after that area (what raw file gives). What you want is ping-pong. That will seamlessly repeat your height map.
     
    mukki014 likes this.
  10. mukki014

    mukki014

    Joined:
    Jul 30, 2017
    Posts:
    148
    No problem. But still thank you for helping me. I've made new project using standard pipeline. Do you have any tips for microsplat for working with map magic 2. I've already setup the material and it's working. But if any tip you want to give will be helpful.
     
  11. FlightOfOne

    FlightOfOne

    Joined:
    Aug 1, 2014
    Posts:
    460
    I am still trying to figure microsplat and mm2 out but it has not been a pleasant experience so far. Not fault of either MM or Microsplat alone but together it hasn't been working too well for me. I think I am going to finalize my terrain first then apply microsplat. As shown here:
     
    mukki014 likes this.
  12. mukki014

    mukki014

    Joined:
    Jul 30, 2017
    Posts:
    148
    Well I've already get it working from the beginning. If you want I can help you with that. And thank you for the tips. Let me know if you want. What problem you are facing?
     
  13. mukki014

    mukki014

    Joined:
    Jul 30, 2017
    Posts:
    148
    @FlightOfOne Hi friend. I'm experiencing a strange bug. So I tested default map magic scones. They seem to work. And generate infinite terrain. Also sometime I got an error empty weld terrain. I don't know what's wrong with my graph. Is there some specific setting like I want to have 257 resolution of heightmap so is there some setting that I should set for main margin and so on to a relative number.
     
  14. mukki014

    mukki014

    Joined:
    Jul 30, 2017
    Posts:
    148
    @Wright Hi I'm using map magic 2 core free version. And I'm experiencing a bug or issue. When I use import node and set it to 'ping pong ' mode so terrain seems to generate infinitely in editor. But when I build it (my platform is Android using Unity 2019.4 LtS ) so terrain doesn't generate infinitely. Then I've tested the demo scene so it work fine on my Android device. But it doesn't works when using import node. Thank you. Please help me it giving me headache as I'm tired of iterating and changing the scene in hope that it will work this time. Thank you again.
     
  15. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,943
    Unfortunately I have no plans for Polaris integration. Try adding this proposal to ideainformer - if it will get more votes than RAM it will be the next asset to integrate.

    I've had a Whittaker demo scene, but for some reason it's not included in final assembling. Will try to find why and check if it's working.

    Yes, there could be a problem with Unity package manager. Here is a description of an issue in this thread (don't remember who it was, but thanks!)
    It's not clear from the video what's happening on pressing the play button, but probably it's still seed serialization error that was fixed. Try updating removing older packages.

    I guess Import node is exactly what you are looking for.

    Try using biomes with different height values: use average height at level 10 for sea, at level 100 for plains, and 250 for mountains. This way if you gradually blend sea with the plains the height level will gradually change as well.

    There is no thing like "subtractive biome" since all of the biome graphs are supposed to work independently assigned to MM directly. And you cannot lower the height level below 0 to make such a negative biome height. So treat the value of 50 as your game water level.

    No, it's not a known bug, but I got your email and will try to help you you with that.

    Is anyone else experiencing this error?

    Odd thing, MM does about the same when pinning with a frame. Are you running this code in editor or in playmode? Could you please paste it as a text?

    Empty weld terrain? If you mean empty tile then I will appreciate if you could find more or less reliable way to reproduce it. I've heard about this issue, but can't repeat it.

    Might be related with Android trying to use native code. Could you please try disabling "C++ Native Code" in Windows - MapMagic - Settings to find out if it will make the editor and build import the same?
     
    Last edited: Apr 27, 2021
    protopop and mukki014 like this.
  16. FlightOfOne

    FlightOfOne

    Joined:
    Aug 1, 2014
    Posts:
    460
    What approach do you guys use for pathfinding in map magic terrains? Can the unity navmesh or A* (from Aron) be used for this?
     
  17. mukki014

    mukki014

    Joined:
    Jul 30, 2017
    Posts:
    148
    You can use the asset called procedural spawner. They might have something in it. Also I've a workaround you can create sort non dynamic or pinned terrain and lock them then you can do what you want. Even add spawner in those terrains so whenever player enters in that area enemy will spawn. For finding that specific location on those locked terrain you can use another asset like hud navigation system so player can easily navigate or travel to the marker. Hope that's help thank you.
     
  18. mukki014

    mukki014

    Joined:
    Jul 30, 2017
    Posts:
    148
    @Wright thank you for a quick response. I will try to disable the C++ code. But it only happen when I use import node. As I've tested the default scenes. They seem to work. But Disabling C++ method I will try and let you know. Thanks once again.

    [Edited]
    @Wright so I tried Disabling the C++ code from setting and made a quick scene. But it doesn't seems to work either.
     
    Last edited: Apr 28, 2021
  19. Zoryth

    Zoryth

    Joined:
    Dec 5, 2016
    Posts:
    85
    Thank you.
     
  20. Refeas

    Refeas

    Joined:
    Nov 8, 2016
    Posts:
    184
  21. FlightOfOne

    FlightOfOne

    Joined:
    Aug 1, 2014
    Posts:
    460
    I am looking to implement my own AI, I am looking specifically for path finding only. But I will take a look at this, maybe it will give me some ideas. Thanks!

    EDIT: It seems that A* Pathfinding by Aron can be used for this.
     
    Last edited: Apr 28, 2021
  22. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,943
    Could you please check if editor version now generates the same result as the build one? If it is really so and you have no repeating import details in editor as well as in build - could you please send me the data?
    To reproduce the issue I need a scene, a graph and it's meta file. I will need only 3 files (with 3 metas). There's no need to send models or other assets. I will appreciate if you don't compile the unity package with the dependencies.

    A description of the issue in email will also come in handy - way more handy than mentioning post on forums.

    Sorry for missing the post, but unfortunately I've got nothing to cheer you up. The package is applied in the finalize stage that is executed not per generator, but once for all VS output nodes. It's not just a GUI limitation.
     
  23. Refeas

    Refeas

    Joined:
    Nov 8, 2016
    Posts:
    184
    Well, either way, it's very limiting. Working even with tens of vegetation items is very tedious and difficult to manage. I believe VSPro APIs allow to retrieve the package's IDs (or indices), so you could pass that data around and fetch the appropriate package at the final stage for specific nodes.
     
  24. unity_IpxdANggCs1roQ

    unity_IpxdANggCs1roQ

    Joined:
    Feb 19, 2018
    Posts:
    31
    Node offset doesn't make any changes for almost all nodes in my environment. Is this a bug? or am I wrong?
    mm2offsetnotwork.PNG

    And I often encounters Thread failed Errors when I'm editing map magic graphs and Terrains are not correctly updated.
    mmError.png
    How can I fix this? (Windows 10, Unity 2020.3.5f1, Version 2.14, Ryzen7 3700x, 32GB)
     
    Last edited: Apr 29, 2021
  25. FlightOfOne

    FlightOfOne

    Joined:
    Aug 1, 2014
    Posts:
    460
    @Wright

    Hi Denis, do you have any practical tips for eliminating these gaps?
    upload_2021-4-29_9-24-18.png upload_2021-4-29_9-25-28.png
    I tried increasing the margins sometimes they work but most of the time it doesn't and worst of all increasing makes generation incredibly slower.

    Gab is worse between drafts and the main more than draft-draft or main-main.

    I read somewhere that the nodes that we use may be contributing to this. Is this true? if so what nodes/parameters?


    P.S. I still need to email you the stuff with the Microsplat, and I will do so when I get back to that part. Also do you prefer emails over forum? Because I have emailed you several times but I never got a response, so I figured you probably prefer the forum. Let me know, I am happy to email, it is easier for me too.

    Thanks!
     
  26. FlightOfOne

    FlightOfOne

    Joined:
    Aug 1, 2014
    Posts:
    460
    One more! I recently bought the brush and just started using it. Every time I add, select, deselect, or draw on the Map Magic Brush script I get these errors.
    upload_2021-4-29_10-5-12.png
     
  27. moltke

    moltke

    Joined:
    Apr 28, 2019
    Posts:
    54

    thank you very much this fixed my problems
     
    protopop likes this.
  28. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,943
    This means that for some reason the draft tile is trying to generate twice. Is there any way I can reproduce this error? Could you please send me the scene and the graph?
    I will need only 2 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.

    A description of the issue in email will also come in handy - way more handy than mentioning post on forums.

    This offset is measured in world units. Making it half a meter can hardly produce a noticeable result, could you please try to increase the offset value?

    The drafts should not be welded to the main tiles since they have a different resolution. However they are creating seams that are visible only from the draft tiles themselves, where the player is not supposed to be. These seams are not visible from the main tiles:
    DraftSeams2.jpg DraftSeams3.jpg

    That sounds serious! I always try to answer, might be missing something - but not several emails. What were the dates you emailed? Were you using Cyrillic headers in your emails?

    Has someone else got unanswered emails to me?

    Actually I prefer ideainformer to report issues and ideas - it's a special service that allows me to track tickets, keep things organized and gather issues/ideas statistics (like how many users do agree with a ticket). It also automatically duplicates all of the ticket change to my email, so I'm aware of all the changes here.

    Could you please describe the steps to reproduce this issue? Like:
    - start new scene;
    - create new terrain;
    - add Brush component;
    - assign preset X;
    - etc.

    Glad you could sort that out!
     

    Attached Files:

    protopop likes this.
  29. FlightOfOne

    FlightOfOne

    Joined:
    Aug 1, 2014
    Posts:
    460
    @Wright Hi Denis (or is it Dennis, here and your email name is Dennis, but on asset store it is Denis?)

    Thanks for the response. Ok, now it makes perfect sense about the draft.

    About the emails, it was my email system, not you, I apologize!

    I went back and checked all my folders (I use office 365) and you had indeed responded to my last on the same day. It had gone into my junk folder and I never found it when I searched for it because I searched for "Denis" because your email showed up as "Dennis". I have a feeling it was the same fate that happened to previous emails. I never bothered to mention this to you because you had answered those questions on the forum. But yea, I can use ideainformer. Thanks!


    As for the brush. Here it is. Shows up as soon as I set the preset.
    upload_2021-5-1_9-15-36.png
     
  30. BigBalu

    BigBalu

    Joined:
    May 11, 2018
    Posts:
    1
    Hi, I'm getting seams between terrains even when they're the same resolution. Any idea how to fix this?

    Thanks!

    Edit: I'm using Microsplat, Unity 2020.1.1f1, URP 8.2.0

    Screenshot 2021-05-02 163018.jpg

     
  31. Roan-Albers

    Roan-Albers

    Joined:
    Jan 28, 2013
    Posts:
    5
    Yes odd indeed! After some more research it does happens in editor but the crashes don't occur in playmode. We've also found that it only crashes on MM terrains with MicroSplat, so we'll investigate this further!

    EDIT: Confirmed it's the MicroSplat node!
     
    Last edited: May 4, 2021
  32. mike114

    mike114

    Joined:
    Dec 29, 2017
    Posts:
    4
    Hello, I have this error too with MagicBrush. I have Unity 2020.3.3f1 with URP and MapMagic 2 Bundle 2.1.4.

    I tried this :
    -New empty scene
    -Create a terrain
    -Add Magic brush Component on the terrain
    -Add the preset "Add"
    -Click Button Draw and try painting the terrain and I get the error below

    Same error with Unity 2019.4.21f1 (with and without URP) in a new empty scene.

    Capture.PNG
     
    Last edited: May 3, 2021
  33. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,943
    The thing is that happens in a clear project in a new scene, but unfortunately not for me. It seems to be a string parse error. Could you please click the first (top) error and paste details here so I could replace it with TryParse to see what's exactly wrong?

    BTW what is your OS?

    Good thing to know that it doesn't occur in playmode, but I will look into MS output anyways for the next version. Thanks!

    Unfortunately there are no weld algorithms for MicroSplat. They might be added in the next version, but I can't promise that.

    Ah, yep, I haven't decided on a name yet. But from now on I will be Denis :)

    This error doesn't seem to be related with the one reported by mike114, but anyways - what is your OS?
     
    FlightOfOne likes this.
  34. FlightOfOne

    FlightOfOne

    Joined:
    Aug 1, 2014
    Posts:
    460
    I am on windows 10 (64bit).
     
  35. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,943
    I don't get it why this can happen. I'm also using Win 10, and still can't reproduce this. Maybe something in build settings? What is the target platform?
     
  36. Aress28

    Aress28

    Joined:
    Dec 12, 2015
    Posts:
    89
    How we use CTS if i paint textures with brush?
     
  37. mike114

    mike114

    Joined:
    Dec 29, 2017
    Posts:
    4
    My OS is Windows 10 64Bits.
    Target Platform is set to Windows x86 by default.

    This is the first error which happens when I imported MapMagic.

    Code (CSharp):
    1. Exception: Could not load graph data:
    2. System.FormatException: Input string was not in a correct format.
    3.   at System.Number.ParseSingle (System.String value, System.Globalization.NumberStyles options, System.Globalization.NumberFormatInfo numfmt) [0x00083] in <eae584ce26bc40229c1b1aa476bfa589>:0
    4.   at System.Single.Parse (System.String s, System.Globalization.NumberStyles style, System.Globalization.NumberFormatInfo info) [0x00000] in <eae584ce26bc40229c1b1aa476bfa589>:0
    5.   at System.Single.Parse (System.String s) [0x0000b] in <eae584ce26bc40229c1b1aa476bfa589>:0
    6.   at Den.Tools.Serialization.Serializer.DeserializeRecursive (System.Object[] splitString, System.Collections.Generic.Dictionary`2[TKey,TValue] deserializedIdsObjs, System.Collections.Generic.IList`1[T] unityObjs) [0x000b7] in C:\UnityProjects\TestMapMagic2\Assets\MapMagic\Tools\Serializer\Deserialize.cs:55
    7.   at Den.Tools.Serialization.Serializer.DeserializeRecursive (System.Object[] splitString, System.Collections.Generic.Dictionary`2[TKey,TValue] deserializedIdsObjs, System.Collections.Generic.IList`1[T] unityObjs) [0x003c5] in C:\UnityProjects\TestMapMagic2\Assets\MapMagic\Tools\Serializer\Deserialize.cs:183
    8.   at Den.Tools.Serialization.Serializer.DeserializeRecursive (System.Object[] splitString, System.Collections.Generic.Dictionary`2[TKey,TValue] deserializedIdsObjs, System.Collections.Generic.IList`1[T] unityObjs) [0x003c5] in C:\UnityProjects\TestMapMagic2\Assets\MapMagic\Tools\Serializer\Deserialize.cs:183
    9.   at Den.Tools.Serialization.Serializer.DeserializeRecursive (System.Object[] splitString, System.Collections.Generic.Dictionary`2[TKey,TValue] deserializedIdsObjs, System.Collections.Generic.IList`1[T] unityObjs) [0x00369] in C:\UnityProjects\TestMapMagic2\Assets\MapMagic\Tools\Serializer\Deserialize.cs:157
    10.   at Den.Tools.Serialization.Serializer.DeserializeRecursive (System.Object[] splitString, System.Collections.Generic.Dictionary`2[TKey,TValue] deserializedIdsObjs, System.Collections.Generic.IList`1[T] unityObjs) [0x003c5] in C:\UnityProjects\TestMapMagic2\Assets\MapMagic\Tools\Serializer\Deserialize.cs:183
    11.   at Den.Tools.Serialization.Serializer.DeserializeRecursive (System.Object[] splitString, System.Collections.Generic.Dictionary`2[TKey,TValue] deserializedIdsObjs, System.Collections.Generic.IList`1[T] unityObjs) [0x003c5] in C:\UnityProjects\TestMapMagic2\Assets\MapMagic\Tools\Serializer\Deserialize.cs:183
    12.   at Den.Tools.Serialization.Serializer.Deserialize (System.String str, System.Collections.Generic.IList`1[T] unityObjs) [0x00029] in C:\UnityProjects\TestMapMagic2\Assets\MapMagic\Tools\Serializer\Deserialize.cs:19
    13.   at MapMagic.Expose.Override.OnAfterDeserialize () [0x00010] in C:\UnityProjects\TestMapMagic2\Assets\MapMagic\Expose\Override.cs:250
    14.   at Den.Tools.Serializer.DeserializeObject (System.Int32 refId, Den.Tools.Serializer+Object[] serialized, System.Object[] deserialized, System.Object[] reuse, System.Action`1[T] onBeforeDeserialize) [0x004f4] in C:\UnityProjects\TestMapMagic2\Assets\MapMagic\Tools\Serializer.cs:641
    15.   at Den.Tools.Serializer.DeserializeObject (System.Int32 refId, Den.Tools.Serializer+Object[] serialized, System.Object[] deserialized, System.Object[] reuse, System.Action`1[T] onBeforeDeserialize) [0x0046b] in C:\UnityProjects\TestMapMagic2\Assets\MapMagic\Tools\Serializer.cs:633
    16.   at Den.Tools.Serializer.Deserialize (Den.Tools.Serializer+Object[] serialized, System.Action`1[T] onBeforeDeserialize) [0x0000f] in C:\UnityProjects\TestMapMagic2\Assets\MapMagic\Tools\Serializer.cs:191
    17.   at MapMagic.Nodes.GraphSerializer200Beta.Deserialize (MapMagic.Nodes.Graph graph) [0x0000b] in C:\UnityProjects\TestMapMagic2\Assets\MapMagic\Nodes\GraphSerializer.cs:60
    18.   at MapMagic.Nodes.Graph.OnAfterDeserialize () [0x00008] in C:\UnityProjects\TestMapMagic2\Assets\MapMagic\Nodes\Graph.cs:1150
    19. MapMagic.Nodes.Graph.OnAfterDeserialize () (at Assets/MapMagic/Nodes/Graph.cs:1159)
    20.  
    And the second :
    Code (CSharp):
    1. FormatException: Input string was not in a correct format.
    2. System.Number.ParseSingle (System.String value, System.Globalization.NumberStyles options, System.Globalization.NumberFormatInfo numfmt) (at <eae584ce26bc40229c1b1aa476bfa589>:0)
    3. System.Single.Parse (System.String s, System.Globalization.NumberStyles style, System.Globalization.NumberFormatInfo info) (at <eae584ce26bc40229c1b1aa476bfa589>:0)
    4. System.Single.Parse (System.String s) (at <eae584ce26bc40229c1b1aa476bfa589>:0)
    5. Den.Tools.Serialization.Serializer.DeserializeRecursive (System.Object[] splitString, System.Collections.Generic.Dictionary`2[TKey,TValue] deserializedIdsObjs, System.Collections.Generic.IList`1[T] unityObjs) (at Assets/MapMagic/Tools/Serializer/Deserialize.cs:55)
    6. Den.Tools.Serialization.Serializer.DeserializeRecursive (System.Object[] splitString, System.Collections.Generic.Dictionary`2[TKey,TValue] deserializedIdsObjs, System.Collections.Generic.IList`1[T] unityObjs) (at Assets/MapMagic/Tools/Serializer/Deserialize.cs:183)
    7. Den.Tools.Serialization.Serializer.DeserializeRecursive (System.Object[] splitString, System.Collections.Generic.Dictionary`2[TKey,TValue] deserializedIdsObjs, System.Collections.Generic.IList`1[T] unityObjs) (at Assets/MapMagic/Tools/Serializer/Deserialize.cs:183)
    8. Den.Tools.Serialization.Serializer.DeserializeRecursive (System.Object[] splitString, System.Collections.Generic.Dictionary`2[TKey,TValue] deserializedIdsObjs, System.Collections.Generic.IList`1[T] unityObjs) (at Assets/MapMagic/Tools/Serializer/Deserialize.cs:183)
    9. Den.Tools.Serialization.Serializer.DeserializeRecursive (System.Object[] splitString, System.Collections.Generic.Dictionary`2[TKey,TValue] deserializedIdsObjs, System.Collections.Generic.IList`1[T] unityObjs) (at Assets/MapMagic/Tools/Serializer/Deserialize.cs:157)
    10. Den.Tools.Serialization.Serializer.DeserializeRecursive (System.Object[] splitString, System.Collections.Generic.Dictionary`2[TKey,TValue] deserializedIdsObjs, System.Collections.Generic.IList`1[T] unityObjs) (at Assets/MapMagic/Tools/Serializer/Deserialize.cs:183)
    11. Den.Tools.Serialization.Serializer.DeserializeRecursive (System.Object[] splitString, System.Collections.Generic.Dictionary`2[TKey,TValue] deserializedIdsObjs, System.Collections.Generic.IList`1[T] unityObjs) (at Assets/MapMagic/Tools/Serializer/Deserialize.cs:183)
    12. Den.Tools.Serialization.Serializer.Deserialize (System.String str, System.Collections.Generic.IList`1[T] unityObjs) (at Assets/MapMagic/Tools/Serializer/Deserialize.cs:19)
    13. MapMagic.Expose.Override.OnAfterDeserialize () (at Assets/MapMagic/Expose/Override.cs:250)
    I tried several things and I found that if I just add the Magic Brush component and let the preset source to None, I don't get any errors when I paint but if I set the Preset Source to Add, I get this error when I try to paint :
    Code (CSharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. MapMagic.Nodes.Graph+<GeneratorsOfType>d__48`1[T].MoveNext () (at Assets/MapMagic/Nodes/Graph.cs:525)
    3. MapMagic.Brush.MapMagicBrush+<BrushReadsOrdered>d__39.MoveNext () (at Assets/MapMagic/Brush/Core/MapMagicBrush.cs:220)
    4. MapMagic.Brush.MapMagicBrush.Apply (UnityEngine.Vector3 pos, System.Boolean isFirst) (at Assets/MapMagic/Brush/Core/MapMagicBrush.cs:190)
    5. MapMagic.Brush.Trace.Drag (UnityEngine.Vector3 pos, System.Single spacingDist, System.Action`2[T1,T2] stampFn, MapMagic.Brush.MapMagicBrush brush) (at Assets/MapMagic/Brush/Core/Trace.cs:102)
    6. MapMagic.Brush.BrushInspector.DrawBrush (MapMagic.Brush.MapMagicBrush brush) (at Assets/MapMagic/Brush/Editor/BrushDraw.cs:108)
    7. MapMagic.Brush.BrushInspector.OnSceneGUI () (at Assets/MapMagic/Brush/Editor/BrushDraw.cs:42)
    8. System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <eae584ce26bc40229c1b1aa476bfa589>:0)
    9. Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    10. System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <eae584ce26bc40229c1b1aa476bfa589>:0)
    11. System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <eae584ce26bc40229c1b1aa476bfa589>:0)
    12. UnityEditor.SceneView.CallOnSceneGUI () (at <c9b5231e365148a4bc210cc4e439206d>:0)
    13. UnityEditor.SceneView.HandleSelectionAndOnSceneGUI () (at <c9b5231e365148a4bc210cc4e439206d>:0)
    14. UnityEditor.SceneView.OnGUI () (at <c9b5231e365148a4bc210cc4e439206d>:0)
    15. UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition, UnityEngine.Rect viewRect) (at <c9b5231e365148a4bc210cc4e439206d>:0)
    16. UnityEditor.DockArea.DrawView (UnityEngine.Rect viewRect, UnityEngine.Rect dockAreaRect) (at <c9b5231e365148a4bc210cc4e439206d>:0)
    17. UnityEditor.DockArea.OldOnGUI () (at <c9b5231e365148a4bc210cc4e439206d>:0)
    18. UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <0e3a02984c324383b31846a6ed7b2744>:0)
    19. UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <0e3a02984c324383b31846a6ed7b2744>:0)
    20. UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <0e3a02984c324383b31846a6ed7b2744>:0)
    21. UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Boolean canAffectFocus) (at <0e3a02984c324383b31846a6ed7b2744>:0)
    22. UnityEngine.UIElements.IMGUIContainer.SendEventToIMGUIRaw (UnityEngine.UIElements.EventBase evt, System.Boolean canAffectFocus, System.Boolean verifyBounds) (at <0e3a02984c324383b31846a6ed7b2744>:0)
    23. UnityEngine.UIElements.IMGUIContainer.SendEventToIMGUI (UnityEngine.UIElements.EventBase evt, System.Boolean canAffectFocus, System.Boolean verifyBounds) (at <0e3a02984c324383b31846a6ed7b2744>:0)
    24. UnityEngine.UIElements.IMGUIContainer.HandleEvent (UnityEngine.UIElements.EventBase evt) (at <0e3a02984c324383b31846a6ed7b2744>:0)
    25. UnityEngine.UIElements.EventDispatchUtilities.PropagateEvent (UnityEngine.UIElements.EventBase evt) (at <0e3a02984c324383b31846a6ed7b2744>:0)
    26. UnityEngine.UIElements.MouseEventDispatchingStrategy.SendEventToRegularTarget (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.BaseVisualElementPanel panel) (at <0e3a02984c324383b31846a6ed7b2744>:0)
    27. UnityEngine.UIElements.MouseEventDispatchingStrategy.SendEventToTarget (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.BaseVisualElementPanel panel) (at <0e3a02984c324383b31846a6ed7b2744>:0)
    28. UnityEngine.UIElements.MouseEventDispatchingStrategy.DispatchEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel iPanel) (at <0e3a02984c324383b31846a6ed7b2744>:0)
    29. UnityEngine.UIElements.EventDispatcher.ApplyDispatchingStrategies (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, System.Boolean imguiEventIsInitiallyUsed) (at <0e3a02984c324383b31846a6ed7b2744>:0)
    30. UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <0e3a02984c324383b31846a6ed7b2744>:0)
    31. UnityEngine.UIElements.EventDispatcher.ProcessEventQueue () (at <0e3a02984c324383b31846a6ed7b2744>:0)
    32. UnityEngine.UIElements.EventDispatcher.OpenGate () (at <0e3a02984c324383b31846a6ed7b2744>:0)
    33. UnityEngine.UIElements.EventDispatcherGate.Dispose () (at <0e3a02984c324383b31846a6ed7b2744>:0)
    34. UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <0e3a02984c324383b31846a6ed7b2744>:0)
    35. UnityEngine.UIElements.EventDispatcher.Dispatch (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, UnityEngine.UIElements.DispatchMode dispatchMode) (at <0e3a02984c324383b31846a6ed7b2744>:0)
    36. UnityEngine.UIElements.BaseVisualElementPanel.SendEvent (UnityEngine.UIElements.EventBase e, UnityEngine.UIElements.DispatchMode dispatchMode) (at <0e3a02984c324383b31846a6ed7b2744>:0)
    37. UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at <0e3a02984c324383b31846a6ed7b2744>:0)
    38. UnityEngine.UIElements.UIElementsUtility.UnityEngine.UIElements.IUIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& eventHandled) (at <0e3a02984c324383b31846a6ed7b2744>:0)
    39. UnityEngine.UIElements.UIEventRegistration.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <0e3a02984c324383b31846a6ed7b2744>:0)
    40. UnityEngine.UIElements.UIEventRegistration+<>c.<.cctor>b__1_2 (System.Int32 i, System.IntPtr ptr) (at <0e3a02984c324383b31846a6ed7b2744>:0)
    41. UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& result) (at <6ddf8eac3856492ab1b8cf42618915cc>:0)
    I recorded this to show what happen :
     
  38. FlightOfOne

    FlightOfOne

    Joined:
    Aug 1, 2014
    Posts:
    460
    My target is also windows, x86_64. But would this have problems in the editor? One thing though, I move all my assets to a "Thridparty" folder. Would this have something to do with this, not being in the path Asset\?
     
  39. FlightOfOne

    FlightOfOne

    Joined:
    Aug 1, 2014
    Posts:
    460
    @Wright @mike114

    What Mike posted in the video is the exact problem I am having too.
     
  40. Hemath

    Hemath

    Joined:
    Jul 15, 2020
    Posts:
    5
    Hi there!
    I'm considering buying the Spline module. I have read the document but still, have some questions. It would be very kind of you if you could help me.
    The feature of the texture on the spline shown in the picture below is random.

    I'm curious about the effect if I use a road picture, like:
    upload_2021-5-7_3-7-51.png
    Will the pattern on the road bend along the path of the painting?

    Besides, I'd like to confirm that it is possible to apply the spline texture on the terrain without modifying the shape of the terrain surface, right?

    Thanks for your reply! Have a good day :-D
     
  41. Zoryth

    Zoryth

    Joined:
    Dec 5, 2016
    Posts:
    85
    How to change seed at runtime? Main graph is for biomes.
     
  42. Diego_Graphics

    Diego_Graphics

    Joined:
    Nov 3, 2014
    Posts:
    143
    @Wright So sorry to bother you again on the same subject, but the Whittaker still doesn't seem to work. The errors from back then don't repeat, but the Whittaker node doesn't give any output nodes. I have specified a gradient as temperature and a noise as a rainfall. In each biome field of the Whittaker Node a separate biome is linked with a Noise on a Height output and a standard Texture output with a Texture. Neither Height nor Texture are taken over.
    Also the output masks of the respective biomes of the Whittaker Node do not give any result. The node does not work.

    I am on version 2.1.4 and have cleared the assetstore cache, restarted the computer etc. so it should be the current version. To be 100% sure you could send me the .unitypackages, but I think it is the current version.

    Otherwise, since there are often package update problems (it's not your fault), you could maybe write the version number in the readme file in the future. that would make it much easier for support communication to quickly determine which version is installed. Or just a version.txt file or something. but that's a side note, i' m mainly concerned with the non-functioning Whittaker node.
     
  43. Diego_Graphics

    Diego_Graphics

    Joined:
    Nov 3, 2014
    Posts:
    143
    You can expose the seed field of a node (if it is a seed based node) and then set this expose value from C#.
    Documentation: Changing via script

    The spline module is currently not designed for this. you cannot put a texture like a road moving along a spline on a terrain directly. for this you can only place a mesh on the terrain that represents the road and has a UV map that runs along the spline. e.g. like EasyRoad. unfortunately there is no integration of MapMagic and EasyRoad yet so that is rather not possible.

    but there is a node in the spline module that allows you to flatten the spline areas so that they make a clean path along the spline but of course you can also just place the texture on the terrain without affecting the terrain shape.
     
    Wright likes this.
  44. Hemath

    Hemath

    Joined:
    Jul 15, 2020
    Posts:
    5

    Thanks a lot for your advice! I get it.
     
  45. Zoryth

    Zoryth

    Joined:
    Dec 5, 2016
    Posts:
    85
    Thank you. I already did it other way tho :p. I just changed the
    .graph.random
    for overall different map with each seed.
     
  46. CodeBison

    CodeBison

    Joined:
    Feb 1, 2014
    Posts:
    254
    Hi,

    First, I want to say I loved MapMagic 1, and am excited to get started with MapMagic 2!
    That said, I've hit a couple stumbling blocks. I haven't been able to find any reference online for how to do tasks like the following via scripting:
    * Choose a seed at runtime and generate a terrain based on that seed (not starting terrain generation until I've had time to complete other setup, such as syncing the seed across the network)
    * Wait for the first tile to complete generation so I can ensure terrain is generated before spawning characters
    * Check which tiles are still generating, if any

    I could do these in MM1, but the API seems to be significantly different in MM2. Would you be able to point me in the right direction?

    Thanks!
     
  47. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,943
    FlightOfOne, mike114, could you try reimporting MapMagic/Brush/Graphs folder (right click - Reimport). Will it display an
    System.FormatException: Input string was not in a correct format.
    exception?
    Are you using a bundle or modules? If so - what modules are you using?
    I'm really set to solve - or at least reproduce - this issue this weekend, so feel free to use discord #issues channel for faster communication.

    Is CTS updating when you stroke with the standard terrain tools, but not with MM Brush? If so could you please send me the scene, CTS profile used here and texture arrays?
    I will need only the mentioned 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.
    A description of the issue in email will also come in handy - way more handy than mentioning post on forums.

    It is painting control map pixels. It's like a standard texture painting with terrain tool - the second channel will appear here, no more than that.

    The first in queue is RAM integration - and theoretically it can also create a road since it's a mesh bended along the spline.

    You can change the seed at starting a game on executing this line in Start/Awake/OnEnable:
    Code (CSharp):
    1. mapMagic.graph.random = new Noise(seed, permutationCount:32768);
    2. //32768 is initial permutation num for MM noise
    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: https://www.dropbox.com/s/qb7u9wqn8mh6ig8/NewSeedOnStartup.cs?dl=0

    You can subscribe to static Action<TerrainTile, TileData, StopToken> TerrainTile.OnTileApplied to determine if some specific tile has been generated and applied, or to Action<MapMagicObject> TerrainTile.OnAllComplete that is called when all of the tiles are done.

    I guess I will make FAQ section on wiki to store the most often questions and answers.

    Could you please try this scene? Here I've tried to link Contrast node with preview enabled to each of the Whittakers outputs, and it seems to be producing the expected mask if this biome is used on the preview tile.
     
  48. mike114

    mike114

    Joined:
    Dec 29, 2017
    Posts:
    4
    I'm using a bundle.
    If I reimport MapMagic/Brush/Graphs folder now, nothing happens but if I create a new scene and then reimport the Graphs folder, I don't get the error "System.FormatException: Input string was not in a correct format." but instead, I get this error 17 times :


    Code (CSharp):
    1. Exception: Could not load graph data:
    2. System.FormatException: Input string was not in a correct format.
    3.   at System.Number.ParseSingle (System.String value, System.Globalization.NumberStyles options, System.Globalization.NumberFormatInfo numfmt) [0x00083] in <eae584ce26bc40229c1b1aa476bfa589>:0
    4.   at System.Single.Parse (System.String s, System.Globalization.NumberStyles style, System.Globalization.NumberFormatInfo info) [0x00000] in <eae584ce26bc40229c1b1aa476bfa589>:0
    5.   at System.Single.Parse (System.String s) [0x0000b] in <eae584ce26bc40229c1b1aa476bfa589>:0
    6.   at Den.Tools.Serialization.Serializer.DeserializeRecursive (System.Object[] splitString, System.Collections.Generic.Dictionary`2[TKey,TValue] deserializedIdsObjs, System.Collections.Generic.IList`1[T] unityObjs) [0x000b7] in C:\UnityProjects\TestMapMagic2\Assets\MapMagic\Tools\Serializer\Deserialize.cs:55
    7.   at Den.Tools.Serialization.Serializer.DeserializeRecursive (System.Object[] splitString, System.Collections.Generic.Dictionary`2[TKey,TValue] deserializedIdsObjs, System.Collections.Generic.IList`1[T] unityObjs) [0x003c5] in C:\UnityProjects\TestMapMagic2\Assets\MapMagic\Tools\Serializer\Deserialize.cs:183
    8.   at Den.Tools.Serialization.Serializer.DeserializeRecursive (System.Object[] splitString, System.Collections.Generic.Dictionary`2[TKey,TValue] deserializedIdsObjs, System.Collections.Generic.IList`1[T] unityObjs) [0x003c5] in C:\UnityProjects\TestMapMagic2\Assets\MapMagic\Tools\Serializer\Deserialize.cs:183
    9.   at Den.Tools.Serialization.Serializer.DeserializeRecursive (System.Object[] splitString, System.Collections.Generic.Dictionary`2[TKey,TValue] deserializedIdsObjs, System.Collections.Generic.IList`1[T] unityObjs) [0x00369] in C:\UnityProjects\TestMapMagic2\Assets\MapMagic\Tools\Serializer\Deserialize.cs:157
    10.   at Den.Tools.Serialization.Serializer.DeserializeRecursive (System.Object[] splitString, System.Collections.Generic.Dictionary`2[TKey,TValue] deserializedIdsObjs, System.Collections.Generic.IList`1[T] unityObjs) [0x003c5] in C:\UnityProjects\TestMapMagic2\Assets\MapMagic\Tools\Serializer\Deserialize.cs:183
    11.   at Den.Tools.Serialization.Serializer.DeserializeRecursive (System.Object[] splitString, System.Collections.Generic.Dictionary`2[TKey,TValue] deserializedIdsObjs, System.Collections.Generic.IList`1[T] unityObjs) [0x003c5] in C:\UnityProjects\TestMapMagic2\Assets\MapMagic\Tools\Serializer\Deserialize.cs:183
    12.   at Den.Tools.Serialization.Serializer.Deserialize (System.String str, System.Collections.Generic.IList`1[T] unityObjs) [0x00029] in C:\UnityProjects\TestMapMagic2\Assets\MapMagic\Tools\Serializer\Deserialize.cs:19
    13.   at MapMagic.Expose.Override.OnAfterDeserialize () [0x00010] in C:\UnityProjects\TestMapMagic2\Assets\MapMagic\Expose\Override.cs:250
    14.   at Den.Tools.Serializer.DeserializeObject (System.Int32 refId, Den.Tools.Serializer+Object[] serialized, System.Object[] deserialized, System.Object[] reuse, System.Action`1[T] onBeforeDeserialize) [0x004f4] in C:\UnityProjects\TestMapMagic2\Assets\MapMagic\Tools\Serializer.cs:641
    15.   at Den.Tools.Serializer.DeserializeObject (System.Int32 refId, Den.Tools.Serializer+Object[] serialized, System.Object[] deserialized, System.Object[] reuse, System.Action`1[T] onBeforeDeserialize) [0x0046b] in C:\UnityProjects\TestMapMagic2\Assets\MapMagic\Tools\Serializer.cs:633
    16.   at Den.Tools.Serializer.Deserialize (Den.Tools.Serializer+Object[] serialized, System.Action`1[T] onBeforeDeserialize) [0x0000f] in C:\UnityProjects\TestMapMagic2\Assets\MapMagic\Tools\Serializer.cs:191
    17.   at MapMagic.Nodes.GraphSerializer200Beta.Deserialize (MapMagic.Nodes.Graph graph) [0x0000b] in C:\UnityProjects\TestMapMagic2\Assets\MapMagic\Nodes\GraphSerializer.cs:60
    18.   at MapMagic.Nodes.Graph.OnAfterDeserialize () [0x00008] in C:\UnityProjects\TestMapMagic2\Assets\MapMagic\Nodes\Graph.cs:1150
    19. MapMagic.Nodes.Graph.OnAfterDeserialize () (at Assets/MapMagic/Nodes/Graph.cs:1159)
     
  49. Diego_Graphics

    Diego_Graphics

    Joined:
    Nov 3, 2014
    Posts:
    143
    No that doesn't work, nothing comes out of it. The terrain remains completely flat, the output previews in the graph view show (N/A) and nothing happens.Can you please send me the Unitypackages of the current version via pn? so that I can make 100% sure that the version is correct. otherwise we don't get on with the problem.
    It makes no sense to go over and over a problem, which exists already for a while, if the basic question of the versions is not 100% clarified. I know that this is not your fault, this is due to the Unity Package manager problem but somehow I have to solve the problem and be able to exclude that the version is wrong. Since there is no version number in the readme file(Please think about changing this in the future) I need a current Unitypackage file that I can download without package manager. I send you via PN my order ID to the Biome&Functions package.
     
  50. Aress28

    Aress28

    Joined:
    Dec 12, 2015
    Posts:
    89
    I Mean how to use CTS with MM2 if i paint textures with MM Brush on MM2 Terrain?is it Possible?And what about ussing MM brush on large MM2 terrain with many many terrain chunks?Is it possible to generate terrain with 10x10 draw with MM brush to fit my needs and then generate terrain with all changes i did with MM brush?or terrain will not save changes with Brush if i unpin and pin again terrain?
     
    Last edited: May 9, 2021 at 11:17 PM
unityunity