Search Unity

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. BigYetti

    BigYetti

    Joined:
    Apr 11, 2015
    Posts:
    26
    @Crossway

    In the long tutorial on MapMagic, Denis explains how to do this at about 6 minutes in.

    Essentially you need to start with a Raw Input height map of your island that you scale to the size of the 25 tiles. Then it can be surrounded by water.

    I'd imagine its possible to do without using the Raw heightmap input by creating a filtering that pushes the terrain down around the outside. But it sounds like too much messing about. I'd just use the Raw image input.

    The tutorial is long but it really will get you going nicely with MapMagic.

     
    Last edited: Oct 14, 2016
    malkere likes this.
  2. BigYetti

    BigYetti

    Joined:
    Apr 11, 2015
    Posts:
    26
    It would be great if eventually we were able to use jpg or other image formats like are used in Gaia. Opens it up to more of us hobbyist that don't have Photoshop. <nudge> @Wright
     
    Last edited: Oct 14, 2016
  3. Jesus

    Jesus

    Joined:
    Jul 12, 2010
    Posts:
    502
    Can't you use a cone or something under the 'simple form' node? Then multiply that by your random noise and you should be able to get an island-ish peak in the middle and have it fade to 0 height around the edges.
     
  4. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    you can also download the old photoshop cs2 for free from a link here:
    https://forums.adobe.com/thread/2195507
    you need an account and the link gets moved around sometimes. It also has some problems with some windows10 computers. it's funky on my desktop but works, it works fine on my laptop too, both win10

    I wonder what @Wright is working on at the moment? =D
     
    BigYetti likes this.
  5. Crossway

    Crossway

    Joined:
    May 24, 2016
    Posts:
    507
    Can you please explain more about this?
     
  6. BigYetti

    BigYetti

    Joined:
    Apr 11, 2015
    Posts:
    26
    Looks like yea.

    2016-10-14_7-40-37.png
     
  7. Crossway

    Crossway

    Joined:
    May 24, 2016
    Posts:
    507
    Thanks but I said a 25 tiles terrain but it's a 1 tile terrain. also the borders are not flat.
     
    Last edited: Oct 14, 2016
  8. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212

    nice guy Jesus was pointing out the cone simple form node which creates a decaying circle from a point. if you scaled it to 25 it would cover 25x25 terrains, but it would be circular, so your corner terrains would all be underwater. it would be an easy fix though.

    for a slightly more complicated fix you could mix together more cones in your corners (using offset) using additive blends so the corners would come above the water level.
     
    Crossway likes this.
  9. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    getting this error again now =/

    Invalid editor window MapMagic.MapMagicWindow
    UnityEditor.EditorApplicationLayout:FinalizePlaymodeLayout()

    trying to press Play, while "Maximize on play" is selected.
    no MapMagic in the scene or editor graph tabbed anywhere...
    gonna try rebooting..

    reboot didn't work. I reset the layout to default and got this error:

    Failed to destroy editor windows: #1
    MapMagicWindow
    UnityEditor.WindowLayout:LoadWindowLayout(String, Boolean)

    the layout did indeed reset though, and I can play maximized again...?
     
    Last edited: Oct 15, 2016
  10. Stanchion

    Stanchion

    Joined:
    Sep 30, 2014
    Posts:
    269
    @malkere Windows -> Layouts -> Default
     
  11. minhdaubu2

    minhdaubu2

    Joined:
    Jun 10, 2014
    Posts:
    76
    Is there a way to always enable the terrain in Play-mode
    -I have a terrain at the size of 4000. As i move the camera far away, it become disable in hierachy
    Thx you.
     
  12. Crossway

    Crossway

    Joined:
    May 24, 2016
    Posts:
    507
    Thank you, but something is weird that offset doesn't work for me at all! I mean I can't move shapes on terrains with offset.
     
  13. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    @minhdaubu2 what are you General Settings in MapMagic set to?
    You can disable the MapMagic script altogether, or make sure that your disable distance is above 4000.

    @Crossway like this?

    using the offset settings does nothing for you?
    (off to company party for several hours)
     
    Crossway, Wright and minhdaubu2 like this.
  14. minhdaubu2

    minhdaubu2

    Joined:
    Jun 10, 2014
    Posts:
    76
    Ty so much, disable the Mapmagic script works perfect.
     
    malkere likes this.
  15. Crossway

    Crossway

    Joined:
    May 24, 2016
    Posts:
    507
    Please look at below pic. it's stuck there and not move at all !
     
  16. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,276
    You can use the Texture Input - this generator is similar to the Raw one, but uses the standard unity texture formats - including jpeg you mention. Note that texture should have have read/write enabled in advanced import settings.

    malkere, thanks for explaining flat tops, biomes and generate distance questions - I have literally nothing to add about it. Dune2, I'm sticking by this post, consider it dev approved :)

    Can you recall what have you done before the layout error appeared?

    Voxeland refactoring. I plan to make it compatible with MMWG, I've got to change the data structure for that. Moreover I plan to add multithreading to improve performance, and new materials to improve visual quality. Recent sale showed that it's still got pretty much demand, so it's worth fine update, but still my main goal is MMWG compatibility.

    Damien-Delmarle, does this happen in a clear project, with only MM installed?

    Crossway, could you please send me the scene?
     
    Crossway, malkere and BigYetti like this.
  17. tanoshimi

    tanoshimi

    Joined:
    May 21, 2013
    Posts:
    297
    I think I lost the conversation thread that this relates to. I don't have Photoshop but I've been using MapMagic for a while now and I've never been aware of any feature I'm unable to use as a result. What node requires Photoshop?
     
  18. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    ya something does look right there; I'd send it to wright. Also I was using it as a mask on the noise node, you're screenshot shows you using it as as the base for you heightmap, then additively adding the noise to the cone. It should still move 500 when you offset it 500 though =o
     
    Crossway likes this.
  19. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,276
    I guess this refers to the Raw Input. I've heard Gimp should be able to create RAW images, but I have not checked it yet (since I'm pretty happy with Photoshop - especially it's subscription price which is 5 times lower in Russia :p). I will take my time to install Gimp and check out if it can work with 16bit raw images.

    Crossway, recieved your scene, will take a look at it shortly.
     
    Crossway likes this.
  20. tanoshimi

    tanoshimi

    Joined:
    May 21, 2013
    Posts:
    297
    You certainly don't need Photoshop to work with RAW files - there's nothing proprietary about the format at all. I've always used GDAL to get heightmap data into Unity (https://alastaira.wordpress.com/2013/11/12/importing-dem-terrain-heightmaps-for-unity-using-gdal/) but I'm fairly confident GIMP can do it too.
     
  21. Dune2

    Dune2

    Joined:
    Sep 22, 2016
    Posts:
    38
    @minhdaubu2 You can Tag the terrain. In the following, I've tagged my terrain "Terrain" and set the "Around Objects Tagged" to "Terrain"

     
    minhdaubu2 likes this.
  22. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    have we sorted through this problem yet?
     
  23. antoripa

    antoripa

    Joined:
    Oct 19, 2015
    Posts:
    1,163
    Hi,
    I have version 1.6 I do not see Floor node. ?? Someone can help me ?
     
  24. docsavage

    docsavage

    Joined:
    Jun 20, 2014
    Posts:
    1,021
    Hi antoripa.

    It was replaced with the height options if I remember rightly. Not got the project open to test sorry but thought would post to save you time looking.
     
    antoripa likes this.
  25. antoripa

    antoripa

    Joined:
    Oct 19, 2015
    Posts:
    1,163
    I did not get you .. I follow the tutorial on you tube and with first tree that use Floor with two input : Scattered and the Height from the terrain generation.. how can i do the same ?
     
  26. docsavage

    docsavage

    Joined:
    Jun 20, 2014
    Posts:
    1,021
    Hi antoripa,

    I agree the tutorial does show it as there and that's when I discovered it had been removed. When placing objects now there are new settings in the object nodes for height of placement. I think there's a checkbox called called height scale. I get the impression it has more uses but haven't had chance to test MM lately
     
    antoripa likes this.
  27. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,276
    antoripa, to place objects on terrain Relative Height parameter of Object Output is used now - it is turned on by default, so you should have already properly placed objects without Floor Generator.
    RelativeHeight.jpg
    I've added a note to the video to to avoid confusing new users.

    malkere, I can hardly see what's the problem is - is it the brightness difference in grass meshes? Are those seams placed at the terrain chunk edges? Does it happen when you manually draw grass with a brush? What are the grass output settings?
     
    docsavage and antoripa like this.
  28. antoripa

    antoripa

    Joined:
    Oct 19, 2015
    Posts:
    1,163
    Thanks ...it works very well.
    One more question. What I an trying to do is to spawn the player on the created terrain at ground level with 2 options : same position each restart .. or different position each restart. But no success.
    Can you give me a suggestion ? Thanks
     
  29. Jesus

    Jesus

    Joined:
    Jul 12, 2010
    Posts:
    502
    You want to look into the object part of mapmagic. Instead of rocks or whatever, you would get it to generate a bunch of 'potential-spawn-location' prefabs around the terrain. Then, when you want to spawn the player, either search for the first spawn location object, or pick a random one.

    The script you might be able to find elsewhere (unity wiki or the Unity MP tank example), but the MM component will be about the Object Output part.
     
    antoripa likes this.
  30. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    @Wright Those are the seams of three terrains branching out from 0,0. The grass colors on each terrains vary greatly, though the settings should of course be all the same. Even if only use one grass, set both the dry and healthy colors to white, there is a clear difference between the terrains. I don't understand why... might not even be MapMagic...
     
  31. nhf75

    nhf75

    Joined:
    Apr 5, 2013
    Posts:
    35
    Hi, i'm not bought your plugin yet, but it's my intention. I would like to know if you have Perlin Noise node and in the Erosion node you can include Flow map, Deposition map and Wear map like Erosion of Worldmachine. If we can do it by other way, can you explain to me what we need to do? Your plugin is fantastic and i need this features because this represent ravines that are very important to the Army. Thank you.
     
  32. Hakazaba

    Hakazaba

    Joined:
    Jul 1, 2015
    Posts:
    119
    So, how does using biomes at the same time as RTP work? How do we make sure it uses the right amount of texture layers for RTP while mixing multiple biomes?
     
  33. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    I haven't really gotten deep into it yet, but I think I will have to apply all textures globally to ensure RTP picks them up on the same layers. By default MapMagic just puts textures on when they're needed, but if you add a constant 0.01 to each textures they always get added on to all terrains equally. I hope to control biomes with flora and fauna more than lots of terrain textures.
     
  34. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    @Wright do you plan on implement a reset (shift) to zero feature for truly infinite worlds any time soon? Like, before the new year?
     
  35. Hakazaba

    Hakazaba

    Joined:
    Jul 1, 2015
    Posts:
    119
    Hey i have a couple of feature requests that shouldn't be too difficult related to RTP support.

    One would be the option of generating your terrain at a lower mesh detail level than the internal heightmap that Mapmagic generates and use it for RTP's tessellation features.

    The other would be the optional ability to generate distant chunks at a lower detail level before you approach them. So that those in the distance would generate quickly, and then have a slower generation when you approach so that the silhouette of distant terrain wouldn't have holes.
     
  36. Crossway

    Crossway

    Joined:
    May 24, 2016
    Posts:
    507
    Hi, did you check that scene I send you? what was the problem?
     
  37. cookimage

    cookimage

    Joined:
    Sep 10, 2012
    Posts:
    729
    Game Demo video, we are using MapMagic, love it!
     
  38. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,276
    Crossway, you've done everything almost right - but note that offset is set in world units, not resolution pixels (otherwise it will crawl on resolution change). And your terrain size is incredibly big, so offset of 500 gives almost no effect. To offset your cone to the neighbor terrain you've got to use 20000.

    I don't really know. On the one hand it's out of the scope of the plugin, on the other - I've got to do it for my own project, so I'll think I'll include it in MM and Voxeland as a free bonus. But I can't say for sure when it will be done, but probably not in the next couple of months.

    This one sounds wisely, but I've encountered a problem trying to implement it - the best way to do so causes a blink on lod/full detail change when terrain disappears. To bypass this problem I should make a very big change, so this feature was postponed.

    Currently all of the textures are used on all the terrains when using RTP Output. I have in plans making it the same way Texture Output does (use only those textures that are really used on terrain), but I will implement it after the Voxeland integration.

    malkere, could you please send a scene to mail@denispahunov.ru? I will probably need the grass texture (in case if I will fail to reproduce it with my own).
     
    Crossway likes this.
  39. Matro

    Matro

    Joined:
    Mar 15, 2013
    Posts:
    38
    You do not need PS to get a height map into MM.

    If you have World Machine you just need two nodes an input node and a height output node put your jpg grayscale 16bit image in the input node and then convert it in the height output node see image.
     

    Attached Files:

  40. Ascensi

    Ascensi

    Joined:
    Sep 7, 2013
    Posts:
    579
    @Wright will the same editing system of Voxeland remain ie; generator sliders (my preference) to work with the node system in MM and the MM nodes make changes to the sliders in Voxeland interchangeably?
     
  41. nhf75

    nhf75

    Joined:
    Apr 5, 2013
    Posts:
    35
    Please, i need to know if what i need is posssible to do with this plugin to buy it..
     
  42. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,493
    You can't I tried
     
  43. tanoshimi

    tanoshimi

    Joined:
    May 21, 2013
    Posts:
    297
    Two interesting "features" just caught me out in relation to chunk pooling with infinite terrains that I thought I'd note here for the benefit of others:

    a.) when terrain chunks are recycled from the pool they retain their original name. So at the outset you might have a neatly-named 3x3 grid like this:

    0,1 1,1 2,1
    0,0 1,0 2,0
    0,-1 1,-1 2,-1

    However, as you move around and terrain chunks are removed/replaced at new locations, *they keep their original name*. So you can't rely on the offset in the name to indicate a terrain chunk's relation to its neighbouring chunks.


    b.) Although child objects placed by Mapmagic on terrains are removed/regenerated when a chunk is recycled, any additionally-added components/child objects remain. I was creating additional objects in OnApplyCompleted that were getting duplicated each time a chunk was recycled, for example.


    Just thought I'd point these out!
     
    malkere likes this.
  44. ThunderSoul

    ThunderSoul

    Joined:
    Sep 28, 2016
    Posts:
    63
    Does MapMagic have an API/SDK to randomly generate terrain through code so that I can create random maps for my game?
     
  45. tanoshimi

    tanoshimi

    Joined:
    May 21, 2013
    Posts:
    297
    You definitely can - I just did (using GIMP 2.8.6 Windows - what version are you trying?).

    Admittedly, it seems to flip the image (though I remember this is a Unity thing - terrain heightmaps have 0,0 at the top-left instead of the bottom-left (or maybe the other way around), but that's relatively trivial to correct.
    Raw_GIMP.jpg
     
  46. docsavage

    docsavage

    Joined:
    Jun 20, 2014
    Posts:
    1,021
    Hi @Wright,

    Having a bit of a problem I can't figure out. If the grass density is increased to greater than 1 or if the constant node is more than 1 the grass starts to plant but with empty rectangular and straight sided areas. I've included the pics to show you.

    Everythings fine at 0 to 1. After 1 it all goes wrong. I tested it with the constant node as this seems to be simplest error free method can think of to test.

    Ok.png
    OK




    WithSquaresLess.png
    Density 1.2. Can see problem top right

    WithSquares.png

    density 3 Big empty sections


    Thanks

    doc

    Edit - using windows 10 64 bit. Unity 5.4.2f2 but happened on 5.4.2f1 as well

    Edit 2 - The grass is not on the mountain rock simply because the grass distance is past draw distance. Just a coincidence it looks like they are masked. If close up the grass is on the mountains etc as expected with constant node (if density at 1 or less).
     
  47. docsavage

    docsavage

    Joined:
    Jun 20, 2014
    Posts:
    1,021
    Hi @Wright,

    Ok - update. Managed to get it working but not in a way expected. The terrain had a resolution of 512. At this resolution the problem is as above. I changed resolution to 2048. Problem gone. No Idea why. This is exactly the same project with no changes other than resolution.

    I'll test 1024 to see if that works. I don't fancy editing in 2048 as generation times will become an issue.

    If 1024 doesn't work I'll post here. Otherwise assume 1024 works as well as 2048.

    Thanks

    doc
     
  48. docsavage

    docsavage

    Joined:
    Jun 20, 2014
    Posts:
    1,021
    Only thing I can think of is that it's trying to draw more grass than places to plant it so it results in these blank areas. Probably wrong. 1024 did work as well so I'll crank up density to see if I can reproduce it again.
     
  49. docsavage

    docsavage

    Joined:
    Jun 20, 2014
    Posts:
    1,021
    Managed to reproduce it. At 1024 resolution the density limit seems to be 5. At 6 the blank spaces starts again

    1024limit.png


    Is this something everyone already knows and I missed it or is it a new issue????
     
  50. docsavage

    docsavage

    Joined:
    Jun 20, 2014
    Posts:
    1,021
    At 2048 resolution the density limit is around 20

    Edit. Obviously density limit is related resolution. If this is already well known then hopefully this will help a bit for some others who come across it as well. I've read most of the manual. I'm sure didn't see it mentioned but I could have forgotten