Search Unity

[RELEASED] MapMagic 2 - infinite procedural land generator

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

  1. jukibom

    jukibom

    Joined:
    Aug 31, 2015
    Posts:
    28
    I've got a game working in Multiplayer with MM, ideally you want to provide the same seed and just allow each client to handle their own terrain generation. The code is freely available here if you want something to pick at https://github.com/jukibom/FlyDangerous

    As for floating point, not sure what you mean here. If you mean floating origin, I use that too and that's also in the code above.
     
    PutridEx, twobob and Wright like this.
  2. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,036
    MM is generated locally and does not pass any information over the network. However, generating terrains at the same position will create absolutely similar results, as long as the graphs (including seed values) are the same. This way you can make each of the clients generate terrains at all of the player positions, or, that is more performance-wise, generate all of the players' terrains on server, and let each client work with their terrains only.

    MapMagic 1 could not work with the most wide-spread solution implementation (could not find it's source, but here is the copy). So it had it's own way to solve this. MM2 can be moved during generating and even between apply frames, so it can work with this solution, and it is not built-in here now.

    Speaking of multiplayer - I think it's more the matter of not floating solution, but working of solution + multiplayer together. Guess there should be some interface between multiplayer and world positions that adds/subtracts origin offset on passing data.

    I've brought the answer to a separate document: MM2 Events. It had to be done sooner or later :)

    1.5 minutes? Wow. How big is your brush? And what are you doing with it?
     
  3. ge01f

    ge01f

    Joined:
    Nov 28, 2014
    Posts:
    92
    The brush is not very big in terms of the graph. I am just dong basically a Ridge brush modified with Erosion, and not a high level of erosion.

    With 1 terrain its very fast. With 2 its reasonable, but slow. With 26 terrains added into the Brush Terrains, it is taking 1.5 minutes just to draw the gizmo once and then I clicked the enable button off on Map Magic Brush so it would stop killing the editor.

    So thats why I think its the Terrain testing and not the brush graph. In terms of brush size its only 50-100 size on a 2000x2000 terrain, so not large. And it wasnt even crossing terrain boundaries.

    With just 2 terrain boundaries, it works reasonably well, but there is some massive performance issue going on there. If you need more details to debug, let me know. Currently, I would think with 26 sets 2000x2000 terrain you should see the problem yourself.
     
  4. harpingseal

    harpingseal

    Joined:
    Sep 3, 2020
    Posts:
    42
    Ok,Thank You,I've found a multiplayer floating precision solution,And also last time,The biome not showing up,If anyone wonder,Its because the noise somehow don't range from 0-1 the solution is use a different noise,With More Intensity.
     
  5. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,037
    Wright likes this.
  6. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,036
    Are built-in brushes slow too?
    You have 26 2K terrains in one scene, that is actually quite a lot. Maybe it's Unity doing something on change of any of them (welding or pixel error LOD calcualting). Try to exclude them from Brush's terrains list (not removing) - will the brush speed change?
     
  7. PlayerDev

    PlayerDev

    Joined:
    Mar 15, 2017
    Posts:
    9
    Hi,

    I'm using MapMagic to create a new terrain at runtime. When a player starts a new game, I generate a random terrain with a new seed at the beginning, then use that terrain for the rest of the game.

    So I want to generate that terrain only once and keep it for that game. I want to save the MapMagic terrain and load it by script.

    What would be the correct procedure for that?

    Thanks
     
  8. ge01f

    ge01f

    Joined:
    Nov 28, 2014
    Posts:
    92
    I tested it again, and have better information now. It turns out the 90 second delay is consistent, but it only happens on clicking the "Draw" button.

    After the 90 second delay, then the built in and my customized graphs both work smoothly and quickly. There is something about pressing the Draw button that causes this delay.

    I did a bunch of drawing, then and it was fine. I switched brushes, no problem. Then I turned off Draw and I turned it back on again, and it was another 90 seconds delay.

    mm2_brush_1.PNG
     
    twobob likes this.
  9. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,037
    I suppose you could covert it to Unity terrains as they are created? and like maybe store them... But.
    You dont say if this is an infinite terrain, How big it is. What 3rd party addons you might be using.

    There are just too many unknowns to start to give you a good answer.
    Go to the Discord and ask there. It will most likely be orders of magnitude faster than this messaging mechanism at providing good answers.
    https://discord.gg/GC2M2PrE
     
  10. kaelidian

    kaelidian

    Joined:
    Dec 4, 2019
    Posts:
    1
    Is there anyone here that's actually used the whittaker diagram node with any degree of success? I've gone in and made each individual biome required, all with varying terrain height and layered textures. I then made a control biome to place the whittaker node into and provided multiple types of input for temperature and precipitation, including everything from imported maps with noise to just simple gradients and noise.
    I am seeing actual changes in terrain height but it blends textures from every graph onto one and doesn't actually divide biomes in any way.
    When I scaled down I did actually notice that it was only raising height on certain masked areas and not others but otherwise I can't manage to get a multiple tiled biome management system going.

    I've searched the internet tirelessly and found things on the whittaker diagram but nothing in correlation to map magic aside from the very brief documentation which isn't entirely helpful in getting any kind of success other than realizing in small steps new things that are wrong with it.

    Anyone with any insight as to how it works would greatly be appreciated.
     
  11. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,037
    We used it. It's pretty alpha in some regards and indeed there are some particularities to its operation, you can just look at the code to see what it can and can't do. It's a relatively brief read of two parts. In principle it's a nice thing, we did use it for some time. however in the end one can emulate such a thing with any multiple input stacked biome array and that can be more flexible than the fixed extant Whittaker implementation. Not sure if Discord https://discord.gg/GC2M2PrE will have more to add but that was our initial takeaways
     
    Wright likes this.
  12. atten0007

    atten0007

    Joined:
    Jun 25, 2021
    Posts:
    27
    Hi folks,

    I'm currently making a game named "Planetsave" to tell the people that they should only do environment friendly things. I'm making the game map for this game with MapMagic2, but in my Unity (2022.1.0a12.1604) there's only flat terrain and when I'm changing some things in the Magic Graph editor, the terrain is still flat. Can someone help me please with this very S***ty issue?

    Sincerely yours,
    Atten007
     
  13. Soulice

    Soulice

    Joined:
    Aug 18, 2014
    Posts:
    60
    8000 meter by 8000 meter square space with water, think big blue plane. Can MapMagic place several large islands in that space, think modeling the Hawaiian Islands? What would be the process to do so, if possible?
     
  14. onefoxstudio

    onefoxstudio

    Joined:
    Sep 28, 2016
    Posts:
    104
    Not sure to understand how to install all modules except core ? Modules are all over the place; I don't see a way to separate them.

    As for the release, you're speaking of the Bundle with this fix ?

    As of today, no update on the Asset Store so far.

    Thanks !
     
  15. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,037
    Hi. "It is all flat" is a bit of generic state when things aren't well. so. perhaps either describe any errors that occur, or jump onto discord https://discord.gg/GC2M2PrE
    If the question is ARE ALPHA RELEASES SUPPORTED the answer is no. for obvious reasons. Denis did add a support pass for the Beta recently, anything newer than that is going to require some user intervention to get working if it doesn't "just work"
     
    Wright likes this.
  16. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,036
    So you want to save the terrain in a game save file? This will make each game save quite big to keep all of the data - not only terrain height, splat and grass maps, but the position of every object. Maybe just store seed (and graph reference)? You can generate terrain on first game load and on graph/seed change. Generating terrain with the same seed will create absolutely the same result as before. If you want to change the terrain in playmode (like chop trees) I recommend to saving changes only.

    Pressing Draw button makes initialization and preparation of all the terrains for faster work. It reads the maps and converts them to internal Matrix format to avoid reading constantly. I guess such a large quantity of large maps requires too much RAM, and cached to disk if it's not enough. I will think of the way prepare only closest terrains... but how to determine which ones are closest? By camera position?

    It's alpha. I can't guarantee compatibility with un-released Unity versions, but recently made a patch for latest Unity beta. I have not even looked into alpha, honestly.
    It might be that 2022.1 brings something that is vital to your project even on prototyping phase, but if not - I really recommend starting a new project with more or less reliable Unity, and switch it to 2022.1 as soon as it will be released. These days there are almost no things that make upgrading a project impossible left.
    And nice to see that MapMagic 2 will serve such a good purpose.

    Could you please try to:
    - remove MM;
    - install core;
    - install fix;
    - install modules?

    I decided to postpone uploading in case Unity will change the beta. In this case it would be faster to make changes that meet the latest changes. MM beta for Unity beta :)
     
  17. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,037

    Can MapMagic place several large islands in that space,
    Yes. it can do that. Denis actually posted something once that made the island demo produce multiple islands (seem to recall he inverted a mask? something) Think someone talked about it recently on Discord.
    Anyway. yes it can

    What would be the process to do so, if possible
    Well as stated. first you would make one island and then replicate altered versions of it via noise or some other means (functions, Expose, all sorts of options really). That is just one possible workflow.

    You could use actual sat data and just build from imported heights I suppose if the map is fixed in size and should be the same each time. That is just another workflow. (The data, the conversion would all have to be done BY YOU. but it's not brain surgery)

    Modelling each island individually and locking sections of them and also using larger swathes of preset or premade heightmaps is another option for a more AAA kinda vibe (or maybe even Unreal 4) workflow.

    You are limited by what each tool can actually do, obviously, but AFAIK each one of those workflows outlined above has been attempted by someone, recently, using MapMagic2.

    Rivers however may be an issue. if you just want beaches you should be fine.
     
    Soulice likes this.
  18. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,037
    not unreasonable. multiple cameras just scale linearly anyway.


    I am liking this TWICE - like this.
     
    jukibom likes this.
  19. ge01f

    ge01f

    Joined:
    Nov 28, 2014
    Posts:
    92
    I think starting with the camera position/frustrum is a good start, but having to process a new terrain as Im drawing is probably fine too, since they arent done all up-front.

    If I have 26 terrains, I will probably not draw on all 26 of them right now. If I start to scroll and draw on more, I would find it acceptable if I got more lag as it needed to cache, though it would be good to get some message (even debug log info) that it is doing that so I know why things are stalling.

    I can work with the 90 second delay to initialize, since I can separate my work in a way where I do more of it up front, but I tend to alternate work, so it would be better to have a smaller start up cost on the Brush Draw init for large terrain sets.

    Setting only 2 terrains or something each time is also a work around, but its a pain.
     
    twobob likes this.
  20. onefoxstudio

    onefoxstudio

    Joined:
    Sep 28, 2016
    Posts:
    104
    Thanks to @twobob we were able to translate what you said to human understandable words.
    Can't open graphs from the demo but that's expected behavior.

    When you said "install modules" it means "just install the Generators/Spline or Generators/Objects" folder. Actually those are not 'modules' since MM Splines, MM Objects and MM Biomes already contain the Core. So re-installing the 'fix' over it clearly messes everything up (see my post a while ago).

    I would have appreciated you take a bit more time to explain that little point; also, it would be more clear (and I guess less hard to maintain) to have Splines, Objects, Biomes just be modules and not work as standalone just like MicroSplat does; any of the MS module require you to install MS 'core' otherwise it just won't work.

    Anyway, now it works up to beta17 so I'm happy.
     
  21. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,037
    YAY!!!!! Party popper explosions, Fanfares, Et cetera ;)
     
  22. focuslabstudios

    focuslabstudios

    Joined:
    Feb 23, 2018
    Posts:
    30
    Hi I'm using Microsplat and I need to use the SetComponent feature in order to use custom features such as tinting the terrain in realtime. However when I use SetComponent I get this error:
    Terrain doesn't have splat map textures


    And if I try to switch Apply Type from Textures to Splats or Both I get a threading error:

    Code (CSharp):
    1. Thread failed: System.IndexOutOfRangeException: Index was outside the bounds of the array.
    2.   at (wrapper managed-to-managed) System.Object.ElementAddr_4(object,int,int,int)
    3.   at MapMagic.Nodes.MatrixGenerators.TexturesOutput200.BlendLayers (System.Collections.Generic.IList`1[T] matrices, System.Collections.Generic.IList`1[T] masks, MapMagic.Terrains.Area area, System.Collections.Generic.IList`1[T] channelNumbers, MapMagic.Products.StopToken stop) [0x00230] in C:\Users\timgr\Documents\Unity\git\New\FarNorthGame\Assets\MapMagic\Generators\Matrix\Runtime\TexturesOut.cs:223
    4.   at MapMagic.Nodes.MatrixGenerators.MicroSplatOutput200.Finalize (MapMagic.Products.TileData data, MapMagic.Products.StopToken stop) [0x002b1] in C:\Users\timgr\Documents\Unity\git\New\FarNorthGame\Assets\MapMagic\Compatibility\MicroSplat\MicroSplatOutput.cs:140
    5.   at MapMagic.Nodes.Graph.Finalize (MapMagic.Products.TileData data, MapMagic.Products.StopToken stop) [0x0003f] in C:\Users\timgr\Documents\Unity\git\New\FarNorthGame\Assets\MapMagic\Nodes\Graph.cs:948
    6.   at MapMagic.Terrains.TerrainTile.Generate (MapMagic.Nodes.Graph graph, MapMagic.Terrains.TerrainTile tile, MapMagic.Terrains.TerrainTile+DetailLevel det, MapMagic.Products.StopToken stop) [0x0007d] in C:\Users\timgr\Documents\Unity\git\New\FarNorthGame\Assets\MapMagic\Terrains\TerrainTile.cs:717
    7.   at MapMagic.Terrains.TerrainTile+<>c__DisplayClass48_0.<EnqueueTask>b__0 () [0x00000] in C:\Users\timgr\Documents\Unity\git\New\FarNorthGame\Assets\MapMagic\Terrains\TerrainTile.cs:624
    8.   at Den.Tools.Tasks.ThreadManager.TaskThreadAction (Den.Tools.Tasks.ThreadManager+Task task) [0x00002] in C:\Users\timgr\Documents\Unity\git\New\FarNorthGame\Assets\MapMagic\Tools\ThreadManager\ThreadManager.cs:138
    9. UnityEngine.Debug:LogError (object)
    10. Den.Tools.Tasks.ThreadManager:TaskThreadAction (Den.Tools.Tasks.ThreadManager/Task) (at Assets/MapMagic/Tools/ThreadManager/ThreadManager.cs:141)
    11. System.Threading.ThreadHelper:ThreadStart ()
    12.  
    What can I do to make the errors go away so I can use the feature properly?
    I'm using latest MM2 and HDRP 2020.3.2f1
     
  23. LuciferDreams

    LuciferDreams

    Joined:
    Oct 8, 2019
    Posts:
    3
    Hey I started using map magic 2 after some testing with the nodes I realized that tha margin of each terrain is not blending with their neighbors leaving a unnatural line on each tile.
    I tried increasing the main margin value from 2 to 256 but the problem still there also tries changind the resolution ofthe main terrain from 128 to 1024 and the same problem appears.
    Im using a raw texture for the terrain, i though that maybe the texture was the problem but no matter the scale on te impoted map the errors ar only on the edge of each tile. also tested on a simple graph without any node but I can find the solution. T1.png
    T2.png What should I do?
    Im using unity 2019.4 LTS
     
  24. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,036
    I'm afraid it can result in an unexpected freeze each time you start painting on the next terrain. It will be hard to determine where this freeze comes from, and will have an impression that the Brush is unstable and can freeze any time you work.

    Maybe the solution would be manually selecting terrains to paint in Terrains list, but I doubt it would be convenient.

    Pity it is mostly terrain reads, and could not be done in another thread at the background.

    Sorry for being unclear. I have submitted beta-compatible version to asset store today to avoid version incompatibility with modules.

    You've got to output splats together with MicroSplat. To do this use Textures output parallel to the MicroSplat one, with the same layers and connections. This will increase the generate time, but will allow to edit terrain manually.

    In upcoming version it's possible to output splats automatically, by switching output mode to Both in MS output advanced tab.

    As far as I remember Unity 2019 did not support proper terrain welding - even if the heighmaps were welded, it still created some difference due to terrain LODs (pixel error) and normals. However it might be related with the graph - terrains are textured, but I can see no texture output. Can you please open Tutorial demo scene and pin a new tile here?
     
  25. LuciferDreams

    LuciferDreams

    Joined:
    Oct 8, 2019
    Posts:
    3

    Hey, thanks for replying.
    So what version of unity will work better with map magic to avoid the unnatural margins.
    yeah the terrain is textured because i had some extra nodes before i delet them to test an empty graph.
    Ive tryed the tutorial scene the thing is that whenever i use an imported map the margnins appear but only there if i use a noise as a starting point there are not visible margins.
     
  26. focuslabstudios

    focuslabstudios

    Joined:
    Feb 23, 2018
    Posts:
    30
    That's great, I tried outputting splats using the texture node but that in combination to MS breaks the generation. When are you releasing the new version? :)
    Thanks
     
    twobob likes this.
  27. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,037
    2020 LTS is okay AFAIK.
     
  28. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,037
    Actually, it can work, but it's pretty hit and miss right now. We are also waiting on Denis's promised update to fix the biome implementation - and we have just abandoned till then as "unworkable" in our workflow
     
    Last edited: Oct 26, 2021
  29. LuciferDreams

    LuciferDreams

    Joined:
    Oct 8, 2019
    Posts:
    3
    Hey.
    I had problems with the tool seeing weird margins on each tile, I was using unity 2019.3 LTS. so Ive tried the 2020.3 LTS version but the problem still there. Ive tried with the raw texture and the image texture on the imported map but got the same results some weird margins. they are not a big deal but when there are some mountains the margins are to obious they loock like sharp cliffs.
    The problem appears on empty graphs when there are'nt litterally any nodes just imported map into height output. Ive tested many different combinations on the main margins, on the main resolution, on the pixel perfect, the tile size, the terrain height. but no solution comes up.
    Has anybody faced the same problem?
     
    twobob likes this.
  30. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,037
    Perhaps it's an issue with the imported data? Hard to tell. The Discord is a better place to get more immediate answers.
    https://discord.gg/GC2M2PrE
     
  31. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,036
    MM 2.1.8 is available at the Asset Store. It brings:
    Unity 2021.2 beta compatibility
    New feature: Safe Borders object generator
    Bug fixes:
    - Direct Texture/Matrix outputs now return textures/matrices without margins
    - Loading Brush graphs in Finnish locale
    - Whittaker node can now be used in biome
    - Some Whittaker performance improvements
    - Fixed Splats/Both for MicroSplat output

    Currently I'm working on 2.2.0, that will have Cluster biome node and will support layered biomes. Unfortunately no ETA on this yet.

    I've tried RAW import in 2019, but it seems to be that tiles are welding correctly here. Could you please email me your scene, your graph, imported map and their meta files?

    Speaking of Unity version, I'm currently using 2021.1. I can live without new terrain brushes and new scene view toolbar in 2021.2 - but the new logo is quite good (I am the only one who see 3 arrows gizmo in it?)

    It was pending Unity review meanwhile :)

    Yes, I've noticed this problem from time to time in 2019. But never seen this in 2021 - here Unity introduced terrain LOD stitching algorithm. Maybe it's LOD, or maybe Unity improved something else - but everything seems to be working fine here.
     
    twobob likes this.
  32. ge01f

    ge01f

    Joined:
    Nov 28, 2014
    Posts:
    92
    Sounds tricky. I think I can manage with just selecting the terrains manually myself, or putting up with the initial delay on turning on Draw with all the terrains.

    I think maybe you just need a message that Unity will display as to what is happening, so that people dont think its broken.
     
  33. MagiSoftworks

    MagiSoftworks

    Joined:
    Feb 12, 2019
    Posts:
    122
    HiYa! I get a discord Invite is expired, Do I need invite from Denis ?
     
  34. focuslabstudios

    focuslabstudios

    Joined:
    Feb 23, 2018
    Posts:
    30
    I have a bug when using the latest Microsplat in MM2 with SetComponent on and ApplyType = Both.

    Basically I have to set the terrain BaseMapDistance to 0 or the terrain disappears when the camera get's closer. Is there some kind of fix for this in the works or do we always need to render the terrain at full resolution?

    This is also a huge issue because Microsplat adjusts the BaseMapDistance during generation in the editor when using Tesselation.
     
    Last edited: Oct 29, 2021
  35. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,037
    https://discord.gg/vAdvUSTf

    And in fact that goes for everyone today who posted on here.
     
  36. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,037
    I would love to know what you think would be an acceptable message for that
     
    MagiSoftworks likes this.
  37. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,037
    Did you ever do this Denis.
    It seems to not work at all still. Only the initial tile is generated still on WebGL

    http://mm2.idea.informer.com/proj/MM2?ia=136844
    I'll try messing around with code stripping and whatnot

    WebGL does not support threading, maybe it's as simple as disabling that. NOPE

    Only PINNED tiles are generated. the infinite stuff does not trigger,
    upload_2021-10-29_23-56-4.png
     
    Last edited: Oct 29, 2021
  38. rillani

    rillani

    Joined:
    Dec 16, 2020
    Posts:
    6
  39. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,036
    Anyways unexpected several seconds freeze would not be pleasant - even if it will be described and justified. Maybe it would be better to mark unavailable terrains somehow - to let the user manually add them to edit list? What about disabling them - do not treat disabled terrains as active? (don't remember exactly whether it's already works this way).

    I don't know why Discord creates temporary links by default. Here is the constant one: https://discord.gg/yCJEgSw

    Are you sure that the main tile shader is working? Setting base map distance to 0 fills all the terrains in a simplified material - and no main shaders are displaying. If the terrain is not visible until base map distance then it's most possible not related with base map.

    Native code and multithreading are not supported in WebGL. Beside that, WebGL has very strict limitations on the amount of memory used. To make it work:
    - Disable C++ Native Code in Window-MapMagic-Settings;
    - Disable multithreading in MapMagic object - Multithreading - Use Multithreading;
    - Disable draft terrains in Tile Settings - Use Draft Terrains - Playmode. Actually, drafts don't have much sense when multithreading is disabled;
    - Start with very low resolution, and raise it with testing whether it works. Also keep the nodes count as low as possible.
     
  40. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,037
    I did everything except disable draft. which I will right now. The nodes count is near zero already upload_2021-10-30_9-45-1.png

    129 Fails with an error.

    EDIT: I got it working with a resolution of 257 and an insanely small build. thanks for your time.

    Whilst 513 can work . it is incredibly slow. And will time out at start up. Confirmed as working with limitations.

    Sizes beyond this won't work at all.
     

    Attached Files:

    Last edited: Oct 30, 2021
    Wright likes this.
  41. focuslabstudios

    focuslabstudios

    Joined:
    Feb 23, 2018
    Posts:
    30
    Hi I encountered another issue using the VS Pro Object component. The "regard prefab scale" option doesn't actually take into account the prefab scale, instead it just defaults to (1,1,1)
     
  42. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,037
    is this just on trees? I noticed it on trees. That seems to depend on the prefab somehow
     
  43. focuslabstudios

    focuslabstudios

    Joined:
    Feb 23, 2018
    Posts:
    30
    for me this happens on Objects too (VS Pro Objects category to be more precise). I haven't tried it for any other VSPro categories but suspect it's the same for all of them. I'm using Indirect Instanced rendering btw
     
  44. focuslabstudios

    focuslabstudios

    Joined:
    Feb 23, 2018
    Posts:
    30
    ran into another issue as well using Microsplat with SetComponent enabled and ApplyType: Both.

    Getting this issue on Builds, but not in editor:

    Code (csharp):
    1. Exception: Routine error: System.NullReferenceException: Object reference not set to an instance of an object
    2.   at JBooth.MicroSplat.MicroSplatTerrain.Sync () [0x000b8] in <8a327c6f4255407992560aa80f0f204b>:0
    3.   at MapMagic.Nodes.MatrixGenerators.MicroSplatOutput200+ApplySplatsData.Apply (UnityEngine.Terrain terrain) [0x00063] in <0f52ad6496c14ba4a2d9b13e2d27d103>:0
    4.   at MapMagic.Terrains.TerrainTile.ApplyNow (MapMagic.Terrains.TerrainTile+DetailLevel det, MapMagic.Products.StopToken stop) [0x00022] in <da9678c033c4444f83b9713aad01e100>:0
    5.   at MapMagic.Terrains.TerrainTile+<>c__DisplayClass51_0.<Generate>b__0 () [0x00000] in <da9678c033c4444f83b9713aad01e100>:0
    6.   at Den.Tools.Tasks.CoroutineManager.Update () [0x000e2] in <37cdb61172794158a1b47e54ee266ce4>:0
    7.   at Den.Tools.Tasks.CoroutineManager.Update () [0x00103] in <37cdb61172794158a1b47e54ee266ce4>:0
    8.   at MapMagic.Core.MapMagicObject.Update () [0x0002a] in <da9678c033c4444f83b9713aad01e100>:0
     
  45. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,036
    If you mean standard trees - In most cases Unity treats them as billboard/impostor trees (unless they have no LOD in prefab). This kind of objects has some limitations: they could not be rotated and scaled (scale is applied to billboards only, not objects themselves). This is Unity limitation, not MM one. You can use Objects output to place your trees as standard objects, but in this case do not expect Unity tree optimizations (batching and billboarding) and thus performance will be reduced.

    I will appreciate if you could report this on ideainformer to keep track on this issue. The MS error seems to come from MicroSplat code, but probably it's MM that does not supply it with something. Would be great if you could report it here as well.
     
  46. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,037
    some trees do resize. I've got it working for several people along the way. Never really noticed a pattern since I don't personally ever notice a problem
     
  47. airop

    airop

    Joined:
    Sep 4, 2012
    Posts:
    25
    any idea on how i can flatten a area using the brush plugin?
     
    twobob likes this.
  48. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,037
    you could write a graph that has a single fixed height value in it. then use that as the brush "input" graph. That would seem to "write to fixed height" if that is what you mean. don't use brush often think that would work.
     
  49. PolyMad

    PolyMad

    Joined:
    Mar 19, 2009
    Posts:
    2,282
    I am having a problem when building:

    upload_2021-11-4_11-18-19.png

    The same DLL seems to be in two folders in MapMagic: TOOLS/PLUGINS and TOOLS/PLUGINS/x86.
    I would like to know which one to delete.
     
  50. airop

    airop

    Joined:
    Sep 4, 2012
    Posts:
    25
    i have no idea on how to do this. do i need to create a brush graph?
     
    twobob likes this.
unityunity