Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Join us on Dec 8, 2022, between 7 am & 7 pm EST, in the DOTS Dev Blitz Day 2022 - Q&A forum, Discord, and Unity3D Subreddit to learn more about DOTS directly from the Unity Developers.
    Dismiss Notice
  3. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

MapMagic 2 - infinite procedural land generator

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

  1. Evallis

    Evallis

    Joined:
    Nov 6, 2012
    Posts:
    20
    For anyone who is modifying their graph at runtime for world generation sliders or options shown to the player before the world is generated, you can modify any graph's "Override Variables" through code, even sub-graphs like biomes!

    For example, in all my biomes I have a Constant exposed to a value called "Trees" that I use to mask the final count of trees on a tile.

    A.PNG

    Before I generate the world, I use this code to alter the "Trees" value on all my biomes based on a slider that the player can change.

    Code (CSharp):
    1. foreach (MapMagic.Nodes.Graph Biomes in YourMapMagicObject.graph.SubGraphs(false))
    2. {
    3.      Biomes.defaults["Trees"] = TreesSlider.value;
    4. }
    You can also access a graph directly in your script by assigning it in the inspector:

    Code (CSharp):
    1. public MapMagic.Nodes.Graph MyGraph;
    2.  
    3. // Then change the variables you want.
    4. void Start()
    5. {
    6.      MyGraph.defaults["Trees"] = TreesSlider.value;
    7. }
    8.  
    Note that this does change the variable's value on the graph asset itself, so the change will persist if you use this in the editor! (My values are always set before the world generates, so it doesn't matter for me.)

    There might be a better way to do this, but this has been working for me.
    Hope this helps someone!
     
    Wright and Liminal-Ridges like this.
  2. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,145
    Could you please remind what is the grass problem in URP?
     
  3. Tim-Wiese

    Tim-Wiese

    Joined:
    Jul 7, 2012
    Posts:
    64
    I'm sort of losing my mind with MapMagic2. It's constantly breaking where I have to go and mindlessly reconnect already connected links between seemingly random nodes after a couple generations. Main Terrain will simply stop rendering with no visible errors or warnings. I pulled out microsplat thinking that was the issue since it also seems to barely be functional with mapmagic2. I really want this to work but it feels like with 2021.3.9f1 this is barely usable. Is there any known bugs with this? This is exhausting trying to sort out what the issue could be because it seems to be completely random.
     
  4. dwilhelmdw

    dwilhelmdw

    Joined:
    Mar 22, 2019
    Posts:
    11
    Not MapMagic2 related but, looks likes Humble Bundle is doing a Nature Manufacture bundle.
     
  5. Liminal-Ridges

    Liminal-Ridges

    Joined:
    Oct 21, 2015
    Posts:
    224
    My mistake, grass works fine.

    Im working with latest both MM2 and Unity without problems so the error is in your project. Maybe make a new project?
     
  6. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,145
    Wait, what?! No, it's not a known issue, but I'm anxious to know why this happens. If it occurs in a clear project and you could find out the steps to reproduce at least with some probability - please let me know! Most probably I will need a scene, a graph and their meta files.

    Does someone else have the same issue?
     
  7. Tim-Wiese

    Tim-Wiese

    Joined:
    Jul 7, 2012
    Posts:
    64
    Hi Denis,
    What's a good email to send this stuff over to. I obviously can't send the models/textures but the objects are nothing custom all available on asset store. Nature Manufacture/Nature Renderer 2021, Microsplat all latest and up to date.

    Today I'm finding 4 nodes in a graph is too much I guess? All I had was noise/contrast/selector/height is set to 500 height with 1000 size tile and there was a Microsplat node with 12 textures assigned (not connected) it was way way to slow even when panning around the graph with a constant hitching chugging to do anything. This chugging became present as I started to work on the full graph but also after deleting everything in the graph so all that was left was those nodes. My guess is some kind of slow down is happening over time.
    Also it seems like copy/pasting nodes from another graph is a big nono? Typically, I find it results in a 50/50 chance of a crash to occur and don't even think about copy/pasting the microsplat node.

    Also, are there certain nodes that are expensive to use? I have about 5-6 grass nodes since I can only add one grass object per node (i'm using mesh unlit for Nature Renderer/Shaders 2021).
    Is the stroke node expensive? I use them frequently to place ferns, branches, small rocks etc around trees. I also use those strokes to place textures beneath trees (ie: leave texture) and also to keep some objects from spawning vs using stroke or other less precise means.
    Also, I had functions working when trying to clean up my graph but found it exploded my batches with Nature Renderer 6,000+ and a strange massive hitch of 30+ms also it was painfully slow to work with so I've shifted back to working within one graph.
     
  8. Maxit0

    Maxit0

    Joined:
    Oct 12, 2022
    Posts:
    4
    Hello
    Im trying to use MapMagic but i always get this problem.
    I hope anyone can help me.



    Property _Rect already exists in the property sheet with a different type: 3
    UnityEditor.EditorGUI:DrawPreviewTexture (UnityEngine.Rect,UnityEngine.Texture,UnityEngine.Material,UnityEngine.ScaleMode)
    Den.Tools.GUI.Draw:DrawGrid (UnityEngine.Rect,UnityEngine.Vector2,UnityEngine.Vector2,UnityEngine.Color,UnityEngine.Color,single,single,bool) (at Assets/MapMagic/Tools/GUI/Editor/Draw.cs:2480)
    Den.Tools.GUI.Draw:StaticGrid (UnityEngine.Rect,single,UnityEngine.Color,UnityEngine.Color,bool) (at Assets/MapMagic/Tools/GUI/Editor/Draw.cs:2439)
    MapMagic.Nodes.GUI.GraphWindow:DrawGraph () (at Assets/MapMagic/Nodes/Editor/GraphWindow.cs:260)
    Den.Tools.GUI.UI:Draw (System.Action,bool,UnityEngine.Rect) (at Assets/MapMagic/Tools/GUI/Editor/UI.cs:259)
    MapMagic.Nodes.GUI.GraphWindow:OnGUI () (at Assets/MapMagic/Nodes/Editor/GraphWindow.cs:200)
    UnityEngine.GUIUtility:processEvent (int,intptr,bool&)




    Code (CSharp):
    1. gridMat.SetVector("_Rect", new Vector4(displayRect.x, displayRect.y, displayRect.size.x, displayRect.size.y) * dpiFactor);



    Thx in advance
     
  9. dwilhelmdw

    dwilhelmdw

    Joined:
    Mar 22, 2019
    Posts:
    11
    A long time ago I asked about using MM2 on a M1 Mac and at the time the NativePlugins.bundle was not built for Apple Silicon. I haven't had the time to try until today. I updated MM2 and tried again with no luck so I just pulled and built the NativePlugins.bundle for both intel and silicon and it now works for me in a stand alone app. For reference on my system the bundle is 357K were it was around 144k (?) before so I think the difference is that intel and silicon code now both exist in the bundle but I could be wrong.

    For people that want to do this themselves here is how I did it, but I must say I am sure this is not the best way to get the code compiled.
    I downloaded the code from https://gitlab.com/denispahunov/too...ces/MapMagicMacNative/NativePlugins.xcodeproj

    Then I unzipped the file. I had to rename the .NativeSources folder because it is hidden (I am sure there is a better way to do this)
    I opened the NativePlugins.xcodeproj in Xcode 14
    Selected Product, Build for Running (which I think is good for release)
    I then had to go to ~/Library/Developer/Xcode/DerivedData/NativePlugins-dpunxngqjlofxtejnekgogdrcvte/Build/Products/Release (Your path name might be a little different but you get the idea)
    From there I copied NativePlugins.bundle to my unity project, replacing the existing one.

    I don't work in Xcode normally so I sure some experts are laughing at what I did but this worked for me so it is better than nothing.
     
    Wright likes this.
  10. dwilhelmdw

    dwilhelmdw

    Joined:
    Mar 22, 2019
    Posts:
    11
    I have seen this error on my Mac but for me I got it when I had the graph view opened. I just needed to close the graph view to get rid of the error.
     
  11. Maxit0

    Maxit0

    Joined:
    Oct 12, 2022
    Posts:
    4

    Thank you for taking the time to respond.
    I already solved that problem, I reinstall my unity + the package XD. Now I have another problem :) normal right? hahaha
    If I use "Pin as Draft" I can't step on those terrains, and they dont load the changes I make in the main one (grass, trees, etc.) Do you have any idea what I could be doing wrong?




    thx in advance
     
    Last edited: Oct 20, 2022
  12. Evallis

    Evallis

    Joined:
    Nov 6, 2012
    Posts:
    20
    @Wright Is there a way to change the Main and Draft tiles range during runtime without re-generating the existing tiles? Thanks!
     
  13. leonid_b

    leonid_b

    Joined:
    Feb 19, 2019
    Posts:
    4
    Terrain not showing or visible at build.
    Hello to everyone who've battled the bugs with MM2. I am trying to build a terrain at runtime, I have made a test project, having only MM2. I have tested with both URP and Lightweight. No result.

    The way I am creating the terrain: just calling this Instantiate(mapMagicPrefab.gameObject, transform);
    I have tried in Awake, Start, and press a button in Update. No result.

    I have added the terrain shader to be always included for Lightweight it's Nature/Terrain/Standard and for URP
    Universal Render Pipeline/Terrain/Lit. No result.

    Unity version 2021.3.5f1, have also tried 2020.3.25f1, MM2 version 2.1.11. No result.

    Thank you!
     
  14. Greviouss

    Greviouss

    Joined:
    May 27, 2016
    Posts:
    56
    Yep, it does not... but...

    having a node that would stamp insert a predefined custom shape into the procedural algorithmic noise generated maps after it was all initally generated or during the generation process and stuff would be really cool I think....
     
  15. Greviouss

    Greviouss

    Joined:
    May 27, 2016
    Posts:
    56
    then you could psuedo randomly based on some logic place terrain features based on things like biomes
    For example desert biome where you can easily insert a canyon with this - an otherwise nearly impossible feature to generate in mm - or a lake, or any other suitable point of interest or location specific terrain features into the users otherwise randomly generated map magic terrains,

    This is one example, but something like this can add alot to alot from alot of different angles for alot of users.

    Yes Map magic is the ultimate random infinite terrain generator that makes infinite terrains that go on forever and ever and ever..... Harnessing it with logic nodes to make it do specific things is not outside of the scope of what map magic kinda does do tho.
     
  16. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,145
    Hmm, just tried copy and paste MicroSplat node from and to different graphs. Could you please make sure that copying from included demo MicroSplatGraph to SimpleGraph doesn't work for you?

    Might it be that Nature Renderer or other asset interferes and makes MM work unproperly? May I ask you to test graph re-linking and copying in a clear project?

    I guess one of the most expensive nodes is erosion - it's performance depends on a number of iterations. When this value is high it can take a second or more. But it runs in a background and doesn't reduce FPS.

    Grass output applies grass to terrain, and this could not be made in a separate thread. It is way faster than erosion, but it slightly affects FPS. Grass is applied very fast, faster than heightmap or textures. However, Nature Renderer might process changed grass results on it's own, and it might be that your bottleneck is here.

    What MM version are you using? You can have a look in Window - MapMagic - About. I have already fixed this a couple of versions ago, but it might be a regression.

    Wow, thanks for sharing this information! Would it be possible to share the compiled bundle?

    Yes, draft terrains will always remain draft. Most common case for pinning them is displaying as a background, so they usually don't require generating full-res version.

    Hm, yes, but then it will be applied only when a camera moves to a new tile. You can try calling
    mapMagicObject.tiles.Deploy(mapMagicObject.tiles.camCoords, mapMagicObject.tiles.pinned, mapMagicObject);
    but I have not tested it.

    Have you tried adding shader to always included list? FAQ: My terrain is not visible in build

    Actually there's a Stamp node. And you can use RAW file (and Import node) to define stamp heightmap.
     
  17. Greviouss

    Greviouss

    Joined:
    May 27, 2016
    Posts:
    56
    ok i have been tracking and uncovered what i think is some kind of a bug.
    I have a semi complex graph.

    If i go into vs and change a node in the graph from
    Iinlet<MatrixWorld> to IMultiInlet ---(or outlets, either or seems to generate this...)

    saving and moving focus back over to unity has far as i can tell has
    a 50/50 chance of completely destroying the graph the node is contained in.
    and possibly the parent graph if its a function node.

    This has happened to me multiple times now.
    Undoing the vs code changes, THEN quitting unity, not saving, and reopening the project is the only steps of events that can undo this.

    Going in and changing the code in vs alone is NOT enough.

    No error is apparently thrown in unity reflecting this the graph just ... is gone.

    I have also confirmed that the EXACT same code changes do not destroy the graph if the node is removed from the graph before the changes are applied in vs, and the node works as intended loading from the menu with no issues.
     
    Last edited: Oct 23, 2022
  18. leonid_b

    leonid_b

    Joined:
    Feb 19, 2019
    Posts:
    4
    Yes, i have stated in my message that I have included it. IT'S NOT WORKING.
     
  19. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,145
    Hm, yes, it's better to remove the node from graph if you are changing it's type with code. Will mention it in custom node writing documentation.

    If you have a tile pinned - terrain is still not displayed? Do you have any error in developer console?
     
  20. dwilhelmdw

    dwilhelmdw

    Joined:
    Mar 22, 2019
    Posts:
    11
  21. leonid_b

    leonid_b

    Joined:
    Feb 19, 2019
    Posts:
    4
    No I dont have any errors in the log file nor the console.
     
  22. Liminal-Ridges

    Liminal-Ridges

    Joined:
    Oct 21, 2015
    Posts:
    224
    @Wright is it possible to make a terrain like this? https://ibb.co/Gxk61GB
    Also is there a callback for when all the drafts and mains are done generating in runtime?
    Also when i enable instancing in the grass node unity crashes
     
    Last edited: Oct 26, 2022
  23. onionman77

    onionman77

    Joined:
    Nov 3, 2013
    Posts:
    8
    Hi there, I was wondering if it's possible to change the settings of a mapmagic terrain via script? Is there a place to discuss this? A discord or dedicated forum board? thank you!
     
  24. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,145
    Thank you! I guess all of the Apple Silicon users find this helpful!

    If you have MapMagic object in scene (not created with script) and have at least one tile pinned - is terrain displayed?

    For some reason image is not opening - it just displays some mountains picture for one frame and then disappears. Both in Chrome and Edge.

    You can subscribe to `Action TerrainTile.OnAllComplete` that is called when all of the tiles are done.

    Yep, I could reproduce this in 2021.3.4. Will look into it, thanks for letting me know!

    Yes, but the way to do this depends on what exactly settings you wish to change.

    If it is global seed: change the seed at starting a game on executing this line in Start/Awake/OnEnable:
    Code (CSharp):
    1. mapMagic.graph.random = new Noise(seed, permutationCount:32768);
    2. //32768 is initial permutation num for MM noise.
    You can also change exposed values, or get nodes by their ids and change their values directly. You can find more information in Scripting FAQ.

    Do not forget to re-generate terrain if it already exists after value changed:
    mapMagic.ClearAll(); mapMagic.StartGenerate();


    https://discord.gg/yCJEgSw However it's just a server where users share their own knowledge, screenshot, advises, etc. I'm not a frequent guest here, so don't use it as a support channel.
     
    Liminal-Ridges likes this.
  25. Liminal-Ridges

    Liminal-Ridges

    Joined:
    Oct 21, 2015
    Posts:
    224
    Sorry this should work https://imgur.com/a/gC8H8o9
     
  26. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,145
    Well there's some overhanging cliffs - I'm afraid Unity terrain doesn't support those. And probably you will need triplanar mapping (from CTS or Microsplat) to make vertical surfaces look good.
     
  27. Liminal-Ridges

    Liminal-Ridges

    Joined:
    Oct 21, 2015
    Posts:
    224
    I tried using BEAST shader on the terrain but didnt work, it just became invisible
     
  28. unity_qjzcLLlpE6jQhg

    unity_qjzcLLlpE6jQhg

    Joined:
    Oct 10, 2021
    Posts:
    2
    I'm having harvestable trees in my game and am also using infinite terrain. I've added them as objects and want to remove them from the tile once it is loaded. However I can't find an event in which I could do that. `OnLodSwitched` seemed promising, but seems to trigger to early - the objects aren't loaded yet. `OnTileComplete` also looks interesting but isn't available yet (any timeframe when 2.2 comes out?). Which event would I need to utilize here?
     
  29. Liminal-Ridges

    Liminal-Ridges

    Joined:
    Oct 21, 2015
    Posts:
    224
    @Wright what happens if i want to bake lightmaps on pinned tiles? to i mark them as static?
     
  30. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,145
    You can use TerrainTile.OnTileApplied to determine whether some specific tile applied. More here: Events.

    I'm not aware of how this asset works. If it is just a shader - or at least can produce a shader that can be assigned to terrain - then you can create a material and assign it to Terrain Properties -> Material Template slot of MM object. If it requires some scripting - then most probably it should be changed to work with MM.

    If you make MM object static all tiles created with it will be marked static as well (as long as Copy Layers and Tags is enabled in Terrain Properties).
     
    Liminal-Ridges likes this.
  31. unity_qjzcLLlpE6jQhg

    unity_qjzcLLlpE6jQhg

    Joined:
    Oct 10, 2021
    Posts:
    2
    @Wright Thanks. I've tried it previously, but I have missed that it fires twice - once with "ready" on false, once on true (with ready on false objects are not there yet, with true they are).
     
  32. onionman77

    onionman77

    Joined:
    Nov 3, 2013
    Posts:
    8
    I had missed this reply, thank you so so much!
     
  33. Greviouss

    Greviouss

    Joined:
    May 27, 2016
    Posts:
    56
    page no worky
     
  34. Greviouss

    Greviouss

    Joined:
    May 27, 2016
    Posts:
    56
    Liminal-Ridges likes this.
  35. Greviouss

    Greviouss

    Joined:
    May 27, 2016
    Posts:
    56
    upload_2022-11-1_12-36-9.png

    is there a way to smooth all the edges of a series of tiles?

    Kinda easy to see where tile edges are in this image,
    I have tried all the tools but generally any effort i make seems to leave DEEPER tile edge marks as opposed to leveling them out.

    how can i smooth it out all at once and not per tile?
     
  36. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,145
    Well you can increase Margins value to make each tile generate part of the neighbour tile, but I guess it won't solve a problem here. What are you doing with them, why they look so blurry? Actually such nodes as blur or erosion require bigger margins. Try lowering Blur node values (yep, to smooth it out you need to lower blur).

    I guess the first one is a draft, and second is main. You can check which is what with TileData.isDraft
     
  37. Greviouss

    Greviouss

    Joined:
    May 27, 2016
    Posts:
    56
    without some blurs i get this, and this does not generate a smooth set of values
    this is just the raw from my node height out with nothing else
    the node is finding the nearest water - or trying to - and it can read across tile lines fo rthe most part. I have another better looking algorithim, but these take SO LONG TO COMPLETE even on lower details, and that one takes even longer still, and raising the margins is not needed for any other node in the graph, so yea while that might mostly work - it needs to be extended to like tile width * 2.5 - 3x - and extending all of the margins to what makes this go away is sub optimal to say the least as it extends the generation times to unacceptable levels due to the unneeded extended margins.

    certaily up for anyone who has a fast and reliable multi tile water distance solution, im all ears...

    Ive seen someone else on the discord trying to also mess with custom margins, (i assume for a very similar reason)
    but nothing concrete there yet.

    upload_2022-11-1_15-43-50.png
     
  38. Greviouss

    Greviouss

    Joined:
    May 27, 2016
    Posts:
    56
    a higher accuracy variant i have removes the unwatnted mid tile lines but generates its own issues :

    upload_2022-11-1_17-15-43.png

    upload_2022-11-1_17-16-12.png
     
  39. Liminal-Ridges

    Liminal-Ridges

    Joined:
    Oct 21, 2015
    Posts:
    224
    any news on the grass gpu instancing bug?
     
  40. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,145
    I'm going to submit new version on Monday. This is the bug I haven't actually fixed yet, but I plan to do it for 2.1.12

    If you are using your own node I can't advise you anything since I'm not sure exactly how it works. But smoothing the tile, or any other way of reading other tile information is not possible - otherwise there's no way to generate infinite terrain (or this terrain will change depending on what tile was generated first).
     
    Liminal-Ridges likes this.
  41. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,145
    I found out that it's a Unity issue, and created a reproduce case with no MM involved - but then decided to look into documentation:
    Mmm, too bad. Documented bug even worse than a usual bug - it means that it won't be fixed soon.
     
    Greviouss likes this.
  42. Liminal-Ridges

    Liminal-Ridges

    Joined:
    Oct 21, 2015
    Posts:
    224
    big shame. what is the current render mode? and why cant it be vertexLit?
     
  43. onionman77

    onionman77

    Joined:
    Nov 3, 2013
    Posts:
    8
    Hey I've got a question, I'm trying to modify a graph and the height output says that it is not set to the current graph, and it doesn't seem to effect the heightmap at all, the graph just keeps generating the same noise map. Do you know how i fix this? Thank you!
     

    Attached Files:

  44. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,145
    I'm not sure I fully understand what you mean, but you are outputting a heightmap from Import node, and Import node has no heightmap assigned (there is None in Map slot).
     
  45. onionman77

    onionman77

    Joined:
    Nov 3, 2013
    Posts:
    8
    That is actually because I'm trying to set that heightmap at runtime, And if it wasn't being set I'd expect a flat terrain, instead I still get a random heightmap.
     
  46. onionman77

    onionman77

    Joined:
    Nov 3, 2013
    Posts:
    8
    For some reason it did end up working. Removing and replacing the node, making sure the scene was saved, and something kicked in. Something I'm curious about now though is using a texture2d as heightmap as runtime. The import node expects a matrix asset, not a texture, is there a place I can look about generating a heightmap from a texture at runtime? Thank you!

    Actually I was also wondering is it possible to modify the texture of an importer asset at runtime? Thank you!

    [Edit] Actually nevermind I got it working! [/Edit]
     
    Last edited: Nov 8, 2022
  47. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,145
    I see you got it working, but still answer if someone else wants to do the same.

    Try looking into MatrixAsset's ImportTexture method. This is the one that called when you import texture with importer's matrix asset. Theoretically it should work in runtime - I can see no obstacles here.
     
  48. Tim-Wiese

    Tim-Wiese

    Joined:
    Jul 7, 2012
    Posts:
    64
    So nuking the library seemed to resolve some of the issues I was having with mapmagic2. Also, nuking microsplat and syncing/resyncing helped as well with the massive hitching I was experiencing. I believe it had some kind of corruption going on. Nature Renderer's camera script. LODs, and distance drawing in MM2 was in conflict with one another causing additional slowdowns at runtime that after much tinkering (ie: removing their camera script) helped immensely.

    Application.tick while a more general Unity problem seems to happen the more I generate/regenerate maps. Shutting off instant generate helps a bit but Application.Tick still appears every time I regenerate. Graph slowdown seems to be linked to the number of preview nodes visible and open in a complex graph. Restarting my computer seems to be better for a while but complexity of the graph definitely and frequent iteration on the graph makes this seemingly impossible to avoid.

    As for the grass output node, I understand for grass this may be necessary but what about small detail objects? Could there be a Detail Object node similar to how the Object node allows for multi-prefabs. (ie: like a random number of different small rocks that one plans to apply to a specific defined area)
    Currently, I am setting up 5 grassoutputs setting them to mesh-unlit and assign one prefab to each node. This seems pretty clunky and bloats the map with so many nodes. If I don't want overlapping of detail objects I have to create a pretty hefty series of blends/subtracts etc to pull this off.
    Thoughts?
     
  49. deshowiz

    deshowiz

    Joined:
    Mar 28, 2015
    Posts:
    15
    Hi, I noticed that pathfinding causes tile seams if you're trying to stamp to make rivers. I played around with some noise and found a new solution. The input portal is the height before this section is SUBTRACTED from the mostly flat ground that was already generated. Both endpoints you see on the right that get cut off by the screenshot are subtracted. The top endpoint is the river itself, the bottom endpoint is a "smooth" decline towards the river scaled by relative height. I'd recommend on getting the first endpoint working before moving onto the second. The second may need a large adjustment depending on your surrounding terrain anyways. This is much faster than pathfinding and doesn't suffer from that tile seam issue.

    It's important to note that for my setup I have the sea level at around 0.52 (520 units on the y axis for me), so the selector values will have to be adjusted for wherever your sea level is. This may also effect how you may want to scale some of the constants (except for the bottom constant that has a value of 1). Two selectors are being used to create some extra noise so that the river won't look as jagged due to the resolution level of your terrain. The overall "tiling" of the rivers can be adjusted by changing the "size" of the 2 noise nodes on the far left. I'd recommend replicating these values, and then playing around with the noise on the left to change it to your needs.

    Hope this is helpful!

    upload_2022-11-10_0-51-16.png
    upload_2022-11-10_0-44-42.png
     
    Zimnel, Wright and Tim-Wiese like this.
  50. Liminal-Ridges

    Liminal-Ridges

    Joined:
    Oct 21, 2015
    Posts:
    224
    @Wright any idea if i can make the grass cast and receive shadows?