Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

MapMagic 2 - infinite procedural land generator

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

  1. Sluggy

    Sluggy

    Joined:
    Nov 27, 2012
    Posts:
    1,008
    Does anyone have some advice on how to properly setup DirectMatricies for querying textures when using Biomes? I've tried adding an identical Texture node and output matrix via the use of a function and I've also tried removing all texture and matrix outputs except on a single layer. No matter what it seems that I can only retrieve the topmost layer from the biome node via script using MaxtrixWorld.GetWorldValue() when it comes to texture values regardless of what is actually displayed on the terrain at the given location.



    EDIT:

    Just to be a little more specific, I'm actually obtaining the tile's DirectmatrixiesHolder and then looping through all of it's keyvalue pairs looking for the best fit. In every case where the texture of a lower layer doesn't match the texture of a higher layer it seems I cannot get anything except 0 back from all possible queries.

    Code (CSharp):
    1. var terrain = tile.GetTerrain(false);
    2. var holder = terrain.GetComponent<DirectMatricesHolder>();
    3.  
    4. //TODO: yay, loads of garbage being generated here... :P
    5. string currBestId = string.Empty;
    6. float currBestValue = 0f; //default strength of 0. we need a value higher than this to even consider playing a sound
    7. var maps = holder.maps;
    8.  
    9. var mapPos = Map.transform.position;
    10. foreach (var kvp in maps)
    11. {
    12.     MatrixWorld matrix = kvp.Value;
    13.     if (!matrix.ContainsWorldValue(srcPos.x - mapPos.x, srcPos.z - mapPos.z))
    14.         continue;
    15.  
    16.     //check the value for this matrix and see if it's better than our current best, if
    17.     //so that means we found the best id to play for this location.
    18.     float val = matrix.GetWorldValue(srcPos.x - mapPos.x, srcPos.z - mapPos.z);
    19.     if(val > currBestValue)
    20.     {
    21.         currBestValue = val;
    22.         currBestId = kvp.Key;
    23.     }
    24. }
    25. if (!string.IsNullOrEmpty(currBestId))
    26.     return mat.RandomSound(currBestId);
    27. else return null;

    EDIT 2: Looks like I may have found my answer here. https://gitlab.com/Mnlk/mapmagic-spline-tools/-/wikis/tutorials/mm2_biomes

    The Biome Height Sync looks to be the tool I can use to output heights to the texture blend node within the root graph. It's gonna be another twelve hours till I get home and can confirm, though.
     
    Last edited: Mar 20, 2024
  2. deshowiz

    deshowiz

    Joined:
    Mar 28, 2015
    Posts:
    22
    I've been having an issue with object masks:

    upload_2024-3-20_20-49-10.png

    upload_2024-3-20_20-49-28.png

    A selector is creating the mask from the noise map. I've made sure to check that there isn't somehow some residual value above 0 coming out of the selector anywhere. The object density is high in the screenshot but that's just to easily reproduce the issue. It is reproduceable with a low density as well. I notice that if I change the mask seed the extra objects will sometimes appear and disappear in different spots on the map.
    upload_2024-3-20_20-53-8.png
    I tried updating recently to solve this problem and that has not fixed the issue. I need very exact results for what I'm doing and this is cutting into the output considerably. Any ideas?

    Edit: I realize the mask looks slightly off cause I posted the wrong selection, but the process is the same. It's using a selector with 0 transition and no color values to match those random outside object positions exist.
     

    Attached Files:

    Last edited: Mar 21, 2024
  3. Sluggy

    Sluggy

    Joined:
    Nov 27, 2012
    Posts:
    1,008
    Not sure if your problem is related to what I've seen but I often find 'ghost' objects that were previously spawned and never cleaned up after making changes to the graph and then generating. When that happens, I need to completely clear out all tiles (either via unpinning and re-pinning or via code at runtime) in order get rid of them.
     
  4. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,282
    Well, yes. However it's implemented only for the new spline engine, and doesn't work with current one. I'm not sure that the new system will be included in next update, so will think of a way to downgrade it to the old one.

    On second though - why not? We can have two parallel spline systems for test purpose since they both are still in beta.

    Good catch! I could reproduce and fix this issue. Here's a fixed version (MapMagic\Generators\Objects\Runtime) if you don't want to wait for the next release.

    I will appreciate if you could find the way to reproduce it. Yes, pinning and unpinning tiles might help, but it's definitely not okay, and I'm going to fix it.
     
    deshowiz likes this.
  5. o888Roses

    o888Roses

    Joined:
    Nov 27, 2019
    Posts:
    21
    Hey! Just a few problems I've been running into when using MM these past weeks:

    Laggy Dragging

    Laggy generator dragging caused by recording the undo action every frame. By diagnosing the method
    Code (CSharp):
    1. GeneratorDraw.MoveGenerator(Cell cell, Vector2 moveTo)
    I was able to find that
    Code (CSharp):
    1. GraphWindow.current.graphUI.undo.Record()
    takes between 70ms up to 340ms to process, per frame. What I did to fix it was modifying the
    Code (CSharp):
    1. MoveGenerator(Cell cell, Vector2 moveTo)
    to comment out the record undo:
    Code (CSharp):
    1. public static Vector2 MoveGenerator(Cell cell, Vector2 moveTo)
    2. {
    3.     // Commented out because of performance issues.
    4.     // GraphWindow.current.graphUI.undo.Record();
    5.  
    6.     // Other code...
    7. }
    And modified the end of the
    DragGenerator(Generator generator, HashSet<Generator> otherSelected = null)
    method to support undo only when starting to drag:
    Code (CSharp):
    1. // If we start dragging then we can start recording the undo object.
    2. if (DragDrop.TryStart(generatorCell, UI.current.mousePos, generatorCell.InternalRect))
    3. {
    4.     GraphWindow.current.graphUI.undo.Record();
    5. }
    This way, it only causes a little bit of lag at the start of the dragging operation (between 80 to 340 milliseconds) but it stays fluid after that.

    Crashing when adding any new layer
    Basically, adding a new Layer of anything (Prefabs, trees, grass, texture layers, etc) on a fairly big graph will show a "hold on" message forever:

    upload_2024-3-22_12-39-39.png

    Steps to reproduce:
    1. Have an fairly big graph.
    2. Add an Objects out generator.
    3. Add at least 5 items in it (the more item you had, the longer it'll make you wait).
    4. Add a sixth item, and it will get stuck in this eternal loading loop.

    Extra Info:
    • Of course, I tried simply waiting. Since my laptop isn’t the best, I thought it might just take for ever (for some reason). Turns out waiting 30 minutes wasn’t enough.
    • I disabled “Auto Generate” (the option to automatically re-generate the terrain when changes are made to the graph), but that did not change either.
    • I tried unlinking the generator completely before adding a new item, but there again, it didn’t solve anything.
    I also found that the more layers you add, the longer the loading time will be, but after 5 the loading time is basically infinite for me.

    Overall, adding more and more elements to the graph will show this unity popup (even for non layers actions which still are taking the longest to compute) slowing down the creation workflow by a lot :(

    Potential issues?

    Since this is causing unity to load forever, I suspect some kind of infinite loop somewhere. In the task manager, Unity does seem to be responding as well, indicating it’s not performing an operation too heavy for it. Maybe a nasty while(true) loop is hidden somewhere?

    Even after looking through the layer code and object fields code for some time I could not find anything directly related to this issue. Not being the author of the code myself, there was too many links leading to different places to find anything meaningful

    It's really annoying though, as it means that I pretty much cannot add anything to my graph anymore. Any idea of why it happens?
     
  6. Greviouss

    Greviouss

    Joined:
    May 27, 2016
    Posts:
    176

    Direct matrices does not record the textures placed in the world, just a height representation of whatever you fed to it..

    I have already posted the solution for finding the highest texture in a stack at a given point : HERE
     
    Sluggy likes this.
  7. Greviouss

    Greviouss

    Joined:
    May 27, 2016
    Posts:
    176
    Nice fix on the drag!
    the real reason for my message here tho is :
    I do not suffer from the same issues you do with object placement changes, even dynamic ones like you mentioned.
     
  8. Greviouss

    Greviouss

    Joined:
    May 27, 2016
    Posts:
    176
    @Wright
    This looks promising
    but i cannot find the actual node for this anywhere?
    In my biomes i have an issue where when i try to section off a slope for anything it sees the edge of where my biomes meet as part of a high degree slope and i cannot find a way around this that actually works right... that node loosely seems like it would kind of solve this specific issue for me (not sure how ill link it across 17 biomes... but sure)..
    upload_2024-3-22_9-52-37.png
     
  9. o888Roses

    o888Roses

    Joined:
    Nov 27, 2019
    Posts:
    21
    I'm on a not so good laptop + my mm/unity installation must be hella broken since pretty much anything I do throws these popups:
    upload_2024-3-22_15-31-42.png
    Weirdly enough, I don't have this issue on my PC either, only on me laptop :(
     
  10. Greviouss

    Greviouss

    Joined:
    May 27, 2016
    Posts:
    176
    if your laptop does not have a gpu like nvidia etc, an integrated gpu from intel or other will not do that well,
    If you do have one of the better gpu solutions, ensure that it is being used by windows when unity launches.
     
  11. o888Roses

    o888Roses

    Joined:
    Nov 27, 2019
    Posts:
    21
    Yeah I have an intel Iris XE graphics card lol, though my processor is pretty good and I have plenty of RAM:
    upload_2024-3-22_17-7-29.png
    upload_2024-3-22_17-7-43.png

    Quick Update
    The infinite loading appears to be happening when finishing to generate the terrain:
    upload_2024-3-22_17-8-31.png

    Then I thought that it might be caused by an infinite loop in one of my own generators, but unplugging all of them didn't solve anything. I think there's a loop somewhere with portals: the first requiring the second and the second fetching data from the first. I'll review my graph in it's entirety again and update you after that.
     
  12. o888Roses

    o888Roses

    Joined:
    Nov 27, 2019
    Posts:
    21
    Update
    God thanks I had made backups of the graph from before I added what made everything go wrong. I ended up rewriting the whole thing using functions for each and every aspect of the terrain. The graph went from a big mess that cannot fit on screen at once, even in Mini mode, to this, way cleaner base graph:

    upload_2024-3-22_18-29-56.png
    I don't encounter this infinite loading issue anymore, so I guess the problem was indeed a nasty nested infinite loop somewhere in my logic. The good side of things is that now I have a super flexible and pretty looking graph to work with :]

    For those curious about what functions look like, here's what the "Manage Human Interactions" function look like. Sorry if it's a bit zoomed out :[

    upload_2024-3-22_18-39-58.png
    Here's how it looks in-game! (The roads are in white so it's easier to see them):

    upload_2024-3-22_18-44-18.png
     
    Sluggy and hopeful like this.
  13. Greviouss

    Greviouss

    Joined:
    May 27, 2016
    Posts:
    176
    The ultimate question will be :
    With that many nodes,...
    How long does it take to generate a standard tile (1k res @ 1k size) ?
     
  14. o888Roses

    o888Roses

    Joined:
    Nov 27, 2019
    Posts:
    21
    My terrains are 192×192 as I found that to be the sweet spot for quality/memory usage. While large tiles do offer more time to the processor to process the neighbouring tiles, I found they often take a lot of space in memory. Very small tiles have the same problem, but they generate even slower because the CPU only has so many threads to work with.

    But anyway, on my crappy computer, one tile of size 1024×1024 took 6547ms on average to generate.
    The equivalent of that is 6 tiles of 192×192 (equivalent to a 1152×1152 tile) took 2479ms on average (tested 20 times for both, and averaged the results).

    Optimisation truly is a struggle with MM unfortunately though. Only having two LOD levels is really limiting. I really want to implement my own terrain tiles to allow for any number of LOD levels (probably using a DetailLevel array), but I haven't had the courage to go and start implementing it :(
     
  15. Sluggy

    Sluggy

    Joined:
    Nov 27, 2012
    Posts:
    1,008
    They can be used if you feed the textures into them however, that seems to entirely break down once biomes are introduced. The link I posted ended up being way more hassle than I wanted so I rolled back to my classic terrain sampler solution which looks about the same as yours. Thanks for the headsup, regardless!
     
  16. Greviouss

    Greviouss

    Joined:
    May 27, 2016
    Posts:
    176
    biome nodes do not import the terrain data, they create thier own independant matrixworlds kinda,
    ive posted about this before but this image should cover it enough....

    check for this in your biome node:

    upload_2024-3-22_20-55-37.png
     
  17. Greviouss

    Greviouss

    Joined:
    May 27, 2016
    Posts:
    176
    I have created a system that allows me to have multiple mm controllers at varying sizes and densities - each with independent graphs that all overlap, and dynamically remove overlapping tiles....

    ill post another updated video on it soon but you can see the early version here
     
    Last edited: Mar 23, 2024
    khushalkhan, Sluggy and hopeful like this.
  18. Sluggy

    Sluggy

    Joined:
    Nov 27, 2012
    Posts:
    1,008
    Out of curiosity, is that something you'd ever consider releasing? I was quite dismayed a while back when I discovered that mapmagic only manages a single object in the scene. Thankfully, my scene is very low complexity so it didn't matter that much. But it would have allowed me more freedom if I could have, say, nested one map inside of another that had a hole cut out of the middle.
     
    Greviouss likes this.
  19. o888Roses

    o888Roses

    Joined:
    Nov 27, 2019
    Posts:
    21
    Hm yeah I've seen it already and it's really impressive! I know it's possible but it's just such a long thing to implement and I can't get to just doing it. Instead I'll add more detail to my world :D
     
    Greviouss likes this.
  20. Greviouss

    Greviouss

    Joined:
    May 27, 2016
    Posts:
    176
    My theory is once my game releases i will release all the map magic stuff that makes it possible as a companion asset to map magic 2.
     
    Sluggy likes this.
  21. Greviouss

    Greviouss

    Joined:
    May 27, 2016
    Posts:
    176
    @Wright there is no active event for OnTileDestroyed or OnTileRemoved etc....??
    Im sure thats intentional cause no one ever needed it maybe, but having a need for it I noticed it was not an option...
     
  22. Greviouss

    Greviouss

    Joined:
    May 27, 2016
    Posts:
    176
     
  23. Greviouss

    Greviouss

    Joined:
    May 27, 2016
    Posts:
    176
    @Wright - Generate is creating errors but Its not always happening,
    Can i safely just alter the values created by Generate, without breaking anything I dont know about that would be relying on specific returns from Generate()... or is something looking at these expecting those specifics and im just not seeing it?


    upload_2024-3-27_0-43-39.png
     

    Attached Files:

  24. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,282
    Thanks for finding that out! Yes, this should increase the performance. I will check that undo works properly and do the same for the next version. Except maybe instead of adding something laggy at drag start I will do it on MouseUp, when lag won't be noticeable. I've got to store node original position to temporarily move it here before undo, but I think it's possible.

    Could you please email me that fairly big graph (just graph itself, no scene needed) so I could look into it?

    Hm, I can think about adding something similar - but it's a bit unclear on what exactly it does. So, it outputs height from a biome in BiomeSet? From all biomes? Is it masked height - I mean height multiplied with biome mask, or just general height this biome produces? Or is it the final blended heights from whole BiomeSet? And why height only - height is nothing but a mask and it doesn't differ from texture mask or any other map.

    Well, there are no LOD levels at all. Drafts could be called LOD levels, but actually they are a bit different - they are generated differently, or, to be exact, their generation is cancelled differently. If you change the node the main tile generation will be cancelled and new one launched - while the draft will still be finished to display the change. So Draft is mainly an editor thing for the preview. Ability to use them in playmode is just a bonus.

    I see your use case - you want direct matrices to behave similarly to Height or Texture output, with a finalize stage that will blend all outputs. I wonder why it doesn't work this way by default - I don't remember how it's made but I will look into it.

    @All: I really encourage you to use Functions, especially when working with biomes that require some additional inputs or outputs.

    Multi-resolution approach really reminds me cluster system. Well, I should give it one more try someday.

    It's because the tiles are not removed :)
    In playmode MM uses a tile pool, to avoid deleting and instantiating tiles - with the terrain, but, more important, scattered objects on it. You can use this event to track this:
    Action<TerrainTile> OnTileMoved

    Could you please clarify which specific values you're referring to when you mention altering the Generate function's output? Are these the generated products? But that's what Generate does. Or - what do you mean by "alter"?
     
    hopeful likes this.
  25. SophisticatedSheep

    SophisticatedSheep

    Joined:
    Oct 10, 2021
    Posts:
    5
    I've been trying to place more complex objects (namely ponds with stones around them) to the proceduraly generated terrain and would love some ideas how to prevent the issue when different biomes blend together. Objects themselves can be set to "pure" in the biome blend, but in this case the object itself is not in the biome transition, but the outer parts are:
    On edge with another biome.PNG
    Here is how the graph is generated (the Ponds locations are just random scatter with safe borders to prevent placement on tile edges):
    Ponds graph - stamp.PNG

    What I would need is some kind of "Safe borders" node for Biome blends (I am aware that calculating safety in this case is far easier for tiles than for biome blends). Basicly Locks that can be added procedurally. Any ideas how to best solve this?
     
  26. o888Roses

    o888Roses

    Joined:
    Nov 27, 2019
    Posts:
    21
    I can do that for sure, I think I've saved a copy of the graph. I'll also send you the custom nodes that are in use in the graph (so you don't get confused with unknown nodes).

    Also I managed to fix the problem by splitting the graph in a lot of different functions; I think the problem was mainly a lot of connections between the different parts of the graph, and probably an infinite loop somewhere. Remember kids: always split up the work in different files, it helps readability and bug solving!

    This said I am now facing another, more complicated problem: tiles do not tile seamlessly anymore for some reason.
    I've tried reconstructing the current graph to see when exactly it stops being seamless, and I've found that it actually wasn't seamless from the very beginning :(
    I'll also send you that graph if you're fine with taking a look at it
    Thanks in advance!
     
  27. Greviouss

    Greviouss

    Joined:
    May 27, 2016
    Posts:
    176
    So its worth pointing out that that biome node exists on your help page (thats where i found it) so i was assuming you knew something about it :cool:

    as for the problem it should overcome... or maybe theres another way, idk..

    for me ... i cache my biome terrain and reload it back in the biomes node per biome that needs it... this works fine, especially if i have a terrain out that isnt these and those manipulate....

    The problem comes in around the edges of the biomes...
    Consider these two shots - the first one has no vertical slope assigned to the brown area for rocky faces etc, the second one does include this - but notice how it surrounds the biome completely... this is because the edge is passed off to microsplat as a sharp slope and not the edge of the terrain, ....

    upload_2024-4-1_1-31-12.png
    upload_2024-4-1_1-33-34.png

    and close up on the lower left where the most biome action is you can see how bad this actually is :

    upload_2024-4-1_1-35-8.png

    the graph for this brown biome is extremely simple, and the only difference is the slope node between the two :
    upload_2024-4-1_1-36-5.png

    and the graph that builds this is relatively small if the working under the hood is a bit busy...

    upload_2024-4-1_1-38-45.png

    now the portal pigtail at the end....
    required as is or none of it even works.... (how weird is that?)

    i have tried a plethora of ways to solve this, and when i saw what i assumed was a node you had created i also assumed it might work in the direction of fixing this
     
  28. Greviouss

    Greviouss

    Joined:
    May 27, 2016
    Posts:
    176
    upload_2024-4-1_1-42-3.png

    so this is a snip from your function in mm where the goal i assume is to fix guid's that have a 0 or duplicate value -
    however the way you are calculating these are by time, and while maybe not in the past on slower hardware but my current pc can process more than one on the same clock tick, resulting in a duplicate value that throws that error... now without digging forever, (and even if i do) the error of me altering these output numbers to bypass the duplicate value error could maybe never appear for me and instead for some player(s) down the road cause i have no clear idea where they are also being used at in mm2...

    upload_2024-4-1_3-25-54.png

    but if the actual number assigned there doesnt really "matter" then i can just change how it is being assigned ....

    p.s. mm2 bug here :D
     
    Last edited: Apr 1, 2024
  29. Greviouss

    Greviouss

    Joined:
    May 27, 2016
    Posts:
    176
    its only kinda multi resolution - i couldnt work out the math to do full native dynamic resolutions - largely because the upscaling options dont take into account that the difference potentials of margins, (and coding my own c# node on this instead of leveraging your c++ work is too slow to execute and as a result out of the question to implement at higher resolutions)
    So without forcing specific margins, getting the math to determine the dynamic scale value from any given margin to another while maintaining the node scale was sadly beyond my ability to solve with 100% accuracy....

    So my solution there doesnt actually upscale in most cases - it litterally takes the same resolution and kinda works horizontally instead of vertically packing a more dense area instead with the same resolution, (so a 1km area at 512 - broke down into 4x .5 km areas with the same 512 resolution across each smaller tile... )
    and when it does upscale, it relies very heavily on pre determined static upscale and some rather large margin values that are actually kinda wasteful in loading time and resource usage
     
    Last edited: Apr 1, 2024
  30. Greviouss

    Greviouss

    Joined:
    May 27, 2016
    Posts:
    176
    I see this is how you intended for them to be used - but actively using these in playmode as a LOD is pretty much how i have seen everyone attempt to use them, even me...

    I think thats worth noting ..
     
    hopeful likes this.
  31. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,282
    Do I understand it correctly that you want to scatter objects only where biome mask intensity is 100%? If so there is a way to do it. Biome Blend parameter in Object/Tree output generators is responsible for this. Setting it to Pure will spawn objects only when biome is pure.

    Theoretically MM should determine and prevent creation of loops, even with portals or functions. It will draw the dragging link as red and won't create it upon mouse release. But probably custom nodes, especially changing of their inlets/outlets from code might bypass this. I will look into your graph a bit later - you don't need it now, right?

    You mean it is creating tiles that are not welded with their neighbors? How big is the difference - is it several meters or the tiles absolutely incompatible with neighbors? May I ask you to try to remove custom nodes from the graph to see if the problem persists? If so - could you send me this version?

    If you are talking about this - then it's not my help page :)

    So - you don't want these gray edges to appear? Or you want, but there's something wrong with them?

    Ids are per-generator. It's assigned on node creation and never changed after. Unless you are swift enough to create several nodes in one millisecond this should not happen. Even then there's an id counter that increments after each creation (and applied to new id with bit shift) in case you are creating nodes with the code. So I believe the problem here is deeper than just id assignment - are you manipulating your graph with scripts somehow?

    But yeah, you can change id on node creation - but I don't recommend you doing this when node it linked. And of course it's a don't during generation.

    Well, yes. But at the other hand - there is LOD system for terrains, built-in by Unity. It's questionable whether we should generate 256 for far away terrains first, then 512, then 1024 - instead of just generating 1024 at once for far away terrain. The generation happens in a background, so it can work while the game is running.
     
  32. Greviouss

    Greviouss

    Joined:
    May 27, 2016
    Posts:
    176
    I am blind and... I dont even know how i found that ?...
    I followed up on it - its a nice bit of support nodes for mm2, I might check it out..
     
  33. Greviouss

    Greviouss

    Joined:
    May 27, 2016
    Posts:
    176
    Im not, these occur ever so often on a recompile of my project - not all the time, and i cannot tell what exactly is triggering it...

    I do replace the graphs but i dont alter them, and i do this at runtime, not compile time really... and once the final one is in - its in

    Yea i havent seen the processing time on that actually produce positive results - on the upper resolution end -- , but because of that - what I have seen is that you can produce things like cheaper trees, or drawing areas using texture count drops with a easier to process graph for the "LOD" terrains that are farther off vastly improving the range visuals without a full taxation drop of a high detail (or even second) pass...
     
    Last edited: Apr 3, 2024
  34. o888Roses

    o888Roses

    Joined:
    Nov 27, 2019
    Posts:
    21
    No no, take your time, especially the infinite looping problem is not urgent since i've managed to fix it by using functions.

    With roads and all, it will create a difference of several meters. Forests don't propagate well to neighbouring tiles either, and sometimes they simply cut-off. It is like if the tile was positioned wrong, and thus didn't weld properly. Here's a picture of how that looks like:

    Small difference:
    upload_2024-4-4_11-41-46.png

    upload_2024-4-4_11-42-5.png

    Quite bigger difference:

    upload_2024-4-4_11-42-39.png

    Huge difference:

    upload_2024-4-4_11-43-8.png

    upload_2024-4-4_11-44-15.png

    I also sent you this version in my email.
    I also tried removing all of my custom generators, and reconstructed the graph node by node to see where it all started to go wrong, and I found that it was starting to get out of hand around the curve, after the noise pass (my graph is based on the spline example).
     
  35. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,282
    Well, actually it is really so - tiles do not exchange information on what they have generated. Otherwise the generated result will depend on what tile generated first (and thus on a direction player walks). To solve this margins are used - each tile is generated with some additional information that overlaps with the other tile. This value could be changed in Tile Settings. Some generators (especially Blur and Erosion) can exceed margin values, and this is what happened on the screens. Try reducing erosion or blur iterations.

    Objects nodes might have even bigger margins with using Scatter's node Advanced / Additional Margins value.
     
    hopeful likes this.
  36. o888Roses

    o888Roses

    Joined:
    Nov 27, 2019
    Posts:
    21
    I tried margins up to 192 which is the size of a tile, so I thought this wasn't the issue. I'm not using any blur, and my erosion instances is set to 3, that's why I don't understand why it wouldn't work.

    Furthermore, even without erosion, the problem is still here:
    upload_2024-4-4_19-1-36.png
    (this is when disabling completely the erosion node)
     
  37. Greviouss

    Greviouss

    Joined:
    May 27, 2016
    Posts:
    176
    Ping me on discord and i will look at your graph
     
  38. SophisticatedSheep

    SophisticatedSheep

    Joined:
    Oct 10, 2021
    Posts:
    5
    As I've said, I am aware of the Biome Blend. The object placed has Biome Blend set to "Pure", but the surrounding area created with the Stamp is cut off by the biome transition. Hence the Pond being cut off.
    Is it possible to include Locks that are placed at runtime? Is such a thing feasable? I don't know how else I could place a pond so that it doesn't overlap with other biomes.
     
  39. allaith

    allaith

    Joined:
    Jan 13, 2017
    Posts:
    7
    hey everybody,

    I got 3 quick questions about MM2, I hope someone can maybe guide me through, because I purchased the full bundle and I want to make the most out of it.

    1- is there any way to make the flattened spots any other shape than circles, I'm talking about the flatten node ?
    I tried using stamps but they are too chaotic and slow so I'm stuck using the flatten node and its sad that it only generate in the shape of circle.
    2- is there any place or any resource i can maybe get, that will provided extra nodes ? even if they were in beta or experimental, maybe things that could help generate unique shapes or maybe help make gameplay areas a bit more better than the simple flatten node.
    3- is there a way to connect an area that is locked to the procedural main road, see example :

    upload_2024-4-6_21-7-49.png

    I'm making a VR game and MM2 looks like it will be my method of generating the levels.
     

    Attached Files:

  40. Greviouss

    Greviouss

    Joined:
    May 27, 2016
    Posts:
    176
    @Wright
    The margins variable in the BlendLayer function in VsProMapsOut needs a -1

    Higher up in the function you offset the whole thing by -1 but fail to accommodate the blend layer with this same offset

    5x5 tileset without the -1 to margin offset :
    upload_2024-4-7_13-45-25.png

    5x5 tileset with this fix :
    upload_2024-4-7_13-45-58.png
     
  41. Greviouss

    Greviouss

    Joined:
    May 27, 2016
    Posts:
    176
    All this seems possible sure - it will take you some time to figure out how to harness MM2 to your vision...
    if your vision is simple... this will be easy with near no coding
    the less simple and more complex the idea that is your game is / becomes... the more likely your gonna need to get ready to learn custom node coding.

    I bought map magic 2 over 2 years ago and i just in the last 3 months have my games "vision" on screen in a way i like it kinda mostly sorta ... even if its not still a game yet....

    If you have a simple plan or your good at coding (which im sure making a VR game this wont be your first attempt right?) - maybe this is easy

    If not... strap on... i mean in... strap in... heh
    (yep shameless strike at disney shame on me)
     
  42. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,282
    It would be handy if you could post the screenshot of your graph here.

    This might work - you can add slightly add (with 1% opacity) to the biome mask it's blurred version. So near the transitions biome intensity will be 99%, but still enough to prevent objects spawning here.

    A bit hacky, though. I'm thinking of a way to provide biome graph it's current biome mask, so you could use it here and avoid spawning with blurred mask from inside biome.

    Well, you can use stamp node to mask between circle-flattened and original non-flattened maps. But I understand your use case, I can think of adding a special node for this.

    Here :)
    Feel free to use this forum thread to share your nodes.

    If you place void object with some specific tag near the edge of the lock you can read it's position with Get By Tag node. Once done it will be a regular object inside MM, so you can interlink splines to it.

    Got it, adding to my to-do list
     
    SophisticatedSheep likes this.
  43. SophisticatedSheep

    SophisticatedSheep

    Joined:
    Oct 10, 2021
    Posts:
    5
    Good idea, I'll try that. Thanks. But having the biome mask in the biome would be really awesome to be able to play around with biome edges.
     
  44. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,282
    Done! It works, will be available in the next update.

    I've started to look into this, however can't wrap my head around what margins you are talking about. VS Pro map output takes area margins. Should it be area margins-1? If so maybe I'll expose this parameter somewhere in the node?
     
  45. Greviouss

    Greviouss

    Joined:
    May 27, 2016
    Posts:
    176
    upload_2024-4-14_16-0-19.png

    this is where i changed mine to get those results i posted, probably not the best place but it did work..
     
  46. SSL7

    SSL7

    Joined:
    Mar 23, 2016
    Posts:
    349
    is there a public var that shows when mapmagic2 is generating terrain and when its finished?
     
  47. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,282
    Got it, thank you! Will expose it to node's advanced parameters.

    Sure
    mapMagicObject.IsGenerating ()

    Finds out if MapMagic is currently generating or applying terrains.

    You can also use
    mapMagicObject.GetProgress ()

    Returns minimum and maximum of the generated tiles (excluding previews), in percent 0-1. But it's way slower than IsGenerating, might impact performance a bit if checking every frame.

    I also recommend you taking a look at events - in most cases subscribing to OnTileApplied or OnAllComplete would be a wiser choice than querying MM each frame.
     
    SSL7 likes this.
  48. NestorVG

    NestorVG

    Joined:
    Feb 12, 2019
    Posts:
    40
    Is there any reason why using the exposed variables too often can cause the Thread manager to throw errors at like 144?

    This is the line throwing the error:


    I have this set where I get the exposed variables for several noises at the same time:



    This is the special node for voronoi that I use, which includes displacement, since it is not supported by default for some reason

     
  49. Greviouss

    Greviouss

    Joined:
    May 27, 2016
    Posts:
    176
    Solved ;)
     
    NestorVG likes this.
  50. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,282
    Under displacement - do you mean offset, like in Noise node?
    Really, why doesn't Voronoi have it? My loss, I will fix this.
     
    Greviouss likes this.