Search Unity

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

MapMagic 2 - infinite procedural land generator

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

  1. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,267
    It has a document, it has a demo scene - unfortunately I don't plan any videos on it. However feel free to publish request on ideainformer and I'll do it if it will have a demand.

    No, the bundle price is exactly the sum of 4 modules prices.
     
  2. FlightOfOne

    FlightOfOne

    Joined:
    Aug 1, 2014
    Posts:
    668
    @Wright Hi Denis,
    Do you know why this is this, this way? I would like it to be a listed value (e.g. 512) because this causes issues with other terrain tools like Path Painter.

    Either that or do you know how to change this with a script after the terrain is created?

    Thanks!

    upload_2021-6-17_15-32-45.png
     
    Last edited: Jun 18, 2021
  3. keithsoulasa

    keithsoulasa

    Joined:
    Feb 15, 2012
    Posts:
    2,126
    Can I use this on top of Gaia ?

    Specific I want to use Biomes to change Gaia terrains
     
  4. Xaularis

    Xaularis

    Joined:
    Jan 19, 2019
    Posts:
    3
    If I buy the bundle, would I be able to make a cave ?
     
  5. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,267
    No, MapMagic doesn't bring any new tech to terrain system, it just generates standard Unity terrains. And Unity standard terrains do support caves out of the box.

    You can use MapMagic Brush on top of Gaia terrains, but I'm afraid it's not what you want. It's manual terrain editing, biomes work a bit different. Procedural terrains are generated from scratch, and you can't take other terrains as a source.

    Does this happen in a demo scene? I've just tried it here, still seems to be MicroSplat node after starting playmode. If you don't have this issue in demo - could you please report it at ideainformer and share a scene and a graph in issue description?

    MapMagic outputs control maps with the same resolution as a heightmap. Otherwise height and texture details won't match - you will have textures up to half pixel offset from height detail. More on MM wiki.
    So the control texture resolution in this case is 513*513. It could not be properly displayed as enum field, so it's empty. Selecting 512 from the list should re-scale it with Unity means (however it might become blurry after 1-pixel re-scaling).
     
    FlightOfOne likes this.
  6. cookimage

    cookimage

    Joined:
    Sep 10, 2012
    Posts:
    729
    I am having a problem, I can pin any new terrain nor will it auto generate in play with Map Magic 2, Anyone else had this problem?
     
  7. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,267
    Could you please clarify what the problem is? What are you doing, what happens, and what is the expected result?
     
  8. Kaen_SG

    Kaen_SG

    Joined:
    Apr 7, 2017
    Posts:
    206
    Do you by any chance have an updated version of this? the code has changed so much I am unable to get this working anymore. (Using MM2 bundle v2.1.5)

    What is everyone else's solution for biome detection?
    My main objective with this is to be able to set weather zones for Enviro and spawn wildlife based on biome.

    2 other ideas in my head are spawning trigger beacons around the tile... (not very elegant) or sampling the splat map below (might not work with microsplat).
     
  9. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    Perhaps a simpler question is "@Wright can a non-code proficient user (Like a noob) do a simple "X,Y" world request and return say the biome mask at a specified co-ord yet?" This seems like a nice to have. I sense No, but certainly would second such a helper method


    EDIT: Okay. I'll ask http://mm2.idea.informer.com/proj/MM2?ia=136701
     
    Last edited: Jun 24, 2021
    Kaen_SG likes this.
  10. cookimage

    cookimage

    Joined:
    Sep 10, 2012
    Posts:
    729
    I have mapmagic 2 terrain setup in scene, I want to add and pin more terrains sections but when I click pin it does not show me any terrain tiles outline to pin so I cant pin or see more tiles, only the first one. This does not always happen and I wonder if its also linked to me changing the terrain layer from default to my own layer?
     
  11. one_one

    one_one

    Joined:
    May 20, 2013
    Posts:
    621
    Any news here? This is a critical feature for using map magic with VSPro, IMO...
     
  12. Hakazaba

    Hakazaba

    Joined:
    Jul 1, 2015
    Posts:
    119
    I'm trying to use megasplat, I am getting these errors.


    Code (CSharp):
    1. Thread failed: System.IndexOutOfRangeException: Index was outside the bounds of the array.
    2.   at MapMagic.Nodes.MatrixGenerators.MegaSplatOutput200.BlendMegaSplat (MapMagic.Terrains.Area area, Den.Tools.Matrices.Matrix heights, MegaSplatTextureList textureList, System.Collections.Generic.IList`1[T] matrices, System.Collections.Generic.IList`1[T] biomeMasks, System.Collections.Generic.IList`1[T] opacities, System.Collections.Generic.IList`1[T] channelNums, MapMagic.Products.StopToken stop) [0x00229] in E:\RuikaProject\Assets\MapMagic\Compatibility\MegaSplat\MegaSplatOutput.cs:182
    3.   at MapMagic.Nodes.MatrixGenerators.MegaSplatOutput200.Finalize (MapMagic.Products.TileData data, MapMagic.Products.StopToken stop) [0x000a0] in E:\RuikaProject\Assets\MapMagic\Compatibility\MegaSplat\MegaSplatOutput.cs:75
    4.   at MapMagic.Nodes.Graph.Finalize (MapMagic.Products.TileData data, MapMagic.Products.StopToken stop) [0x0002b] in E:\RuikaProject\Assets\MapMagic\Nodes\Graph.cs:944
    5.   at MapMagic.Terrains.TerrainTile.Generate (MapMagic.Nodes.Graph graph, MapMagic.Terrains.TerrainTile tile, MapMagic.Terrains.TerrainTile+DetailLevel det, MapMagic.Products.StopToken stop) [0x00070] in E:\RuikaProject\Assets\MapMagic\Terrains\TerrainTile.cs:682
    6.   at MapMagic.Terrains.TerrainTile+<>c__DisplayClass39_0.<EnqueueTask>b__0 () [0x00000] in E:\RuikaProject\Assets\MapMagic\Terrains\TerrainTile.cs:589
    7.   at Den.Tools.Tasks.ThreadManager.TaskThreadAction (Den.Tools.Tasks.ThreadManager+Task task) [0x00000] in E:\RuikaProject\Assets\MapMagic\Tools\ThreadManager\ThreadManager.cs:138
    8. UnityEngine.Debug:LogError (object)
    9. Den.Tools.Tasks.ThreadManager:TaskThreadAction (Den.Tools.Tasks.ThreadManager/Task) (at Assets/MapMagic/Tools/ThreadManager/ThreadManager.cs:141)
    10. System.Threading.ThreadHelper:ThreadStart ()
    11.  
    I think its due to mapmagic displaying array layers in the ui while assigning clusters instead.

    Also, how do i use puddles and flow?
     
    Last edited: Jun 25, 2021
  13. HiKkY

    HiKkY

    Joined:
    Oct 12, 2013
    Posts:
    4
    Oh, looks like problem was on my side only. After reimport it's all ok now. Sorry for inconvenience.
     
  14. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,267
    Yes, I've got good news on it!
    I've made two new output nodes for upcoming 2.1.6, and right at the moment I'm writing their documentation:
    - Direct Matrices Output
    - Direct Textures Output

    Direct Matrices output has several layers of inlets. Each layer has a user-defined name and receives a map through it's inlet during generate.

    Once generate is complete, Direct Matrices will assign a MonoBehavior called "DirectMatricesHolder" for each of terrains generated by MapMagic. This component is assigned to terrain game object, next to Terrain component. It stores a dictionary of <layer names, layer maps>. Each holder has some helper methods to perform basic operations with maps, like get value at world position by the layer name.

    Direct Matrices stores maps in a WorldMatrix format. It's mainly MM class, but if you want some advanced features like normal or average value or something you can use all of MM's Matrix and WorldMatrix methods.

    Direct Textures output is similar to Direct Matrices, but it stores maps in a common Texture2D format, in case you will be using them in shaders or just feel more comfortable to work with textures instead of matrices.

    Could you please check if you have gizmos enabled in a scene view (Gizmos button at the top right corner of the scene view window)? Tile frames and lock circles are the gizmos and work similarly to Unity's camera frustum or light cone gizmos. They are not displayed and edited when gizmos toggle is disabled.

    Unfortunately no news here, and I'm not going to improve VSPro compatibility further at the moment. However if it's listed at ideainformer and will get enough votes I can change my mind - but can't guarantee that.

    Could you please report it on ideainformer? Once done you will be able to track it and know when it's fixed. This ticket can also provide a communication channel. Other users can also see if the issue was reported or to clarify details.
    And it seems that I will need a scene, a graph, and their meta-files. It would be great if you could cloud-link them in issue description.
    There's no need to send models or other assets. I will appreciate if you don't compile the unity package with the dependencies.
     
    twobob, Kaen_SG and one_one like this.
  15. one_one

    one_one

    Joined:
    May 20, 2013
    Posts:
    621
    thevisad likes this.
  16. TimDoesDev

    TimDoesDev

    Joined:
    Feb 23, 2018
    Posts:
    35
    Hi @Wright The biomes node does not seem to work. Like mentioned previously only the textures from the first biome is being rendered. I use Microsplat and HDRP. And yes, I use the same microsplat material on all biomes
     
  17. toshikama

    toshikama

    Joined:
    Sep 11, 2017
    Posts:
    9
    Hello!
    Thanks for the very nice assets.

    Is there any function in MapMagic2Object like initialize or reset?

    I am replacing MapMagicObject.graph during execution.
    And when I run MapMagicObject.StartGenerate, things happen that I don't want.

    1,If I change from a MapmagicGraph with grass to a Graph without grass, like a desert, the grass is still there.
    2. An error occurs in TreeOutputNode. (Probably due to MultiPrefab.

    I would like to be able to switch between forest and desert without any discomfort by replacing the Graph.
    In particular, I want the grass to grow and be removed according to the Graph settings.
    Could you please give me some ideas?

    Thanks!

    Translated with www.DeepL.com/Translator (free version)
     
  18. Aress28

    Aress28

    Joined:
    Dec 12, 2015
    Posts:
    100
    Hello!Can some tell with nodes best to use to blend in on Grass some other textures like Dirt here and there ...To make some random..I try now with many nodes using snow(just White texture) to see when i come to result i want but sadly no success i mby mixing to much nodes or in incorrect order i dont know :(...
     
  19. TimDoesDev

    TimDoesDev

    Joined:
    Feb 23, 2018
    Posts:
    35
    More than this, there also seem to be a problem with MapMagic and VSPro. it seems like MapMagic isn't actually clearing the VSPro nodes when we remove the nodes, making it generate much more stuff than it should in the background which in turn slows it down immensly
     
  20. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,267
    I will appreciate if you could you report these issues on ideainformer:
    It's a special page to report both ideas and issues. Helps to keep things organized, that result in some pluses:
    - You will be able to track your issue/idea and know when it's fixed;
    - This ticket can also provide a communication channel dedicated to this issue;
    - Other users can also see if the issue/idea was reported, add some comments on it or clarify details.

    If you have a graph and a scene with the reproducible issue it would be great if you could link them in issue description. I will need a scene, a graph, sub-graphs if you are using biomes, and their meta-files. There's no need to send models or other assets. I will appreciate if you don't compile the unity package with the dependencies.

    Changing the whole graph in playmode is rather tricky operation, but it should work if you are doing it when no tiles pinned or generated yet - for example, on scene load. If you are doing on start then you should have no tiles pinned to make it work properly. If you want to replace already generated land then it's better to load the new scene instead.

    It depends on the way you want to blend dirt exactly. The simplest way is just to use a noise map, but I'm not sure that that is what you want. Could you please clarify what you are trying to achieve? A picture or scheme could come in handy.
     
    toshikama likes this.
  21. toshikama

    toshikama

    Joined:
    Sep 11, 2017
    Posts:
    9
    Thank you so much!
     
  22. Aress28

    Aress28

    Joined:
    Dec 12, 2015
    Posts:
    100
    i added image where u see snow going in exact level and its like ring around the island. I marked with red how i want dirt to appear..

    and there is some issue with grass.. i added grass for like 5min using MM2 nodes but now i removed node and my grass still here :) uploading image
     

    Attached Files:

  23. Calamitycal

    Calamitycal

    Joined:
    Jul 6, 2014
    Posts:
    36
    I'm not sure what changed or if it never worked, but my draft terrains are no longer drawing trees, objects, or objects. I have the drafts set to display at 2, but they aren't drawing any of the flora. This creates a really noticeable pop when they all load in. Is there a way to use the lower resolution terrain while still drawing the objects and details?

    Also, I'm trying to edit the objects on a tile after the tile has loaded them. I've isolated where I can do that in the map magic code (I think), but I can't access my object's script to tell it to make the changes due to namespaces.

    Is there a better way to know when a tile has finished loading all of its objects and then tell another object outside of the namespace to go ahead and make the changes? I have all of the code to make the changes working if I call it manually after I know the objects are finished loading, but I need a way to automate this after confirming that the object load is complete.

    Thanks!
     
    Last edited: Jun 27, 2021
  24. nathanjoshuaburns

    nathanjoshuaburns

    Joined:
    Jul 27, 2020
    Posts:
    3
    Hello,

    I have a strange intermittent issue that I've been seeing for a few weeks but haven't been able to get to the bottom of.

    I'm using the MapMagic 2 Bundle and generating infinite terrain with a custom graph. I generate this at runtime with a randomised seed.

    Occasionally (and with no obvious pattern), one or more of the tiles will not generate properly. This generally takes two forms:
    - The tile remains completely flat, with a Grouping ID set to either -1 or -2, the Height is set to 0, and the height map resolution is set to 33 x 33. In comparison the tiles that generate properly have a GroupingID above 0, have a height of 250 (which is what I've set the MapMagic object to) and have a height map resolution of 513 x 513.
    - Sometimes the tiles seems to generate properly with a GroupingID, Height and height map resolution in line with other tiles, but spawns very low down compared to the rest of the tiles.

    I don't receive any warnings or errors in the console. Usually it's one tile that doesn't generate properly, occasionally it's two.

    Any help much appreciated.

    Thanks

    Nathan
     
  25. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    Yeah - I also see this.

    can you make it happen more by adding editor load.

    From my eyeballs: looks like a race condition, an ID/process/map somewhere is either being overwritten or blanked after being written. (you can very occasionally catch it render the first one then blank it flat.)

    Hope that helps find it.

    I also reported two bugs - that are very minor on the MM1 thread because I am clearly an idiot.

    upload_2021-6-30_7-57-25.png
     
    Last edited: Jun 30, 2021
  26. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,267
    Yeee! I could chase, reproduce and fix this issue! Not exactly race condition, but yes, related with threads.
    Thanks everyone who have reported it! It helped a lot since it's a nasty issue that appears from time to time only.
    Fix will be available in 2.1.6, I'm going to submit it this week.

    Just wanted to share these news. Will try to answer other questions soon.
     
  27. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    In your sigi @Wright the link to voxeland should now be https://assetstore.unity.com/packages/tools/terrain/voxeland-9180
     
  28. nathanjoshuaburns

    nathanjoshuaburns

    Joined:
    Jul 27, 2020
    Posts:
    3
    That's great news - thanks for the quick response!

    I'll keep an eye out for 2.1.6
     
  29. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    You know what would make prototyping faster?
    a "Disable Contents" and "Enable Contents" option in right click for Group.
    Expected behaviour: Just walk the group contents and disable/enable any other control in the group.

    Maybe I'll add one
     
  30. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,267
    You can add some noise at the transition between two masks by using the Blend node in Overlay mode. For the noise map use small-patterned noise with increased contrast:
    MaskingOverlay.jpg

    2.1.6 will have a new clearing system on output removal. It will be independent from the output type, and thus will work fine with removing spline nodes as well.

    Odd thing, MM has a protection against creating infinite circles, and do not allows to assign a biome graph if it is already used on upper level - directly or through other biomes. But I guess you've found a fault in this protection. It would be great if you could re-create this graphs without assigning to any MM object and link it on ideainformer. BTW it's exactly the place to report issues you were looking for.
    It's a special page to report both ideas and issues. Helps to keep things organized, that result in some pluses:
    - You will be able to track your issue/idea and know when it's fixed;
    - This ticket can also provide a communication channel dedicated to this issue;
    - Other users can also see if the issue/idea was reported, add some comments on it or clarify details.

    If you have a graph and a scene with the reproducible issue it would be great if you could link them in issue description. I will need a scene, a graph, sub-graphs if you are using biomes, and their meta-files. There's no need to send models or other assets. I will appreciate if you don't compile the unity package with the dependencies.

    It's not clear what the issue is exactly. When does it happens and are there any ways to reproduce it?
    I really appreciate your findings, but good issue description comes more handy then investigations on it's reason. I will look into it once more - I have to, just to make sure that the conclusions are correct. So details on reproducing the issue will help me a lot more than other findings.

    EDIT: yes, that what I meant in the last post: I'll add map to another and send it to whittaker to reproduce it. Thanks!
     
  31. Refeas

    Refeas

    Joined:
    Nov 8, 2016
    Posts:
    192
    Hey @Wright,
    I found a small issue - the GetProgress() method on MapMagicObject returns values bigger than 1.0 (100%). At the start, it returns expected values like 0.1, 0.2 etc. but at some point it jumps from 0.6 to 1.012, then it goes slowly back to 1.0, and finishes at around 0.998. I use the method to show the generation progress to the player at runtime and these numbers are quite confusing. :)
     
  32. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    @Wright Oh my, seriously not sure.
    This setup shown (using just your default stuff) has this weird missing texture when I instantiate at least 4 biomes and miss the data point (I thought it would lerp that)
    upload_2021-7-2_15-19-9.png

    So I add a graph that would hit that data point
    upload_2021-7-2_15-21-6.png
    (that looks better but note the black flecks in the Hot desert)

    Add one more graph (tundra)

    upload_2021-7-2_15-22-34.png
    Tundra appears, Hot desert now disappears.

    DID I FIND IT? please say yes. today has been very dull. I think 6 hours tracing this? That SURELY says "wandering reference" somewhere... NO?

    Adding Snow Plains as one of the graphs seems to clobber MULTIPLE id's Maybe something in TerrainLayers? I have no idea.
    Hope that helps.
    upload_2021-7-2_15-28-12.png
     
    Last edited: Jul 6, 2021
  33. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,267
    twobob, I will appreciate if you could report these issues to ideainformer, since I've got numerous questions on EACH of them. It won't be convenient to track per-issue discussion on forum, and we will end up in spending most of the time trying to clarify which issue exactly we are talking about.

    The main question in general is: have you modified MM code? I can see Debug.LogWarning that I don't use, and it can be the cause of editor hangs, especially if you are trying to output per-pixel data this way (it can end up in 513*513 warning messages).
     
  34. Refeas

    Refeas

    Joined:
    Nov 8, 2016
    Posts:
    192
    Wright likes this.
  35. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    Done. :) notes below.
    Hi. It's one Log.Warning to see if it got to a certain section to a certain value. If it occurs twice it automatically scales the called value to be larger for the exact reason of not getting junk. It emits one value per tile. and only if it is going to exceed to Clamp01 test and then it is clamped01 anyway for extra "clean". it should be okay and doesn't fire all the time.

    "Have I adjusted the code". Yes. It wasn't working in the way I expected. I tried to find out why but just to add debugs to your stuff. And added the World X|Y node. That node is not in your original code but I tested it extensively. and removed it on many occasions to rule it out.

    I shall wait until your next release I guess and change absolutely nothing and just test again. I was hoping you might say something like "The issue fixed at http://mm2.idea.informer.com/proj/?ia=135587 would very likely cause the textures to be mixed up" so that's why didn't quote it again on MM2.

    I can literally just break the default Whittaker. Which is what is pictured many time above. In a few ways. I'll happily split them up into various lumps and report them severally , hopefully this upcoming "threads" fix might make it some of it go away? (mixed up textures for example)
    EDIT: I updated http://mm2.idea.informer.com/proj/MM2?ia=136740#comment-block-49776
    with the exact step required.
    Added http://mm2.idea.informer.com/proj/MM2?ia=136751
    Clamp01 needed for Whittaker inputs
    Added http://mm2.idea.informer.com/proj/MM2?ia=136753
    re-entrant graphs is not guarded against
    Added http://mm2.idea.informer.com/proj/MM2?ia=136752
    Whittaker Terrain Layers mixing up textures

    I did add one for the really badly specified report. like http://mm2.idea.informer.com/proj/?ia=136750 "IT HANGS! for no obvious reason" (not actual title) I'm sorry I can't add more on that one. I have literally tried for 5 days to get a repo case together on that. I even sat for a full hour doing nothing with the graph open and then tested it to check it wasn't some thing that only occurred after "n" minutes. It wasn't
     

    Attached Files:

    Last edited: Jul 6, 2021
  36. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,267
    Version 2.1.6 is available at the Asset Store. Here is what it brings:

    New features:
    - Direct Textures and Direct Matrices to output biome masks or other maps for custom scripting
    - Erosion blur for softer results (and more realistic on higher iterations)

    Bug fixes:
    - Skipping tile from time to time (flat terrain) fixed
    - New output clearing system (removing generated data on disabling/deleting the node)
    - MicroSplat channel re-use in biomes fix
    - GUI icons compression settings
    - VS Pro demo scene fix

    Refeas, twobob, thanks for posting the issues at ideainformer!
     
    baddiego, twobob and christianvogel79 like this.
  37. Calamitycal

    Calamitycal

    Joined:
    Jul 6, 2014
    Posts:
    36
    I think my question may have gotten lost in the many posts that followed it, so asking it a bit differently here:

    I'm trying to edit the objects on a tile after the tile has loaded them. Is there a way to know when a tile has finished loading all of its objects and then tell another object which tile just finished and to go ahead and run the script to make the edits to the objects for that tile? I have the script itself working (if I run it manually) but can't figure out how to know a tile is finished loading it's objects and to communicate that to the gameobject handling the changes.
     
    twobob likes this.
  38. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    I have a similar thought for implementing https://gitlab.com/denispahunov/mapmagic/-/wikis/MatrixGenerators/DirectMatrices if I try to grab the list too early I get an error.

    do we subscribe to an event? if so: Is there a list of subscribeable events? Thanks :)

    By The Way

    Chance of snow 25%
    upload_2021-7-8_5-3-49.png
    works great.

    In terms of speed: here's looking up 5 simple floats from the current tile
    upload_2021-7-8_8-18-26.png
    I tried jetspeeding across a boundary and just walking or doing nothing to add some random loads. that's the min/max of the lookup loop retrieving those 5 values. 0.02ms to 0.03ms roughly. at those margins even measuring the time taken can affect the results. It's fast. Let's just say that.

    We constructed a tiny helper upload_2021-7-8_6-28-2.png
    however:
    Code (CSharp):
    1. DirectMatricesHolder holder = MapMagicObjectRef.tiles.FindByWorldPosition(x, z).gameObject.GetComponentInChildren<DirectMatricesHolder>();
    would be best called scaffold-ed around an onComplete? event - of some kind - most likely.

    cos sometime we get randomly:
    Code (CSharp):
    1. Thread failed: System.NullReferenceException: Object reference not set to an instance of an object
    2.   at Den.Tools.Matrices.MatrixWorld..ctor (Den.Tools.Matrices.MatrixWorld mw) [0x00006] in D:\REPOS\AOTA-Small\Assets\MapMagic\Tools\Matrix\MatrixWorld.cs:72
    3.   at MapMagic.Nodes.MatrixGenerators.DirectMatricesOutput200.Finalize (MapMagic.Products.TileData data, MapMagic.Products.StopToken stop) [0x0004a] in D:\REPOS\AOTA-Small\Assets\MapMagic\Generators\Matrix\Runtime\TexturesOut.cs:798
    4.   at MapMagic.Nodes.Graph.Finalize (MapMagic.Products.TileData data, MapMagic.Products.StopToken stop) [0x0002b] in D:\REPOS\AOTA-Small\Assets\MapMagic\Nodes\Graph.cs:948
    5.   at MapMagic.Terrains.TerrainTile.Generate (MapMagic.Nodes.Graph graph, MapMagic.Terrains.TerrainTile tile, MapMagic.Terrains.TerrainTile+DetailLevel det, MapMagic.Products.StopToken stop) [0x00070] in D:\REPOS\AOTA-Small\Assets\MapMagic\Terrains\TerrainTile.cs:717
    6.   at MapMagic.Terrains.TerrainTile+<>c__DisplayClass48_0.<EnqueueTask>b__0 () [0x00000] in D:\REPOS\AOTA-Small\Assets\MapMagic\Terrains\TerrainTile.cs:624
    7.   at Den.Tools.Tasks.ThreadManager.TaskThreadAction (Den.Tools.Tasks.ThreadManager+Task task) [0x00000] in D:\REPOS\AOTA-Small\Assets\MapMagic\Tools\ThreadManager\ThreadManager.cs:138
    8. UnityEngine.Debug:LogError (object)
    9. Den.Tools.Tasks.ThreadManager:TaskThreadAction (Den.Tools.Tasks.ThreadManager/Task) (at Assets/MapMagic/Tools/ThreadManager/ThreadManager.cs:141)
    10. System.Threading.ThreadHelper:ThreadStart ()

    Thanks :)
     
    Last edited: Jul 9, 2021
  39. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    "Editor" code bug for DirectMatrices. Zooming all the way out in the graph view will disconnect the bottom connection. Off by one array base error?

    upload_2021-7-9_2-23-45.png

    Code (CSharp):
    1. Could not find a cell for inlet/outlet. Removing link
    2. UnityEngine.Debug:LogError (object)
    3. MapMagic.Nodes.GUI.GraphWindow:DrawGraph () (at Assets/MapMagic/Nodes/Editor/GraphWindow.cs:304)
    4. Den.Tools.GUI.UI:Draw (System.Action,bool,UnityEngine.Rect) (at Assets/MapMagic/Tools/GUI/Editor/UI.cs:259)
    5. MapMagic.Nodes.GUI.GraphWindow:OnGUI () (at Assets/MapMagic/Nodes/Editor/GraphWindow.cs:200)
    6. UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
    http://mm2.idea.informer.com/proj/MM2?ia=136774
     
    Last edited: Jul 9, 2021
  40. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    Undo broke my graph, Redo Fixed it again.

    I pressed Cntl Z after accidentally deleting some links then adding a function afterwards and tried to step back through adding my function and it all broke. (since I have to guess, probably the bit where it tried to remove the input off the function (the step before removing the function itself) around that moment anyway.


    Pressed REDO fixing my problem but I thought you should know there is a demon in there somewhere - right around UNDOing the Addition of a function and the subsequent wiring of portals.

    http://mm2.idea.informer.com/proj/MM2?ia=136775
     
    Last edited: Jul 8, 2021
  41. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    There are couple of things we do a lot. like masking to Zero rather than to a B input. also converting to black/white with a midPoint to create masks. Whilst it was trivial to expose/add these tools for internal use was wondering "do other people do this" so I am asking. Perhaps my workflow is misguided. Anyone?

    Also I may raise a request to reimplement the falloff flag in the NativePlugins.dll
    Code (CSharp):
    1. public void Mix (Matrix m, Matrix mask, float maskMin, float maskMax, bool maskInvert, bool fallof, float opacity) =>
    2.                 //    Mix (this, m, mask, maskMin, maskMax, maskInvert, fallof, opacity);
    That thing.

    please un-comment the line 304 in matrix.cpp
    Won't hurt anyone and we actually use it. thanks

    We could rebuild from source, but currently just patch around in the c#. Either needs maintenance without upstream
     
    Last edited: Jul 10, 2021
  42. MaximilianPs

    MaximilianPs

    Joined:
    Nov 7, 2011
    Posts:
    321
    I have 3 questions:

    1. To speed up the work, can I prototyping the terrain with a single terrain, and then port it in a configuration with much more than one? for example 4x4 or 8x8.
    2. How can I "Refresh" the terrain in runtime (via code) ?
      refresh, non randomizing the seed, I modify the terrain when the game starts so I need to recalculate the textures.
    3. Can I set spline via code/runtime to creare roads when the game is loaded?
      I try to explain, I generate the terrain by randomizing the seed, then I spawn 3 or more villages, then I would like to place roads to connect the villages.
    Actually I'm pretty far on the project, indeed I've achieved the village generation and also I can splat the terrain to avoid any glitch with walls and buildings, but the road is actually a real issue :-\
     
    Last edited: Jul 10, 2021
  43. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,267
    twobob, thanks for reporting all the issues on ideainformer! I will review them during the next version bug fixing.

    You can subscribe to static Action<TerrainTile, TileData, StopToken> TerrainTile.OnTileApplied to determine if some specific tile has been generated and applied, or to Action<MapMagicObject> TerrainTile.OnAllComplete that is called when all of the tiles are done.

    I'm going to make a FAQ page where I plan to list all - or at least most useful - events.

    Actually, you can - most of the generators operate with real world values - except maybe import and simple form. So you can create a single 2000*2000 tile for prototyping, and then use 4 1000*1000 tiles for production. It will give more production resolution as well. However remember to change the import/simple form scales.

    You can force MM to generate from scratch with this:
    mapMagic.ClearAll();
    mapMagic.StartGenerate();
    Unfortunately there's no way to refresh textures only, since MM behaves differently in playmode - it optimizes generate and does not keep intermediate results. Just to mention: that's why I don't recommend changing the graph during the playmode.

    Just to clarify: do you know the positions of your villages beforehand, or are they placed with MM?
     
    MaximilianPs likes this.
  44. Calamitycal

    Calamitycal

    Joined:
    Jul 6, 2014
    Posts:
    36
    This is exactly what I was looking for, thank you!

    One thing I am seeing though is that the event seems to occur twice for each tile when they are created.

    I put in a simple debug command to write the name of the tile to test listening for the event, I see the debug text for each created tile as expected, but then it occurs again a second time for each tile. It doesn't appear to be creating duplicate tiles so not sure why the event is firing twice for each tile. I only have one object listening for the event.
     
  45. MaximilianPs

    MaximilianPs

    Joined:
    Nov 7, 2011
    Posts:
    321
    Sure, that I know the exact position, I use MapMagic to generate a random terrain, then I will spawn the towns, and not only I know city position, but even the city gate's exact position and rotation.

    Indeed I will flat the terrain under the towns, and that's the reason why I need to refresh the texture, so I will refresh the entire terrain, as you shown.

    MM is amazing, I still have to tell it :D
     
  46. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    okay. So Map Magic crashed the editor at least 10 times today. The only SINGLE clue that links any action I was doing (all of which are totally unrelated other than they cause the terrain to update) I finally spotted this image here. Just after a crash upload_2021-7-11_21-32-37.png

    Hope that helps. Since it takes 10 minutes to repoen my project. today has required the patience of a saint. If I had to guess that looks like for a moment the whittaker diagram got 0 for the temperature... or something else... then died.

    My actions were at that time completely unrelated to changing any of that.
     
    Last edited: Jul 11, 2021
  47. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    "Can't put a Whittaker diagram inside a biome set." GenerateRecursive gets upset.

    All I want to do is stick some villages over the top without having to weave them inside the layers... please :)

    Code (CSharp):
    1. Thread failed: System.Exception: Could not find Whittaker diagrams. Possibly generator is not initialized
    2.   at MapMagic.Nodes.Biomes.Whittaker200.Generate (MapMagic.Products.TileData data, MapMagic.Products.StopToken stop) [0x002e2] in D:\REPOS\AOTA-Small\Assets\MapMagic\Generators\Biomes\Runtime\Whittaker.cs:237
    3.   at MapMagic.Nodes.Graph.GenerateRecursive (MapMagic.Nodes.Generator gen, MapMagic.Products.TileData data, MapMagic.Expose.Override ovd, MapMagic.Products.StopToken stop) [0x001ed] in D:\REPOS\AOTA-Small\Assets\MapMagic\Nodes\Graph.cs:917
    Any clues? How one might stick an "upper layer" on a whittaker then?
    Call it as a function perhaps? EDIT nope. same error

    upload_2021-7-11_22-14-51.png

    The bottom layer would be a Whittaker.
     
    Last edited: Jul 12, 2021
  48. IrrationalNumberStudio

    IrrationalNumberStudio

    Joined:
    Mar 9, 2021
    Posts:
    2
    Hello, i am following document's Biomes setup, but the last layer in Biomes set can't be shown, is this a bug in HDRP?
     
  49. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,267
    I bet it's one for the draft, and one for the main terrain. Second argument is TileData, which has isDraft isDraft boolean value. It is the way to determine whether this event called by draft or main tile.

    I will mention this in FAQ, thanks for pointing that out!

    It seems that Positions node is what you are looking for. Here you can input direct coordinates of your cities as objects, and flatten land here during generate and connect them with roads.

    Thanks! I do my best to keep everyone happy, but it is nice to hear that I'm doing a good job!

    Selector gets a modified height map as an input. It's not even a heightmap - but a blend of grass textures with increased contrast. This way Selector takes this map and masks all the values between 0.4 (i.e. 100 / MM terrain height) and 0.8. In order to mask the height values connect it directly to height portal, with no modifications in-between.

    It would be handy if you could report this to ideainformer. It seems to be related with Whittaker node, and thus with graph and it's subgraphs, so I will appreciate if you could upload them somewhere and make a link in description.

    Wow. Is it related with MM as well? If so I will appreciate if you could report this as well, and I will try to look why it takes to load so long.

    I will appreciate if you could you please report it on ideainformer (http://mm2.idea.informer.com).
    It's a special page to report both ideas and issues. Helps to keep things organized, that result in some pluses:
    - You will be able to track your issue/idea and know when it's fixed;
    - This ticket can also provide a communication channel dedicated to this issue;
    - Other users can also see if the issue/idea was reported, add some comments on it or clarify details.
    And could you please try opening the snow plains scene to see if it's displayed properly? It contains the biome that is black on your screen.
     
  50. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    @Wright that's identical to the HDRP issues I was having above on the last release.
    It was even the badlands map exactly like that.

    I /think/ the latest update might have fixed that.
    @wechat_os_Qy01cqV1WV5xEfQqmPflxTLLw is it the latest mate?
    EDIT. NO I AM AN IDIOT.

    this is an HDRP terrain texture limitation



    My thing 10ish posts back. Last version https://forum.unity.com/attachments/upload_2021-7-6_1-46-11-png.883915/
     
    Last edited: Jul 13, 2021