Search Unity

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

Map Magic World Generator - a node based procedural and infinite game map tool

Discussion in 'Assets and Asset Store' started by Wright, Mar 10, 2016.

  1. dashasalo

    dashasalo

    Joined:
    Oct 7, 2016
    Posts:
    11
    Hi!

    I ran into a bit of a problem with biomes and can't seem to figure it out. I have two simple biomes - mountains and valleys. Valleys have lakes so I use Shore generator' Sand output to assign a texture for the beach. Everything works great until I combine the biomes, at which point the beach texture is applied where the lakes used to be and so appears on and around the mountains. Screenshots below... The question is what can I do? I don't particularly want sand on my mountains. ;)

    This screenshot shows the landscape without mountains merged and you can see multiple lakes on the left hand side:
    mm_0.PNG
    Here we see the terrain preview of the shore generator sand output mapping nicely to the lakes in the shot above:
    mm_2.PNG

    BUT, as can be seen above, the lakes now sit on the side of the mountain just without water:
    mm_1.PNG
     
    Last edited: Jan 17, 2017
  2. Twoonebe

    Twoonebe

    Joined:
    Mar 30, 2013
    Posts:
    174
    Hello,
    yes, when I last tested Infitiy Grass is well 1 year ago was the same and the developer knew. It was just a recommendation from me as I would make it no one is forced to make it so. Another is the one you describe with the streamer of MM
     
  3. tanoshimi

    tanoshimi

    Joined:
    May 21, 2013
    Posts:
    297
    @dashasalo - how are you "combining the biomes"? If you have a smooth gradient blending between them then you'd expect some of the features from one biome (i.e. the lakes from your valley) to blend into your other biome. If you want a "hard" edge between biomes then you need to create a binary cutoff point.
     
  4. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,267
    dashasalo, this happens when lakes biome opacity is 90% or so - it is lifted enough to be left without water, but still has too much opacity to make lake bottom sand visible. I'd like to recommend you modify lakes biome itself by lifting areas where mountains will be used. You can use curve generator with the same mask used for mountains biome. Note that curve should be inserted before shore generator.

    Reaven99, you can use any shader that does not require additional component both with pinned and dynamic terrains. I.e. if you've got only shader and material assets, and no script should be assigned to terrain then it should work with MM. If component is required you can use it for pinned terrains, but there is a chance that it will not work with dynamic ones (although built-in copy component feature can help in some cases).
    You can try free evaluation version to check if MMWG compatible with the shaders you are going to use.
     
  5. maxaud

    maxaud

    Joined:
    Feb 12, 2016
    Posts:
    177
    LOVE MapMagic so far. Curious if there are limitations to the number of materials used on a terrain. Also, can full PBS materials be used in some way (looking for tessellation)?
     
    Last edited: Jan 20, 2017
  6. hoodoo

    hoodoo

    Joined:
    Oct 19, 2012
    Posts:
    154
    @Wright, I have a question about how to best create heightmap files to act as raw input for MapMagic. I'm not very good at drawing the heightmap in Photoshop. Do you have any tips on how to do this, or are there any other tools that would help?

    I want to build an island with several geographical features, mountainous, cliffs in other areas, sand dunes in another area etc. Then I will have several smaller islands surrounding, some flat and some with mountains and one with a volcano. Having good beach areas in some spots is also important. I've done your longest tutorial video and also a few others so I'm more or less familiar with how to set up things in MM.

    What do you think about a 4k X 4K terrain for all this? Too big or would it be okay?

    Any advice would be much appreciated!
     
  7. Jesus

    Jesus

    Joined:
    Jul 12, 2010
    Posts:
    501
    Probably, if you're going to use MM's shore, erosion and finer noise/detail, your best bet would be to simply create a heightmap that broadly conveys the general shape. There's no point spending days creating the perfect heightmap if you're then going to modify it so drastically within MM.
     
  8. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    Standard unity terrain shaders compute 4 textures in a pass, so if you have 5, you have to make two full passes to render the visible terrain, or three for 9, etc. Some shaders are better at this, RTP can do 8 in one pass, but you lose a little quality, etc. I'm not sure about tessellation, but should be totally possible.
     
  9. hoodoo

    hoodoo

    Joined:
    Oct 19, 2012
    Posts:
    154
    Thanks @Jesus. What's the best way to create a basic heightmap? The ones I'm creating in Photoshop are just not turning out great. I'm using a soft brush to paint the heightmap, but maybe there are other techniques to use? I'm also looking to see if using a specialized program might help (such as L3DT standard edition). Basically, I haven't created many heightmaps and looking for general advice.
     
  10. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    I'm running into this problem again... Does not everyone experience this?
    Apparently the wind and terrain grass tint settings are what cause this. If you set the terrain grass tint (not the healthy/dry tints) to 50% grey then all of the grass stays the same color always (but then it's super dark). If you set it to white the grass fades between 50% and 100% white in a noise based wave pattern. If you turn grass wind speed down to zero it doesn't move, but it still stamps the out colors once creating problems across multiple terrains.

    Surely I'm not the only one with this problem?... going to try implement UNature right now..
     
    ElroyUnity likes this.
  11. tanoshimi

    tanoshimi

    Joined:
    May 21, 2013
    Posts:
    297
    I remember having this problem too (I now use custom grass shaders so it's not an issue). There's a relatively easy fix though - just create your own shader that overwrites Hidden/TerrainEngine/Details/BillboardWavingDoublePass. If you want to base it on exactly the same grass shader as the default but just without the wave lighting, look in terrainengine.cginc - there's a section that looks like this that you can just comment out the lighting calculation (or replace it with a constant:
    Code (CSharp):
    1.  
    2.      float4 s, c;
    3.      waves = frac (waves);
    4.      FastSinCos (waves, s,c);
    5.      s = s * s;
    6.      s = s * s;
    7.      float lighting = dot (s, normalize (float4 (1,1,.4,.2))) * .7;
     
    malkere likes this.
  12. tanoshimi

    tanoshimi

    Joined:
    May 21, 2013
    Posts:
    297
    Hi @Wright and my fellow Map Magicians - I wonder if I any of you could kindly suggest any solutions to a problem I'm facing regarding object persistence:

    I have collectable items randomly positioned all over my terrain, which have been placed using the Scatter generator. The player can walk over an item, it gets collected and put in their inventory, and the original item on the terrain gets destroyed. Works great. Now, the problem comes when the player walks away to a different part of the world and then returns to the area, causing the terrain chunk to be destroyed and then recreated again. In doing so, all the items on this chunk get created again, including any that have already been "collected" by the player... I want only the items that have not yet been collected to be generated.

    I've thought of a couple of possible different approaches as to how to tackle this:
    - Setting the "Remove Range" so high that chunks never get destroyed once generated, so the objects (and everything else about the terrain chunk) persist forever.
    - Maintaining some sort of hashtable of collected items and then checking against this in an OnApplyCompleted callback to remove any collected items every time a chunk is created.
    - Adding some sort of per-object [DontDestroyOnLoad]-functionality and a unique object ID that ensures only one of each type of item is ever generated.

    However, none of these seem perfect so I'm hoping that maybe someone else has faced a similar problem, or could at least make a guess as to how I might solve this! Any suggestions gratefully received :)
     
  13. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,267
    hoodoo, the point of MapMagic is that you do not need a fine detailed heightmap. Here is the one I use for an island tutorial:
    Island4.jpg
    I've used really low-res base map (256*256 for the 100 square km area), it does not have erosion or something, just some soft brush splats. It's more a game design location plan than a real artwork.

    Here is what it looks like being just applied to terrain and being processed with MapMagic (about 1/4 of an area is visible):
    Island4_ingame.jpg Island4_final.jpg
    You do not have to be a great artist to create heightmaps - MMWG will handle all of the details you need: noises, erosion, grass, trees, objects scatter, etc.

    malkere, I guess this happens because of a grass tint noise, it does not welds between terrains. Unity uses some non-obvious algorithms to tint grass, I don't clearly understand them. Maybe it's worth trying to set grass layer Noise (Noise Spread in Unity terrain) value to 0 before creating new shader? This will make the grass uniform though, but in some cases it could be ok.

    This is what I was going to suggest when started to read your post. Just a small remark - it's better to disable the object rather then remove it - this way MM's object pool will work a bit faster. And the same way could be made adding the objects that player drop from inventory. I don't really see drawbacks of this approach - I think it's a good idea to serialize only the changes made to the world.
     
    docsavage, DesertRaven and malkere like this.
  14. marnoch

    marnoch

    Joined:
    Nov 18, 2009
    Posts:
    5
    I've got a map I'm pretty happy with but the trees won't move with the wind( any at all). Is there something special I might be missing? The grass works just fine.
     
  15. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    grass moves with an embedded wind of it's own. If you want trees to bend you need to add a wind zone.
     
  16. marnoch

    marnoch

    Joined:
    Nov 18, 2009
    Posts:
    5
    The thing is, I tried adding one several times with no effect. Both directional and sphere. Maybe I missed something...
     
  17. Hormic

    Hormic

    Joined:
    Aug 12, 2014
    Posts:
    251
    How can i save a normal MapMagic-Landscape as a biome? When i export something it is xxx.nodes format and not usable as biome.
     
    Last edited: Jan 24, 2017
  18. Slugma420

    Slugma420

    Joined:
    Jan 24, 2017
    Posts:
    3
    Heya!
    So I have made this terrain (wip) and now I want to carve a really deep "hole" into it.



    If I increase the Terrain Height in General Settings, every feature will get higher/stretched in Y-scale (I want all the small hills and cliffs to remain in the same height). Anyone knows how I can further lower this part/hole of the terrain while still preserving the details? Thanks for any help.
     
  19. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    what kind of trees are you using? Unity trees? Speed trees? Or just gameobjects? If they're just gameobjects they won't know how to work with the wind on their own. If they are speed trees or unity trees they will have wind settings you should look at to make sure they are on.

    Is the top of your terrain going to the maximum height already? If so they only way to get a hole deeper would be to increase the height. You would want to then control the finished height with one more curve generator before it gets to the actual height output. If you double your height, make the curve start at the left middle, and go straight to the top right, not curved, but straight. That will move everything up 100% while keeping the shape the same. Then you could add a point to that curve to make the very first 0.05 of it go all the way to the bottom left, so only your hole would go all the way to zero. Or add a mask to the curve using the hole, etc.
     
  20. tequyla

    tequyla

    Joined:
    Jul 22, 2012
    Posts:
    335
    Hi Sir,

    is possible to use PolyBrush for editing map from MapMagic ?

    +++
     
  21. Hormic

    Hormic

    Joined:
    Aug 12, 2014
    Posts:
    251
    It would be nice, but here is a quote from the Storepage which says:
    So unfortunatly not, cause MapMagic is generating Unity Terrain.
    You can convert the Terrain with some Tools like this -> http://wiki.unity3d.com/index.php?title=TerrainObjExporter
    to a mesh and then you can use PolyBrush on it.
     
  22. Slugma420

    Slugma420

    Joined:
    Jan 24, 2017
    Posts:
    3
    Thanks a lot man! This input really fixed it for me! :)
     
    malkere likes this.
  23. tequyla

    tequyla

    Joined:
    Jul 22, 2012
    Posts:
    335
    do u think it is possible to update mapmagic with 2 options:

    1 -mesh rendering

    or

    2 - terrain rendering

    ??

    +++
     
  24. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,267
    I'm integrating MapMagic with Voxeland now. Voxeland uses meshes instead of standard terrains and has it's own sculpting algorithms.
     
    MarkusGod and tequyla like this.
  25. slimshader

    slimshader

    Joined:
    Jun 11, 2013
    Posts:
    187
    docsavage likes this.
  26. tequyla

    tequyla

    Joined:
    Jul 22, 2012
    Posts:
    335
    Hi Sir,

    and painting ?

    ++++
     
  27. DesertRaven

    DesertRaven

    Joined:
    Jul 15, 2012
    Posts:
    137
    Hi, I watched several tutorials and am going to buy MM. This is one of the best assets here in Unity. (Btw, this is how the terrain editor was meant to be so I really appreciate you making this possible.)
    I was just wondering if you could somehow make a magic script for overhangs? Is that even possible?
    I have a rendering software for digital nature called VUE, and they use height-maps on their terrains and have overhangs, so I hope it can be done.
     
  28. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    @DesertRaven It cannot be done with unity terrains. Only wish mesh. See comments above about voxelland, or add overhang meshes on top of your unity terrains. Terrains are two-dimension planes that just get raised and lowered, they cant be pushed into 3d
     
  29. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,267
    Well, since Voxeland is a voxel engine it uses a slightly different approach. There is no "paint" on terrain - no color map or something - each voxel contains it's own type with material properties. Imagine smoothed Minecraft - that would be Voxeland.

    DesertRaven, I don't know for sure how overhangs are made in VUE - but I guess it's not a heightmap, but vector displacement map. It is 3-channel map which contains not only the height of the vertex, but it's offset in X and Z axis. Unfortunately Unity terrains does not have this feature.
     
  30. tequyla

    tequyla

    Joined:
    Jul 22, 2012
    Posts:
    335
    Ok i understood.

    I have map magic in my pocket but not Voxeland. A bridge will be possible with merged version of MM+Voxeland product ?

    ++
     
  31. silentneedle

    silentneedle

    Joined:
    Mar 14, 2013
    Posts:
    280
    Small bug report: The Map Magic editor window background is black when working in deferred/linear mode (player settings)
     
  32. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    So I've got my 1024m^2 terrains compressing and saving themselves off the main thread, only using 13ms right now, but I can get that down a lot still... The files are still way too big though, around 1mb at 512 resolution.

    It seems the details are taking up around 60% of that...
    I wonder... @Wright , Is there a way to selectively regenerate parts of a terrain in runtime? ie: to skip the object output when asked to. That way I could store only the object and tree changes and let MapMagic regenerate the details/height/splat without saving them.

    Alternatively I could save only the changes and reapply those every load, that just seems counter-intuitive... though it would certainly use far less processing/storage....
     
  33. Montreseur

    Montreseur

    Joined:
    Jan 24, 2014
    Posts:
    49
    @Wright I looked in the documentation but did not see anything about this. Does Map Magic support 8 layers using RTP?

    My current project is using RTP with 8 layers, and it would be great if I could convert out existing terrains to use Map Magic. Do I just need to bring in two RTP nodes and supply texture masks to the used layers?
     
  34. Black-Spirit

    Black-Spirit

    Joined:
    Sep 14, 2013
    Posts:
    67
    Hi Denis.

    Ive owned MM for a while now, though just recently started using it again. Curious to what is causing these "spikes".
    Increasing the terrain detail results in the spikes becoming worse, and creates even more.

    Is there a global smooth option or the like?

    points.png
     
  35. WickedRabbitGames

    WickedRabbitGames

    Joined:
    Oct 11, 2015
    Posts:
    79
    I've discovered a problem that I can't seem to solve. I am creating a lunar surface and am using your crater solution. I'm blending the basic terrain noise/curve with the output of the crater generator. The problem is that the craters only appear on Terrain 0,0. The surrounding terrains do not have craters.
     
    Last edited: Jan 29, 2017
  36. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,267
    I'm working on it now.

    silentneedle, thanks, fixed this for the next version.

    malkere, I'm thinking of advanced lock feature, that will give the ability to re-generate only some certain output generators (splats and grass, for instance), leaving others (like objects) intact. But I still think that serializing only the changes is the best solution.

    Montreseur, You need to switch RTP to 8-layer manually using _RTP_LODmanager: RTP features first pass -> 8 LAYERS in first pass.

    Black-Spirit, can I see your graph?
    CodexofRome, and your graph too, the image you've attached is not loading.
     
    Last edited: Jan 28, 2017
    malkere likes this.
  37. Black-Spirit

    Black-Spirit

    Joined:
    Sep 14, 2013
    Posts:
    67
    Denis,

    The above screenshot is from your Island scene. No changes to the graph.
     
  38. auhfel

    auhfel

    Joined:
    Jul 5, 2015
    Posts:
    92
    Quick question - How is the infinite part done, are the chunks disabled when you move out of range or are they destroyed? I'm asking because I want to use it on mobile -- I rolled my own 3d endless terrain generator using layered noise, but I found on mobile that I never had enough ram so keeping any LOD's or disabled terrains resulted in a fairly quick crash due to memory limits.

    My solution was just to not use LOD's and destroy any terrain chunks that were out of range, and regenerate them if I come back -- I'm just wondering how MapMagic handles this, and if there's an option to destroy chunks/regenerate them as you move along.
     
  39. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    MapMagic actually resuses the terrains as they fall out of range. When you move far enough for one edge to fall out of range is will be disabled, when you get in range of the edge opposite of it (which is always equal or more distance than the disable range) those terrains will be cleared, repositioned, regenerated, and enabled. My game goes thousands of terrains, simply disabling them would break any computer.

    Some people prefer that though for static worlds and use WorldStreamer etc, to save/load enable/disable the limited world around them.
     
  40. auhfel

    auhfel

    Joined:
    Jul 5, 2015
    Posts:
    92
    Thanks, I appreciate it! I'll likely buy this asset when I get my new card in from the mail. I've gotten the map magic demo to run ~40-50 fps on my low-end smartphone, I'm pretty sure it'll handle the infinite loading too from your information.
     
  41. Hormic

    Hormic

    Joined:
    Aug 12, 2014
    Posts:
    251
    I have tried to assign a windzone to the trees coming with map magic on the tutorial map, but i was not able to force the trees shacking in the wind.
    Is it possible?
    Thanks for suggestions.
     
  42. Black-Spirit

    Black-Spirit

    Joined:
    Sep 14, 2013
    Posts:
    67
    Hi Denis,

    Also is there any updated documentation on RTP support? I followed the steps with the package, though I lose all textures, and the terrain turns a dull grey colour. (Have also set snow to 0)
     
    Last edited: Jan 30, 2017
  43. RakNet

    RakNet

    Joined:
    Oct 9, 2013
    Posts:
    313
  44. tanoshimi

    tanoshimi

    Joined:
    May 21, 2013
    Posts:
    297
    Yes, it is compatible with RTP. Unfortunately, Mapmagic's documentation is somewhat lagging behind the rate of its feature development...
     
    RakNet likes this.
  45. CollosalChris

    CollosalChris

    Joined:
    Mar 17, 2014
    Posts:
    13
    Hey, I'm trying to decide if I should buy Map Magic - is it possible to use it to create procedural levels at runtime?
     
  46. tanoshimi

    tanoshimi

    Joined:
    May 21, 2013
    Posts:
    297
    Yes, that's pretty much exactly what it does... ;)
     
  47. Wavinator

    Wavinator

    Joined:
    Dec 24, 2013
    Posts:
    79
    Black-Spirit any chance your terrain resolution is very low? I used to get the same thing with low resolution terrains because the transitions in the terrain noise don't map to the available terrain vertices very well.
     
  48. Montreseur

    Montreseur

    Joined:
    Jan 24, 2014
    Posts:
    49
    @Wright

    I am still having some issues integrating RTP into MM. I will try to give a clear description of my process so you can tell me what might be going wrong.

    Before Map Magic- I would create a new terrain, assign 8 textures to the Unity default terrain. Then bring in the RTP component, set up my shader configuration in the RTPLod manager, and then continue my work in RTP by importing masks exported from World Machine.

    When trying to use Map Magic, I start with the MM workflow.

    I am bringing in the Map Magic Component and creating/editing a HM. I create a texture object and assign 8 textures to the terrain. From here I am bringing in the RTP component to my scene, setting up the LOD manager (8 layers in first pass).

    What is happening is that sometimes the shader is not displaying on the terrain, but what looks like mipped textures on the terrain instead. After RTP pops back in, it is missing 3 textures, I do not know why it is deleting the last 3 layers.
     
  49. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,267
    auhfel, terrain chunks are removed when they exceed some specific Remove Range from camera (or cameras).

    RakNet, thanks for reporting a dead link! RTPPlugin could be found here: www.denispahunov.ru/MapMagic/RTPPlugin.zip

    CollosalChris, MapMagic can create procedural terrain in runtime, that is the main MM purpose.

    Black-Spirit, you can increase heightmap size without changing MM resolution by increasing Height output "Scale" factor to 2. This will smooth out all of the crisp polygons and peaks.

    Montreseur, you've got to use RTP Output for RTP terrains instead of Texture Output: video (sorry for low res). To get RTP Plugin see the link above.
     
  50. Exbleative

    Exbleative

    Joined:
    Jan 26, 2014
    Posts:
    216
    Hi, I just got the latest MM version, and I'm still having issues with Masks.


    If I have a background layer on my Blend, which is Detail 1, and mix the above layer in if it is white/green, then we shouldn't have this flattened area above ("why flat?"). If the black/red part of the mask means "don't mix", then the layer below should be the high Detail/noisy layer, right?

    Surely other people are using masks and have encountered this? :) Or have I messed my version up somehow?

    *edit
    Actually, I forgot I'd reported this bug already to Denis. I'd like to renew my "can we have a fix soon please" request :)
     
    Last edited: Feb 1, 2017
    trilobyteme likes this.