Search Unity

MapMagic 2 - infinite procedural land generator

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

  1. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    Hi
    please go to the discord. It will take a metric eon here to ask all the questions
     
  2. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,276
    I'd like to mention general questions anyways - just to help dibgickfooker and others to get answers at once:
    - Do you have any errors in the console?
    - Could you make a screenshot of incorrectly generated effect?
    - What do you do before the generated effect occurs? (at least steps to reproduce with some probability)
    - Does this happen in demo scene? (If not - could you please email me the the scene, the graph and their meta files)
    - What is your OS and Unity version?

    I will also appreciate if you could report it on ideainformer. It helps to keep things organized, that result in some pluses:
    - You will be able to track your issue/idea and know when it's fixed;
    - This ticket can also provide a communication channel dedicated to this issue;
    - Other users can also see if the issue/idea was reported, add some comments on it or clarify details.
    - And for me it's way more convenient to track issues in tickets, and discuss them per-ticket rather than use email or forum
     
  3. KingfisherWyvernStudio

    KingfisherWyvernStudio

    Joined:
    Oct 5, 2011
    Posts:
    324
    I've put the fix in the project's folder. It fixed one error, but I still have the rest. I'm not worried about the URP, since it's a HDRP project.
    There are, however, still the three warnings about not being able to load graph data:

    Exception: Could not load graph data:
    System.Exception: Could not find type for: MapMagic.Nodes.ObjectsGenerators.Split200+SplitLayer, MapMagic, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
    at Den.Tools.Serializer.DeserializeObject (System.Int32 refId, Den.Tools.Serializer+Object[] serialized, System.Object[] deserialized, System.Object[] reuse, System.Action`1[T] onBeforeDeserialize) [0x00500] in D:\Testprojects\MapMagic2Test\Assets\MapMagic\Tools\Serializer.cs:643
    at Den.Tools.Serializer.DeserializeObject (System.Int32 refId, Den.Tools.Serializer+Object[] serialized, System.Object[] deserialized, System.Object[] reuse, System.Action`1[T] onBeforeDeserialize) [0x00348] in D:\Testprojects\MapMagic2Test\Assets\MapMagic\Tools\Serializer.cs:582
    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 D:\Testprojects\MapMagic2Test\Assets\MapMagic\Tools\Serializer.cs:633
    at Den.Tools.Serializer.Deserialize (Den.Tools.Serializer+Object[] serialized, System.Action`1[T] onBeforeDeserialize) [0x0000f] in D:\Testprojects\MapMagic2Test\Assets\MapMagic\Tools\Serializer.cs:191
    at MapMagic.Nodes.GraphSerializer200Beta.Deserialize (MapMagic.Nodes.Graph graph) [0x0000b] in D:\Testprojects\MapMagic2Test\Assets\MapMagic\Nodes\GraphSerializer.cs:60
    at MapMagic.Nodes.Graph.OnAfterDeserialize () [0x00008] in D:\Testprojects\MapMagic2Test\Assets\MapMagic\Nodes\Graph.cs:1156
    MapMagic.Nodes.Graph.OnAfterDeserialize () (at Assets/MapMagic/Nodes/Graph.cs:1165)
    MapMagic.Nodes.Graph.OnBeforeSerialize () (at Assets/MapMagic/Nodes/Graph.cs:1142)​


    I'll ignore them for now, like @twobob suggested elsewhere and just get started :)

    Thanks for the help!
     
    twobob likes this.
  4. DarkArts-Studios

    DarkArts-Studios

    Joined:
    May 2, 2013
    Posts:
    389

    Hi,

    Has this been updated at all anywhere? Importing it now, with the latest MM2 throws a bunch of errors.

    Thanks,
     
  5. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,276
    Not sure about this plugin, but there are new official nodes that can help to output any map (like biome mask) to texture or Matrix: Direct Textures and Direct Matrices. From Matrix you can directly read the value at specified position, and texture could be used in shader.

    I think I will submit the new version with all the small fixes accumulated soon - I went too deep into the cluster system for 2.2.0 (the one that allows create some "base" terrain, objects and splines utilized by all tiles).
     
    DarkArts-Studios likes this.
  6. KingfisherWyvernStudio

    KingfisherWyvernStudio

    Joined:
    Oct 5, 2011
    Posts:
    324
    Thanks!
     
  7. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,756
    Hi
    i've got two questions:
    1) I have an existing terrain that I want to keep. I mean the mountains and such that I had to manually adjust to place a few things on it. But I want to auto generate the textures/grass/trees and so on. Can I do that with Mapmagic without losing my terrain?

    2) How's the performance of this in mobile?
     
  8. faintle

    faintle

    Joined:
    Jun 18, 2017
    Posts:
    2
    Hello Wright,
    When I use brush with texture function, the Undo throw errors most time


     

    Attached Files:

    • q0.png
      q0.png
      File size:
      85 KB
      Views:
      1,586
    • q1.png
      q1.png
      File size:
      95.6 KB
      Views:
      1,354
    twobob likes this.
  9. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    1) not really. Vegetation Studio maybe does what you want?
    2) Been a while since I checked and mobiles have come on a lot but I would say poor to shocking (However: YMMV), it's not written with that platform in mind however nothing precludes it. Caveats loom.
     
  10. mick129

    mick129

    Joined:
    Jun 19, 2013
    Posts:
    228
    I have those errors while using MM2 along with Microsplat

    upload_2021-12-20_11-46-9.png

    upload_2021-12-20_11-46-21.png

    I oftend get black tiles if I also use the same texture 2 times
     
  11. Giantsmall

    Giantsmall

    Joined:
    Apr 28, 2019
    Posts:
    18
    Got question about Whittaker layer's influence - is this implemented? do not see any impact when changing it's value.
    In code also there seem to be no references to influence field in Whittaker Layer class.
    BiomesEditor class however contains following line (121): using (Cell.LineStd) Draw.Field(ref layer.opacity, "Influence");
    Help please? :)
     
  12. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,276
    Have no MM at hand until Monday, so can't say for sure, but as far as I remember it should multiply pre-made biome mask with this value. Will look into when get back on a mission.

    Do you remember when those errors started to appear? Were you changing resolutions, texture formats, etc?
    I will appreciate if you could mention this on ideainformer.

    Under texture function you mean a function that is connected to texture output (or maybe texture output only)? Does it work as expected with other brush setup?
    I will appreciate if you could mention this on ideainformer.

    I see your use case, but MM works a bit different - it generates whole terrain from scratch. It doesn't read terrain to use it as masks. But you can export heightmap to RAW format, and then import it with Import node. This way MM will create the same terrain, but can also paint textures, grass, etc.

    It works on mobile devices. However do not expect the performance to be the same as on desktops. Graphs should be optimized and resolution lowered to make them generating at least as fast as on desktop computers.
     
    mick129 likes this.
  13. mick129

    mick129

    Joined:
    Jun 19, 2013
    Posts:
    228
    About my error above, it seems that restarting Unity solved it.

    Edit: sorry the problem is still here, I will add it on the Idea Former
     
    Last edited: Dec 22, 2021
  14. DarkArts-Studios

    DarkArts-Studios

    Joined:
    May 2, 2013
    Posts:
    389
    @Wright I've found a bug with erosion node that is causing cross-chunk seams (like we used to have in Map Magic 1), please consider having a look at resolving this when you have some time I would appreciate it greatly. I've reported it here: http://mm2.idea.informer.com/proj/MM2?ia=137909 -- thank you
     
    twobob likes this.
  15. faintle

    faintle

    Joined:
    Jun 18, 2017
    Posts:
    2
    Thanks for the reply, yes, I mean a brush graph with texture output. Such as the provided Texture brush in your brush module, draw something on terrain and Undo, sometimes it works fine, but throw errors frequently. I'll put this on ideainformer. Thank you!
     
  16. mick129

    mick129

    Joined:
    Jun 19, 2013
    Posts:
    228
    So for my problem above, I have to match the number of textures to match between MM2 and Microsplat.

    But I have another problem which I will report soon on the idea Former. If 2 Microsplat texture are used multiple time (for example the beach texture on 2 different biomes) the texture get black. I also have a problem that I can't find a way to texture the world is I use biomes for that reason.

    In the screenshot below, I created 2 biomes, one is the desert and the other is a forest.
    Both biome work well when they are alone as the main graph, but break if I try to mix them in the same map.

    upload_2021-12-23_11-36-59.png
     
  17. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,276
    Thanks for reporting this issue! I will look deeply into it, for now it seems to be related with pinned tiles. If any of the tiles on seams is pinned it produces proper welding.

    Variable named "Influence" in GUI is used as a standard layer opacity value, and stored in layer.opacity. But yes, it was planned to be used in NormalizeLayers, but it's not send as argument. Fixing. Thanks for letting me know!

    Yes, I will appreciate if you will mention this in IdeaInformer. I can't promise to look into it soon, but it will really help to track this issue.
     
  18. Daahrien

    Daahrien

    Joined:
    Dec 5, 2016
    Posts:
    100
    I get the following error when oipening a Graph, even the default ones.


    ArgumentException: Texture2D.SetPixels: texture uses an unsupported format. (Texture '')
    UnityEngine.Texture2D.SetPixels (System.Int32 x, System.Int32 y, System.Int32 blockWidth, System.Int32 blockHeight, UnityEngine.Color[] colors, System.Int32 miplevel) (at <ad50157ee00e45cdb3c8bd67012f8804>:0)
    UnityEngine.Texture2D.SetPixels (UnityEngine.Color[] colors) (at <ad50157ee00e45cdb3c8bd67012f8804>:0)
    Den.Tools.TextureExtensions.Multiply (UnityEngine.Texture2D tex, UnityEngine.Color color, System.Boolean multiplyAlpha) (at Assets/MapMagic/Tools/Extensions/Texture2DExtensions.cs:219)
    Den.Tools.GUI.TexturesCache.GetColorizedTexture (System.String textureName, UnityEngine.Color color) (at Assets/MapMagic/Tools/GUI/Editor/TexturesCache.cs:73)
    MapMagic.Nodes.GUI.GroupDraw.DrawGroup (MapMagic.Nodes.Group group) (at Assets/MapMagic/Nodes/Editor/GroupDraw.cs:83)
    MapMagic.Nodes.GUI.GraphWindow.DrawGraph () (at Assets/MapMagic/Nodes/Editor/GraphWindow.cs:218)
    Den.Tools.GUI.UI.Draw (System.Action drawAction, Den.Tools.GUI.UI+RectSelector rectSelector, System.Boolean offsetAfterDraw) (at Assets/MapMagic/Tools/GUI/Editor/UI.cs:221)
    Den.Tools.GUI.UI+<>c__DisplayClass30_0.<DrawInSubWindow>b__0 (System.Int32 tmp) (at Assets/MapMagic/Tools/GUI/Editor/UI.cs:86)
    UnityEngine.GUILayout+LayoutedWindow.DoWindow (System.Int32 windowID) (at <4c1b5f56ab12481abc458fdd69da0f26>:0)
    UnityEngine.GUI.CallWindowDelegate (UnityEngine.GUI+WindowFunction func, System.Int32 id, System.Int32 instanceID, UnityEngine.GUISkin _skin, System.Int32 forceRect, System.Single width, System.Single height, UnityEngine.GUIStyle style) (at <4c1b5f56ab12481abc458fdd69da0f26>:0)
    UnityEditor.EditorWindow:EndWindows()
    MapMagic.Nodes.GUI.GraphWindow:OnGUI() (at Assets/MapMagic/Nodes/Editor/GraphWindow.cs:156)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr, Boolean&)

    Any ideas?
     
  19. Thimape

    Thimape

    Joined:
    Jan 11, 2015
    Posts:
    1
    Hi,

    I am having an issue and I am not sure what is going on, are there requirements for the grass object?
    I am trying to add a grass from the package NatureManufacture Meadow and it does not look good:


    the configuration:


    This is how it looks normally if I add it manually to a terrain:


    I am using unity 2020.1.17f1 URP.

    thanks!
     
    Last edited: Dec 30, 2021
  20. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
  21. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,756
    I couldn't understand half the description on that GitHub... is there a demo scene? A terrain that looks like paper folded a thousand times doesn't seem too appealing...
     
    Last edited: Jan 3, 2022
  22. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    It's a reticulation pattern to show heights spreading out over a very wide distance.

    If you don't need it, you don't need it. For me, being able to draw terrains as far as the eye can see instead of "3km in any one direction" is a given in a top drawer game.
     
  23. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
  24. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,276
    Pretty impressive according to the description. Great job! However it's quite clear to me why is it called "billboards" - does it turn a terrain into planar impostor?

    Try switching Mode to Mesh Unlit in Grass Output. It should make the grass rendered with alpha test.

    It complains of unsupported texture format on SetPixel. Might be something platform-related. What is your OS?
     
  25. shazwar

    shazwar

    Joined:
    Jul 3, 2014
    Posts:
    1
    Thanks @twobob for posting this, I've been lazily avoiding the forums.

    @Wright it's definitely a misnomer and I'm taking suggestion for a more clear name if you have any ideas. Billboards sort of reflect what I'd originally set out to do, which was to draw MM based terrains cheaply and far into the distance. What it ended up being is system that renders many height maps using a single mesh (per LoD) and DrawProceduralIndirect. It's currently using MM for heights, but I definitely plan to grab biome weights (if not splats as well).



    Ignore the post processing. I was trying to show that it's performant even with non-basic lighting. This is a range of 50. In the bottom each terrain block is 1km.
     
    twobob likes this.
  26. Daahrien

    Daahrien

    Joined:
    Dec 5, 2016
    Posts:
    100
    It's Windows 10. I'm on a Core i7 2600 with a RX 560 if that matters.
     
  27. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    are GPU based renderings. Okay for distance stuff. Works from the built-in terrain data. I guess it is arguably an imposter based on planes, yes. He gave the best explanation possible however.
     
  28. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    No obvious reason for that to fail IMHO. The card is not "crazy new" (It's pretty similar to my goto dev car) and the OS is certainly not the issue.
     
  29. ekaterinaLosik

    ekaterinaLosik

    Joined:
    Apr 21, 2020
    Posts:
    2
    Hi! Is it possible to place just a one instance of the object using MapMagic 2 Objects?
     
  30. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,276
    Hmmm, I agree with twobob, it doesn't seem to be related with platform. From error description it looks like it can't modify some GUI texture - possibly because of compression or something. It also might be that video card doesn't support BC compression, but it's just a guess. Will check that all of them are uncompressed, and try to find out what happened.
    BTW are you using dark scheme or light one?

    You can use Objects -> Positions node to spawn predefined number of objects (including one object only) on some specific positions.
     
  31. Deleted User

    Deleted User

    Guest

    I don't know if it's with the new update but I start to see seams in between terrain tiles; it's a pretty simple terrain and small (512m). Any idea why or where to look for ?

    Capture d’écran 2022-01-10 à 17.59.59.png
     
  32. Daahrien

    Daahrien

    Joined:
    Dec 5, 2016
    Posts:
    100
    Dark one :p. Don't worry much about it.
     
  33. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,276
    It seems that I already have this issue in my to-do list: here. I will look into it when things will be more stable with clusters.
     
  34. Refeas

    Refeas

    Joined:
    Nov 8, 2016
    Posts:
    192
    Hey @Wright,
    a small feature request this time. :) it would be great if inputs and outputs of the Function node could be re-ordered to make the graphs cleaner and more organised - right now it orders them based on time of creation, which is not very practical. Or at least order them alphabetically and by type (so map in/outs first, then objects ones, then splines for example).
     
  35. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,276
    I think I can add some field like "priority" in function input/output that will determine where it will be displayed in a list.

    Another idea: I can sort inputs/outputs based on their position in a function graph. The higher it is in the graph - the higher it is in function connectors list.
     
  36. Refeas

    Refeas

    Joined:
    Nov 8, 2016
    Posts:
    192
    Manually managing priorities would introduce more tedious work than it would save. I think adding the alphabetical + output type ordering should be the easiset to implement and will improve the workflow a lot.
     
  37. airop

    airop

    Joined:
    Sep 4, 2012
    Posts:
    34
    Multi prefab object and trees do not seem the work, mapmagic only spawns 1 tree and 1 object and ignores the other ones in the list.
     
  38. ekaterinaLosik

    ekaterinaLosik

    Joined:
    Apr 21, 2020
    Posts:
    2
    Hi! How does "save terrain data" function work and does it actually work? Nothing happens when I press the button (Unity 2020.3.13)
     
  39. Ava42

    Ava42

    Joined:
    Aug 4, 2012
    Posts:
    33
    Hi! I have some problem with grass.... so I make my own Shader Graph with atlases / instancing / billboarding / wind, and it works well with native terrain Detail, but...
    When i add it via grass node I receive it:


    Its enough to click "Use GPU instancing" for fix it.. but any change or "generate" erase that setting. Where I can edit source to make it set that flag automatically?
     
  40. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,276
    Is it generating same trees in demo scene (Tutorial Objects) for you? It might be related with the way you scatter objects. Could you please make a screenshot of your objects graph?

    It works similarly to pin/unpin/preview buttons. You've got to check it and select the tile you want to save as terrain data file.

    Mesh Vertex Lit mode doesn't support grass transparency - switching to Mesh Unlit might fix the problem. However it's odd that you don't have any texture at all. Are you using Unity 2022?
     
  41. Ava42

    Ava42

    Joined:
    Aug 4, 2012
    Posts:
    33
    Unity 2021.2.8f1
    Mesh Unlit / Mesh Vertex Lit just show white squares... any texture at all... yeah, you select texture only when selected "Grass" or "Billboard", otherwise you select prefab and prefab have material with custom grass shader with wind etc... and its start to work with flag "Use GPU instancing" that make "render mode vertex lit" parameter grey (disabled and ignored as i understand)... so i just need to make that "Use GPU instancing" set true automatically otherwise I must set this flag 16 times on every grass part manually after any node change.
     
  42. Roan-Albers

    Roan-Albers

    Joined:
    Jan 28, 2013
    Posts:
    9
    I can't expose values from the 'Adjust' and 'Spread' node, is this intended?
     
    Last edited: Jan 24, 2022
  43. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,276
    No, turns out Flatten as well, fixing!

    I am going to bring "Use GPU instancing" parameter to Grass Output GUI in next version.
     
  44. Roan-Albers

    Roan-Albers

    Joined:
    Jan 28, 2013
    Posts:
    9
    Perfect thank you!

    Another thing I ran into was when I use a Split node, and then split them into two Object Output Nodes, the Multi-Prefab check on the Object Output Node doesn't seem to work, it just uses the first one in the Output list.
     
  45. mick129

    mick129

    Joined:
    Jun 19, 2013
    Posts:
    228
    Any news or idea on how to solve this? http://mm2.idea.informer.com/proj/?ia=137932

    Also maybe a weird suggestion but I really like MM2 and Microsplat and I know it is not easy to support both. So on my end, I would be willing to pay for a Microsplat extension and I'm probably sure many of the dev here would think the same. Maybe you could sell the Microsplat integration as a separate module?
    I would buy it on day one.
     
  46. Ava42

    Ava42

    Joined:
    Aug 4, 2012
    Posts:
    33
    thanx! it will be great!
     
  47. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,276
    Currently I'm a bit stuck with cluster update. It will give the possibility to create full-scale rivers, roads, and define the overall continent shape with separate "base", large size low detail graph, but it requires too many core changes. But I hope it worth it. Currently I'm concentrating on this update (and some critical bugs) - it's been a while since the last update, and I try my best to release it ASAP. Once done I will look into compatibility and other issues.

    Probably releasing a separate MS module will make me a millionaire, but my main aim is to make a quality product - for me it's more important then making money. To do this I will need to guarantee that it will work with each MM and MS update, with all possible MS features, on all systems. Probably I've got to hire someone for this, but I have a better idea - if someone feels confident creating and supporting this module as 3rd party developer I have no objection on releasing it on the Asset Store (just ask Jason if he agrees to this as well).
     
    Jaimi and mick129 like this.
  48. mick129

    mick129

    Joined:
    Jun 19, 2013
    Posts:
    228
    You have always be in for the quality and I respect you for that, thanks for your amazing work :).
    And I can'T wait to see what your next update will bring.

    As for MS, I don't have the skill but I really hope to have a working workflow that could include MM2 and MS. I'm good with MM2 but I often have to choose between MS or MM2 on each of my projects unfortunately and it tortures me :(. Also I would love to start a level design serie on youtube when both will work together :).
     
  49. Aress28

    Aress28

    Joined:
    Dec 12, 2015
    Posts:
    100
    MapMagic Brush in Unity 2021.2.7f1 .. I cant Draw anything on terrain there circle not apearing when i mouse over terrain.If i try to paint its just select my terrain......
     
  50. stigmamax

    stigmamax

    Joined:
    Jun 30, 2014
    Posts:
    312