Search Unity

  1. Improved Prefab workflow (includes Nested Prefabs!), 2D isometric Tilemap and more! Get the 2018.3 Beta now.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice
  4. Want to see the most recent patch releases? Take a peek at the patch release page.
    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. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,367
    You can also try using Noise with low detail level and high turbulence:
    Dunes.jpg
     
  2. secondsight_

    secondsight_

    Joined:
    Mar 2, 2014
    Posts:
    107
    Oh, great ! I will try to mix both methods. So maybe voronoi for details. And then maybe substract some low detail large scale noise for valleys. Thanks, will try that (and post results if success) :)

    Edit: Shots
    Edit2: Terrain height is 600





    ...and a few more.

    Starts to work out somehow I think. Mixed voronoi and low detailed noise. Thanks again !
     
    Last edited: Jul 4, 2018
  3. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,367
    Wow, that's really impressive! I realized I'm the fan of your work :)
     
  4. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    3,384
    Well that became good very fast!
     
  5. secondsight_

    secondsight_

    Joined:
    Mar 2, 2014
    Posts:
    107
    Thanks ! But dito, Wright :) Good tools make good results.
     
  6. JLO

    JLO

    Joined:
    Nov 11, 2012
    Posts:
    26
    Hi @Wright I'm thinking about purchasing Map Magic.

    I already own Voxeland but I wanted to know if I change the generator type in Voxeland to Map Magic, do I lose the ability to alter/draw terrain using Voxeland?

    Also does Map Magic Support drawing/altering terrain like in Unity's terrain?

    Thanks.
     
  7. Kris392001

    Kris392001

    Joined:
    May 8, 2018
    Posts:
    35
    Hi All,

    I'm new to Unity and Map Magic (long time GIS programmer) and will probably be asking a lot of simple questions for the next few weeks :)

    First question is I have quite a detailed height map from SRTM data in 16bit raw. I was wondering if any masks (eg biomes) need to cover the exactly the same area and be the same pixel depth, or can I use a smaller (h x w) 8bit raw and offset it to the terrain tiles required?

    Love the dunes in the past few posts, I have a similar requirement for an ice field and am thinking of using flat voronoi. Any advice appreciated.





    Cheers

    Chris
     
  8. secondsight_

    secondsight_

    Joined:
    Mar 2, 2014
    Posts:
    107
    Hey Chris and thanks,

    I guess the trick is to break up the visible patterns from the voronoi with soft erosion or blur.
    For the ice sheets you should end up with something like this... but I have no clue yet how to do that :)



    So because I was bored today I tried around a little bit with the flat voronoi you suggested. Didn´t worked out like I wanted to, but the nodegraph could help you anyways (see below). On the left side I mixed some voronoi in different sizes and moved them to different heights.

    So yeah... I quit in the middle and instead ended up doing this. Not exactly what you need, but I like it:





    ...of course, some more !
     
  9. ajaxlex

    ajaxlex

    Joined:
    Jul 15, 2016
    Posts:
    19
    Exquisite, @secondsight_ -> super exciting work, thanks for sharing
     
  10. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,367
    Consider MapMagic as one more generator for Voxeland - all you can do with the built-in generators could be done with MapMagic. You can change the generated terrain (however changes will not be kept if you force re-generate this area).

    And since vanilla MapMagic uses the standard Unity terrains you can lock them from generate and edit the way you want using the standard tools.

    secondsight_ is the real magician!
     
    JLO likes this.
  11. secondsight_

    secondsight_

    Joined:
    Mar 2, 2014
    Posts:
    107
    Thanks all ! Was fun do test it. Still wrapping my lazy head around ice shelfs.

    I´ve been asked to upload the nodes. So I also packed the light informations, post effect profile and textures and uploaded it:

    Download

    Can someone put that (or just the nodes) on github,if wanted ?
    A short readme is also included. Since this was just a testscene, it works quite good low on ground but needs additional tweaking when viewed from top.

    Oh, and one question:
    Is there some way scale ALL noise at once ? Something like a global scale ? Or could that be a feature for the future: A scale node with one value (default 1) that you can connect noise nodes to ? Would help quite a bit with more complex scenes.
     
  12. Kris392001

    Kris392001

    Joined:
    May 8, 2018
    Posts:
    35
    Thanks secondsight_ for the time you put in. Not quite what I'm after but cool none the less :) I'll play around on the weekend and if I come up with anything worthwhile, I'll post it here.
     
  13. bok

    bok

    Joined:
    Feb 24, 2014
    Posts:
    26
    Is there a way to address something at a certain height level? For instance if I wanted the snow texture to appear only on the highest surfaces of my terrain can I do that? Or if I wanted to have underwater plants that only grow below sea level.
     
  14. secondsight_

    secondsight_

    Joined:
    Mar 2, 2014
    Posts:
    107
    Of course ! Curves are your friend (until we get a propper height selector in 2.0 :) )

    1.) Snow on Top


    2.) Only ocean floor


    3.) Bonus: Beach area. Combined the two above and inverted them. Example: Only grow Palms at the beach.


    Cheers!
     
    camta005 and matteumayo like this.
  15. bok

    bok

    Joined:
    Feb 24, 2014
    Posts:
    26
    @SecondSight: You rock! Thank you so much for your help - you just saved me tons of experimenting work.
     
  16. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,367
    You mean all of the noise nodes should use the same size? Don't know how why it could be useful, but you can do this with MM2 by using a function graph (kinda biome) with a single noise node - changing it's values will change all function nodes in all graphs.
    However I guess you mean scale that will multiply the output size all of the nodes output, not only noise. Don't know, that sounds feasible, I'll see what I can do.

    Oh, but this sounds complicated.

    I'll add this to community graphs page if you don't mind.
     
    CraftingPixelLab likes this.
  17. secondsight_

    secondsight_

    Joined:
    Mar 2, 2014
    Posts:
    107
    I would like to be able to scale mutliple noise sizes at once. They could then be connected to a single node with one mutliply factor in it.
    Example in this shot: 3 noises with different sizes. If I want to double the size all at once, I´d add a x2 factor in the node.


    The usage of this is to make it easier group noises for different terrain types and then scale them to each other. In the example above, all dunes could be grouped and scaled easily.

    But this is "just" a luxus feature I thought about a few times. The function graph for 2.0 sounds great, though !
     
  18. ssmithy

    ssmithy

    Joined:
    Nov 18, 2013
    Posts:
    1
    Thanks secondsight_ for the sand dunes download. Wow, from sand to ice! It is amazing to see what an artist can do with MM.
     
  19. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,367
    I think this should be made with the Function (and value expose) rather then a node. Such node doesn't fit in MM system well. But I'll think about the way to wire the exposed values with different ratio - maybe not in an 2.0 version, but in next releases.
     
    secondsight_ likes this.
  20. Kris392001

    Kris392001

    Joined:
    May 8, 2018
    Posts:
    35
    Hi All,

    A question if I can. Perhaps I'm missing something. I'm moving ahead with the ice shelf project and am pretty happy with basic terrain. There will eventually be an ice shelf between the 2 land masses.



    My areas is 3x3 at 2km per terrain. Using the player setup from the demo scene.
    The distance between A and B is approx. 2km. When I stand at point A and look towards C, I can see B in my peripheral vision.



    But when I look towards B, everything is removed.



    I have generate infinite terrain on, and have set the generate range settings to anything from 2000 to 8000.
    Am I missing something or am I pushing the boundaries with the distances.

    Any help appreciated.

    Cheers

    Chris
     
  21. JLO

    JLO

    Joined:
    Nov 11, 2012
    Posts:
    26
    @Wright Just bought Map Magic! I'm looking forward to using it along side Voxeland. :D
     
  22. Thiole

    Thiole

    Joined:
    Jul 7, 2018
    Posts:
    4
    Sorry if I am brand new, and i saw your tutorial for how to Gradient blend biomes.

    I am trying to generate a large swath of land, and after i make varying degrees of biomes, how would I then generate the land with distributed gradients (so it doesnt change from desert to arctic)
     
  23. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,367
    Could this be related with the fact that the far plane is actually... a plane? It's just the way camera renders the world, not related with MM. Far plane corners are further than it's center, especially when the FOV is high. The camera view distance at the sides is higher than the distance at the center. Just like when you look into the monitor the distance from your eye to it's center is less then the distance to it's side.

    Just try increasing the camera view range.

    So you are trying to make several stripes with gradient? Try adjusting each stripe contrast with the Curve, and then blend them all with the Normalize:
    CurvesNormalize.gif
    Edit: oops, I'm using Noise in this setup. Pretend it's a Simple Form node instead of it.
     
  24. Thiole

    Thiole

    Joined:
    Jul 7, 2018
    Posts:
    4
    idk about gradients always, is there a way to random distribute biomes, but exclude certain ones from being next to each other?
     
  25. Kris392001

    Kris392001

    Joined:
    May 8, 2018
    Posts:
    35
    Thanks for your reply. Increased the camera view range and it worked. Now making some progress on the ice field. :)

    Is it possible for MM to have the option to use 8bit raw files? I know that in my current project I don't need a height range over 256, so 16bit seems like overkill, especially if I can trade pixel depth for areal extent. Or is that a Unity limitation?

    Cheers

    Chris
     
  26. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,367
    Only in some particular cases - like making "stripped" biomes setup with gradients. Otherwise the algorithm is too complicated and could lead to four color problem. The best way to make it is using manually painted raw map (or maps).

    You can use a simple texture instead with a Texture input. Textures use 8bpc that seems to be exactly what you need.
     
  27. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    3,384
    In the absolute pcg sense, not sure about map magic (I haven't tried it with it). You would do an equivalent "Whitaker diagram" (basically it decide which biomes are next to each other following noise input), ie you use two gradient noise and use them as coordinate, to sample a diagram custom made for your design, but instead of directly selecting biomes, you select a group of possible biomes to select in a bucket. By strategically placing biomes bucket in the custom diagram, you make sure some biomes are never next to each other. For example biomes at the extremity of the diagram would never be placed next to each other if they are biomes between them in the diagram, unless you have very sharp noise.
     
  28. Thiole

    Thiole

    Joined:
    Jul 7, 2018
    Posts:
    4

    yeah, IK about whittiker diagram, If i could Id create 2 additive noise diagrams, one for precip, one for temp, and just select on the table that way. But i have no idea how to do that in mapmagic

    edit 1:maybe instead of using biomes, do 1 controls textures from sand to dirt to snow, one controls amount of grass or "tundra" dirt, and precip noise map controls grass /trees + snow of cold?

    edit2: then the hills would be uniform, unless I made every biome rule based on temperature with their textures
     
    Last edited: Jul 12, 2018
  29. jeromeWork

    jeromeWork

    Joined:
    Sep 1, 2015
    Posts:
    174
    Thanks @Artaani That did the trick for me too.

    @Wright This is still a problem, even with the updated CustomShaderOutput.cs on dropbox

    Had to create a material from the CTS shader and add to the node as the Material Template. Only then would the 'Fix' button not throw an error.

    For anyone also doing this, don't panic if your textures disappear after applying that fix. I clicked on Update Now (on the Custom Shader node) and all came back as expected.
     
  30. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,367
    I've submitted the new version that should fix the CTS mode "Fix" button. And will bring some fixes for Unity 2018.2 too. Expect it in Asset Store in a couple of days.
     
    Artaani and camta005 like this.
  31. Thiole

    Thiole

    Joined:
    Jul 7, 2018
    Posts:
    4
    is there a way for you to make it so itll do a voronoi distribution of biomes? so it doesnt do the 4 color problem?
     
  32. Pequisto

    Pequisto

    Joined:
    Apr 21, 2015
    Posts:
    66
    How exactly did you accomplish this? I'm messing around with an evaluation version of MM and have yet to figure this out. I didn't see Denis do this anywhere in his tutorial.
     
  33. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,367
    Mask the stones scatter with the height adjusted by curve, like this:
    TutorialMaskStones.jpg
    This curve inverts the height map and makes it more contrast. It's preview is shown in the scene view. The red areas of the scatter's probability mask show that no stones will be spawned here.

    Sure, here is the voronoi biomes distribution:
    BiomesByVoronoi.png
    EDIT: You might want to add some blur with 4 blur nodes before linking normalize to biome nodes to make biome blends a bit softer.
     
    camta005 likes this.
  34. Pequisto

    Pequisto

    Joined:
    Apr 21, 2015
    Posts:
    66
    EDIT: My bad, accidentally turned off a generator. Thanks!
     
  35. jeromeWork

    jeromeWork

    Joined:
    Sep 1, 2015
    Posts:
    174
    New user, absolutely loving this asset.

    A few ideas/wishes
    • would it be possible to add a 'notes' node - just to annotate parts of the graph as I'm finding it can be difficult to remember what I was trying to do when coming back to improve parts of a complex graph. Maybe showing the title as a label then click on it to open full notes?
    • on a similar tip, could nodes be tinted? I realise types of inputs/outputs are colour coded but it would be great to be able to tint groups of nodes that function together - visually organise things better.
    • also could multiple nodes be selected at together - to move in one go (and as per above tint in one go) Ideally this would be by dragging a selection box with Cntrl Click to add to selection and something like ShiftCntrl Click to remove from selection.
    • in the Vegetation Studio node, could clicking on asset open that asset in the Project window?
    • ditto with the Custom Shader node's layers. Click on texture would open it in the project window.

    A few questions
    • is it possible to switch from Map output to Object output and vice versa? Possible usecase: having defined a patch of grass, I'd like to take that map output invert it and then use that area to scatter a few objects over.
    • I've posted a few Vegetation Studio integration bugs on the GitLab site and I see that it is generally recognised as being a bit flaky. Is there an ETA on an update?
    • and can I ask whether the complexity of a graph has an impact on runtime performance? MapMagic seems to be incredibly efficient at loading and unloading terrain tiles, and it appears that the hardwork of generating everything is done on scene load. Can you confirm?
    Thanks!
     
  36. secondsight_

    secondsight_

    Joined:
    Mar 2, 2014
    Posts:
    107
    I´m currently doing a basic setup for a spooky / magical / autum forest.
    I want to generate as much as possible without the use of bitmap masks. But I need two generate two different shapes that will mark special zones on one map. I´ve tried the whole day to achive this somehow but no real luck. Maybe you guys have some ideas how to tackle this ?

    1. These areas will mark "healthy" zones in the forest with different vegetation. A minumum of one but maximum of three areas of this kind shall be present on one map.


    2. This shape will mark the borders of the level, that is blocked by crystals or such. The shape should vary but still be closed. Of course this could easily be done with a mask and maybe nobody will notice, but maybe it´s possible ?



    Other then that... it´s coming along quite well I think:





    I hope someone has a tip ? :)
     
    Last edited: Jul 18, 2018
  37. ajaxlex

    ajaxlex

    Joined:
    Jul 15, 2016
    Posts:
    19
    @secondsight_, I am not sure why you are reluctant to use bitmap masks, but if you concern is that they are static, then these kind of shapes can be acheived with procedural techniques. For example, you could use an algorithm that picks 2-4 points on the map, but makes sure that they are no closer than x from one another. Then, you draw a series of random sized circles at a random distance from each chosen point to make the blobs. This drawing occurs in a texture that you can then feed into your generator. If you are not a developer, I can show some code for it, but not right now, .....because I am lazy and lying in bed!:D

    Also, those scenes look amazing, as is to be expected from the mighty secondsight_.

    I'll try to work some examples up tomorrow.
     
    Dwight_Everhart likes this.
  38. ajaxlex

    ajaxlex

    Joined:
    Jul 15, 2016
    Posts:
    19
    There is probably a way to get pretty close with existing MM nodes, too.
     
  39. secondsight_

    secondsight_

    Joined:
    Mar 2, 2014
    Posts:
    107
    Thanks ajaxlex !
    I pretty much approached with the same logic as you´ve described it, but with nodes (somehow). Yes, I´m no coder and so any help would be appreciated ! Will be bussy with other stuff the next week, though so no need to hurry :)

    What would be a niifty feature to have: a random mask selector !
    So, you feed MM an array of mask textures(or raw heightmaps) and then it randomly chooses one on generation based on some probability factors. Would that be possible to have ?
     
  40. zoltanBorbas

    zoltanBorbas

    Joined:
    Nov 12, 2016
    Posts:
    37
    Hi there,

    What terrain shader are you using, how is that i see no tiling?
     
  41. secondsight_

    secondsight_

    Joined:
    Mar 2, 2014
    Posts:
    107
    These are just the basic unity shaders, specular setup (I think even legacy). I have used only two textures on three layers. Of course you want to have seamless sand textures first. But I guess the whole trick is that I mixed two of the same textures with different scaling and normal map intensities. This way they mix up quite nice. The rest is a simple light setup that unifies the whole scene with some primary colors.
     
    zoltanBorbas and AthrunVLokiz like this.
  42. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,367
    It could be done with the groups. You can add a note to the group as well as actually group nodes to move them simultaneously. Color groups will be available too in MM2.

    Actually, clicking on the asset (both VS package or texture) once will select it in the Project window. Isn't it working for you?

    These node setups will give something more or less similar to the maps you've posted:
    HealthySpots.png

    HealthySpotsOutline.png

    They differ mainly in a last curve node form, so all of the other nodes could be re-used by linking these different curve to blend.
     
    ajaxlex likes this.
  43. secondsight_

    secondsight_

    Joined:
    Mar 2, 2014
    Posts:
    107
    Yeah... I always forget about the blob node !!
    Fantastic...will work that in. Thanks Wright ! There goes my weekend...
     
  44. jeromeWork

    jeromeWork

    Joined:
    Sep 1, 2015
    Posts:
    174
    Thanks @Wright
    I'll look into Groups for organising things.
    and looks like Blob does the Object to Map conversion I was looking for :)

    Re. node click to assets in Project. No not working for me (unless I'm doing something wrong?)
    - I see the thumbnail and 'select' for Textures node, but not Custom Shader and Vegetation Studio:
    https://drive.google.com/open?id=1pKOla_KLoeXqVsBAAe29oVMxjLgw6RDy (5MB)
     
  45. kain_vinosec

    kain_vinosec

    Joined:
    Jan 25, 2016
    Posts:
    5
    So, newbie question. Just bought this, opened it up by itself in 5.6.6f2 and immediately get:
    Assets/MapMagic/Generators/VegetationStudioOutput.cs(121,10): error CS0246: The type or namespace name `VegetationSystem' could not be found. Are you missing an assembly reference?
    Can someone help?
     
  46. jeromeWork

    jeromeWork

    Joined:
    Sep 1, 2015
    Posts:
    174
    @kain_vinosec Do you own Vegetation Studio? The obvious answer is, if you do, import it.

    Not sure what's best to do if you don't own VS. Maybe try moving VegetationStudioOutput.cs out of your Project folder and see if the console grumbles about that. (i.e. throws up any additional errors)?

    Or go into the script and comment out most of what's there.
     
  47. jeromeWork

    jeromeWork

    Joined:
    Sep 1, 2015
    Posts:
    174
    @Wright Any advice on whether the complexity of a graph has an impact on runtime performance? Am I right in thinking that the impact happens only once (on scene load) but not as each terrain tile is loaded?

    Also any ETA on a Vegetation Studio integration update?
     
  48. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,367
    I meant the package asset. All of the CTS and VS icons and names are part of the CTS and VS scripts. MM has no data about the sources, so the only way to select, add or change them is through CTS or VS only.

    My bad, it's an issue - already fixed but yet not reviewed by Unity. As a quick fix just remove VegetationStudioOutput.cs file.

    Each node linked to one of the outputs increases the generate time of each terrain tile - from dozen of milliseconds up to seconds in case of erosion in editor (note that generate in build usually 2-3 times faster). If the node or node chain is not connected to the output node they are not generated thus does not affect generate time.
    However node complexity is hardly related with a scene load time.

    If you are talking about "The type or namespace name `VegetationSystem' could not be found." in 1.9.2 - it's already fixed and will be available on AS soon. If not - could you please remind me the issue ticket number?
     
  49. jeromeWork

    jeromeWork

    Joined:
    Sep 1, 2015
    Posts:
    174
    Thanks @Wright
    - so just so I'm clear... each time a terrain tile is loaded (the player comes close enough) then the calculations take place. It's not all done on the initial scene load?
    So the complexity of the node graph has an impact on how smooth things feel as you explore the environment?
    - is there the possibility of caching this 'generate time' or, better still, caching the state of the terrain and spawned prefabs. I think it's something that MadMaps does, in the way that it creates stamps - all that data (height/splat and prefab placement) are saved as an asset.
    Could this be in any way possible? Would it not greatly hepl performance or am I misunderstanding the way things work?

    Re. Vegetation Studio integration issue. I'm thinking about ticket #243 which I posted a few days ago and #208 which lists a few issues I have too but didn't want to replicate by posting again.

    Would you like me to create a ticket for the 'click on asset doesn't open in Project issue I wrote about above?
    https://forum.unity.com/threads/map...ite-game-map-tool.390920/page-64#post-3569161
     
  50. shedworksdigital

    shedworksdigital

    Joined:
    Nov 7, 2016
    Posts:
    17
    Just chiming in to say that the first point in ticket 208 is a super important one that severely limits the usefulness of the VS integration.