Search Unity

  1. Looking for a job or to hire someone for a project? Check out the re-opened job forums.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

[RELEASED] MapMagic 2 - infinite procedural land generator

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

  1. Zimnel

    Zimnel

    Joined:
    Apr 23, 2015
    Posts:
    66
    Wright, sent you a wetransfer with the scene and an image with a complete setpixel error.
     
  2. onefoxstudio

    onefoxstudio

    Joined:
    Sep 28, 2016
    Posts:
    59
  3. Noctys

    Noctys

    Joined:
    Aug 23, 2013
    Posts:
    36
    Locks don't appear transitioning correctly. It doesn't seem to matter how big or small I make the transition. See below:
     

    Attached Files:

    Last edited: Apr 14, 2021
  4. Mr_Darkness

    Mr_Darkness

    Joined:
    Apr 6, 2020
    Posts:
    8
    Hi, I am having difficulties using microsplat with biomes. It turns out that the textures of only one of all biomes are displayed.
     
  5. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,942
    Thanks for reporting the issue. Seems to be that split node resets objects id to 0, so they are the same number on random. Will look into this issue.

    If I'll do so you won't be able to combine several graphs in biomes - what if mountains biomes will have a height of 1000, and hills 100 - which height should be used. I guess 1000, but then fields will be stretched in height. Anyways, this is more a property of mapmagic object - like tile size or resolution.

    Thanks, but I will appreciate if you send not the full project, but a scene, a graph and it's meta file. I will need only 3 files. There's no need to send models or other assets.
    A description of the issue in email will also come in handy - way more handy than mentioning post on forums.

    Fixed! The document is updated. The main change is that to read inlet product you've got to use `data.ReadInletProduct` (instead of `data.products.ReadInlet`), and to store product - `data.StoreProduct` (instead of setting data.products[]).

    And just for convenience: the sample generator file if you'd like to use it.

    I confirm this issue. Something went wrong with locks, don't know why - I haven't even touched them recently - but I will find out. Thanks for reporting it!

    MicroSplat Output settings are global across all the biomes - you can use only one material per terrain, and this material has to have all the textures assigned.
     
    onefoxstudio likes this.
  6. onefoxstudio

    onefoxstudio

    Joined:
    Sep 28, 2016
    Posts:
    59
    Thanks @Wright Dennis.
    Me, and a few others are having trouble trying to grasp how we can use the generators to do other things like for example getting the points of splines to feed RAM (or other spline based assets), or simply doing simpler things like processing Inputs.

    I know you're very busy, but when you find time I think adding simple 'Hello World' generators would be very helpful for (some of) us.

    MapMagic 2 is really awesome ! Thank you for making this !
     
  7. moltke

    moltke

    Joined:
    Apr 28, 2019
    Posts:
    52
    I somehow messed up my project; i had saved my mapmagic graphs in a separate folder, but now when i try to import them back into a restored project i get this message.



    is there any way for me to acquire my graphs again? the old meta files are there but im still getting this error.
     
  8. ArMeSh

    ArMeSh

    Joined:
    Sep 7, 2013
    Posts:
    4
    Try to Assets/Reimport All
     
  9. ArMeSh

    ArMeSh

    Joined:
    Sep 7, 2013
    Posts:
    4
    Hi guys, have issue with my pipeline - i have big island graph with 5x5 chunks - but i wanna make different biomes on this island - I have MM2, MM2 Objects, MM2 Splines, MM2 Biomes, tutorials not covered my issue :(
     
  10. krooq

    krooq

    Joined:
    Jan 30, 2013
    Posts:
    17
    @Wright would love to see a Discord server for this community to share ideas and grow, feel like its really missing compared to the other giants.
    Also want to see what other people have been able to do with their graphs!
     
  11. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,942
    Yeah, I've promised to look into MicroSplat/VS Pro compatibility issues this week, and still got a lot to do on that. However I can provide some explanations on how to do custom nodes that do this or that then. Maybe append wiki doc with code examples. It would be cool if you could come up with specific requirements on what these nodes have to do.

    As far as I understand it's complaining that you have meta files, but no graph assets themselves in this folder (with the same names). You need to have 2020.1 graph 1.asset itself, not just it's meta file.

    On second though it might be caused with a dot in a file name.

    Have you seen this video? Theoretically it's exactly about what you are trying to do - I'm making different biomes on 3 terrain tiles.


    Yes, there is a community discord channel. It's a server where users share their own knowledge, screenshot, advises, etc. (but I'm not a frequent guest here, so don't use it as a support channel).
     
    krooq likes this.
  12. Diego_Graphics

    Diego_Graphics

    Joined:
    Nov 3, 2014
    Posts:
    140
    Sorry for the late reply. Yes I am 100% sure, it is the current Assetstore version (2.1.3) just this one also has the bug that the Graph View can no longer move. It is still the same bug the appearance. I can at most still try to change the Unity version, but can not be the point of the thing.
    and yes, i already tried the patch you posted to fix the GraphView bug, it does fix the GraphView problem, but the problem with the Whittaker node remains unsolved.

    Edit:
    I have now tried it in a newer Unity version: Same result, same error.
    I sent you a copy of the project via mail.
     
    Last edited: Apr 17, 2021
  13. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,942
    Thanks for sending the project! I've tried to run it - yes, there was the same issue with Whittaker node, but I've tried to download the latest MM2 (core) version with the package manager - and everything seems to be working.
     
  14. Diego_Graphics

    Diego_Graphics

    Joined:
    Nov 3, 2014
    Posts:
    140
    I use the separate MapMagic packages (not a bundle), so I download MapMagic2 and then MapMagic2 Biomes and Functions.

    Can you mail me the version as Unity Package that you have in your package manager. I would like to know if the problem can be fixed with it. I can't do much more than delete my assetstore folder to make sure I get the latest package version. the fact that I also have the error that the graph view won't move proves that I'm using the latest version.
     
  15. ArMeSh

    ArMeSh

    Joined:
    Sep 7, 2013
    Posts:
    4
    @Wright yes, I watched this video thanks, but problem not in combine few biomes, but when I trying to add objects or spline it's works, or change rules with heights - it's start ruining :(
     
  16. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,942
    Could you please try updating the core version? Only core version, after all the modules. Don't know what causes this, but it will help me to find out if I will know whether it helps only in my case or in other cases as well.

    What do you mean by ruining? Is it an error, or some weird generate results (like height is always 0 or 1), or other results that are not expected? A screenshot of biomes transition with a biomes graph photo might help to find out what went wrong.

    Trying to reproduce this, but seems that I'm missing something. I can spawn different objects with different prefabs after the split node:
    SplitBug.jpg
    Is it something I do wrong, or just don't get it what the issue is?
     
  17. Diego_Graphics

    Diego_Graphics

    Joined:
    Nov 3, 2014
    Posts:
    140
    I hope I have understood correctly what you mean:

    1. I have now imported MapMagic2 (the free asset), version 2.1.3.
    2. Then I imported MapMagic 2 Biomes and Functions ( 2.1.3 ).
    3. After that I imported MapMagic 2 ( the free asset ) again.

    So if that's what you mean by updating the core version. But no, it still comes the same error after that.

    If you can please send me a copy via email I would like to test if that fixes the problem. then I would know that something is wrong with the assets in the package manager.

    Edit: I tested it on a second computer where Unity was not installed. Also there: same error.
    I have completely removed Unity from the computer, deleted all unity AppData folders and caches and then re-installed. Same error. I also tested it in unity 2021.1.3f1, again: same error.

    I know I only have something to report when there are bugs and problems. But here is some positive feedback: The integration of MicroSplat has improved significantly. So thumbs up for that.
     
    Last edited: Apr 19, 2021
  18. mick129

    mick129

    Joined:
    Jun 19, 2013
    Posts:
    131
    Huum for the "first object spawning" issue this is weird, I guess there must be another factor combined with split. I will do more research and try to reproduce it on a new graph and send that to you once I have some news . Thanks!
     
  19. Aubrey-Falconer

    Aubrey-Falconer

    Joined:
    Feb 13, 2008
    Posts:
    438
    Greetings @Wright! WebGL is a supported deployment target, right?

    I've tried deleting all MM2 assets and reimporting the latest 2.1.3 Asset Store package to my project twice now, but builds are failing with the following error:

    Plugin 'NativePlugins.dll' is used from several locations:
    Assets/MapMagic/Tools/Plugins/x86/NativePlugins.dll would be copied to <PluginPath>/NativePlugins.dll
    Assets/MapMagic/Tools/Plugins/NativePlugins.dll would be copied to <PluginPath>/NativePlugins.dll
    Please fix plugin settings and try again.
    I'm new to WebGL as a build target, but my understanding is that native plugins are supported and can be referenced for inclusion by appropriate build targets as normal. ( https://blogs.unity3d.com/2017/01/19/low-level-plugins-in-unity-webgl/ ). If not, should I simply exclude the WebGL platform for the NativePlugins.dlls? The project builds when I do this, but am I missing out on a potentially viable performance boost? I'm asking in the public thread in case this is something you might want to do to streamline the build process for the next team to try a WebGL build in a future release version.

    upload_2021-4-18_20-43-22.png
     
    Last edited: Apr 19, 2021
  20. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,942
    Version 2.1.4 now available. It brings a fixes for the couple of issues:
    - Seed serialization fix
    - Lock transition fix
    - MicroSplat output now supports more than 16 channels
    And it adds constant (level) preset to Brush module.

    Unfortunately there's no way to use native plugins for WebGL - the thing is that you don't even know the platform you will run build project. Please correct me if someone knows a way to do this.

    You can disable native plugins in Window - MapMagic - Settings.

    It would be great if you could reproduce this issue, thanks!

    Sure, I'll send you a link via PM if you don't mind (sorry, I don't remember your email exactly, will have to iterate all of them for last several days).
    I'm still hoping that updating to 2.1.4 might help. If not - then there might be an issue with the package manager (however don't know why it worked in a fresh install - maybe Unity uses a single cache for all projects?)

    Yes, I realize that users commonly write here if they have a problem or at least a question. But this cheers me up, I'm really glad to hear that! Thanks!
     
  21. Aubrey-Falconer

    Aubrey-Falconer

    Joined:
    Feb 13, 2008
    Posts:
    438
    Thx @Wright >16! Microsplat channels just made my day

    The project I'm working on at the moment targets multiple build platforms, WebGL being one. I've discovered that Unity's inspector allows for a super-clean method to exclude native plugins from inclusion in builds for particular platforms rather than using the MM settings to exclude from all platforms, and this is working nicely for me with MM so far. Perhaps you'd want to change this in the next release package, and streamline the process for others targeting WebGL.

    upload_2021-4-19_18-7-51.png
     
  22. Nyxo

    Nyxo

    Joined:
    Mar 12, 2013
    Posts:
    21
    I was just debugging why some of my custom functionality doesn't work when I integrate MapMagic2 with MicroSplat (it works with each one individually, just not when used together), and I think I came across a bug in MicroSplatOutput.cs -- I don't think it actually solves my problem, but I happened to notice it while perusing the code:

    In MicroSplatOutput200.Finalize(), you have 2 blocks of code (one for Textures || Both, and the other for Splats || Both) that assign to a variable named applyData, and following those blocks of code, you then use applyData in Graph.OnOutputFinalized?.Invoke().
    The problem is that if you are using MicroSplatApplyType.Both, it will enter the first block of code, assign a value to applyData, then enter the 2nd block of code and completely blow away applyData with a new assignment. If I understand the code correctly, I believe it should be doing a Graph.OnOutputFinalized?.Invoke() call for BOTH of those blocks of code, shouldn't it?

    I did discover how I could achieve what I was trying to do tho, but I don't think it's really the ideal fix. Looking for some input from @Wright on this. Ultimately, what I'm trying to do, is at runtime, make minor adjustments to the texture blends on the terrain. While testing, I came up with 2 ways to do this, and both of them work on a normal Terrain using the default shader, a normal Terrain using MicroSplat, and MapMagic2 using it's shader. But NOT with MapMagic2 + MicroSplat together.
    The two methods (which are basically the same thing) were to:
    1) Call TerrainData.GetAlphamaps(), modify the return value, and then send it back with TerrainData.SetAlphamaps()
    2) Call TerrainData.GetAlphamapTexture(), modify the pixels, and apply them.

    After inspecting the code, I discovered that I could set the MicroSplat output node to Apply Type "Texture", and then my code could basically do Terrain.activeTerrain.GetComponent<MaterialPropertySerializer>().GetTexture("_Control0"), and modify/apply the pixels in that texture. That feels pretty dirty to me tho.
    Also, I'm confused as to why my earlier 2 methods don't seem to work when I have the MicroSplat output node set to "Splat".. If I attach a debugger, I can _see_ MM2 apply the splats via TerrainData.SetAlphamaps(), and I can _see_ MicroSplat read the splats from TerrainData.alphamapTextures (and I put a debug line in to read a pixel from it -- it's correct, it's my modified data), yet I don't actually see the results on the terrain. Super confused by this.

    In the meantime, I have a workaround that functions, even if it's dirty~
     
    Last edited: Apr 20, 2021
  23. Diego_Graphics

    Diego_Graphics

    Joined:
    Nov 3, 2014
    Posts:
    140
    Cool. the fix you sent me via PN seems to be a step in the right direction. But please test if the biomes also generate an output. this is definitely not the case for me. Each biome field of the Whittaker node is set and contains a Microsplat output node with a selected texture. Also the parent graph has a microsplat node with a selected ground texture.

    A Moisture and a Temperature input map is set. Errors are definitely no longer occurring, but no biomes are being generated. It seems that the Whittaker node does nothing.

    The package manager has been a hell for a while now, Unity seems unable or unwilling to finally fix this problem. Therefore, I actually meant if you can send me maybe the .unitypackage. That would be easier than sending a zipped project. Just to be sure if it is really the package manager. The zipped project has worked so far and solves at least the occurrence of errors, except that just no biome is generated.

    We can use the forum PN function instead of email for private messages in the future, if you prefer.
     
  24. FlightOfOne

    FlightOfOne

    Joined:
    Aug 1, 2014
    Posts:
    451
    @Wright

    Hi Denis, is there a way to get an event when a tile changed (activated, switched to high res and deactivate) at run time? Also, how do the objects and tree work, are then gpu instanced?

    Also, could you please point me to the correct documentation for the latest MapMagic?

    Thanks!
     
    Last edited: Apr 21, 2021
  25. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,453
    Just a note, I updated to MapMagic 2.1.4, using it for IOS and the graph ALT Dragging works:) Thank you for the fix.
     
  26. duminju1990

    duminju1990

    Joined:
    Jul 26, 2019
    Posts:
    30
    @Wright Ah I see.. I thought the biome node will be able to "smoothen" the height difference.
    Anyway, I want to confirm that the Microsplat >16 texture now works like charm! (tried 20 textures). Thank you sooo much for the improvement!

    Another same issue with @Diego_Graphics, the Whittaker node, no longer have error message but still not working. I'm using Map Magic 2 bundle v2.1.4 with below setting. Is there anything that I miss in the graph to make it work? I use sample graph in the demo & insert into the first 3 graph slots.

    upload_2021-4-21_19-17-3.png

    In scene view:
    upload_2021-4-21_19-17-23.png
     
  27. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,942
    Thanks for sharing this! However, it will just disable the plugin, and you will get null (entry point not found) when trying to call it. So it should be wrapped into # defines - if platform is WebGL it's using standard Unity c# scripts, if standalone then calling native library. And if you'll do this wrapping in code then native functions won't be called anyways.

    Thanks for sharing this! Yes,
    Code (CSharp):
    1. Graph.OnOutputFinalized?.Invoke(typeof(CustomShaderOutput200), data, applyData, stop);
    2. data.MarkApply(applyData);
    should be really in both blocks. This way it will add both ApplyCustomData and ApplySplatsData to apply queue. And will call OnOutputFinalized event as well.

    BTW you can use this event to change textures in ApplyCustomData, this way you can read them directly from data rather then from terrain material.

    Thanks for letting me know! This should fix it.

    You can subscribe to OnLodSwitched<TerrainTile, bool, bool> action delegate, where first goes terrain tile, and booleans are enabled main and draft accordingly. If none is enabled - tile is disabled.

    Unfortunately MM has nothing to do with this - it applies standard Unity trees and objects.

    You can find the latest documentation on GitLab Wiki.

    Oh, sorry, forgot to mention it in change list :)
     
    FlightOfOne likes this.
  28. Nyxo

    Nyxo

    Joined:
    Mar 12, 2013
    Posts:
    21
    Maybe I'm not understanding your suggestion/code correctly, but isn't what you're suggesting only capable of modifying texture blends as they're on their way to MicroSplat immediately following a graph generation? What I need to do is modify some texture blends at an arbitrary time, in response to an event occurring in the game.

    Also, I found another minor bug :)
    In VSProOps.UpdateCopySystem(), when "clearing storage," your current code calls
    new PersistentVegetationStoragePackage()
    when it should actually be calling
    ScriptableObject.CreateInstance<PersistentVegetationStoragePackage>()
    .
     
  29. onefoxstudio

    onefoxstudio

    Joined:
    Sep 28, 2016
    Posts:
    59
    Thanks for the fix Dennis.

    Well I think for us it's some dark magic. I think the most obvious 'output' would be to have a more 'clear' view of the input and output. For example an output node that would just hold an array of (x, y) and float and an event that we can register to when it's updated. I imagine something like have that output node feed Polaris terrain for example, that would be awesome to have it 'realtime' (for now it's a tedious process). For input node, same, an example to show what is the array and more precisely 'where' to write the function to do something.

    I hope it makes sense, let me know if it's unclear i would do some drawings.
     
  30. FlightOfOne

    FlightOfOne

    Joined:
    Aug 1, 2014
    Posts:
    451
    @Wright Thanks for the responses Denis! I have couple of more questions:

    Do I pin all needed tiles as new tiles for them to be streamed after the build? because in the editor play mode, they only get streamed if I pin them as new tiles. Anything I pin as drafts stay as draft and do not get generated as high res maps in play mode. What is the proper work flow for this?

    I recently purchased the spline (also emailed you about it), will you be making one of those wonderful tutorial video for this near future? I can't seem to find much about this, on how to use it etc..

    Lastly, I see two buttons, "Save Terrain Data and Save as Copy" are these supposed to work? When I click on them, they do not seem to do anything.

    Thank you!
     
  31. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,942
    Sorry, I thought you need to change textures before they are applied to terrain. But yes, in your case reading them from material seems to be the only solution since they are nor stored anywhere after generating is done except the material itself.

    Thanks! In previous version it was called from non-main thread, so creating an asset this way produced an error. But now it's called from apply, so it should be done this way, fixing.

    There could be some problem with the event, because MM nodes are generated in a mentioned non-main thread. It has no access to terrain, scene, objects and all of the other Unity stuff. It's a pure math calculations. What the outputs do is they store the calculation results in a sub-class (usually named ApplyData) and apply these results to terrain when unity calls update in main thread.
     
  32. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,942
    If you pin a tile as a draft it will stay as a draft. It is supposed that this pinning was made intentionally, for example for horizon meshes. In order to generate all of the tiles leave them empty or pin main tiles only.

    Yes, but first I'm going to make some big changes here. Change the splines engine completely. I don't know ETA for this. I'm afraid that making video before that will be outdated after that.

    You've got to select the pinned tile to save it's data. Enable the button, and move cursor over a tile - it should be highlighted with green.
     
    FlightOfOne likes this.
  33. krooq

    krooq

    Joined:
    Jan 30, 2013
    Posts:
    17
    @Wright when working on the VSPro/MicroSplat integration fixes for the next version could you please include fixes for:
    - VSProMapsOut node using the 2^x resolutions, the fix I mentioned on pg 22 of forum i.e. subtract 1 from splatsSize (2 lines) works for me
    - MicroSplat textures go blurry after saving the scene, need to regen to fix it, (this isn't a big issue but it is a bit annoying)

    Thanks for all your hard work, it is appreciated far more than you know :)
    After inspecting the MM code I can see that it is made with great care and is quite easy to navigate. I wish there was a way I could contribute.

    Also wanted to say I have been on the Discord (https://discord.gg/yCJEgSw) this week and there is lots of really nice people on there helping each other out. The MM community is really nice and create some really impressive stuff. Even though the forum is the best place to contact Denis for support, I also recommend everyone to jump on discord to see if the community can help with common or known issues.
     
  34. Noctys

    Noctys

    Joined:
    Aug 23, 2013
    Posts:
    36
    May have found another bug -- or maybe I am doing something wrong. Trees don't seem to be rotating anymore. I have everything setup the same as before Scatter --> Spread --> Mask --> Adjust --> Rarefy --> Trees -- But all the trees are rotated the same way, these are very simple low-poly trees with no LOD (not billboards).

    I can do the exact same thing though and push it to objects instead of trees ...Adjust --> Rarefy --> Objects and it rotates just fine... So no big deal, I just use Objects for now. :D
     
  35. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,798
  36. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,453
  37. focuslabstudios

    focuslabstudios

    Joined:
    Feb 23, 2018
    Posts:
    8
    Hi when using MM2 and adding a VS Pro object I have an issue. When disconnecting the VS Pro object node it doesn't actually clear/remove the generated vs pro object. I have no idea what is going on. Is this a known bug, if so how do I fix it? :)
     
  38. Roan-Albers

    Roan-Albers

    Joined:
    Jan 28, 2013
    Posts:
    5
    Thanks for the seed serialization fix @Wright, much appreciated!

    We came across something else that is probably not intended. When pinning multiple drafts at once (not waiting for one to be generated and then pinning another) Unity crashes. Any ideas there?
     
    Last edited: Apr 23, 2021
  39. duminju1990

    duminju1990

    Joined:
    Jul 26, 2019
    Posts:
    30
    @Wright I use the fix & I got below result. I still use the same method: graph slot is from sample graph. Can you help? Also is there any tutorial on setting up Whittaker biome?
    upload_2021-4-23_20-4-7.png

    upload_2021-4-23_20-4-51.png
     
  40. FlightOfOne

    FlightOfOne

    Joined:
    Aug 1, 2014
    Posts:
    451
    Thanks Denis!

    One more thing, this is more of a guidance question since you have far, far more experience with terrains than I. Is there a benefit to having smaller terrains vs larger terrain tiles. I am trying to decide between 512 x 512 vs. 1024 x 1024 terrain tiles. I'd think the smaller ones would be faster? What would you recommend? My entire map is going to be 8km x 8 km.
     
  41. Noctys

    Noctys

    Joined:
    Aug 23, 2013
    Posts:
    36
    @FlightOfOne - From personal experience I can tell you that smaller tiles are faster (less is loaded into memory at the same time), however the trade off is that sometime you can see the missing tiles farther off in the distance. In the cases where that happens you can bump up the draft range to 3 or 4. I think though if you are running a tile size of 500+ you won't have to do that.
     
  42. Bodyclock

    Bodyclock

    Joined:
    May 8, 2018
    Posts:
    148
    @Wright Hi, I'm implementing a custom node to try and generate a more complex base form for islands. In essence it takes a series of base cone forms and overlaps them to form larger more complex shapes. The idea is to be able to deterministically generate these from a seed.
    I've taken the Simple Form cone code and implemented a loop that adds a temporary matrix to a base matrix for the number of required cones. This works to an extent, if I don't use draft terrains in the editor or at runtime. I think there is something fundamental that I'm not understanding about how to blend matrices in a loop. The result if I use draft terrains or change the scale is inconsistent with pieces of the forms not appearing on pinned terrains.
    The simplified code for the loop is below, nothing too complex. If anyone has any ideas on where I'm going wrong or has a better approach, I'd appreciate it.

    Code (CSharp):
    1.     public override void Generate(TileData data, StopToken stop)
    2.     {
    3.         intensity = 1;
    4.         scale = ((Mathf.Min(size.x, size.y) / data.area.active.worldSize).x) / 2;
    5.         offset = new Vector2(0, 0);
    6.  
    7.         Debug.Log("Island Size : " + size);
    8.         Debug.Log("Chunk Size : " + data.area.active.worldSize);
    9.         Debug.Log("Min Size : " + Mathf.Min(size.x, size.y));
    10.         Debug.Log("Max Scale : " + (Mathf.Min(size.x, size.y) / data.area.active.worldSize).x);
    11.  
    12.         MatrixWorld matrix = new MatrixWorld(data.area.full.rect, data.area.full.worldPos, data.area.full.worldSize, data.globals.height);
    13.  
    14.         for (int i = 0; i < 2; i++)
    15.         {
    16.             MatrixWorld tempMatrix = new MatrixWorld(data.area.full.rect, data.area.full.worldPos, data.area.full.worldSize, data.globals.height);
    17.             Cone(tempMatrix, (Vector2D)offset, scale * (Vector2D)data.area.active.worldSize, stop); //size is chunk-size relative
    18.             matrix.Add(tempMatrix);
    19.             matrix.Clamp01();
    20.             offset = new Vector2(-1500, -1500);
    21.             //scale /= 2;
    22.         }
    23.         data.StoreProduct(this, matrix);
    24.     }
     
  43. FlightOfOne

    FlightOfOne

    Joined:
    Aug 1, 2014
    Posts:
    451
    Thank you! Good to know.
     
  44. FlightOfOne

    FlightOfOne

    Joined:
    Aug 1, 2014
    Posts:
    451
    @Wright Hi I keep getting these weird connections or gaps between tiles. Some time go away after generating several times. Most of the times they appear else where. I should say the gaps along the seems are almost always visible especially on draft tiles.

    See here:

    upload_2021-4-23_16-46-13.png upload_2021-4-23_16-49-17.png

    Here are my tile settings and the graph:
    upload_2021-4-23_16-47-14.png

    upload_2021-4-23_16-47-50.png


    Edit: I get a lot of errors from null ref say tile trying to access to index, out of bound

    Here's the out of bound one, this happens when I click the add layers button in Microsplat node.
    Thread failed: System.IndexOutOfRangeException: Index was outside the bounds of the array.
    at MapMagic.Nodes.MatrixGenerators.BaseTexturesOutput`1[L].BaseGenerate (MapMagic.Products.TileData data, MapMagic.Products.StopToken stop) [0x00148] in C:\Unity Working\AF Main\AFTC\Assets\THIRD_PARTY_EXTENSIONS\MapMagic\Generators\Matrix\Runtime\TexturesOut.cs:93
    at MapMagic.Nodes.MatrixGenerators.MicroSplatOutput200.Generate (MapMagic.Products.TileData data, MapMagic.Products.StopToken stop) [0x00000] in C:\Unity Working\AF Main\AFTC\Assets\THIRD_PARTY_EXTENSIONS\MapMagic\Compatibility\Runtime\MicroSplatOutput.cs:38
    at MapMagic.Nodes.Graph.GenerateRecursive (MapMagic.Nodes.Generator gen, MapMagic.Products.TileData data, MapMagic.Expose.Override ovd, MapMagic.Products.StopToken stop) [0x001ed] in C:\Unity Working\AF Main\AFTC\Assets\THIRD_PARTY_EXTENSIONS\MapMagic\Nodes\Graph.cs:913
    at MapMagic.Nodes.Graph.Generate (MapMagic.Products.TileData data, MapMagic.Products.StopToken stop, MapMagic.Expose.Override ovd) [0x00039] in C:\Unity Working\AF Main\AFTC\Assets\THIRD_PARTY_EXTENSIONS\MapMagic\Nodes\Graph.cs:856
    at MapMagic.Terrains.TerrainTile.Generate (MapMagic.Nodes.Graph graph, MapMagic.Terrains.TerrainTile tile, MapMagic.Terrains.TerrainTile+DetailLevel det, MapMagic.Products.StopToken stop) [0x0004b] in C:\Unity Working\AF Main\AFTC\Assets\THIRD_PARTY_EXTENSIONS\MapMagic\Terrains\TerrainTile.cs:681
    at MapMagic.Terrains.TerrainTile+<>c__DisplayClass40_0.<StopEnqueueTask>b__0 () [0x00000] in C:\Unity Working\AF Main\AFTC\Assets\THIRD_PARTY_EXTENSIONS\MapMagic\Terrains\TerrainTile.cs:634
    at Den.Tools.Tasks.ThreadManager.TaskThreadAction (Den.Tools.Tasks.ThreadManager+Task task) [0x00000] in C:\Unity Working\AF Main\AFTC\Assets\THIRD_PARTY_EXTENSIONS\MapMagic\Tools\ThreadManager\ThreadManager.cs:138
    UnityEngine.Debug:LogError (object)
    Den.Tools.Tasks.ThreadManager:TaskThreadAction (Den.Tools.Tasks.ThreadManager/Task) (at Assets/THIRD_PARTY_EXTENSIONS/MapMagic/Tools/ThreadManager/ThreadManager.cs:141)
    System.Threading.ThreadHelper:ThreadStart ()

    upload_2021-4-23_18-18-45.png

    Here's another, this comes when I try to unpin a tile. I am not sure if this also has to do with microsplat, as I didn't see this show up until I used that node.
    Failed to create Object Undo, because the action is too large. Clearing undo buffer
    UnityEngine.StackTraceUtility:ExtractStackTrace ()
    MapMagic.Terrains.GUI.PinDraw: DrawSceneGUI (MapMagic.Core.MapMagicObject,MapMagic.Terrains.GUI.PinDraw/SelectionMode&) (at Assets/THIRD_PARTY_EXTENSIONS/MapMagic/Terrains/Editor/PinDraw.cs:277)
    MapMagic.Core.GUI.MapMagicInspector:OnSceneGUI () (at Assets/THIRD_PARTY_EXTENSIONS/MapMagic/Core/Editor/MapMagicInspector.cs:69)
    UnityEngine.GUIUtility: ProcessEvent (int,intptr,bool&)

    This node seems to make things incredibly slow and sluggish also.
     
    Last edited: Apr 24, 2021
  45. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,942
    Thanks, I'm really glad to hear that!
    I will add -1 to the next plugin version.

    If these are impostor (billboard) trees - they are automatically converted from single-object tree prototypes with no LODs - then they could not be rotated. It's a Unity limitation, not MM one.
    They could not be scaled as well (however their billboards are scaled for some reason).

    Seems that all of VSPro data is not removed by MM for some reason. In this cases unpinning tile and pinning it again might help.

    I've tried, but could not reproduce this. Does this happen with drafts only, or with main tiles as well? Are clicking drafts one-by-one, or selecting them with a frame? How often do you click to pin the tile?

    The thing with Whittaker node is that all of the biomes should be assigned. If some biome is not used it will just leave an empty place on it's position.

    I recommend using smaller tile size, but larger tiles count. This will make them generate faster (each tile is generated in a separate thread), will apply the generated results more smoothly, and will consume less memory. However there could be an overhead on generating tile margins: same margins added to all the tile edges no matter of tile size. So try to reduce the margins value with the tile size if possible - and try to keep it as low as possible in general unless you will have a noticeable seams.

    Drafts are the terrains with lower resolution. Try changing tile resolution in order to find out if it still works the same, but with more/less details.

    Could you please email me the graph you've shown on a screenshot, a scene with these settings, and map used in the import node (with their meta files)?

    ( A description of the issue in email will also come in handy - way more handy than mentioning post on forums. I will need only 3 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. )
     
    krooq and FlightOfOne like this.
  46. aganm

    aganm

    Joined:
    Sep 25, 2019
    Posts:
    85
    Hey! Is there any news on the MM2 polaris output integration? I'm searching for a non-destructive way of making low poly terrain.
     
  47. duminju1990

    duminju1990

    Joined:
    Jul 26, 2019
    Posts:
    30
    @Wright I've inserted all the graphs into the slot, but no luck. It all went blank now.. :(
    upload_2021-4-24_22-52-39.png
     
  48. moltke

    moltke

    Joined:
    Apr 28, 2019
    Posts:
    52
    1. Seeds are not saving after hitting play but instead are reverting to a previous seed after hitting play

    2. Downloading your update from the package manager did not apply the tree lock fix, so I have to apply your download link for this fix and apply it manually. (This might be a problem with my unity version not downloading the updated files or maybe the tree lock fix was not applied to the patch correctly?)

     
  49. mukki014

    mukki014

    Joined:
    Jul 30, 2017
    Posts:
    142
    Hi is it possible to import user heightmap in MM2 as we could in MM1. I would love to use the maps I made in world machine and then use map magic for spawning objects and infinite generation also for texturing. So is it possible to import raw or r16 file into graph? Thank you
     
  50. FlightOfOne

    FlightOfOne

    Joined:
    Aug 1, 2014
    Posts:
    451
    Until you wait for an answer form Denis, here's a little trick I use.

    First I get all of the map to show up in one tile (could be a large tile if you want, like 4096x4096, I find it easier), just play with scale and offset.

    Then I even use the terrain brushes to make changes. E.g. draw a path.

    Finally, go to terrain (component) and export the height map and Import it back into MM 2 (using import node ---> Blend node (add)). Now you retain your height map with all the changes too! This is fool proof and works every time.

    upload_2021-4-24_10-48-28.png
     
    Last edited: Apr 26, 2021
    Noctys and mukki014 like this.
unityunity