Search Unity

Map Graph – Node-based Random Map Generation

Discussion in 'Assets and Asset Store' started by InScatterbrain, Aug 3, 2020.

  1. InScatterbrain

    InScatterbrain

    Joined:
    Mar 7, 2017
    Posts:
    233
    Map Graph v1.1.2 is now available.

    This update mostly addresses some issues with the Randomly Stamp Tilemaps node and hexagonal grids.

    Please be aware that the Randomly Stamp Tilemaps node now gives a different output on the Placements port, so that may affected your existing map generators. In order to get the same result as before, you can merge the result from the Placements port and Empty points port together, using the newly added Merge Points node.

    Changes:

    • Made changes to how the Randomly Stamp Tilemaps node stamps tilemaps. It no longer stamps the empty tiles within the tilemap prefab's bounding rectangle, removing any existing tiles at those points.

      Please note: This change might impact your existing Map Graphs' output, as these empty tiles are no longer included in the points gotten from the Placements output port. Instead you can now get them from the new Empty Points port.

    • Added the Empty Points output port to the Randomly Stamp Tilemaps node, containing any empty tiles spaces within the stamped tilemap prefab's bounding rectangle.

    • Added the "Create/Map Graph/Tilemap Prefab" option to the Create menu, which creates a new tilemap prefab with all the required components, as a more convenient way of creating entries for Tilemap Sets.

    • Added the Map Graph Tilemap Prefab component with a Lock Shape option for tilemap prefabs with hexagonal grids.

      Enabling Lock Shape on a tilemap prefab will make adjustments to tile coordinates when it's stamped onto another tilemap, so that its shape stays the same whether it's placed on rows with different offsets or not.

      More info about this issue in this forum post: https://forum.unity.com/threads/rel...ed-random-map-generation.944568/#post-6681352

    • Added the optional "Precise Margin?" input port to the Randomly Stamp Tilemaps node.

      Settings this to true will create a more accurate margin outline around stamped tilemaps, instead of the default bounding rectangle, at the expense of performance.

    • Added the Merge Points node, which takes two sets of points and merges them together into one set.

    Check out the complete changelog here.
     
  2. InScatterbrain

    InScatterbrain

    Joined:
    Mar 7, 2017
    Posts:
    233
    After installing v1.1.2 your tilemaps will deform again, because locking the shape is now an optional thing. To solve this, you should add the new Map Graph Tilemap Prefab component to your tilemap prefab and enable the "Lock Shape" option on it.

    Also, you can now use the new "Precise Margin?" input port on the Randomly Stamp Tilemaps node to create a more accurate margin around your tilemap placements. Just attach a constant bool node to it, enable the checkbox, and there should be no more gaps between your stamped tilemaps and their margins. :)
     
  3. spryx

    spryx

    Joined:
    Jul 23, 2013
    Posts:
    557
    This is an incredibly cool tool and I am keeping an eye on it for my next project.
    Question for you and my apologies if it has been answered.

    I see that MG can create both prefabs and gameobjects, but is it possible for MG to simply provide metadata
    so we can interpret/ modify that before visualization occurs.

    The reason I ask is that I have adapted Karcero for my current project (Karcero produces more pleasing dungeons than BSP-style algs). This works well enough, but I transform Karcero memory maps into metadata (VirtualMaps). From there I can apply styling (e.g. Old Dungeon, Lava Dungeon, etc).

    I realize this might be a loaded question of course, the various generators of MG would produce different sets of data, but is, or could there be a unique set of data tied to a particular generation alg? Might it be possible for end users to assign the metadata?

    Thanks for reading my long, rambling question here :)
     
  4. InScatterbrain

    InScatterbrain

    Joined:
    Mar 7, 2017
    Posts:
    233
    Thanks for the kind words! If I understand your question correctly, then yes, there's a couple of ways to achieve this. :)

    Actually the data for either tilemap or prefab maps is the same up until the point the data gets converted to either tilemaps or gameobjects by the appropriate nodes. You don't have to use those nodes, if you don't want to. Or you could write your own node before passing it on to those nodes.

    For example, here's the final part of one of the example graphs:

    upload_2021-1-7_23-45-4.png

    You could put your own custom node before the Texture To Tilemap node and manipulate the texture data, or after to manipulate the tilemap data, before passing it to the Copy Tilemap Data node

    You could even write your own node to convert (texture or tilemap) data to your own map format, instead of the default tilemap or prefab options. This is a way you could convert the data into the metadata you use for your VirtualMaps instead.

    Writing your own node is pretty straight-forward. (There's a section about it in the manual: https://mapgraph.insanescatterbrain.com/manual/creating_your_own_nodes.html)

    Another way to do it, is to output data using output parameters or to manipulate the tilemap or prefabs after Map Graph has finished (there's an OnProcessed event that gets called every time a map gets generated, that you could hook into).

    There's a caveat at the moment though, namely that the type of variables that can be used as in and output parameters is currently fixed, so at the moment you can't use your own classes as input or output for graphs (yet!). This is a limitation I want to get rid of sooner rather than later (which shouldn't be to hard at this point, actually :)). So I could move that up on the priorities list, if that would become an issue for you.

    Also, if you want a different styling or theme, you can simple create different tilesets/prefab sets that you can swap out to create different looking maps with the same graphs.

    Sorry for the equally (if not moreso :D) rambling answer. And don't worry if this sounds a bit overwhelming. I'll gladly help you out if you get stuck on something!

    I hope this answers your question? :)
     
  5. InScatterbrain

    InScatterbrain

    Joined:
    Mar 7, 2017
    Posts:
    233
    Map Graph v1.2 is now available.

    Changes:
    • Improved Map Graph's inspectors, such that list items such as parameters and named colors can now be renamed and reordered, among other improvements.

    • Added the Scale Texture node, for the up or downscaling of textures, which can be used to work with tilemap grids of different sizes, for example.

    • Fixed bug where the Randomly Fill Texture node's output mask wouldn't work, if no mask was provided as input.

    • Added instructions to the manual on how to install the sample project manually, as an alternative to the automatic install script.

    • Added a credits section to the sample project page of the manual, crediting the creators of the assets used in the sample project.

    • Added a missing change to the changelog for v1.1.2: Added optional port for setting the outline's width on the Draw Outline node.

    Check out the complete changelog here.
     
  6. InScatterbrain

    InScatterbrain

    Joined:
    Mar 7, 2017
    Posts:
    233
    Map Graph v1.2.1 is now available.

    Just a bunch of bug fixes this time.

    I've had some requests for additional examples for the sample project. So I'll be working on that for v1.3. :)

    Changes:
    • The graph editor no longer breaks when unsetting a loaded Graph's Named Color Set, if that graph contains any Named Color nodes. Instead the Named Color nodes' values get set to "[None]".

    • Fixed undoing/redoing removing entries from a Tileset type, Prefab Set type or Tilemap Set type.

    • A Named Color node's selected value now gets correctly restored after undoing the deletion of that particular value.
    • Input components now show a more specific warning when no runner is set or no parameter is selected, instead of showing a generic error.
    • A more specific error is now logged whenever a Tileset type, Prefab Set type or Tilemap Set type doesn't contain any entries.

    Check out the complete changelog here.
     
    w409544041 likes this.
  7. InScatterbrain

    InScatterbrain

    Joined:
    Mar 7, 2017
    Posts:
    233
    Map Graph v1.3 is now available.

    Changes:
    • Sample Project: Added RPG example.

    • Sample Project: Added hex strategy example.

    • Sample Project: Added race track example.

    • Added nodes for getting random values, specifically:
      • Random Bool
      • Random Color
      • Random Float
      • Random Int
      • Random Vector2
      • Random Vector2Int
      • Random Vector3
      • Random Vector3Int
    • Added Perlin Noise Fill Texture node, which fills a texture with a Perlin noise pattern.

    • Added Corner Points node, which extracts and outputs the corner points from a set of points.

    • Added Areas To Points node.

    • Added Draw Areas node.

    • Added Texture Size node (useful to get a texture's size after scaling it, for example).

    • Added extra Width ports to the Draw Outline node for different outline thickness on different sides.

    • Added Connect Diagonals port to the Extract Areas node. If set to true, diagonally neighbouring pixels will be considered to be part of the same area.

    • Added Outer Areas and Inner Areas output ports to the Extract Areas node, to differentiate between nodes that are touching the outer bounds and ones that aren't.

    • Default width when drawing connections is now 1 instead of 0.

    • Fixed bug where the graph editor would no longer show changes after having switched to another window.

    • Fixed bug where changes to a tilemap wouldn't get persisted after running a graph in the editor.

    • Fixed bug where the input parameter's ID would be displayed in the "parameter is not assigned" warning, instead of its name.

    • Fixed bug where the changes to object set (Tilesets, Tilemap sets, Prefab sets) entries wouldn't get persisted.

    • Implemented a workaround for a bug in the MIConvexHull library that would trigger a ConvexHullGenerationException in the Generate Area Graph node.

    Check out the complete changelog here.
     
  8. ysys-jeff

    ysys-jeff

    Joined:
    Aug 2, 2012
    Posts:
    8
    Great, I saw the hex strategy example, it takes some time to learn, thank you~;)
     
  9. InScatterbrain

    InScatterbrain

    Joined:
    Mar 7, 2017
    Posts:
    233
    I hope it helps!

    Let me know if there's something that needs more explanation. ;)
     
  10. clagrens

    clagrens

    Joined:
    May 19, 2017
    Posts:
    96
    Hi!I want to ask some question.
    Some time I want to reuse some small graph,But I do not see sub graph implementation.
    And I want to draw single rect or point but no node can do it.(For example: Hero reborn point)

    If you have some good method please tell me!
    Thanks!
     
  11. clagrens

    clagrens

    Joined:
    May 19, 2017
    Posts:
    96
    I modify the DrawRects node to support Draw single rect , but In graph view I can not get the texture preview.

    It work, but no preview , really strange.

    Here is the code.

    Code (CSharp):
    1. var rect = rectangleIn.Get<RectInt>();
    2.             var drawColor = drawColorIn.Get<Color32>();
    3.             var outlineOnly = outlineOnlyIn.Get<bool>();
    4.  
    5.             textureData = textureIn.Get<TextureData>().Clone(Disposer);
    6.             var colors = textureData.Colors;
    7.             var width = textureData.Width;
    8.  
    9.  
    10.             if (outlineOnly)
    11.             {
    12.                 var p0 = new Vector2Int(rect.xMin, rect.yMin);
    13.                 var p1 = new Vector2Int(rect.xMax - 1, rect.yMin);
    14.                 var p2 = new Vector2Int(rect.xMax - 1, rect.yMax - 1);
    15.                 var p3 = new Vector2Int(rect.xMin, rect.yMax - 1);
    16.                    
    17.                 textureData.DrawLines(drawColor, p0, p1, p2, p3, p0);
    18.             }
    19.             else
    20.             {
    21.                 for (var x = rect.xMin; x < rect.xMax; ++x)
    22.                 {
    23.                     for (var y = rect.yMin; y < rect.yMax; ++y)
    24.                     {
    25.                         var index = y * width + x;
    26.                         colors[index] = drawColor;
    27.                     }
    28.                 }
    29.             }
    30.            
    31.             textureOut.Set(() => textureData);

    upload_2021-2-10_15-7-36.png
    upload_2021-2-10_15-7-56.png
     
  12. clagrens

    clagrens

    Joined:
    May 19, 2017
    Posts:
    96
    I finish InvertMask node!
    I think it would be useful for someone else:
    Code (CSharp):
    1. var size = sizeIn.Get<Vector2Int>();
    2.             var mask = maskIn.Get<Mask>();
    3.            
    4.  
    5.  
    6.             var Newmask = new Mask();
    7.  
    8.             for (var i = 0; i < size.x*size.y; ++i)
    9.             {
    10.                     if(mask.IsPointMasked(i))
    11.                         Newmask.UnmaskPoint(i);
    12.                     else
    13.                         Newmask.MaskPoint(i);
    14.                    
    15.             }
    16.  
    17.             maskOut.Set(() => Newmask);
     
  13. clagrens

    clagrens

    Joined:
    May 19, 2017
    Posts:
    96
    And Random Size Circle Node!
    Code (CSharp):
    1. var fillColor = drawColorIn.Get<Color32>();
    2.             var centers = centersIn.Get<Vector2Int[]>();
    3.             var minradius = minradiusIn.Get<int>();
    4.             var maxradius = maxradiusIn.Get<int>();
    5.  
    6.             textureData = textureIn.Get<TextureData>().Clone(Disposer);
    7.  
    8.             var colors = textureData.Colors;
    9.             var width = textureData.Width;
    10.             var height = textureData.Height;
    11.            
    12.  
    13.             int radius = 0;
    14.  
    15.             foreach (var center in centers)
    16.             {
    17.                 radius = UnityEngine.Random.Range(minradius,maxradius);
    18.                 var relativePoints = TrigMath.CalculateAllPointsWithinCircle(radius);
    19.  
    20.                 foreach (var relativePoint in relativePoints)
    21.                 {
    22.                     var worldPoint = relativePoint + center;
    23.                     if (worldPoint.x < 0 || worldPoint.x >= width ||
    24.                         worldPoint.y < 0 || worldPoint.y >= height) continue;
    25.  
    26.                     colors[worldPoint.y * width + worldPoint.x] = fillColor;
    27.                 }
    28.             }
    29.  
    30.             textureOut.Set(() => textureData);
    upload_2021-2-10_17-10-58.png



    But I still dont know why the node preview no working.
     
  14. InScatterbrain

    InScatterbrain

    Joined:
    Mar 7, 2017
    Posts:
    233
    Unfortunately, there are no sub graphs. It's a planned feature, but I can't really say when it will be implemented yet. I'll move it up on the priorities list though. :)

    If you want to draw a single rectangle, you could simply pass a rectangle set containing only a single rectangle to a Draw Rectangles node. But I see you've already solved it by writing your own node. ;)
     
  15. InScatterbrain

    InScatterbrain

    Joined:
    Mar 7, 2017
    Posts:
    233
    Thanks for sharing! :)

    By default, a node doesn't have a preview image. You'll need to add your own NodeView class for that node type. Something like this should give you what you want:
    Code (CSharp):
    1. using InsaneScatterbrain.ScriptGraph.Editor;
    2.  
    3. [ScriptNodeView(typeof(DrawSingleRectNode))]
    4. public class DrawSingleRectNodeView : ScriptNodeView
    5. {
    6.      public DrawSingleRectNodeView(DrawSingleRectNode node, ScriptGraphView graphView) : base(node, graphView)
    7.      {
    8.          var previewImage = this.AddPreviewImage();
    9.          node.ProcessingCompleted += () => this.UpdatePreviewImage(previewImage, node.TextureData.ToTexture2D());
    10.      }
    11.  }
    This is an editor script, so make sure it's in an Editor folder (or assembly)
     
  16. InScatterbrain

    InScatterbrain

    Joined:
    Mar 7, 2017
    Posts:
    233
    Thank you for sharing! :)

    There's also an "Invert" option on the Texture To Mask node, but this is a great addition for existing masks.
     
  17. InScatterbrain

    InScatterbrain

    Joined:
    Mar 7, 2017
    Posts:
    233
    Again, thanks for sharing, that's awesome! :D

    To have a a preview on this one as well, you'll have to make another NodeView for it, similar to the one in my previous post. :)
     
  18. Seveen

    Seveen

    Joined:
    Jan 10, 2015
    Posts:
    1
    Hey there !
    I've started using that asset and it's very nice.
    I read in this thread that you were planning to allow arbitrary types as Input/Output of graphs, and I wanted to let you know I'm looking forward to this feature.
     
  19. InScatterbrain

    InScatterbrain

    Joined:
    Mar 7, 2017
    Posts:
    233
    Thanks for letting me know, I've put it on the list for the next feature update. :)
     
  20. InScatterbrain

    InScatterbrain

    Joined:
    Mar 7, 2017
    Posts:
    233
    Map Graph v1.3.1 is now available.

    Changes:
    • The Random BSP Rooms node no longer attempts to make rooms smaller than 1x1 in size, which causes a StackOverflowException.

    • A duplicate node can no longer be connected to the node that it's a duplicate of.

    • The Texture output on the Extract Areas node is no longer the same as the Texture input. Instead it only outputs the colors for the extracted areas, as intended.

    • The text field of the first new type in a tileset or tilemap set is no longer unresponsive until the asset is reselected in the project window.

    • Fields of constant nodes with multiple fields (like vectors) are now placed below each other instead of beside each other.

      This is to avoid an issue with Unity's flexing behaviour, where change in a field's width gets distributed over all the fields on that row instead of just the field that should have its width increased, causing the contents to be cut off.

    • Improved the workaround for exceptions thrown by the MIConvexHull library, as it didn't catch all cases.

    • Fixed bug where changes wouldn't show in the graph editor, if the editor was already opened on Unity startup.

    • Initialization script now sets graphs dirty to ensure that any changes are always persisted in standalone builds.

    • Sample Project: Removed unused named color and tile type from the Race Track example.

    • Manual: Added the tilesets, used in the new sample project examples, to the sample project page's credits section.

    • Manual: Updated the "Important Considerations" section of the "Creating your own nodes" page.

    Check out the complete changelog here.
     
  21. clagrens

    clagrens

    Joined:
    May 19, 2017
    Posts:
    96
  22. InScatterbrain

    InScatterbrain

    Joined:
    Mar 7, 2017
    Posts:
    233
    That looks interesting. I can't make any promises, but I'll definitely look into it. :)
     
  23. InScatterbrain

    InScatterbrain

    Joined:
    Mar 7, 2017
    Posts:
    233
    Map Graph v1.4 is now available.

    This version introduces sub graphs and the ability to add input/output parameter types. It's now also possible to connect an out port to an in port if the out port's type derives from the in port's type.

    Changes:
    • Added the Process Graph node, to process other graphs inside a graph (Sub graphs).

    • Added the [InPort] and [OutPort] attributes as a new way for adding ports to nodes.

    • Adding more parameter types is now possible by using the new [InPort] and [OutPort] attributes. The types of these ports will be added as a possible input or output parameter type.

      Please note that this only works when using the these attributes. Using the AddIn or AddOut methods will not add the types as possible parameter types.

    • An out port can now also be connected to an in port with a type that is a parent of the out port's type.

    • TextureData now uses a standard Color32 array instead of a native array, to avoid issues with disposing (or lack there of) when using texture data as an output parameter.

    • Manual: Updated the "Creating your own nodes" page.

    • Manual: Added a page explaining how to use sub graphs.

    Check out the complete changelog here.
     
  24. InScatterbrain

    InScatterbrain

    Joined:
    Mar 7, 2017
    Posts:
    233
    In order to use another graph inside a graph, simply add a Process Graph node (found under "Graphs > Process Graph"). When you assign the graph, that graph's input and output parameters are used as in and out ports.

    I've updated the "Creating your own nodes" tutorial to show how to use the new InPort and OutPort attributes. If you've added a lot of own custom nodes, don't worry, the AddIn and AddOut methods still work fine so you don't have to replace them all.

    You'll only need to replace an AddIn call with the new attribute if you want to add that type as a possible type for input parameters. And you only need to do it once for each type. Same goes for the out ports.
     
    clagrens likes this.
  25. InScatterbrain

    InScatterbrain

    Joined:
    Mar 7, 2017
    Posts:
    233
    Map Graph v1.5 is now available.

    This version introduces the Waveform Function Collapse (WFC) node. (Big thanks @clagrens for the suggestion! :))

    It also introduces a bunch of workflow improvements.

    The WFC node takes a (preferably) small training texture and generates a texture of a desired size that's locally similar to the training texture. It can require quite a bit more performance than more traditional techniques such as Celullar Automata and BSPs, but it can be a super powerful tool to generate complex structures, without having to create your own complex algorithms!

    A WFC example graph has been added to the sample project (and a tutorial page will be coming soon).

    To learn more about WFC you can checkout the original algorithm here: https://github.com/mxgmn/WaveFunctionCollapse

    Or checkout some of the (easier to understand) materials here:
    You can find out more about the WFC library Map Graph uses here: https://github.com/BorisTheBrave/DeBroglie

    To improve workflow, each graph will now open in its own window, so multiple graphs can be open at the same time. It's now also possible to generate a named color set from a tileset or prefab set. These named color sets will automatically be linked to the set it originates from. This means you no longer have to manually add a new named color by hand each time you add a new tile/prefab type. Existing named color sets can also be linked to one or more tile/prefab sets. (More info about how this works will be added to the manual soon.)

    Changes:
    • Added Waveform Function Collapse node.

    • Named Color Sets can now be linked to Tilesets and Prefab Sets, meaning that for every tile/prefab type, a named color will be added automatically. Whenever a type in a linked set gets added/removed/renamed, it will be synchronized with any linked Named Color Sets accordingly.

    • Each graph now gets opened in its own editor window.

    • Editor window now displays the opened graph's name as the window's title.

    • The script graph runner and script graph input components are now displayed as Map Graph Runner and Map Graph Input in the components menu. They are moved from the "Scripts" to the "Map Graph" category.

    • Added a "Add to Scene" button to the Map Graph inspector, which adds a new game object with a Graph Runner component to the current scene and assigns the selected graph to it.

    • Added a "Map Graph/Graph Runner" option to the GameObject create menu, which adds a new game object with a Graph Runner component to the current scene.

    • Added Tilemap To Data node, which converts a Tilemap object to a TilemapData object.

    • Added a preview image to the Texture To Mask node.

    • Graph runner's Processed event is now also available as Unity Event in the inspector.

    • Set a minimal width of 20 pixels for text input fields in the graph editor, so they're easier to select when they're empty or contain only one character.

    • Sample Project: Added a basic Waveform Function Collapse example.

    Check out the complete changelog here.
     
    Last edited: Mar 13, 2021
  26. InScatterbrain

    InScatterbrain

    Joined:
    Mar 7, 2017
    Posts:
    233
    Right now, my top priority is to dramatically improve the documentation. There have been a lot of changes and additions to Map Graph in the months since the first release and the manual has been lagging behind. I'm sorry to everyone that's been affected by this.

    Please don't hesitate to let me know if you get stuck on something that the documentation hasn't been able to help you with and I'll get back to you as soon as possible!

    In the meantime, I'm working on more tutorials and improving the node index page, so that it provides a clear overview of all the nodes and what their function is.
     
  27. InScatterbrain

    InScatterbrain

    Joined:
    Mar 7, 2017
    Posts:
    233
    The node index page has just been updated: Descriptions for each node's ports have been added, describing their functions and default values.

    This is the first in a series of documentation improvements. I plan to add more example usages, as well as example images, that should make it easy to understand what each node does. More tutorials will follow soon.

    If something in the node index is still unclear or if you spot any mistakes, please let me know and I'll update it. :)
     
  28. InScatterbrain

    InScatterbrain

    Joined:
    Mar 7, 2017
    Posts:
    233
  29. clagrens

    clagrens

    Joined:
    May 19, 2017
    Posts:
    96
    Thank you for your hardcore work!
    It must be the best Map generator in Asset Store now!
     
    w409544041 and InScatterbrain like this.
  30. InScatterbrain

    InScatterbrain

    Joined:
    Mar 7, 2017
    Posts:
    233
    I'm glad you like it! :)
     
  31. dbugger

    dbugger

    Joined:
    Jan 10, 2013
    Posts:
    55
    This looks great! I am guessing you used the GraphView API, right? I'm surprised you managed this much, with such a limited documentation.
     
  32. InScatterbrain

    InScatterbrain

    Joined:
    Mar 7, 2017
    Posts:
    233
    Thanks! :)

    That's right, Map Graph uses the GraphView API. There was quite a bit of trial-and-error involved, due to the lack of documentation, but once you get the hang of it, it's a very nice tool to have. And to be fair, Unity doesn't officially provide support for that API, so I knew what I was getting myself into. ;)
     
  33. InScatterbrain

    InScatterbrain

    Joined:
    Mar 7, 2017
    Posts:
    233
    Map Graph v1.5.1 is now available.

    This update adds a help button to each node, that allows you to quickly open a browser to that node's entry on the node index page.

    upload_2021-4-6_11-38-47.png
    You can find the help button in the top-right corner of each node.

    Changes:
    • Added help buttons to nodes in the editor that link to the node's documentation on the node index page.

    • Manual: Improved the node index page by adding descriptions about a node's ports.

    • Manual: Added images to the node index as visual examples of what these nodes can do.

    • The Draw Connections (Manhattan) node's Connection Width is now optional with a default value of 1.

    • Cleaned up unused variables in the Randomly Stamp Tilemaps node.

    • Moved TextureToMaskNodeView and ProcessGraphNode to the correct namespaces.

    • Random Points node's Percentage port now requires a connection, instead of the Mask port.

    Check out the complete changelog here.
     
  34. InScatterbrain

    InScatterbrain

    Joined:
    Mar 7, 2017
    Posts:
    233
    I've updated the manual again: Two new tutorial pages have been added under the new "Basic Map Types" section.

    The pages explain the basics of creating cave-like and room-based maps.

    More will follow soon!
     
    w409544041 likes this.
  35. w409544041

    w409544041

    Joined:
    Aug 3, 2017
    Posts:
    52
    Looks nice!Thank for your help.My Jprg style map now is works perfect.
    And Any Plans with new Node?
     
  36. InScatterbrain

    InScatterbrain

    Joined:
    Mar 7, 2017
    Posts:
    233
    Yes, I will continue to add new features, including new nodes. Right now my focus is on expanding the documentation though.

    Is there anything in particular you'd like to see added? :)
     
  37. w409544041

    w409544041

    Joined:
    Aug 3, 2017
    Posts:
    52
    Not yet,everything is going fine,now.
     
    InScatterbrain likes this.
  38. InScatterbrain

    InScatterbrain

    Joined:
    Mar 7, 2017
    Posts:
    233
    A new page has been added to the "Basic Map Types" section of the manual, called "Sample-based maps".

    It explains how to use the Waveform Function Collapse node to generate maps based on a sample texture.
     
    w409544041 likes this.
  39. InScatterbrain

    InScatterbrain

    Joined:
    Mar 7, 2017
    Posts:
    233
    The "Combining map types" page has been added to the manual.

    It explains how to combine different basic map types to create your own custom variations.
     
    w409544041 likes this.
  40. InScatterbrain

    InScatterbrain

    Joined:
    Mar 7, 2017
    Posts:
    233
    Added the "Tips for rule tiles" page to the manual.

    It links to information about Unity's rule tile system and describes how to avoid ending up with mismatched tiles, due to missing rules.
     
    w409544041 likes this.
  41. InScatterbrain

    InScatterbrain

    Joined:
    Mar 7, 2017
    Posts:
    233
    I've added a page about how to link tiles/prefab sets to a named color set (and why you'd want to ;)).

    I've also updated the "Creating your first map generator" tutorials, as some of the information on there was a bit out-of-date for the latest Unity versions (plus I fixed some mistakes).

    I'll start focusing on adding some new features again, but I'll keep adding new stuff to the manual as well.

    Please let me know if you want to see a tutorial about a certain subject or if something is not explained clearly enough!
     
    w409544041 likes this.
  42. InScatterbrain

    InScatterbrain

    Joined:
    Mar 7, 2017
    Posts:
    233
    Map Graph v1.5.2 is now available.

    This update contains the most recent changes to the manual and a couple of bug fixes.

    Changes:
    • Fixed bug where an exception would be thrown when removing the first or last type of a tile or prefab set

    • Replaced the default reorderable list headers with custom ones, as the default ones didn't show up in more recent versions of Unity.

    • The "Pick a set" window will no longer erroneously trigger the validation check when closing the window without a selection.

    • Manual: Added the "Basic map types" pages.

    • Manual: Added the "Linking a named color set to tilesets/prefab sets" page.

    • Manual: Added the "Tips for rule tiles" page.

    • Manual: Updated the "Creating your first map generator" tutorials.

    Check out the complete changelog here.
     
  43. bibaleebu

    bibaleebu

    Joined:
    May 3, 2021
    Posts:
    6
    Purchased last night and so far it hasn't disappointed! But I'm quite new to this whole aspect of game development and I'm having some difficulty. I want to generate a tilemap based off of perlin noise. That's easy, I've figured it out. But I want more than one threshold. Is there a way to set values for multiple tile types? If it's less than 10, it's water. 10-15 is shoreline, 16-30 is grasslands? That kind of thing? I tried running several noise nodes but even setting the seed myself, they weren't generating the same noise patterns. Thanks!
     
  44. InScatterbrain

    InScatterbrain

    Joined:
    Mar 7, 2017
    Posts:
    233
    The ability to reuse Perlin noise data for multiple thresholds, is something that's on my todo list, but unfortunately is not possible, quite yet. I'll add it to the list for the coming release, though!

    In the meantime, there are some alternative approaches possible. You could for example start out with the Perlin noise texture and add outlines of different tile types around it. Something like this:
    upload_2021-5-12_20-18-59.png

    Is that something that would work for your use case?
     
  45. bibaleebu

    bibaleebu

    Joined:
    May 3, 2021
    Posts:
    6
    Awesome, thank you!

    That will definitely work to allow me to continue prototyping while waiting on reusable noise values. I can just start with a background color of the lowest layer, then perlin noise myself a topmost layer and border everything in between, using random border sizes to up the variety.
    It’d be nice if there were an easy way to export perlin values to a 2d array. I could then grab two of those arrays and compare the values to set up a rudimentary biome generator. I’ll have to stick with unity’s built in noise for that now though. Just an idea
     
    Last edited: May 12, 2021
  46. InScatterbrain

    InScatterbrain

    Joined:
    Mar 7, 2017
    Posts:
    233
    I'll probably make it output a 2D array for the noise data, so it should be easy enough to export.

    Glad this solves your issue for the time being. Please let me know if you have any other questions or feature requests. :)
     
  47. JuanJSAR

    JuanJSAR

    Joined:
    Feb 21, 2014
    Posts:
    47
    Hi, are there any examples of use with 3D and multi-level?
    For example, to make a small city with mountains or different levels of height.
    for example:
    3b01e8d1-2f77-46d4-9f2d-c9efd8f08b0f.jpg
     
    w409544041 likes this.
  48. InScatterbrain

    InScatterbrain

    Joined:
    Mar 7, 2017
    Posts:
    233
    There's a 3D example included, but it's single level. However, there are a bunch of examples that use multiple layers of tilemaps, which is basically the same process, except for the type of output generated. I'll look into adding a multilevel example, though. :)

    If you don't want to wait for that and want to try to do if yourself, just let me know if you get stuck and I'll gladly help you find a solution. :)
     
  49. JuanJSAR

    JuanJSAR

    Joined:
    Feb 21, 2014
    Posts:
    47
    It would be great, I have not bought it yet, but I am interested in making maps that are randomly generated like the one in the previous image. Since I want the maps to always be varied.

    Could you make an example like in the image to see if it works for me?

    Thank you and I'm sorry for the inconvenience.
     
  50. InScatterbrain

    InScatterbrain

    Joined:
    Mar 7, 2017
    Posts:
    233
    It's no inconvenience! It seems like a good idea to have an example like that. :)

    I'm hoping to have some time this week to work on it.
     
    JuanJSAR likes this.