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

    Mazak

    Joined:
    Mar 24, 2013
    Posts:
    226
    Well that worked, thanks... I modified flatten to use the src.GetAverage and I added a % of that value (heightModifier). This gives me exactly what I am looking for!

    I attached the file since several are looking for something similar.

    All my settings are in the screen shot.

    upload_2016-12-29_16-13-26.png
     

    Attached Files:

    trilobyteme, Hormic and malkere like this.
  2. Szaruga

    Szaruga

    Joined:
    Jan 29, 2016
    Posts:
    403
    For some time I look at tools for creating terrain (purchased, among other things: GAIA, Terrain Composer 2) but MapMagic seems to me the best tool.
    Each of these tools allows you to create beautiful landscapes, but ...
    the problem arises when I want to improve fragment (eg remove one specific hill enlarge the valley, etc.)
    I can do this manually, but then i lose the possibility to continue editing area from the tools (MM, G, TC2) :(

    I have a dream that someday someone will do a tool that will allow the use of (at any moment of the work) manual adjustments to the terrain ... it would be perfect. :)
    But i know it's impossible :(

    Regards.
     
    malkere and Mazak like this.
  3. Mazak

    Mazak

    Joined:
    Mar 24, 2013
    Posts:
    226
    I think if we had the ability to run the Height generator, edit a terrain manually, then lock the terrain and not run the height generator on that single terrain ever again.

    The other generators could then continue to run.

    Would this solve the issue you are having?
     
    malkere and tanoshimi like this.
  4. Deleted User

    Deleted User

    Guest

    Hi Denis,

    Can you please advise what imaging programs can/should be used to make the required .raw file to generate the height map according to your specifications. I'm trying Gimp as recommended in your video description ("Image editor with the ability to save 16bpc .raw files (like Gimp or Photoshop)") but can't seem to export the .raw file or choose 16bpc and PB byte order in Gimp. Can you please advise.

    Thanks.
     
    Last edited by a moderator: Dec 30, 2016
  5. tanoshimi

    tanoshimi

    Joined:
    May 21, 2013
    Posts:
    297
    That sounds like a good idea.
    Not near a computer at the moment but I'm guessing you can't simply disable the Height Output generator and expect a terrain chunk to retain its current height (what would happen to terrain chunks that had not previously been generated?).

    I guess you could approach this by having an *input* generator that read the heights of an existing terrain, applied texture maps etc etc and then simply wrote the same heights back in an output generator. Would that work, @Wright?
     
  6. Mazak

    Mazak

    Joined:
    Mar 24, 2013
    Posts:
    226
    I would do it on a terrain by terrain basis.

    Lets say you have a terrain, you manually edit five terrains in a 10 x 10 grid. flag those terrains NOT to modify the height.

    Then you decide to change the splat maps, grass, and trees.

    You have placed some buildings so you can also turn off the object placement for the five.

    A simple script placed on the terrain would simply have the output generator check boxes.
     
  7. Twoonebe

    Twoonebe

    Joined:
    Mar 30, 2013
    Posts:
    174
    Hi, I just tested the demo and am followed the tutorials on youtube. Has everything worked so far quite well, I've then looked more closely at the video in which Denis generated a whole world. Unfortunately, the video from as it is an older version is therefore I have a few questions to you and hope you can help me.

    I've assigned objects to a texture z.b Grass.

    1. How can I now distribute several objects on the landscape without appearing in themselves?

    2. The same applies to trees. And how do I manage this in forests?

    3. Is there a possibility if I now place stones in the landscape, the z.b grass does not appear in the objects but in a radius around the object?

    Would be happy about help
     
  8. ayk

    ayk

    Joined:
    Nov 14, 2013
    Posts:
    58
    I've been having the same problem with GIMP. It doesn't seem to support .raw natively.

    I currently manage to work around if by leaving the colour mode as RGB, exporting to .bmp, and setting the advanced options to 16-Bits R5 G6 B5. Once that's done I change the file's .bmp extension to .raw, and it imports into MM.

    The problem with this method, though, is that the image doesn't import into MM perfectly. It is flipped and offset to the right, so I have to tweak it in GIMP until I get the proper results in MM.

    I hope a better method presents itself to me soon! :)
     
  9. Deleted User

    Deleted User

    Guest

    Thanks very much @ayk for your suggested work around, I too can now import a file that looks somewhat like a terrain - even though the terrain is very stepped and off alignment as you mentioned (in Denis' video his is very smooth when imported). Can you advise how you corrected the alignment issue in Gimp.

    I would still like to hear from Denis on the issue as to what programs should be used because it should be very clear in the asset store description/requirements before people purchase.
     
  10. tanoshimi

    tanoshimi

    Joined:
    May 21, 2013
    Posts:
    297
    There really is no software requirement - the RAW file format is a standard containing, well, just raw height information. It is not designed to be read or edited by graphics programs, but typically output by geological surveys such as the USGS. There are free programs such as MicroDEM or OGR2OGR capable of converting this to other formats. Photoshop just happens to load it too

    If you want to use a graphics program like GIMP to "draw" a terrain heightmap, you should use the texture input generator instead. However these are typically limited to 8bit resolution because they use a single grayscale channel of values from 0-255.
     
  11. ayk

    ayk

    Joined:
    Nov 14, 2013
    Posts:
    58
    It was just trial and error for me to correct the alignment. Use Layer > Transform > Offset to move the texture in GIMP. It'll wrap the image around and you'll have to play with the values for x and y until it looks correct in Unity.

    [QUOTE="tanoshimi, post: 2903068, member: 283612"If you want to use a graphics program like GIMP to "draw" a terrain heightmap, you should use the texture input generator instead. However these are typically limited to 8bit resolution because they use a single grayscale channel of values from 0-255.[/QUOTE]

    Ooo... thanks for this tip! I was trying to use the texture input generator, but I couldn't get it to work. Now I know why! I'll have to experiment with it when I get home from New Year's dinner with the fam.
     
  12. tanoshimi

    tanoshimi

    Joined:
    May 21, 2013
    Posts:
    297
    Just make sure you have read/write enabled in the texture inspector settings and you should be able to use any texture from your project as a heightmap - brighter pixels = higher.
     
  13. psistalk

    psistalk

    Joined:
    Sep 23, 2013
    Posts:
    68
    Thanks, Mazak I used the pad creator to place multiple cities. Just need to disable the trees and grass on the cities.

    upload_2016-12-31_16-18-5.png

    upload_2016-12-31_16-18-16.png
     

    Attached Files:

    • pic1.jpg
      pic1.jpg
      File size:
      522.9 KB
      Views:
      901
    malkere and Mazak like this.
  14. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,274
    Thanks :)
    I am thinking about manual terrain editing with MMWG, some sort of sculpting thing. I plan to combine it with Erosion Brush, so that it will paint not only the noise or erosion, but all of the custom graph.

    Oh, I like that idea! Some kind of advanced lock mode where you can choose which generators should affect locked terrain. But as tanoshimi said it should read already existing terrain information, so it will be not the easy thing to implement.

    RETRO_GEEK, I'm not very familiar with Gimp, but as I can remember I saw RAW format export here. I might be wrong, in this case I'll remove Gimp mention. Pity I don't have Gimp at hand now to take a look. Anyways, even if Gimp does not support 16bpc raw format I'll try to find free workaround.

    Generators like Scatter or Forest try to not to spawn objects on the same or close positions, but when using different kind of objects with different scatters it could really be a problem - in this case subtract generator should be used - it will remove objects withing a some distance from the other objects:
    SubtractOverview.jpg SubtractOverview_a.png

    Blob Generator could be used as subtract analog for maps:
    SubtractGrass.jpg
     
    malkere and Mazak like this.
  15. Twoonebe

    Twoonebe

    Joined:
    Mar 30, 2013
    Posts:
    174
    Thank you very much
     
  16. killer1171090

    killer1171090

    Joined:
    Feb 23, 2013
    Posts:
    145
    Would it be possible for this to support planets?
     
  17. tanoshimi

    tanoshimi

    Joined:
    May 21, 2013
    Posts:
    297
    MapMagic generates terrains (textures, heightmaps, grass, trees, and other objects). If you can make a planet from that, then yes.
     
  18. tanoshimi

    tanoshimi

    Joined:
    May 21, 2013
    Posts:
    297
    I've uploaded some custom generators to my GitHub account at https://github.com/alastaira/MapMagicExtensions, so if anyone would like to make use of them please help yourselves. Here's example of some of them:

    Chance Generator:
    The following graph has a 2/3 chance of creating desert, and a 1/3 chance of creating swamp biome.


    Pick Generator:
    The following graph picks either the Constant, Noise, or Voronoi generator to create the heightmap with equal probability.


    Single Point Generator:
    The following graph places a single cube on the terrain at coordinates somewhere between (300,120) and (400,150).
     
  19. Aceego

    Aceego

    Joined:
    Apr 5, 2015
    Posts:
    37
    is there a way to use Navmesh or something? I work with emerald AI but i need the Navmesh bake
     
  20. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,274
    That's true, but unfortunately MM internally works with standard Unity terrains, and there is no way to make them spherical. So I'd rather say that there's no planets support, at least out of the box.

    tanoshimi, thanks so much for sharing your generators! Guess many of MMWG users will find them helpfull!
    And, looking forward, I'd like to say that Chance Generator, as far as I guess how it's working, will not make MM to generate all of the biomes from the list, but only a selected one.

    Aceego, mm does not generate navmesh for dynamic terrains at runtime. A dynamic pathfinding should be used instead, using waypoint navigation, collision detection and steering behaviors. An open terrain is not a maze, so in most cases it will be enough. Apex Path boasts dynamic pathfinding, but I have not tested it. Some users claim that they are using Apex Path alongside MapMagic with great results.
    However, for pinned terrains that can have some complex POI like villages or cities a manual navmesh could be created with the standard tools.
     
  21. tanoshimi

    tanoshimi

    Joined:
    May 21, 2013
    Posts:
    297
    I guess it depends what @killer1171090 meant by whether MM (or, indeed Unity terrain in general) "supports planets"...
    If you just want to make it look like you're walking on a curved surface, you can apply some sort of cylindrical rolloff in the vertex modifier of the shader applied to the terrain (crude example attached!):
     
    Aubrey-Falconer and Wavinator like this.
  22. Wavinator

    Wavinator

    Joined:
    Dec 24, 2013
    Posts:
    79
    If there was a way to project noise spherically I could see using MapMagic to make a planet with a shader (Curved World may be a good candidate).

    Libnoise allows conforming noise to a sphere, but I don't know what MapMagic would need to do to accomplish something similar. The main problem is joining noise at the hemispherical seam and what to do at the poles.
    http://libnoise.sourceforge.net/tutorials/tutorial8.html
     
  23. tanoshimi

    tanoshimi

    Joined:
    May 21, 2013
    Posts:
    297
    I don't think you need to worry about spherical noise projection - you could just use a seamless 2D noise texture that repeats with the periodicity of your mapmagic tiles.

    The terrain itself is not curved at all - it is just warped that way in the shader so there's no issue at the poles of hemisphere boundary.

    Then, to make it possible to walk all the way around the surface and back to where you started you need a little scripting that says, roughly "if distance from origin > one whole terrain chunk, move player one whole terrain chunk back towards origin". Since the terrain repeats identically on each chunk, this would be seamless (from a terrain point of view, at least)
     
    Wavinator likes this.
  24. sammi32

    sammi32

    Joined:
    Feb 19, 2014
    Posts:
    16
    hi,

    can i import a extern splat and then yes, how?

    and for the future, is there a way to export colormap and normalmap, for rtp?

    I love Map Magic ist the best Terrain Editor great Job :)

    thank you and best regards
     
  25. Reaven99

    Reaven99

    Joined:
    Oct 3, 2015
    Posts:
    39
    Hello everyone,
    Is there a forum or a git or something similar to share presets that have been made with the asset?

    Big thanks in advance!
     
  26. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    Trying to find how to alter the preset resolution settings so I don't have to conform to 512... anyone know the answer?

    found it in MapMagicEditor.cs line 23
    public enum Pots { _64=64, _128=128, _256=256, _512=512, _1024=1024, _2048=2048, _4096=4096 };

    edit: MM seems incapable of dealing with just changing that though.. various other terrain settings like size are not following along... working on it..

    meh I'm stupid.. I was thinking of "power of 2" as "multiple of 2"... 500 is impossible with basic unity terrains
     
    Last edited: Jan 7, 2017
  27. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,274
    sammi32, you can use Texture Input or Raw Input generators to import external maps. To export maps to RTP it's better use RTP Output.

    Reaven99, feel free to publish your presets here or make your own repository. I'm thinking of making some hub for third-party generators - guess presets could be stored there too - but I'll get on it after the Voxeland integration.
     
  28. Mazak

    Mazak

    Joined:
    Mar 24, 2013
    Posts:
    226
  29. Twoonebe

    Twoonebe

    Joined:
    Mar 30, 2013
    Posts:
    174
  30. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
  31. FelixWun

    FelixWun

    Joined:
    Aug 10, 2013
    Posts:
    2
    Hey there, Map Magic noob here. Really enjoyng playing around with it so far :). It's incerdible how little time it takes to create very nice looking terrain using this tool.
    I was just wondering, is it possible to place objects based on elevation? For example, I have an island and I'd like to place certain objects (driftwood, shells, stones etc) only on the beaches above tide level. Is there a way to do this using Map Magic? I've tried using the sand texture as a mask, but that still results in a good chunk of the objects being placed under water.

    Thanks,
    Felix.
     
  32. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,274
    Thanks!
    You can use a Curve generator for that. Input a heightmap and modify it with something like this:
    CurveHeightSelector.png
     
  33. FelixWun

    FelixWun

    Joined:
    Aug 10, 2013
    Posts:
    2
    Perfect! Thanks I didn't think of that at all :rolleyes:
     
  34. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    couldn't get RTP output to work, it was just rendering everything pure white.

    It was an RTP updating problem with 5.5
    If you delete the Relief Pack entirely from your project, update and reimport it works fine.

    does anyone experience problems with the basemap distance turning things super dark?
    I changed the max setting in MapMagicEditor.cs:400 to 10,000 to counteract this.
    I've seen Thomas of RTP say that basemap distance is set very high in RTP because it never renders everything inside the high-quality map

    I'm constantly getting this error:
    Left neighbor of the terrain has a different heightmap resolution. Stop neighboring.
    UnityEditor.DockArea:OnGUI()
    ???
     
    Last edited: Jan 14, 2017
  35. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,274
    Standard Unity terrain base map distance is limited to 2000. I don't know what will happen if you will use MM to override it to 10 000, but since you've got an error I guess this limitation is not for nothing. Usually 2K distance is further than camera far plane, so increasing it doesn't make sense in most cases.
     
  36. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    my camera far plane goes up to 4-5,000.. I guess that means I don't need 10,000 =0
    it seems to be working fine, though.
     
  37. Quatum1000

    Quatum1000

    Joined:
    Oct 5, 2014
    Posts:
    889
    Hi Denis,

    would it be possible to generate an area previously, lets say 25 terrains with about (800m each) in square completely and only load the already created on requirement?

    I do not require an infinity area because of the far distance cam and object jitter above 9999.999 meters float accuracy restriction. I thinks is a lot faster to load only than procedurally create at runtime for none infinity scenes.
    Thank you.
     
  38. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    @Quatum1000 I do everything procedural so I'm not experienced with that, but I think if you turn off "generate infinite terrains", and use the "hide out-of-range terrains" options it will do what you're looking for.
     
  39. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    One thing I'm noticing should be fixed... we have the option to "Copy components to terrains" but if we use RTP it copies RTP onto all of them and then complains we shouldn't be doing that. I need to add scripts to my terrains as they come in and so am using that option. Perhaps if MM recognized RTP doesn't need to be copied it would be better.
     
  40. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,274
    Quatum1000, well, you can try setting "Generate Range" to 10000 (800*25/2) and "Enable Range" to 1000 (for instance), but I suppose that the scene will consume too much memory. What is the reason to do that when generating happens in the background anyways?
    BTW nice trick with a fly, haven't seen it before

    malkere, it's not possible to copy components when using RTP Output. I will try to see what I can do with that. The problem is that there is no ReliefTerrain class in Unity out of the box, and I cannot make MM ignore this component since it does not exist, but I guess it could be solved with reflection.
     
    Last edited: Jan 15, 2017
    malkere likes this.
  41. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    I'm sure a smarter person than myself would just use the oncompletion voids to add any necessary scripts/components, I don't fully understand how those are supposed to work yet XD
     
  42. marnoch

    marnoch

    Joined:
    Nov 18, 2009
    Posts:
    5
    Has anyone tried using MM with Unistorm weather system? Seems like it should work ok but not sure with the infinite loading terrain.
     
  43. Wavinator

    Wavinator

    Joined:
    Dec 24, 2013
    Posts:
    79
    I did some basic testing & got the default Unistorm setup to work fairly easily with the floating point origin code from Unity wiki

    http://wiki.unity3d.com/index.php?title=Floating_Origin

    I've tested with walking and driving a vehicle, expecting maybe framerate drops or hitches but it works transparently. (Without it, of course, you eventually move to the edge of the Unistorm skydome)
     
  44. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    I've got multiple MM systems running in a single scene, using Load and specifying the MapMagic.Instance. Only one at a time because of they way they're built.

    Still can't get a zero point reset to work without regenerating everything... Something to do with the camera/terrain distance calculations I'm not grasping...
     
    Twoonebe likes this.
  45. recon0303

    recon0303

    Joined:
    Apr 20, 2014
    Posts:
    1,634

    how long ago was this about InfiniGrass?? I use it for mobile even and its fine, performs fairly well... So not sure what happen, did you contact the developer?? I use SKY master, and all of his tools, and any issues I had was fixed really fast...Also InfiniGrass 2 is coming any day..

    I do export out of MM, and use World Streamer for the streaming aspect.So could be related to this with those assets maybe?? I dunno , I do not use MM to stream at all..
     
    Twoonebe likes this.
  46. recon0303

    recon0303

    Joined:
    Apr 20, 2014
    Posts:
    1,634
    I use SKY master and have used UniStorm, I like SkY master better, but both where fine... BUT I only used MM to make the terrain, I exported them out and used World Streamer to Stream a larger terrain. I even use it for large mobile games.
     
  47. Reaven99

    Reaven99

    Joined:
    Oct 3, 2015
    Posts:
    39
  48. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    @Reaven99 RTP support is built in, like it says on the store page and just a few comments up in this thread =O
    Maybe you should look for your answer a little <3
     
  49. Reaven99

    Reaven99

    Joined:
    Oct 3, 2015
    Posts:
    39
    Thank you for the reply, i know RTP is supported yes i could have left that one out haha.
    But are there more shaders supported?
     
  50. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    Well, really, MapMagic just alters basic unity terrains. Just like if you put in a new terrain, changed the heightmap, painted it, added grass, added trees, by hand. It just does that through scripting for you. So any shader that works for a unity terrain should work with mapmagic. If you are running things in runtime, like infinite generation, there could be some hiccups, but there should definitely be a way to get them to work. If you are not using infinite generation then you can just generate the terrains and delete MapMagic from your scene or even project entirely.
    The screen shot I posted yesterday or the day before was using RTP3.3 btw.