Search Unity

  1. 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. EnriquePage91

    EnriquePage91

    Joined:
    Jul 2, 2015
    Posts:
    67

    I’d like to add myself to this request too, I’m getting the same error. Although I haven’t checked the fix suggested here, it seems as if this was more of a bug than a warning intended for the user of MM.

    On the side, I’m using the Runtime Procedural Texturing add-on for MicroSplat - I cant seem to get it working properly (the biomes get the dominant color on the texture but the texture can’t be seen).

    I’m interested in getting MicroSplat with the Procedural Texturing and the Digger integration add-on to work together with MM. so far, I’ve been working on integrating MS without such modules.

    I’m using tessellation and triplanar mapping as I’m almost sure digger will require this last one - could this be the reason why I’m not getting any textures drawn? Or is the problem the procedural Texturing add-on?


    As for the shortcuts:

    I think a great option would be to use the space bar to pop up an interactive menu like the one that happens on right click, but also include a field that uses reflection to get the desired nodes. Not sure how much work that reflection search field would require however :/ might be a little too much work but it would be a blessing.

    As for the suggestion of using shift delete for the nodes, I’m sorry but I don’t agree - poster of the suggestion even says that CTRL+D = duplicate would be great cause it would be consistent with Unity’s ways - precisely for this same reason shift + delete doesn’t make much sense to me - I think it’s best if a highlight on the node is used to reflect the active status of it and allow deletion.

    In order to avoid the issue the poster describes, the highlight should disappear and maybe a different field highlight should appear if a field on the node is selected instead (to reflect that delete is not affecting the node but the field instead).
     
    Last edited: May 2, 2020
  2. daschatten

    daschatten

    Joined:
    Jul 16, 2015
    Posts:
    208
    Got some more issues with microsplat, also reported them in the microsplat discord. Using Microsplat Terrain 3.401 and HDRP 3.4 packages, Unity 2019.3.11 with HDRP 7.31.

    Original:


    Enabling UV Scale in Microsplat Shader (Disabling UV Scale reverts this):


    Enabling Height Offset in Microsplat Shader (Does not revert if disabled!):
     
  3. EnriquePage91

    EnriquePage91

    Joined:
    Jul 2, 2015
    Posts:
    67


    Oh man, that might just be the reason why I’m not getting any textures then. I’ll check and confirm, thanks!


    PS: I'm not using any of the new render pipelines, still using the legacy stuff.
     
  4. daschatten

    daschatten

    Joined:
    Jul 16, 2015
    Posts:
    208
    Seems the issue is due to no MicroSplatTerrain component is added to the terrains. In MicroSplatOutput.cs there is
    ApplyData.ApplyTmp() which adds the MicroSplatTerrain component but this method is never called. Maybe @Wright can verify this assumption.

    After adding MicroSplatTerrain manually is seems to work.
     
  5. azmundai

    azmundai

    Joined:
    Jun 21, 2010
    Posts:
    26
    Some issues im having:
    1. can't duplicate. ive tried in a couple of different scenes/graphs. seems the function is disabled/not implemented?
    2. Map Preview interface doesn't work. I can preview the map, but none of the buttons/fields/sliders accept changes.
    3. Title Font on the nodes is too big, while that is nice in some ways for zooming out on the graph, portal names get cutoff. I get that it cant accommodate super long names, but as is, is rather limiting for me.
    4. When you open the mini preview over a Unity Curve node, you can't close the mini preview (it opens the unity curve window).
    5. Unity Curves don't update unless you press regen all.

    MM2 just seems so much more un-intuitive for some reason. In MM1 I was easily able to add layers of terrain data, and mask out area, the mask in the unity curve node seems to just add the mask as terrain data or something? Ive been blending layers in photoshop for 30 years, and I just can't get my head around it in MM2 for some reason.

    What I am trying to do right now is create something like the shore node, not exactly, but similar. I was able to recreate it fairly easily in mm1, i liked having more control over it. I set a basic Noise > Curve for a sharp(ish) coastline, then pushed that curve over a little for the "ridge" and then blended a similar but less sharp curve to create walkable transition.

    I threw this together quick in MM1, Im using a very large noise which is creating the seems, MM2 seems to have fixed this, but I am unable to recreate this. The shore just gets added to the coast with a blend node then into height



    in MM2 the mask gets applied everywhere, but I am applying it the curves? because there is no mask for the blend, and the mask node melted my brain.

    I'll keep trying, but .. any advice?
     
    Last edited: May 2, 2020
  6. EnriquePage91

    EnriquePage91

    Joined:
    Jul 2, 2015
    Posts:
    67
    Yep, this did the trick!


    Thanks for coming back to post that, I have never used microsplat and honestly this would have taken me ages!

    I haven't tried using tessellation or uv scaling on this however, but I'm guessing it'll work fine now? I'll try it out as soon as my textures are actually decent looking haha.

    Thanks again!
     
  7. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,823
    That's something to think about. I'll look into it when will be writing custom node documentation. You've got to use a separate assembly in this case, but the problem is that MapMagic got to reference it. Possibly an assembly with some standard name? Can't tell that yet.

    Fixed for the next version.

    Thanks for the tip, will try to apply MS component, will see if it will fix per-channel uv issue.

    Thanks for reporting the issues. Some of them (1,2,5) are fixed for the next version.

    Can't reproduce the issue 4: do you mean pressing the arrow-up button at the bottom of the node opens the curve editor?

    Not sure about the font. Yes, it was specially made to be noticeable on a far zoom. However, feel free to share your ideas about it, and I will surely make it smaller if others will find it big too. Probably I've just get too used to it.
     
  8. halecc

    halecc

    Joined:
    Dec 17, 2016
    Posts:
    31
    Hello Denis,

    I found a discrepancy between your heightmap generated from MM2 versus the same heightmap exported then imported through ImportedMaps. This is very problematic for people who want to combine the MM2 workflow with other tools.

    The picture shows the difference between the same heightmap after it was exported then imported through ImportedMaps. The ImportedMap is at a higher elevation.

    Edit: I noticed this also happens with splatmaps, there is an offset in the splatmap if it is exported and then imported by ImportedMaps
     

    Attached Files:

    • Ex1.png
      Ex1.png
      File size:
      439.8 KB
      Views:
      68
  9. EnriquePage91

    EnriquePage91

    Joined:
    Jul 2, 2015
    Posts:
    67
    Hey Denis sorry for bothering you again,

    I'm getting a lot of culling on what seem to be "sub-chunks" of the actual MapMagic terrain chuncks, that my camera and character are currently on. I am not really sure what to do here, any suggestions? It looks as if my character was walking in the void, as the sub-chunk he is standing on is one of the ones that is getting culled.

    My MapMagic object is at Vector3.Zero and my character is currently around 1700, 800, 1800. I don't think he's too far from the origin but perhaps it's all because of that?


    EDIT: Yep, it's because of floating point precision.

    Is a fix for this coming soon or should we implement our own system to "recenter" to Vector3.Zero the player and terrain whenever a threshold is met (or constantly, or whatever)?
     
    Last edited: May 2, 2020
  10. azmundai

    azmundai

    Joined:
    Jun 21, 2010
    Posts:
    26
    Cant press the blue bar with up arrow in 2. I can press it in 1, but only if im over the thin light grey line above the X field in the offset area.

    It's like whenever there is something that isn't a "ui background" thing .. you can't click it.



    Also, I dont get this:

    The mask applied to the curve, gets applied to the whole terrain? Is that how it's supposed to work or am I using it wrong?
     
    Last edited: May 3, 2020
  11. daschatten

    daschatten

    Joined:
    Jul 16, 2015
    Posts:
    208
    I have several biomes blended with Biome Set, each biome has a transition value to smooth between the biomes. Though i want to remove biome objects below water level. Within the biome this doesn't work because of blending (ocean is a biome, too), but the transition is needed for the height. I even tried to split biome height and object and set it like this:

    upload_2020-5-3_15-19-59.png

    Doesn't work either. How can i achieve this?
     
  12. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,823
    Sorry for being so ignorant, but what is ImportedMaps? Is it an asset or standard Unity's terrain to raw exporter/importer? Could not find anything by briefly googling it or searching at the asset store.

    The thing is that MapMagic can apply the heightmap 3 different ways:
    - with the simple SetHeights() method
    - with the multiple SetHeightsDelayLOD(), called in coroutine to avoid lag spikes
    - by creating a render texture and assigning it to terrain via SyncHeightmap()
    You can choose the heightmap apply method in Outputs Settings both for draft and main tile. And all of them producing the same result.

    And I've just tried exporting terrain to RAW and importing it again using the standard Unity tool, and I can't see any change either.

    1800 is just a second terrain in a row, it is way far from the distance where floating point effect will be noticeable. Tile chunks usually disappearing when they exceed maximum terrain height level (i.e. set to 1 or more at the heightmap). Is there any way I can reproduce this issue?

    I see. They are also clicked with the middle mouse. Will try to do something about it - not in the next version (it's already submitted, pending for Unity review), but hopefully in the next one.

    At first glance I see that you are using the Mix mode for the bottom (background) layer of the blend node. I've changed the Blend node the way it's done in MM1 - the blend mode of the background layer could not be selected because it has no sense. For now I'd rather recommend you using Add instead.

    So in other words you are trying to place a biome after the heightmap is applied? The thing is that we can know the final height only when all of the biomes were calculated. MapMagic works in 3 main stages:
    - generate, when all of the nodes in all the biomes are calculated
    - finalize, when MM reads generated values for all the output nodes, and blends them using the biome masks
    - apply, when the height/texture/etc data is assigned o terrain.
    So, MapMagic doesn't know the final height until the end of the finalize stage. And after this stage no change in biome masks is allowed (the biomes already blended, right?). So I'm afraid you can't use a final height as a biome mask.

    I understand your use case (bring underwater into a separate biome), and will try to think of a workaround. Probably a special underwoter biome type or something. But for now I can't imagine of how to achieve this.
     
  13. daschatten

    daschatten

    Joined:
    Jul 16, 2015
    Posts:
    208
    Could you add a "exclude objects from biome blend area" option? Maybe with a curve so it can be adjusted?
     
  14. halecc

    halecc

    Joined:
    Dec 17, 2016
    Posts:
    31
    Denis i sent you a more detailed explanation with images to your email, mail@denispahunov.ru. Let me know if i explained it well.
     
  15. daschatten

    daschatten

    Joined:
    Jul 16, 2015
    Posts:
    208
    It seems it can be done through reflection, found this:

    * https://stackoverflow.com/questions/5411694/get-all-inherited-classes-of-an-abstract-class
    * https://stackoverflow.com/questions/857705/get-all-derived-types-of-a-type

    If this works custom node assembly defs just need to reference the MM2 package and inherit from the base classes. Would be a fine solution :)
     
  16. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,823
    New MapMagic version is available at the AssetStore: 2.0.2:
    - No .NET 4.x compatibility level required anymore
    - Vegetation Studio Pro compatibility: objects scripts fix
    - Selected generators now could be removed with Del key
    - Add menu open on pressing Space key
    - Blend node: 1st layer now background
    - Matrix Preview inactive controls fix
    - Unity Curve node update fix
    - Camera position for non-zero MM placement fix
    - Forest node fix
    - Re-used tiles are now hidden until generated
    - Duplicate generators fix - MicroSplat compatibility: fix non-full layers set
    - MicroSplat compatibility: can assign MS component to terrains to use per-channel uvs and other features

    All of the modules require an update to work with this version.

    The thing is MM2 assembly should reference the custom node assembly to load classes from it. Briefly looked through the answers on stackoverflow - the first one is loading the classes from the same assembly, the second one iterates all the assembles, which can be extremely slow depending on the project. Guess it's the way to cache it.
    As an alternative, I can use am assembly with some custom name. It will be your assembly definition file, it won't be shipped with MapMagic, it just need to have a name like "MapMagic.CustomNodes".

    Will look into it, thanks!

    You can switch Biome Blend to Pure in Object Output Properties. This will place the objects only when the biome mask value is 100%.
     
    camta005 and valarus like this.
  17. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,823
    New video will be available within an hour - this time it is devoted to the functions, exposing values and graph re-using:
     
    valarus likes this.
  18. taylank

    taylank

    Joined:
    Nov 3, 2012
    Posts:
    170
    @Wright I've been getting frequent crashes with MM2. There isn't a particular action that triggers it other than refreshing a graph with changes. My editor log shows this regarding the crash:

     
  19. EnriquePage91

    EnriquePage91

    Joined:
    Jul 2, 2015
    Posts:
    67


    Hi Dennis,

    Yes that's why originally I was kinda weirded out, but when I did reset my character's location to the origin (same as MM2 object), it all worked fine, so I figured it was it - definitely a wrong assumption anyway as I observed a few hours later the problem was still there.


    I'm using Microsplat and trying to integrate it with the Procedural Texturing add-on (and Digger too, although I haven't gotten to it yet), so perhaps this has something to do with it? Ultimately I've noticed it wasn't simply a culling issue, regenerating the terrain fixes the problem and actually generates the terrain's textures underneath my character.

    As for whether this is due to the system keeping track of on which chunk the camera currently is at or not having an issue or the terrain generation itself, I am not sure.

    To clarify, the mesh is there, the collisions are enabled - it is only the textures which are missing and therefore the terrain cannot be seen. The textures react as if they were being culled because of the camera, it almost feels as if MM2 believed my camera was actually a few meters ahead of where it actually is. My camera has a pivot container : it is an empty object without considering the camera. I only do this to have an offset from the pivot which follows my player around. Could it be that MM believes the Pivot to be the camera itself and is therefore offsetting the culling of such textures until the terrain is generated anew and the actual camera is found by MM (as opposed to the pivot)?

    I also have a few things I've noticed that are probably bugs and I will report on these ASAP, just need to take the time to organize my thoughts and make it as concise as possible. I'll be back then.

    As for now, I'm gonna go try the update to see what has been fixed on my side ! Seems like Microsplat has gotten some love on this one, so maybe a lot will be better for me too.



    Side question:

    1) Is there a way of not generating terrains until the user forces a "generate" onto it? My graphs are getting very slow, particularly the native MM curves are becoming unusable since I have over 30-40 on my graph. Although with Unity's curves all is good, and apparently they now work as expected which means I shouldn't have this issue anymore, performance in general is starting to drop while reconnecting nodes.

    I'd like to be able to recompute the "preview" of a node but only whenever it is needed, and if possible without the need to recompile the whole graph. Naturally I'd like to also have the option to recompile the whole graph only when I instruct the graph to do so. Just so that I can work without as many interruptions as the graph updating after each change can lead to (when interruptions are long).


    2) Do node previews lower performance ? Are these only calculated when the tab is open? I have a ton of them open to figure what I'm doing, but perhaps I should close them once I'm done with it to speed up graph compilation.



    Thank you in advance Denis!
     
    Last edited: May 6, 2020
  20. pacoja84

    pacoja84

    Joined:
    Dec 4, 2018
    Posts:
    3
    Hello Everyone,

    Im trying to create a mountain range using mapmagic 2, but I'm not 100% satisfaced with the result:
    upload_2020-5-6_22-18-32.png

    This is the graph which Im using:

    upload_2020-5-6_22-20-57.png

    I have mainly 2 complains:
    1. I'm using multiplier, so my mountains height are reduced.
    2. I would like to have more non mountain range areas, but if I increase the size of the spread noise, I have also more mountains in the mountains areas.

    Any tip? Maybe using splines to create mountain chains?

    Thanks in advance!
     
  21. EnriquePage91

    EnriquePage91

    Joined:
    Jul 2, 2015
    Posts:
    67
    watch the "mixing multiple biomes" tutorial on youtube, or something like that. Denis goes over how to create a tri-chunk world with 3 biomes. The concepts explained there will help you out a lot. Especially the use of the gradient to define the height of the biomes. Think of how you can apply that same concept in several ways (cones fading at the borders can become mountains or circular masks... etc).

    A personal tip: play with the scale of your noises, blur the biggest ones to make them smoother and use them as masks to make parts of your map more "mountainy" than others.

    if you use a noise at a super high scale, it is easy to mix it with smaller scaled noises to recreate the effect you desire;
    you might just not be familiar with how to do so but once you get it it will make perfect sense.

    Just make sure your super high scale nodes have a multiply blending mode and put them on top of the other ones. Also play around with curves to modify the "speed" of height transitions. Try to keep your high scale maps with high intensity, you don't want to lose your maximum height when you multiply those with the maps that will be generating the mountains.

    Essentially, think of those high scale noises as a way of distributing biomes based on "height". Certain parts of your map will "hide" the mountains while others will show them, and any mountain in between those areas will get interpolated in height. You want the high scale noise to be a blurry one with big black parts and white parts, hopefully a "smooth" one (think of very high scale perlin noise).

    Hope that helps.

    BTW: opening up the image previews on the nodes will give you a far better idea of what you're doing (think of this software as photoshop layering of a height map), just press the little downwards arrow that every node has and you will be able to see a color map reflecting the height. The lower right corner of this image has an icon that lets you turn that into a grayscale. Use the feature, it'll be helpful.
     
    Last edited: May 6, 2020
  22. taylank

    taylank

    Joined:
    Nov 3, 2012
    Posts:
    170
    @Wright Here's another one, again crash due to memory leak

     
  23. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,823
    Could you please email me the graph?

    Speaking of that import issue - I could reproduce it and nearly fixed it (however some issue remains when Import node scale is smaller than a chunk size). I guess it will be fixed for the next version.

    You can pin the terrains as drafts, and pin hi-res chunks only when it is needed.

    Preview calculation is executed in a separate thread, and this thread is not started while all of the draft and main tile threads are working. So it's executed in a "spare time" and should not affect performance.

    As EnriquePage91 said, you've got to increase the plains mask's noise size. Yes, this will increase the mountainous areas too, but you can fix it with the contrast node.

    And I'd like to recommend you making all of your 50+ tiles drafts (use Pin as Draft instead of Pin), and pin just a couple of terrains to work with. I guess generating all of this land will take ages.

    Exactly!
     
  24. taylank

    taylank

    Joined:
    Nov 3, 2012
    Posts:
    170
    I think the issue is not the graph itself, but the way MM auto-generates the tiles upon changes to the graph. Instead of updating when the user presses enter or when the control loses focus, MM generates upon every single change. This is most problematic with things like Unity Curve, where every slightest move of a control point triggers a refresh. Same thing with other input fields. When you change, say, size of something from 1000 to 2000, MM tries to generate one for 2, another one for 20, then 200, then 2000. Somewhere between all this some threads are getting choked up or not releasing their resources properly, resulting in out of memory crashes.

    I think something like Unity's DelayedAttribute might be useful here for the editor. https://docs.unity3d.com/ScriptReference/DelayedAttribute.html

    I'll try to get you a graph in any case, but I'm not sure how much it'll help.
     
  25. baddiego

    baddiego

    Joined:
    Jan 21, 2018
    Posts:
    4
    Hello everybody,

    first of all, map magic is a great tool! I like it pretty much.

    I figured an issue in MapMagic 2 when importing a texture into a graph. The middle picture is showing it. Apparently, there is an offset between tiles, which is best visible in terrain with mountains. The offset sees to be related to the "Main Margins" setting. Changing that setting did change the effect. I changed the code temporarily to test margin size 0, and it seemed to solve the problem.

    The issue seems to be related to the scaling in function ImportWithEnlarge in file MatrixInitial.cs. I finally did patch this function as shown below, by subtracting area-Margins from area.full.worldSize when calculating the width and height of the rectangle. As shown in my lower picture, this change improves the terrain a lot. The effect is however not fully gone. From some positions it is still visible, but only as a little brighter line.

    I hope this helps!

    Best regards,
    D!


    upload_2020-5-8_20-19-58.png



    Graph.png Before.png After.png
     

    Attached Files:

    EnriquePage91 likes this.
  26. pacoja84

    pacoja84

    Joined:
    Dec 4, 2018
    Posts:
    3
    Hello,

    Thanks @EnriquePage91 and @Wright. I use your tips and now looks a bit better.

    Let me attach the pictures of the results just in case someone wants to use as reference.
    I had lot of terrains for testing so the picture is taken in draft mode.
    upload_2020-5-8_23-26-19.png

    upload_2020-5-8_23-28-32.png


    Regards
     
    EnriquePage91 likes this.
  27. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,425
    Hey Dennis,
    So there are a number of optional components MicroSplat has which need to be hooked up. The component itself manages these, so one possible way is to have one on disk somewhere that you grab the data from. The other is to have references to the data and hook them up yourself. The main two being:

    - PropData : This holds all the per texture property information, like per-texture UV scales, tints, etc
    - Procedural Config : This holds information for runtime procedural texturing when it's used.

    If these are not hooked up then a lot of features just stop working. There are a number of other objects too, such various additional textures, terrain blending materials, etc.

    Anyway, if you want send me the code and I can help make sure everything is supported..
     
    Rowlan and EnriquePage91 like this.
  28. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,823
    MicroSplat Output can assign the MiscroSplat component on each of the tiles and assign PropData to it. Thanks for letting me know about Procedural Config, will do the same for it too.

    Sure, you can find MM2 code and MM2 tools at the GitLab - and as I can see you are still registered here with the developer permission. Feel free to download or pull it, change it, and make pull requests (they called merge requests here) if you'd like to.

    Thanks for the code! However you've got to modify ImportWithDownslize too, otherwise it will produce the different result when scale is < 1, and will not match the draft. The thing is downsized scale produces some weird spiked map instead when native mode is enabled, so I've got to do something with the native code first. I plan to fix it this weekend.

    I admit it might not be very convenient to generate it for 2, 20 and 200 when you enter the value from keyboard, so yep, I'll try switching to delayed field to see if it's better.

    However it should not be related with the generate on any change. MM works fine with the constant change and shows all of the changes when you set the values by dragging their label to the right or left. At least it should, and if you encountered an error then I've got to find where exactly it's getting choked to fix this. So thanks for the graph!
     
    EnriquePage91 likes this.
  29. nitoh

    nitoh

    Joined:
    Mar 20, 2014
    Posts:
    24
    Hi everyone,

    I have a question: How can i get a callback about the end of the generation?

    Thanks
     
  30. pacoja84

    pacoja84

    Joined:
    Dec 4, 2018
    Posts:
    3
    Hello,

    I have trying to test the integration with Vegetation Studio Pro, but I cannot see the VS Pro Outputs.
    I can see the CTS, Microsplat, Megasplat on Maps and in objects only Objects and Trees.

    I try adding Vegetation Studio Pro to the scene and without it.
    My unity version is 2018.4
    Mapmagic 2: version: 2.0.2
    Mapmagic Objects: 2.0.2

    I also try the demo scene that @Wright in Gitlab and when import the VS Graph it say that VS generator doesn't exists.

    Any idea?
     
  31. Refeas

    Refeas

    Joined:
    Nov 8, 2016
    Posts:
    145
    Hey @Wright,
    since Unity exports its RAW terrain heightmap vertically flipped, it would be great to have an option to mirror/flip it back to the proper rotation via MapMagic - either in Import node, or Imported Map scriptable object or the Stamp node - either would be great. :)
    The problem is: I manually create some Unity terrain (for my points of interest for example - villages, etc.), then export that via Unity to RAW format and import that to MapMagic via Import node to use it as a stamp - however, the heightmap is vertically flipped now, so my only option is to edit the generated RAW file directly.
    Having the flip option would make this workflow easier and should be easy to implement.
    I logged the suggestion to the IdeaInformer here:
    http://mm2.idea.informer.com/proj/MM2?ia=133501

    Would be much appreciated!
     
    EnriquePage91 and Lars-Steenhoff like this.
  32. EnriquePage91

    EnriquePage91

    Joined:
    Jul 2, 2015
    Posts:
    67
    I get this issue quite a lot without even importing textures into the graph - I haven't looked into this you posted as my project just stopped working out of nowhere but I definitely want to check this out as soon as I manage to open it once again so thanks for posting it!

    Since I can't really open it at the moment however....

    I do have a question, do you think there might be a similar fix for the same issue when utilizing noise nodes? I've gotten this problem quite often and the only solution I've found other than utilizing the margin feature of MM2, is not to blur my node outputs too much. Whenever I use blur at high intensities, these errors become super evident so I just had to stop doing it. I'm not trying to have you find out - but you might perhaps already know since you looked into the code that deals with this with images.

    Great fix regardless of whether it applies to noise generated maps or not!



    Nice! It's looking pretty good. MM2 might be a little confusing at first, but it honestly is quite a breeze compared to programming all of this yourself. Especially if you consider it has a node editor which makes the process of getting the kind of procedural terrain you want, a LOT easier. Keep up the good work and I'm sure you'll find interesting ways of combining the different nodes to get the kind of stuff you want to build!
     
    Last edited: May 11, 2020
  33. mmaclaurin

    mmaclaurin

    Joined:
    Dec 18, 2016
    Posts:
    244
    Hola, I am running the 2.0.2 build that just came out. Using with MicroSplat and seeing a new error that has got me blocked:

    I have 5 layers (0..4) in the texture arrays, the microsplat material, and the microsplat output node. I'm just starting to set up my texture layers, but this error is keeping my terrain from regenerating.

    The stack is not terribly useful, but here it is:

    Thread failed: System.InvalidCastException: Specified cast is not valid.
    at MapMagic.Nodes.MatrixGenerators.MicroSplatOutput200.Finalize (MapMagic.Products.TileData data, MapMagic.Products.StopToken stop) [0x000f7] in C:\Users\mmacl\Documents\Unity\caw_classic\Assets\MapMagic\Compatibility\Runtime\MicroSplatOutput.cs:53
    at MapMagic.Nodes.Graph.Finalize (MapMagic.Products.TileData data, MapMagic.Products.StopToken stop) [0x00088] in C:\Users\mmacl\Documents\Unity\caw_classic\Assets\MapMagic\Nodes\Graph.cs:805
    at MapMagic.Terrains.TerrainTile.Generate (MapMagic.Nodes.Graph graph, MapMagic.Terrains.TerrainTile tile, MapMagic.Terrains.TerrainTile+DetailLevel det, MapMagic.Products.StopToken stop) [0x0007c] in C:\Users\mmacl\Documents\Unity\caw_classic\Assets\MapMagic\Terrains\TerrainTile.cs:665
    at MapMagic.Terrains.TerrainTile+<>c__DisplayClass38_1.<StopEnqueueTask>b__0 () [0x00000] in C:\Users\mmacl\Documents\Unity\caw_classic\Assets\MapMagic\Terrains\TerrainTile.cs:617
    at Den.Tools.Tasks.ThreadManager.TaskThreadAction (Den.Tools.Tasks.ThreadManager+Task task) [0x00002] in C:\Users\mmacl\Documents\Unity\caw_classic\Assets\MapMagic\Tools\ThreadManager\ThreadManager.cs:125
    UnityEngine.Debug:LogError(Object)
    Den.Tools.Tasks.ThreadManager:TaskThreadAction(Task) (at Assets/MapMagic/Tools/ThreadManager/ThreadManager.cs:128)
    System.Threading.ThreadHelper:ThreadStart()
     
  34. taylank

    taylank

    Joined:
    Nov 3, 2012
    Posts:
    170
    There are a couple things on the MicroSplat node that need to be checked and hooked up. Do you have the Set Component box checked? Do you have the PropData object assigned? Also make sure you have a layer in MM graph for every layer defined in MS.
     
  35. Gabriel_SG

    Gabriel_SG

    Joined:
    Apr 7, 2017
    Posts:
    198
    Congrats on the v2 launch! Just found out about it and starting to dig in!

    Just a tiny issue but your links in the about tab are linking to the old/locked/defunct forum thread.
    Might want to update it.

    upload_2020-5-11_17-37-36.png
     
  36. mmaclaurin

    mmaclaurin

    Joined:
    Dec 18, 2016
    Posts:
    244
    + Version isn't updated in 2.0.2 "About MapMagic" panel
     
  37. taylank

    taylank

    Joined:
    Nov 3, 2012
    Posts:
    170
    @Wright I'm having extremely noticeable seams when using Blur. Downsample is set to 20, and Blur is set to 10.
    By the way, the wiki entry for Blur is still showing MM1 blur node.

    upload_2020-5-11_10-9-30.png
     
    EnriquePage91 likes this.
  38. taylank

    taylank

    Joined:
    Nov 3, 2012
    Posts:
    170
    Same area with default blur (downsample 10, blur 3) still noticeable seams:
    upload_2020-5-11_10-17-40.png
     
  39. EnriquePage91

    EnriquePage91

    Joined:
    Jul 2, 2015
    Posts:
    67

    Yep, I actually commented about this on my last post here I believe....

    I believe Baddiego might have found a solution - although his fix was for texture importing, the effects are so similar
    that he might have just tapped into the source of the issue - perhaps procedurally generated maps go throughout an analogous system which has the same error the texture importing had before Baddiego's fix,



    Let's hope this info by Baddiego will be good enough to point Denis in the right direction!
     
  40. Refeas

    Refeas

    Joined:
    Nov 8, 2016
    Posts:
    145
  41. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,823
    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.

    VSPro uses the asmdefs it's integration requires a special assembly setup for MM2. And since the early (pre-2019.2) assembles had no support for assembly reference, there is no assembly setup for Unity 2018. Any chance you could upgrade your project to 2019.2 or later? NP if you can't, I will try to think how to make it all work in older Unity versions.

    You can select whether your heightmap should be flipped on export from Unity - are you sure you have that toggle unchecked? The exported heightmap should be imported back to MapMagic with no additional changes (except that it will be slightly scaled, but this issue will be fixed in next version).

    Could you please paste a screenshot of your graph so I could reproduce this issue?

    Got it, thanks!

    You are downsampling the texture 20 times, so you are exceeding the tile margins limits. The thing is that each tile doesn't get the height of the neighbor one, and not related with it in any way. But for some generators, like Blur, it's mandatory to know the continuation of the tile on the border. So MM generates some virtual extra area for each tile, called margins. You are just reached the limits of this area - you can increase it by changing the Main Margins value in Tile Settings.

    Thanks for reporting those issues! If only you could add a graph and screenshots to reproduce them. I'll look into them anyways, but graph and screens will really help a lot.
     
    EnriquePage91 likes this.
  42. mmaclaurin

    mmaclaurin

    Joined:
    Dec 18, 2016
    Posts:
    244
    Hello, sorry I didn't save a repro, but simply clicking "Set Component" and adding my propData in the Microsplat output node fixed everything. Graph was super simple, just noise->curve->height + noise->microsplat

    It's all working now. MM2 is really great btw, very happy that all my time invested in MM1 applies in MM2.
     
  43. Refeas

    Refeas

    Joined:
    Nov 8, 2016
    Posts:
    145
    Oh, you are right, haven't noticed that one, thanks a lot!

    Already posted there, hope it helps that way. If you need any further help with reproduction, let me know. :)

    Furthermore, I found some other issues:
    - Unity allows you to Shift + Space on any window to maximize them, and you don't have to have that window active - just hovering over it activates the shortcut. So this way it collides with MapMagic's spacebar shortcut. Would it be possible to either detect the spacebar when it's pressed without shift or only when mouse is over MM Graph, which would also make more sense because it could create the node on the position the cursor is?
    - The Expose function is absolutely amazing, but it's not available in the Stamp node - it's grayed out.
    - The "Instant Generate" checkbox doesn't work properly - it still generates the terrain when it's unchecked - it would be great if it only generated the previews for the nodes and not apply them to the terrain.

    Hope I'm not too annoying with these. MM2 is a great improvement overall. :)
     
  44. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,823
    The new version (2.0.3) is available at the asset store. It brings:
    - Import node scale and performance fix
    - The experimental right-click menu. It based on the same principles as Shader Graph's Create menu. Some might find it more convenient, and, the more important, it works with Unity 2020 Beta. This feature is enabled in Windows -> MapMagic -> Settings -> enable Experimental Features.

    EDIT: unfortunately modules were not updated. Can't roll it back to the previous version, and it will take some time for modules to being reviewed. This Structs.cs file in MapMagic/Tools should fix the compile errors.

    Glad you could sort that out!

    Thanks for reporting these! Added to my to-do list.

    Despite MM2 was in open beta for several months, it's still got some rough edges. And I'm trying to fix it as soon as possible.
     
    Last edited: May 14, 2020
    valarus likes this.
  45. EnriquePage91

    EnriquePage91

    Joined:
    Jul 2, 2015
    Posts:
    67
    Hi @Wright !

    I wanted to give you some feedback on the way things are working for me:

    1 - It would be nice to make sure the SHIFT key is not pressed while pressing the SPACE key in order to pop up the "right click menu", this is because Unity's default command to expand a window to occupate the whole screen is SHIFT + SPACE, and this command cannot be triggered on the MapMagic Editor window because it triggers the right click menu. I remember accounting for this on my early fix, sorry for not pointing it out earlier.

    2 - I know this might not be trivial because I haven't checked how nodes work in your code, especially the "group node" (I guess it is considered a node?). Ultimately, It would be amazing if a group could include groups inside it, I love frames
    as organizational tools and being able to have at least a 2nd level of depth in groups would be amazing. Although portals are an even more useful tool for this (thanks for implementing them! so many node editors miss such a nice feature), it would be great if this was possible and didn't require much work from you (I don't want to sidetrack you from more important stuff with what might be relatively personal nitpicks).

    3 - I honestly believe the zoom range is just simply too narrow. I often zoom in and out of graphs to be able to quickly travel around it - I guess a minimap could do, and would also be a lovely added feature, but ideally being able to define on MapMagic's settings the "max Zoom" and "min Zoom" values would be amazing. I'm not sure if this might conflict with how nodes work, perhaps doing connections would be impossible but I would certainly appreciate being able to do so regardless of whether connecting things is almost impossible when you have zoomed out too much. It is obviously also a nitpick, but it certainly would make it easier to move around the editor imo.





    As for the update you released yesterday,

    I've just downloaded it and ran into the (I guess) 22 errors you were pointing out to here:

    I've replaced the Structs.cs file that comes included with the current Asset Store package with the one you've added to dropbox and although it did fix the compile errors that were due to casting from the vector2,3...etc classes on your Tools to the Unity variants, my terrain can no longer generate after this fix. It actually made it entirely flat immediately after I tried to generate it with the new Structs.cs file in place.

    To be specific, the node at fault for this seems to be the Simple Form node, as it is not generating outputs. As soon as I replace this node by a noise node, my map computes just fine.

    The first time the engine compiled after changing the Structs.cs file, a few errors popped up but unfortunately I haven't been able to reproduce them ever since, I guess I could re-import the previous Structs.cs file and repeat the process if needed. The errors were of the nature of some values being "null" when they shouldn't, if I recall correctly, but they disappeared after clearing the console.

    I'm also using MicroSplat and I noticed that I had to re-add the MicroSplat output node as it was corrupted after the update (it simply looked grayed out and was basically the closest to an "abstract" output node you could have and some casting that didn't work out - the node was named UNKNOWN). I've hooked the new output node up, but I'm still not getting any geometry displacement on the map happening so it's does not seem to be an error with the MicroSplat output node, but I figured I'd bring it up in case it is.


    Thanks in advance for all the support and the amazing product.
     
    Last edited: May 15, 2020
  46. Aress28

    Aress28

    Joined:
    Dec 12, 2015
    Posts:
    84
    Hi!Im geting Error : Generators\Objects\Runtime\ObjectsModifiers.cs(442,40): error CS1503: Argument 1: cannot convert from 'Den.Tools.Vector2D' to 'UnityEngine.Vector3' ...anyway how to fix?
    it comes after i imported new update in to my unity 2019.3 project
     
  47. EnriquePage91

    EnriquePage91

    Joined:
    Jul 2, 2015
    Posts:
    67
    This is the error I solved by following Denis'suggestions that I quoted on my previous post, the one right before yours.

    Be aware that the fix currently does NOT support "Simple Form" apparently, at least for me it doesn't work. The rest seems to be fine.
     
  48. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,823
    You can replace Structs.cs file in MapMagic/Tools to fix the compile errors. This happened because of the modules version mismatch: MM core 2.0.3 is at the asset store, and modules are pending the review.

    I've fixed the Simple Form today, it will be soon available at the AS, but thanks for notifying me!

    EDIT: these fixes are combined in a single patch. The fixed assets are currently pending Unity review, it will take some for them to be released.
     
    Last edited: May 16, 2020
    EnriquePage91 likes this.
  49. mmaclaurin

    mmaclaurin

    Joined:
    Dec 18, 2016
    Posts:
    244
    Hello @Wright are there updated instructions for vegetation studio pro with MM2? I'm new to VSPro and have not been able to get it running properly in MM2 after a few hours of trying. Was hoping that since Objects module is a dedicated package we would see more info on VSP integration, but it doesn't appear in the manual at all. Pointers?
     
  50. mmaclaurin

    mmaclaurin

    Joined:
    Dec 18, 2016
    Posts:
    244
    Haha actually figured things out by watching the old video more closely. Never mind!! Working great on MM2.
     
    EnriquePage91 likes this.
unityunity