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. Dismiss Notice

MapMagic 2 - infinite procedural land generator

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

  1. valentinwinkelmann

    valentinwinkelmann

    Joined:
    Nov 3, 2014
    Posts:
    186
    Thanks I will try that with the Complete Package, if I run into the problem again. How you can reproduce it I don't know, it was as said an fresh project on Unity 2020.2.5f1 in URP.

    The problem is not existent on 2020.2.6f1, so I consider that solved for me. But can you explain me how to enable the MicroSplat TerrainBlending function in MapMagic?
    In the changelog you mention the support.

    Enabling Terrain Blending itself for a non-MapMagic terrain is easy, it doesn't work in MapMagic. How do I have to proceed to be able to use TerrainBlending?

    upload_2021-2-25_16-29-32.png
     
  2. mick129

    mick129

    Joined:
    Jun 19, 2013
    Posts:
    228
    I would also be curious about the Microsplat's feature, how it work, also do we still need to use "use custom splatmap" with Microsplat?
    I did some test and honestly don't manage to do a lot :p

    In one project I no longer have the white texture when I save, but in the other one, every time I save the texture all become white so I have to regenerate to fix it, I'm still not sure what is causing this.

    And could you explain briefly what is the impact of the new options in the Microsplat node? I tend to have some weird normal and wrong texturing when I hit the last option but this is probably me doing something wrong.
     
    valentinwinkelmann likes this.
  3. valentinwinkelmann

    valentinwinkelmann

    Joined:
    Nov 3, 2014
    Posts:
    186
    yeah... Would be just really cool if there would be a documentation...:rolleyes:
    https://gitlab.com/denispahunov/mapmagic/-/wikis/MatrixGenerators/MicroSplat
     
  4. N1warhead

    N1warhead

    Joined:
    Mar 12, 2014
    Posts:
    3,884
    GPU Instancer gets a problem with the new update sadly as well. Something tells me it's probably a quick fix but idk lol.

    Code (CSharp):
    1.                 else if (generator is IMultiBiome)
    2.                 {
    3.                     IMultiBiome biome = (IMultiBiome)generator;
    the iMultiBiome is where the issue is at.
     
  5. dmenefee

    dmenefee

    Joined:
    Oct 14, 2019
    Posts:
    142
    I'm also seeing the corrupted file issues, on 2019.4.21f1. I applied the patch and re-imported these with no improvement.

    Edit: importing the complete package fix upoaded to Dropbox did resolve these issues.
     
    Last edited: Feb 26, 2021
  6. progrand

    progrand

    Joined:
    Aug 23, 2020
    Posts:
    1
    Just installed 2.1.0: NativePlugins windows x64 missed entry points like ReadMatrixTile and MatrixParallax.
     
  7. mick129

    mick129

    Joined:
    Jun 19, 2013
    Posts:
    228
    If I'm not wrong, the fix in this forum (page 17) will solve it.
     
    peter_sibiro likes this.
  8. Giantsmall

    Giantsmall

    Joined:
    Apr 28, 2019
    Posts:
    17
    1. I have a problem with rotating/scaling trees node, it's height works as expected but rotation and scale is not applied. Works ok for Objects node - any idea what might be wrong?
    2. Another problem is with lots of error messages whenever I interact with graph:
    Draw Graph Window failed: System.NullReferenceException: Object reference not set to an instance of an object
    3. Functions: - are function nodes instantiated for each usage of function? Or is the same function output used? I have function that has no inputs.
     
    Last edited: Feb 26, 2021
  9. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,227
    Just a reminder - if you have issues with import node, function update or VSPro/MegaSplat/MicroSplat compilation errors in 2.1.0 here is a patch to fix them.

    This patch is currently pending Unity review, so it will be available at the AS soon. Unfortunately I can't release it the same day I fix the issues, it always takes several days for Unity to review the changes. Sorry for that!

    And I'd like to recommend you to perform a clean install on upgrading to 2.1.0, with removing older version. Seems that package manager doesn't upgrade some files for some reason.

    And I will really appreciate if you can report any other issues (after applying patch). If I can reproduce and fix them swiftly they will be included in enqueued update. Feel free to use this forum, ideainformer or email.

    Diego_Graphics, mick129, going to add MicroSplat wiki page right after fixing MM1 (and MM2 as well) issues.

    Could you please clarify what problem actually is? Is it a compilation error? Or at least an error of any kind? Does clean install help?

    Doesn't seem to be a compile error - could you please clarify when it happens or is there any way to reproduce it?

    Unity doesn't support rotation of billboard trees. Billboard trees are the most common type of trees - not SpeedTree, Tree Editor tree, trees with LOD component. They are always facing the same direction no matter if they were created with MapMagic or drawn by hand.

    This limitation is relevant for version 2020.1 and below - don't know if they fixed it in later versions - I saw the ticket on their bug report page.

    Could you please clarify what graph it is? Have you applied a patch?

    If you have several function instances in your graph each instance is generated independently, with their own input maps and overridden values.

    Yes, functions can have no input - this is quite usual. And yes, it will be generated twice even if it has no input. In this way functions they behave similarly to any other nodes - if you have a noise node with same parameters it will be generated twice anyways.
     
    Last edited: Feb 26, 2021
    boysenberry likes this.
  10. N1warhead

    N1warhead

    Joined:
    Mar 12, 2014
    Posts:
    3,884
    @Wright it just says " The type or namespace name 'IMultiBiome' could not be found (are you missing a using directive or an assembly reference?)"

    So I'm sure there's something that was changed with the update that replaces IMultiBiome, unless it's private now which could explain that I suppose.

    But I'm not using Biomes currently so I just commented them few lines out and it worked. But yeah, figured I'd at least let ya know :)
     
  11. Swyfft

    Swyfft

    Joined:
    Mar 14, 2019
    Posts:
    54
    Hi ..
    Thanks for the update and the patch .. It installed cleanly and I'm running tests now..

    One small thing that I noticed is that when I press ALT key to drag the graph, it doesn't seem to work anymore ..
    have to zoom out and zoom in again to reposition..
    have tried with 2020.1 and 2020.2..

    ciao ..

    p.s. I tried to email you about the Brushes testing .. but the emails weren't delivered.. so I sent you a PM here instead with my info.
     
  12. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,227
    The version at the asset store has been updated, and now it includes the patch included. No need to update if you have applied it yourself.

    I'm still not going to stop and will look into:
    - Alt-button error
    - MicroSplat issue on exporting both splats and MS control maps - latest MicroSplat asset itself removes applied MS data on splats change. Depending on your MS version it could work fine or fill everything with one texture.
    - IMultiBiome error if I can reproduce it somehow

    So I guess the version will be updated once more next week.

    And I'd like to thank mick129, thevisad, HP, JohnnyFactor, nobluff67, Refeas, Nunez-Torrijos, drkasch, Diego_Graphics, N1warhead, Swyfft and everyone else for their feedback and reports!
     
  13. N1warhead

    N1warhead

    Joined:
    Mar 12, 2014
    Posts:
    3,884
    @Wright there's one more issue I'd like to report. In URP tree's aren't spawning in.
    For some reason the URP tutorial scene didn't have an tree nodes on it so I go in and add a scatter, forest and trees and drop PineMed1 from demo assets into it (made sure it had a URP shader of course) and they aren't creating.
    upload_2021-2-26_5-57-45.png
     
  14. N1warhead

    N1warhead

    Joined:
    Mar 12, 2014
    Posts:
    3,884
    Nevermind apparently they do work, just not on the scene. I changed the height to 9384 to simulate real life heights) and changed the noise scale to 3300 and they worked.

    im kind of curious as to why they didn't work on the demo terrain as it was, I had to make changes for them to appear.

    Now they work as they should. Perhaps it was the short LOD distance on them or something. I have to be like right near them I guess.

    Ignore my last messages I suppose lol.
     
  15. N1warhead

    N1warhead

    Joined:
    Mar 12, 2014
    Posts:
    3,884
    @Wright There is a bug I've just discovered with Import node (perhaps it was mentioned in here already), I mentioned in discord yesterday that the Offset's on the import node don't work.

    I figured I'd give it another shot after all the great fixes you've been working on.
    No matter if I set the offsets to -10000 on each axis it stays in the same position as 0 on both. :(
    upload_2021-2-26_8-25-43.png
     
    Wright likes this.
  16. Giantsmall

    Giantsmall

    Joined:
    Apr 28, 2019
    Posts:
    17
    I am certain prefabs I use are not bilboard trees, if they were would they rotate if put into Objects node? Mine does rotate in that case. Tried it with Unity 2020.2.2f1.
    Also I edited my post later on and added also scaling problem (only height works). Would that be result of using billboard trees?

    No I have not applied the patch, I find file under the link deleted.
    I am not sure what types of graph we have, anyway my graph has grown big enough to make it difficult to identify single one responsible.. I guess I will have to dissassemble the graph piece by piece to find out.
    Do you think that error could cause rotation problems

    I will then try to make my main graph as function to avoid duplicating random nodes.
    Thank you!!
     
  17. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,227
    Yes, billboard trees couln'd not be both rotated AND scaled. However, billboards themselves are scaling, but the models are not for some reason.

    I understand the rotation limitation - it's not possible to render universal billboard from the trees rotated at different angles. But scale seems to be a bug, it is reported, but still exists for year or so. Oh, am I following Unity example? Will try do better :)

    You can output trees as objects, but note that scene performance won't benefit from it.

    If you haven't applied a patch it's better to update MM via the asset store - the new version is available at the AS.

    No, rotation problem is related with Unity tree system, not with your graph or MM in general.

    If you have used functions then I definitely recommend you updating.

    Thanks, will look into it!
     
    N1warhead likes this.
  18. N1warhead

    N1warhead

    Joined:
    Mar 12, 2014
    Posts:
    3,884
    @Wright LOL I hate being the pest here mate hahaahah.
    I keep running into this error (pops up twice) each time I start.

    Code (CSharp):
    1. Exception: Empty weld array. Possibly terrain has not been generated yet
    2. MapMagic.Terrains.Weld.ApplyToTerrain (UnityEngine.TerrainData terrData, System.Single[] arr, Den.Tools.Coord dir) (at Assets/MapMagic/Terrains/Weld.cs:689)
    3. MapMagic.Terrains.Weld.WeldDraftToMain (MapMagic.Terrains.TerrainTile reference, MapMagic.Terrains.TerrainTile welded, Den.Tools.Coord weldDir) (at Assets/MapMagic/Terrains/Weld.cs:650)
    4. MapMagic.Terrains.Weld.WeldSurroundingDraftsToThisMain (MapMagic.Core.TerrainTileManager tileManager, Den.Tools.Coord coord) (at Assets/MapMagic/Terrains/Weld.cs:576)
    5. MapMagic.Terrains.TerrainTile.SwitchLod () (at Assets/MapMagic/Terrains/TerrainTile.cs:214)
    6. MapMagic.Terrains.TerrainTile+<ApplyRoutine>d__44.MoveNext () (at Assets/MapMagic/Terrains/TerrainTile.cs:783)
    7. Den.Tools.Tasks.CoroutineManager.Update () (at Assets/MapMagic/Tools/ThreadManager/CoroutineManager.cs:147)
    8. MapMagic.Core.MapMagicObject.Update () (at Assets/MapMagic/Core/MapMagicObject.cs:142)
    9.  
    Causes this to happen and such.
    upload_2021-2-26_9-35-55.png

    I've confirmed it isn't related to the demo scene, at first I figured it was as everything was good. Until these couple of chunks from my own system didn't work. (Same exact errors).

    But here's my custom graph if it helps at all.
    upload_2021-2-26_10-47-8.png
     
    Last edited: Feb 26, 2021
    AlanGreyjoy likes this.
  19. valentinwinkelmann

    valentinwinkelmann

    Joined:
    Nov 3, 2014
    Posts:
    186
    Simple forms (like gradient, pyramid and cone) but also locks are not scaled in their position when the tile size changes. This is problematic because noise does that. Would be cool if you could fix this.
    This is very problematic when you resize terrains because of resolution.

    In order to quickly and easily adapt the whole thing to our workflow I would like to override variables in the super cool new Exposed system, how is that possible using C# to set and get certain variables.
     
    Last edited: Feb 26, 2021
  20. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,227
    2All MapMagic 1 users: here is a right-click menu fix. The menu is taken from MM2 with a compact single window and search field. Sorry that it took so long, but I was doing this this time menu as well :)
     
  21. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,227
    And a patch to MicroSplat (Apply Type: Both) and Import node offset .
    Could't reproduce the offset issue with a simple form - seems to be working fine with any form.
     
    mick129 likes this.
  22. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,549
    Im using a lot of portals to clean up my graphs and am wondering is there any extra overhead to using them for both MapMagic 1 and MapMagic 2? Is it safe to use them performance wise?
     
  23. secondsight_

    secondsight_

    Joined:
    Mar 2, 2014
    Posts:
    163
    Thank you very much, Wright !
     
  24. valentinwinkelmann

    valentinwinkelmann

    Joined:
    Nov 3, 2014
    Posts:
    186
    @Wright
    I noticed with MicroSplat so some more errors.
    A: When I select the setup "
    Apply Type: Texture
    InShader->UseCustomSplatmaps: True
    "
    it causes the terrain to blend the textures completely wrong, they are all overlaid very randomly and make more of a uniform mush. It doesn't matter if the terrain is instanced or not.

    B: If I choose the setup "
    Apply Type: Splats
    InShader->UseCustomSplatmaps: False
    "
    it causes the terrain to behave rather correctly from the blending point of view, but the whole thing doesn't react at all to the set textures in the MicroSplat node. completely wrong textures are displayed. Also here it doesn't matter if instanced or not.

    C: If I choose the setup "
    Apply Type: Both
    InShader->UseCustomSplatmaps: False
    "
    Leads to the same behavior as B

    D: If I select the setup "
    Apply Type: Both
    InShader->UseCustomSplatmaps: True
    "
    Leads to the fact that only one texture is displayed.


    In short: No single option to apply MicroSplat to the terrain currently works. MicroSplat on non-MapMagic terrain behaves normally (both instanced and non-instanced).


    Unity 2020.2.3f1 URP | MapMagic 2.1.1 | MicroSplat 3.731
     
    Last edited: Feb 27, 2021
  25. Byberg

    Byberg

    Joined:
    May 20, 2013
    Posts:
    74
    I currently have 2.1.1 installed according to the package manager. But i cant seem to find the new nodes for the edge and the beach stuff.... am i missing something?
     
  26. ElevenGame

    ElevenGame

    Joined:
    Jun 13, 2016
    Posts:
    143
    @Byberg maybe you have the same issue with the package manager, that I sometimes have: It shows the current version number, but still installs an older package.. One can delete the local packages (should be at User\AppData\Roaming\Unity\Asset Store-5.x) and download again to fix it!
     
  27. Byberg

    Byberg

    Joined:
    May 20, 2013
    Posts:
    74
    Can i delete them there without messing up or removing stuff from my project?
     
  28. valentinwinkelmann

    valentinwinkelmann

    Joined:
    Nov 3, 2014
    Posts:
    186
    Yes, It is immediately shown in the Package Manager as "Not Installed" after delete and can then be re-downloaded. The PackageManager only keeps the UnityPackages. Deleting them will not affect any projects that use the packages.
     
    ElevenGame likes this.
  29. mick129

    mick129

    Joined:
    Jun 19, 2013
    Posts:
    228
    Is there any available documentation about creating new MM2 nodes?
     
  30. Padawaan

    Padawaan

    Joined:
    Feb 3, 2019
    Posts:
    7
    Hey,

    2.1.0 and 2.1.1 made the terrains invisible in built game.

    In editor and playmode, everything's fine, but in build they're not visible. I can tell they're correctly generated tho, because rigidbodies are colliding with the terrain geometry.

    Is there a way to get previous version ? 2.0.8 was working fine for me, but I can't rollback, and my project is basically broken in this state.

    On another side, the locks are still bugged for me. It's not like what it was in 2.0.8, but it's still unusable. I can reproduce it by running any demo graph in a empty project, making terrain modification, locking it, entering playmode, getting far from the tile so it unloads, and then get back to it so it regenerates.

    The locked spot geometry will go wild and most of the time, the height data looks set to max terrain height.

    Using Unity 2019.4 and HDRP 7.5 with the standard terrain shader

    EDIT: I cleaned up my project, and gave MicroSplat a try, and so far it fixed my invisible terrain issue. Maybe it was something related to HDRP standard shader, I don't know.

    Now, it's another thing, but I'm not sure if I'm integrating microsplat correctly. Is there any proper workflow to follow ? The wiki about the microsplat output is empty, so I've followed the MapMagic 1 video about it.

    I created the shader and the material manually, and activated the "use custome splats" microsplat feature. It all worked fine until I started to use a graph with blended biomes. I had weird terrain shading and unity freezes to crash in playmode.

    I then saw somewhere that we have to uncheck the "draw instanced" feature on the MapMagicObject, and that's what I did. It's working fine since then, even if my drawcalls seems to have doubled (I was at ~400, and now it's moving between 500 and 1000).

    So, am I doing something wrong ? Or is it the correct way to use MicroSplats ? There's no documentation for this on the wiki (Draw instanced is also missing from the wiki)

    Sorry for the wall of text !
     
    Last edited: Feb 28, 2021
  31. valentinwinkelmann

    valentinwinkelmann

    Joined:
    Nov 3, 2014
    Posts:
    186
    There is no tutorial for the MapMagic2 MicroSplat node yet, I've been waiting for it for a long time.

    The way you describe it is also the way I go.

    Except for the invisible terrain problem, I often have the same problems. Now currently on URP with MapMagic2.1.1 additionally the problem that MicroSplat blending plays totally crazy.
     
  32. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,227
    Portals just take a product from input and transfer it's reference to exits. No cloning or anything - they generate almost no overhead.

    Thanks! Seems that I've got to submit new version this week as I mentioned, will try to include this fix.

    Here's a changed code for a custom generator that will work with MM 2.1:
    Code (CSharp):
    1. [Serializable]
    2. [GeneratorMenu(
    3.     menu = "MyGenerators",
    4.     name = "MyFirstGenerator",
    5.     colorType = typeof(MatrixWorld) )]
    6. public class MyGenerator : Generator, IInlet<MatrixWorld>, IOutlet<MatrixWorld>
    7. {
    8.     [Val("Position")] public Vector2D position;
    9.     [Val("Radius")] public float radius = 30;
    10.     [Val("Hardness")] public float hardness = 0.5f;
    11.  
    12.  
    13.     #if UNITY_EDITOR
    14.     [UnityEditor.InitializeOnLoadMethod]
    15.     static void EnlistInMenu () => MapMagic.Nodes.GUI.CreateRightClick.generatorTypes.Add(typeof(MyGenerator));
    16.     #endif
    17.  
    18.  
    19.     public override void Generate (TileData data, StopToken stop)
    20.     {
    21.         MatrixWorld src = data.ReadInletProduct(this);
    22.         if (src == null) return;
    23.         if (!enabled) { data.StoreProduct(this,src); return; }
    24.         if (stop!=null && stop.stop) return;
    25.  
    26.         MatrixWorld stroke = new MatrixWorld(data.area.full.rect, data.area.full.worldPos, data.area.full.worldSize, data.globals.height);
    27.         stroke.Stroke((Vector2D)stroke.rect.Center, stroke.rect.size.x/2, 0);
    28.         if (stop!=null && stop.stop) return;
    29.         //more an example of creating new matrix. This could be done without it with Matrix.Fallof
    30.  
    31.         MatrixWorld dst = new MatrixWorld(src);
    32.         dst.Add(stroke);
    33.         dst.Clamp01();
    34.         if (stop!=null && stop.stop) return;
    35.  
    36.         data.StoreProduct(this, dst);
    37.     }
    38. }
    EDIT: namespaces just in case:
    Code (CSharp):
    1. using System;
    2. using Den.Tools;
    3. using Den.Tools.GUI;
    4. using Den.Tools.Matrices;
    5. using MapMagic.Products;
    6. using MapMagic.Nodes;
    7.  
    I will update the doc with the samples from this code and add it's link to main wiki page.

    If you are using no tile pinned - please make sure that terrain shaders are always included in build. Otherwise Unity will optimize build and skip them since it got no terrain to use. To add shaders in Project Settings - Graphics - Always Included Shaders increase the shader count, and pick the Nature/Terrain/Standard as the last one.

    This should not fix shaders, but sure, here is the core version.Let me know via email if you are using bundle or modules.

    Odd thing, I could not reproduce it with demo scenes, but it really moves tile for the new graph. Will look into it, thanks for reporting!

    Going to fix all MS bugs and write a document on the way MS node is used. Will try to look into the MS instanced mode, but can't promise that I can do anything to make it work 100% reliable.
     
  33. mick129

    mick129

    Joined:
    Jun 19, 2013
    Posts:
    228
    Thank you for the fast answer and you really did a good job with MM2, really appreciated :).
     
    ElevenGame likes this.
  34. Goffa

    Goffa

    Joined:
    Dec 2, 2013
    Posts:
    8
    Hi, I'm having trouble with roads not connecting when using the spline tools. I would like to have road networks that are larger than one tile, so I uncheck the "Within Tile" checkbox, but the network that comes up is always broken. Attached is a minimum setup of nodes to reproduce the problem, and the output. I would like to add a relax node on to this, but already here it is broken
    Roads.PNG Setup.PNG
     
  35. Padawaan

    Padawaan

    Joined:
    Feb 3, 2019
    Posts:
    7
    Indeed, no tile was pinned in the concerned scene. I added the shader and the issue is gone so far.

    Thanks for the support. However, as everything is now working, it should be fine and I won't bother you with that.

    Looks like it's on the way !
     
  36. N1warhead

    N1warhead

    Joined:
    Mar 12, 2014
    Posts:
    3,884
    Hey @Wright Is there any way to use lets say 2 Import nodes to be two different tiles?
    I tried to ask in Discord yesterday but people were talking so I guess it got blown over lol.

    Essentially here's what i'm wanting to do.

    ImportNode 1 - Will be 0-0 terrain (starting tile).
    ImportNode 2 - offset 1000 on the x axis (1-0) position.

    While it does work, I find I'm having trouble getting them to blend correctly.
    When I do a blend node it appears to rip lines across all tiles. and making both tiles unrecognizable.

    I've tried both Blend and Function nodes.

    If this isn't supported I think it would be a great thing to support that way we can get multiple heightmaps to be procedurally generated :)
     
  37. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,549
    Thank you:) Im using a bunch of portals and its great way to keep teh graphs clean and organized. I'm so glad MapMagic has them.
     
  38. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,227
    Yes, splines module has pretty much limitations now. After releasing brush module and filling gaps on wiki I plan to develop splines module - switch it's engine, add new nodes and fix issues like that.

    Sounds feasible, it should work with a simple blend node in Add mode. The only blending issue I assume is adding last pixel of first import and first pixel of second import on tile seam. It's hard to say for sure whether it's this error or not without a screenshot.
     
  39. JohnnyFactor

    JohnnyFactor

    Joined:
    May 18, 2018
    Posts:
    343
    Question about the Split node since the docs aren't clear on this: is the probability normalized, as in, it sums to 1?
     
  40. JohnnyFactor

    JohnnyFactor

    Joined:
    May 18, 2018
    Posts:
    343
    Since I'm here, I'll report a bug.

    Attaching a Spread node downstream of another Spread node results in the node not updating properly when changed.

    In this example, I have trees in the 1st node and grass in the 2nd node. The grass objects are generated properly but the old objects are not deleted when changing any value. I eventually end up with many 1000s of orphaned objects.

    EDIT: I have discovered this is happening on the 1st Spread node too. In fact, it's happening on all Spread nodes.

    spread.jpg
     
    Last edited: Mar 2, 2021
  41. moltke

    moltke

    Joined:
    Apr 28, 2019
    Posts:
    109
    is there an object conform to terrain modifier?
     
  42. Liminal-Ridges

    Liminal-Ridges

    Joined:
    Oct 21, 2015
    Posts:
    255
    In MM1 there was an invert node that inverted the heightmaps, is there a way to do it now @Wright ? Im asking cause i want to make a scarce noise map with more low to zero areas than high but the noise module mostly generates high-values heightmaps
     
  43. SammmZ

    SammmZ

    Joined:
    Aug 13, 2014
    Posts:
    166
    You can just use curves to invert ;)
     
  44. Liminal-Ridges

    Liminal-Ridges

    Joined:
    Oct 21, 2015
    Posts:
    255
    I tried it but im too stupid to figure the maths lol how do i do it?

    Also check this pic out. Is there a way to reduce the MapMagicObject.Update or its children's load?

     
  45. JohnnyFactor

    JohnnyFactor

    Joined:
    May 18, 2018
    Posts:
    343
    Invert is now done with the Contrast node. Just set contrast to -1.
     
    Liminal-Ridges likes this.
  46. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,227
    Yes. If you set the probability 1 in two layers it won't create the object in both, but will use 0.5 chance instead.

    Just clarifying: do you mean it leaves the source objects, the once from the Spread node input? If so Retain Originals fixes it.
    If it create new objects each generate, never removing old ones: is there a reliable way to reproduce it? If so could you please send me the scene, the graph and object prefab (and their meta files). Thanks!

    Could you please clarify what are you trying to achieve? Isn't it a Floor node?

    Curves are actually no so complicated as they might seem. Try watching this video (at current time), hope it can shed some light on it.

    But as JohnnyFactor it's better to use Contrast for invert.

    Seems this appears when MapMagic applies heightmap to terrain. During this frame Unity assigns heightmap, refreshes chunk LODs, generates collision, etc. Yes, it takes some time, unfortunately I can't speed it up, move to thread or split in several frames - it's Unity's method.
     
  47. Refeas

    Refeas

    Joined:
    Nov 8, 2016
    Posts:
    192
    Hey @Wright,
    currently on MM 2.1.1 + all the patches applied and discovered some more issues.

    1. Scatter node + Add margins seem to behave strangely. When I leave the margins at 0, I'd expect all the scattered points to be within the map's boundaries, which is not the case and there's quite an overflow.
    This Scatter:
    upload_2021-3-2_22-37-23.png
    produces this:
    upload_2021-3-2_22-37-42.png

    This way it's really difficult to determine the proper value for the margins to prevent seams when combined with Flatten for instance and different values seem to provide random results
    This is Add Margins -200 for instance, setting it to -300 produces the exact same result, etc. Just try putting random values in.
    upload_2021-3-2_22-44-40.png

    2. This issue, which I reported couple of months ago and is supposedly fixed, is not actually fixed: http://mm2.idea.informer.com/proj/?ia=134562
    I checked the code and the fix I provided is not applied, so the VSProMapsOut throws ArgumentOutOfRangeException around line 84 when you use more than 1 VS Pro mask. Applying my suggested fix again resolves the problem.

    3. It is not possible to enable Native Code in the MM Settings window, it enables itself and immediately disables again. I checked the code and found an issue in SettingsWindow.cs around line 214, it has this:
    Code (CSharp):
    1. ToggleKeyword(settings.native, "MM_NATIVE", ref symbols);
    2.             ToggleKeyword(settings.debug, "MM_NATIVE", ref symbols);
    There's probably supposed to be something like MM_DEBUG in the second toggle, I fixed that and can now enable Native.

    So I was able to fix 2 and 3 pretty easily, but I'd really appreciate if you could look into 1 and provide a quick fix if possible. We've been waiting for the add margins fix for months due to tile seams and it still doesn't work properly.

    Thanks!
     
    Last edited: Mar 2, 2021
  48. JohnnyFactor

    JohnnyFactor

    Joined:
    May 18, 2018
    Posts:
    343
    It generates new objects but leaves the old ones behind. If I delete the Object nodes and say "Yes" to clear the map, objects are left behind and I need to delete them manually.

    Anyways, I can't reproduce it reliably and when I start monkeying with other parts of the graph, the problem goes away. I'm going to wait until I have narrowed this down further before I send you something.
     
  49. moltke

    moltke

    Joined:
    Apr 28, 2019
    Posts:
    109

    I'm trying to get my stumps to align with the terrain so on hills/slopes they don't stick out the side but are placed with the base facing the terrain so you can't see under the object

    in other words the object will be placed on the same degree as the hill; it aligns with the terrain

    upload_2021-3-2_20-34-24.png
     
  50. Liminal-Ridges

    Liminal-Ridges

    Joined:
    Oct 21, 2015
    Posts:
    255
    Thanks for the contrast, but why does the heightmap apply on update? Shouldnt it apply only durign generation? How can i move to thread or split it?

    Also is there a way to make cliffs with at least one sharp side? Closest i got is voronoi
     
    Last edited: Mar 3, 2021