Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

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
    It's been a little while since the last update was released, so I thought it'd nice to share some details about what I've been working on. :)

    Let me start by saying that I've no intention to stop development on Map Graph anytime soon. So if there's some time between updates, don't worry, it probably just means that I'm working on something that takes more time than usual, or that I'm stuck working on another project that's way less fun, but helps pay the bills. ;) Right now, it's a bit of both.

    So what's coming to Map Graph v1.14? The most significant changes are two new optimizations options.

    The first one being a pooling system, that will reduce the number of memory allocations to a minimum when running a map generator. This will mostly benefit projects that require map generation during gameplay, where it's critical to avoid garbage collection as much as possible.

    The second change is the introduction of multi-threading. Currently, all nodes in a graph are run in sequence on a single thread. There's an option to run a graph asynchronously, so that it doesn't run on the main thread and lock up your game or the editor, but it still uses a single thread.

    Running nodes in sequence makes sense, as a node usually requires the result from another node as input, so it has to wait for the previous node to finish processing anyway. However, there are a lot of situations where nodes could be processed at the same time, which could significantly reduce the time it takes to run a map generator. The new multi-threading feature checks which nodes are dependent on which and uses that information to run nodes in parallel on different threads, whenever possible.

    Multi-threading will mostly benefit "tall" graphs, meaning graphs that don't mostly consist of nodes that only depend on the output of a single other node. (These types of graphs usually look visually taller in the graph editor, so that's why I call them that. :D) There's a performance overhead to using multi-threading, so for graphs that aren't very "tall" it might actually hurt performance a bit and add unnecessary complexity, but for graphs that have a lot going on at the same time, this should reduce the processing time considerably.

    So when is this coming? Honestly, I don't have an ETA yet for v1.14. These features have been mostly implemented, but the debugging process has been slow going at times, and with the holiday season upon us, I don't really want to make any promises about release dates that I can't keep.

    Ok, this is turning into a wall of text, that might make it sound more complicated and scary than it actually is. (It is for me at least ;))

    All you really need to know, is that there will be something like two new checkboxes, one to enable pooling and one to enable multi-threading. That should be all you need to do to use these new features.

    I hope this gives some insight on what's coming. As always, if something's unclear or you have any other questions or feature requests, please let me know. You can post it here or sent me a DM or e-mail, if you prefer. :)

    Happy holidays!
     
    Last edited: Dec 19, 2021
  2. Looping_co

    Looping_co

    Joined:
    Dec 10, 2016
    Posts:
    19
    Hi,
    Great asset!
    Question :
    - I use the RogueLike Map exemple.
    - If I understand well, the ground cover the whole area and the wall are the "real walls" and the space between the rooms.
    - Is it possible to have the ground only be the ground inside the room (and not inbetween the room)?

    I ask that because I need to raycast (ground) to spawn objects.

    Thank you,
    Vincent
     
  3. InScatterbrain

    InScatterbrain

    Joined:
    Mar 7, 2017
    Posts:
    233
    Hi Vincent,

    If I understand correctly, what you want is to basically "subtract" the wall layer from the floor layer so that it doesn't stretch out across the whole map under the wall layer? Is this correct?

    If so, you can do that by creating a mask out of the wall layer and applying that to the floor layer before outputting it. Something like this:
    upload_2022-1-20_16-6-58.png

    Would something like that help solve your issue?
     
  4. Gekigengar

    Gekigengar

    Joined:
    Jan 20, 2013
    Posts:
    738
    Hello, I need something like a gradient/blur/dither node to decide the spawn possibility. (Like for example, less spawn density the further it is from a certain area/region), how do I do this?

    Perhaps a dithered dissolve node would be great? (Dissolves the edge of a texture in various dither options or noise, using the center of the texture's volume.)

    EDIT: And the lack of basic math node feels odd, I can't generate maps that are percentage based, like city area should be 30% of the map size variable. Even basic ones like add/subtract/multiply/divide would be really helpful.
     
    Last edited: Mar 30, 2022
  5. clagrens

    clagrens

    Joined:
    May 19, 2017
    Posts:
    96
    You can use Boolean operations.
    And custom nodes are easy to create.

    Some nodes support setting percentages.
     
  6. Gekigengar

    Gekigengar

    Joined:
    Jan 20, 2013
    Posts:
    738
    But math nodes are basic enough that it should be there by default.

    Boolean value does not have a distance falloff. when its closer to the edge, thus I request a dithered dissolve node.

    I also encounter an issue with the cellular automata smoothing node, it always creates 4 dots at the corners of the texture.
     

    Attached Files:

  7. InScatterbrain

    InScatterbrain

    Joined:
    Mar 7, 2017
    Posts:
    233
    I like the idea for a dither/dissolve node. I'll look into that. :)

    I'm not sure what would be the purpose of a gradient or blur node, though. The problem with gradients and blurs is that it would create new colors to transition from one to another. Those transition colors are most likely not defined as a named color, so Map Graph won't know what to do with those.

    The reason there are no basic math nodes is simply because it (surprisingly) hasn't been requested before and I've personally never had much of a need for them. However, I agree with you that it would make sense to have them and they should be easy to add, so I'll look into that as well.

    Those new nodes might not be included yet in the next release (v1.14) as it's already taking quite a while to get done and I'm hesitant about adding new stuff to that now that it's finally almost finished.

    I'll try to follow it with another release containing those new nodes quickly after the v1.14 release though. However, if you're really stuck without them, let me know and I'll see about providing them to you in a separate patch file.

    You probably want the "[Area] Urban" color to be assigned to the "Empty Color" port in this context. That should get rid of the little white dots. :)
     
    Gekigengar likes this.
  8. Gekigengar

    Gekigengar

    Joined:
    Jan 20, 2013
    Posts:
    738
    You're right, I think dissolve dither would make more sense.

    As for maths node, it would be more than happy to have basic add/subtract/multiply, and nothing more complex. This would already open up a whole new possibility.

    I see, thanks!
     
    InScatterbrain likes this.
  9. InScatterbrain

    InScatterbrain

    Joined:
    Mar 7, 2017
    Posts:
    233
    I've decided to add the basic math nodes to the coming v1.14 release after all, as they're easy enough to implement that it shouldn't hold up the release in a significant way. :)

    I'll look into dissolve dither for the release (soon) after v1.14.
     
    Gekigengar likes this.
  10. Gekigengar

    Gekigengar

    Joined:
    Jan 20, 2013
    Posts:
    738
    Necronator_map_.png
    Is there a way to extract points and connected points data for use?

    I want to use each points as nodes, and want to know which points are connected to which. Wanted the connection to be generated by Map Graph so I can visualize and ensure there will always be a proper route.

    EDIT: Nvm, found out how to use Graph Output. Thanks for the awesome tool!
    poo.png
     
    Last edited: Mar 31, 2022
    InScatterbrain likes this.
  11. Gekigengar

    Gekigengar

    Joined:
    Jan 20, 2013
    Posts:
    738
    Is there a way to connect an already connected point?
    I have 3 areas generated.
    1. Forest
    2. Bridge
    3. City

    But I need the bridge to be the only connector between forest and city.

    My current approach sometimes failed me.
    1. I create points on each area.
    2. I merge the points.
    3. I use generate area graph.
    4. I use draw connections.

    But there is 2 problems in my current approach.
    1. I am not able to create different connection style. (Such as using shortest path for Forest, and Manhattan for City)
    2. Sometimes there will be nodes creating edges across the river.
    Currently I am thinking of 2 nodes that could be helpful to solve this problem.
    1. Connect connected points node which takes 2 already connected point, and try to make a connection between them. (This way 2 connected point can have a connector and a different style)
    2. Connection Mask, which only allows connection to be created within a specific masks. (This way I can use the water color as mask)
    3. Make connection node with max distance option. (But this might fail certain setups, so might not be a surefire way to solve this)
    www.png
    Example of 2 routes
    2 routes.png
     
    Last edited: Mar 31, 2022
  12. InScatterbrain

    InScatterbrain

    Joined:
    Mar 7, 2017
    Posts:
    233
    You could achieve different connection styles by using masks before connecting them. Would something like this work for you?
    upload_2022-3-31_11-23-14.png

    Having mask support directly on the connection nodes would be more convenient though. I'll put it on my todo list to look into that.

    I'm not really sure about the additional connections over water though. If you get a single point from each side and connect those, there should never be an additional connection. I'd need to see the part of the graph that's responsible for creating that connection to see what might be going on there.
     
  13. Gekigengar

    Gekigengar

    Joined:
    Jan 20, 2013
    Posts:
    738
    But will they connect to each other?
     
  14. InScatterbrain

    InScatterbrain

    Joined:
    Mar 7, 2017
    Posts:
    233
    Not initially, no. This approach creates two separate road networks.

    However, you can connect them together with a bridge afterwards.

    I'm not sure what your current approach is for doing this, but one way of doing it would by stamping the separate networks back onto a single texture and connect those again. Something like this:
    upload_2022-3-31_13-15-31.png

    Using this method should only ever create one bridge between the two networks. So that should solve your second problem. :)
     
    Gekigengar likes this.
  15. Gekigengar

    Gekigengar

    Joined:
    Jan 20, 2013
    Posts:
    738
    Thanks, I will give it a try, mind sharing the map graph for me to study from?
    My current approach is to create the forest/city zones, then use their mask to generate points.
    Just didn't know I can connect them using the extract & draw connection (Shortest) without ruining all the other connections.
    BSP.png
    And I end up making roads from BSP Rectangle node, which makes more sense for a city.
    Dark teal is the buildings, thanks for the awesome tool, love learning and using it so far :p
     

    Attached Files:

    • BSP.png
      BSP.png
      File size:
      10.1 KB
      Views:
      261
    Last edited: Mar 31, 2022
  16. InScatterbrain

    InScatterbrain

    Joined:
    Mar 7, 2017
    Posts:
    233
    I can't share the graph file itself. I quickly made it in the in-development version, so it wouldn't be compatible with the Map Graph version you're currently using. Here's a couple of screenshots of the complete graph though.

    Let me know if there's anything that needs clarification. :)
    upload_2022-3-31_14-4-12.png

    upload_2022-3-31_14-5-18.png

    Indeed, they don't necessarily interfere with each other. :)

    The extract & draw connection nodes are sub graphs (you can press the "Open" button on them to see their underlaying graphs), that extracts areas based on the given color, creates a connected graph and draws those connections onto the texture.

    In the first step, creating the networks, each random point is treated as its own area as they're all unconnected.

    In the second step, connecting the networks, each network is treated as an area, as all the points they consist of are now connected.

    Yeah, that looks cool!

    I'm glad you're enjoying it. I don't get to see what people make with Map Graph as often as I'd like, so thanks for sharing. It's really great to see the creative things people create with it.

    If you'd be able to share the results at some point, I'd be really interested in seeing that. :)

    If you have any more questions/suggestions, please don't hesitate to let me know!
     
  17. InScatterbrain

    InScatterbrain

    Joined:
    Mar 7, 2017
    Posts:
    233
    Hey everyone,

    First of all, sorry for the long radio silence. I've been trying (and honestly failing a little bit :rolleyes:) to balance multiple projects during the last couple of months, resulting in all of those projects (including Map Graph) taking more time than I intended.

    Having said that, v1.14 is pretty much done now. I just need to do some final bug testing, but I don't expect to run into any more major issues at this point. Assuming that all goes smoothly enough, I'm planning to submit v1.14 to the asset store at the end of week 19 (week of May 9th).

    Heads up to people that created their own custom nodes: you might need to make some minor changes to those nodes and their views. This new version comes with the biggest overhaul of Map Graph's code since its first release and unfortunately requiring these changes was unavoidable to add support for multi-threading and pooling. Applying these changes should be easy though and how to apply them will be described in the documentation. :)

    If you have any questions, please don't hesitate let me know here or you can sent me a DM (here or on Twitter) or send me an email.
     
  18. InScatterbrain

    InScatterbrain

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

    Always backup your project before updating Map Graph!


    This version comes with a bunch of new features, including the option to run graphs on multiple threads and the option to enable object pooling.

    Please check out the following pages on how and when to use these features:
    - Running a graph asynchronously/multi-threaded
    - Object Pooling

    Things to be aware of when upgrading from a previous version:
    • Map Graph now uses a different random number generator, which means that if you were using static seeds to get a specific result, those seeds will now give different results than before.

    • If you've created your own custom nodes:
      • Any preview images you are using on your custom node views will likely no longer work: Please check out the Creating your own node views page to see how to use preview images in v1.14.
      • The TextureData's Colors property is no longer an Array. In order to break as little as possible, it still supports most things that it would when it was still an Array, but in some situations changes to your code might be necessary.
        The property is now obsolete and using the new SetColor and GetColor methods is preferred.
    • Map Graph has undergone quite a big overhaul under the hood, meaning that it is possible that you'll run into new issues or unforeseen breakages. If you do, please reach out to me here on the forum (this topic or DM), by email or on Twitter and I'll look into it as soon as I can.


    Changes v1.14:
    • Graph runners now have the option "Enable Multi-threading". Checking this option, will process nodes simultaneously on different threads wherever possible.

    • Introduced a pooling system to reduce memory allocations, which should avoid GC issues when generating during gameplay.

    • Map Graph now uses its own random number generation system, instead of .NET's System.Random.

    • Static random seeds can now be set as either an integer or GUID.

    • Area graphs are now generated using a modified version of the Delaunator library, instead of the MIConvexHull library.

      This improves performance and reduces the number of memory allocations.
    • Added addition/subtraction/multiplication/division nodes for int, float, Vector2, Vector2Int, Vector3 and Vector3int types.
      These can be found under Math in the node creation menu.
    • Added the "Run On Awake" option to the graph runner.

    • Added two options to the Create menu to quickly create all the assets needed for either a tilemap-based or prefab-based Map Graph system.

      The new options are available in the Create menu under "Map Graph/Default Assets".
    • Fixed a bug where the Texture To Data node would fail when executed on a non-main thread.

    • Fixed bug where the last item in a data set list was selected by default, with newer versions of Unity.

    • Fixed autofocussing input fields on new nodes for newer versions of Unity.

    • Fixed issue where pasting would paste a previous selection of nodes, instead of the current one.

    • The script graph runner's inspector now gets repainted manually after it's done running a graph, to avoid situations where inspector remains disabled until the mouse enters the inspector.

    • Added a label on the graph runner inspector to display the latest execution time.

    • Renamed "Merge Areas Node" to "Merge Areas".

    • Manual: Added "Using prefabs instead of tilemaps" tutorial.

    • Manual: Added "Placing pre-designed tilemaps" tutorial.

    • Manual: Updated out-dated tutorials.

    • Manual: Added Areas Special Points to the node index.

    • Manual: Updated "Running a graph asynchronously" tutorial to include information about multi-threading.

    • Manual: Added "Object Pooling" tutorial.

    Check out the complete changelog here.
     
    spryx, w409544041 and Gekigengar like this.
  19. InScatterbrain

    InScatterbrain

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

    This update consists of bug fixes.

    Changes:
    • Fixed bug where node execution time label wouldn't get updated with object pooling disabled.

    • Preparable objects, such as tilemap sets, assigned to a constant node are now prepared before running the graph.

    • Adding the same tile/prefab to a set no longer triggers an exception when deserializing that set.

    • Fixed bug where the Rectangles To Areas node would only add the outline points of the rectangles to their respective areas.

    • Empty entries are now removed from sets when its editor gets disabled.

    • Ports no longer get disconnected when their name is changed.

    • The Random Rectangles and Randomly Stamp Tilemap nodes "Fill Percentage" has been renamed and fixed to function as "Max. Fill Percentage" as originally intended.

    • Fixed bug where the Rectangles To Areas node would convert the rectangles to areas with their width and height reversed.

    Check out the complete changelog here.
     
    w409544041 and Gekigengar like this.
  20. InScatterbrain

    InScatterbrain

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

    More bug fixes.

    Changes:
    • Fixed parameter list undo/redo behaviours
      • Adding a parameter is now undoable and redoable.
      • Undoing the deletion of a parameter on a graph that's being used as sub graph, now properly restores the matching port on the affected nodes.
    • Deleting a graph asset that's used as a sub graph, now reloads all the editor windows, to reflect that change without having to reload the editor windows manually.

    • Deleting a graph asset now closes its graph editor windows.

    Check out the complete changelog here.
     
  21. InScatterbrain

    InScatterbrain

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

    Changes:
    • Added Draw Random Rectangles node, to generate random rectangles and draw them in a single step on a new or existing texture.

    • Added Draw Random Points node, to generate random points and draw them in a single step on a new or existing texture.

    • Added Current Or Empty Texture node, to create a new texture or pass through a texture provided. Mostly useful for sub graphs.

    • Added Scale Texture To node, to scale to a specific size. Helpful to deal with precision loss when scaling a texture back to its original size, for example.

    • Added Extract Color node, to easier extract a color and/or the mask, in a single step.

    • "Min. Fill Percentage" ports have been added to the Random Rectangles and Randomly Stamp Tilemap nodes.
      Existing ports connected to the Max. Fill Percentage ports will automatically be connected to the new Min. Fill Percentage ports as well, to avoid unwanted changes in the output of existing graphs.

    • Randomly Stamp Tilemap node's "Fill Percentage" is now actually called "Max. Fill Percentage". Also updated documentation to reflect the name and behaviour change.

    Check out the complete changelog here.
     
    w409544041 and Gekigengar like this.
  22. w409544041

    w409544041

    Joined:
    Aug 3, 2017
    Posts:
    52
    @InsaneScatterbrain Hi,will mapgraph can do a game like Terraria or StarBound,in short word,Chunk based generate.thanks for your reply.
     
  23. InScatterbrain

    InScatterbrain

    Joined:
    Mar 7, 2017
    Posts:
    233
    It's something I want to explore, but haven't looked into much yet, because before the introduction of multi-threading and pooling I didn't think it was a very viable thing to do, except for maybe generating really simple map chunks.

    Using those options though, now you should be able to create chunks at runtime without too much issue. The challenge would be in stitching those chunks together, I think.

    It's something I want to look into further, so I'll move it up on the priority list and see if I can add some features that will make it a bit easier to do and add a basic example or two. Not sure when I'll get around to it that yet though. :)
     
    w409544041 likes this.
  24. w409544041

    w409544041

    Joined:
    Aug 3, 2017
    Posts:
    52
    yeah,in asset store it none chunk base plugin yet,i think muliti thread and pool is good for chunk base generate too.alghough i bought map graph already,but i still want to buy it again.
    by the way,https://assetstore.unity.com/packages/tools/utilities/terratiler2d-198030#content,the plugin is want to do a game like terraia,but absent feature of chunk based,so it will be impossible to make it.
     
  25. w409544041

    w409544041

    Joined:
    Aug 3, 2017
    Posts:
    52
    upload_2022-6-19_8-18-45.png
    it is just roadmap,the author said,it is too hard to implement it.
     
  26. InScatterbrain

    InScatterbrain

    Joined:
    Mar 7, 2017
    Posts:
    233
    You don't need to buy Map Graph again though. If I understand the asset store license agreement correctly, you only need one license per person and you can use it on two computers at the same time. :)
     
    w409544041 likes this.
  27. InScatterbrain

    InScatterbrain

    Joined:
    Mar 7, 2017
    Posts:
    233
    It might be pretty hard to implement it in Map Graph as well, and it probably won't play nice with every single node, but I think it's worth looking into. :)
     
    w409544041 likes this.
  28. w409544041

    w409544041

    Joined:
    Aug 3, 2017
    Posts:
    52
    in recently mapgraph,multi thread and pool were already introduced,so what is your next plan?or next version to do.
    Just curious.
     
  29. InScatterbrain

    InScatterbrain

    Joined:
    Mar 7, 2017
    Posts:
    233
    There's a lot of things I still want to add, but my main focus right now is to make Map Graph a bit easier to use.

    I've had some feedback that it can be a bit tedious to work with all the smaller nodes to get to the bigger result and that it feels like you have to repeat a lot of the same steps.

    To solve this issue, I've been adding more subgraph nodes out of the box for v1.15 and the upcoming v1.16 and I will continue to add more of those going forward.

    I also want to add more of the "missing" basic nodes, such as more basic math operations, for example.

    I try to keep my planning flexible though and change it based on the needs of Map Graph's users. For example, I've moved up chunks-based generation up on the priority list, so that it's now planned for v1.17.

    So please keep sharing suggestions and problems you're having. Obviously I can't promise that every suggestion will make it into Map Graph, but they often do in one form or another. It really helps me a lot in figuring out the needs of Map Graph's users. :)

    For the long term, I'm thinking about doing a v2.0, somewhere in the (probably not so near ;)) future. It would break compatibility with the v1.x versions and that would allow me to make some bigger overhauls to improve the user experience, performance, etc. But I've got no concrete plans on when or if that will happen.
     
    w409544041 likes this.
  30. w409544041

    w409544041

    Joined:
    Aug 3, 2017
    Posts:
    52
    i am so surprised,you move chunk based as v 1.17,because i am fan of terria,but i cant do a chunk based technique.
    in short way,if 1.17 release, use mapGraph,i can do a map just like Terraria or StarBound or MineCraft,right?
     
  31. InScatterbrain

    InScatterbrain

    Joined:
    Mar 7, 2017
    Posts:
    233
    That's the plan. I can't guarantee yet if I'll be able to make it work though. ;)
     
    w409544041 likes this.
  32. InScatterbrain

    InScatterbrain

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

    Changes:
    • Added notes that can be added through the new right-click menu option "Add Note". Only available on Unity 2020.1 and higher.

    • It's now possible to create reference nodes for process graph/subgraph nodes.

    • Renamed the "Add Note" option on the nodes to "Add Comment" to distinguish between the notes on nodes and the new standalone notes.

    • Added Draw Random Circles node, to generate random circles and draw them in a single step on a new or existing texture.

    • Added a subgraph version of the Draw Border node, to draw the border in a single step on a new or existing texture.

    • Added a subgraph version of the Random BSP Rooms node, to generate BSP rectangles in a single step.

    • Added a subgraph version of the Generate Area Graph (Minimum) node, to generate a MST Area Graph in a single step.

    • Added Mask out port to the Draw Border node.

    • Added Mask out port to the Draw Points node.

    • Added preview image to the empty texture node view.

    • Right-clicking a reference node now shows the "Show Original Node" option, to easily navigate to the original node.

    • Updated parts of sample project to use the new subgraph nodes.

    Check out the complete changelog here.
     
    Gekigengar and w409544041 like this.
  33. w409544041

    w409544041

    Joined:
    Aug 3, 2017
    Posts:
    52
    cant believe that,you are so fast.so next is V 1.17 chunk based?
     
  34. InScatterbrain

    InScatterbrain

    Joined:
    Mar 7, 2017
    Posts:
    233
    Yes, that's the plan. Currently, experimenting with some ways of doing that. Might take a bit longer than the previous two releases though. ;)
     
    w409544041 likes this.
  35. w409544041

    w409544041

    Joined:
    Aug 3, 2017
    Posts:
    52
  36. InScatterbrain

    InScatterbrain

    Joined:
    Mar 7, 2017
    Posts:
    233
    Sure, that seems fine. You'll probably want to start by creating a base layer for the landscape using perlin noise or cellular automata smoothing and then draw the rooms on top of that, using BSP or random rectangles and then go from there.

    If you look at the example project it'd be similar to a combination of the landmass example and the roguelike (rooms) or rpg example.
     
    w409544041 likes this.
  37. w409544041

    w409544041

    Joined:
    Aug 3, 2017
    Posts:
    52
    And how to implement circle dungeon,like below?
    https://ctrl500.com/tech/handcrafte...nexplored-explores-cyclic-dungeon-generation/
     
  38. InScatterbrain

    InScatterbrain

    Joined:
    Mar 7, 2017
    Posts:
    233
    I don't think there's a way you could do that with Map Graph out of the box right now.

    To me this looks like a very specific use-case, which means I don't think that will be implemented in Map Graph anytime soon, sorry.

    So you'd have to create your own custom node(s) to make this work in Map Graph.
     
    w409544041 likes this.
  39. w409544041

    w409544041

    Joined:
    Aug 3, 2017
    Posts:
    52
    thanks,so it is doable with map graph,just need some custom nodes?
     
  40. InScatterbrain

    InScatterbrain

    Joined:
    Mar 7, 2017
    Posts:
    233
    Not sure, but you can basically make custom nodes run whatever code you write for them, so I don't see why it couldn't work. It just might be a lot of work. ;)

    If you decide to try, I'd interested to see how it turns out. :)
     
    w409544041 likes this.
  41. InScatterbrain

    InScatterbrain

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

    Changes:
    • Nodes can now be copy/pasted from one graph to another.

    • When a reference node and the node it's referring to are copy/pasted together, the copy of the reference node will now refer to the copy of the node it's referring to.

    • Added "Coordinates" in port to the Perlin Noise Fill Texture node, allowing for chunk-based generation.

    • Added "Points Per Unit" in port to the Perlin Noise Fill Texture node. If a PPU is set, instead of the texture's dimensions, the PPU will be used to normalized point coordinates.

    • Added "RNG State" in port to the Perlin Noise Fill Texture node. Passing a RNG state to this node, will make the node use that RNG state, instead the graph assigned RNG state.

    • Added math nodes: Clamp (Float), Clamp (Int), Max (Float), Max (Int), Min (Float), Min (Int), Power, Square Root.

    • Sample Project: Added "Perlin Noise Chunks" example.

    Check out the complete changelog here.
     
  42. InScatterbrain

    InScatterbrain

    Joined:
    Mar 7, 2017
    Posts:
    233
    In the new version (v1.17) there's now an example in the sample project on how to do chunk-based generation.

    Right now chunks are limited to map generation based on the perlin noise node. I might look into expanding on that in the future, but that seemed to be the sensible starting point.

    The example is still very basic, I might make it a bit more elaborate at some point in the future, but it should be enough to get you started. :)
     
    w409544041 likes this.
  43. w409544041

    w409544041

    Joined:
    Aug 3, 2017
    Posts:
    52
    can you add the new chunk based demo in website:https://insane-scatterbrain.itch.io/map-graph-demo-project ?
     
  44. InScatterbrain

    InScatterbrain

    Joined:
    Mar 7, 2017
    Posts:
    233
    w409544041 likes this.
  45. w409544041

    w409544041

    Joined:
    Aug 3, 2017
    Posts:
    52
    for the chunk demo,is there a "How to do"?i am no idea,how to test chunk based feature.thanks for your reply.
     
  46. InScatterbrain

    InScatterbrain

    Joined:
    Mar 7, 2017
    Posts:
    233
    The new web build is up here.

    There's no tutorial on this yet. I'll likely write one once this functionality reaches a bit more of a mature state. The node index will be updated with v1.17.1 to describe how the new ports on the Perlin Noise Fill Texture node can be used.

    In the meantime, I would suggest looking at the code in the sample project and at the Chunk Manager component's code in particular, as it contains all the code that calls the graph runner to generate all the different chunks.

    If something's unclear, please just reach out to me and I'll do my best to explain it. :)
     
    w409544041 likes this.
  47. w409544041

    w409544041

    Joined:
    Aug 3, 2017
    Posts:
    52
    just take a little time in it,i will say it is awesome.
    you can control the player do anything when map is generating,no Process blocking,Amazing.
    Just emm,it is too simple,if have more complicated like tera styple,that will be very helpful.
    i am looking forward with it.And thanks for your great works,the map graph is the only one Asset which have Chunk Based,i cant image that without you,how can i do a game like tera or starbound, thanks thanks.
     
    InScatterbrain likes this.
  48. InScatterbrain

    InScatterbrain

    Joined:
    Mar 7, 2017
    Posts:
    233
    Yes, the example is very basic. I just wanted something that simply shows how to do the chunk-based generation itself and not much else.

    I'd like to create a more complete example at some point, but that will take a lot more time. I'm not sure yet when I'll get around to that, so I can't give you an ETA on that yet, sorry. :(

    I suggest you start by looking into combining this example with the techniques shown in the other examples and work from there. I think all the pieces are there to get a solid start on that. And if you get stuck on something specific, let me know and I'll try to help you the best I can. :)
     
    w409544041 likes this.
  49. InScatterbrain

    InScatterbrain

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

    Changes:
    • Note theme and font options now get persisted.

    • Fixed issue where dropping a connection on the canvas from a reference node wouldn't automatically open the node creation menu.

    • Multiple graph runners running the same graph will now never try to run the same graph at the same time, as it currently isn't supported and causes issues.

    • Right-clicking a note in the graph editor no longer shows the Add Node and Add Group options.

    • Right-clicking a note in the graph editor now shows the correct text "Note" instead of "Node" on option such as "Duplicate Note".

    • Fixed bug where notes in a copied selection wouldn't be included in the selection after pasting.

    • Manual: Updated the "Adding Notes" page (now the "Adding Notes & Comments" page).

    • Manual: Updated the node index to include the nodes that were added in v1.17.

    Check out the complete changelog here.
     
    w409544041 likes this.
  50. w409544041

    w409544041

    Joined:
    Aug 3, 2017
    Posts:
    52
    Hi, can map graph do a map like diablo2,diablo2 is using many predifined rooms,and combination them.
    i dont know how to use map graph to do that,any tips?