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. Lurking-Ninja

    Lurking-Ninja

    Joined:
    Jan 20, 2015
    Posts:
    4,645
    It's just the way it works, you either pay for it or pay for it with advertisement.
    But alternatively you can use Google Sites if you have a Google Account. https://sites.google.com/
    It's simple, you can edit the pages visually, even you can embed docs and presentations and youtube videos easily, etc.

    And your page will be available on the https://sites.google.com/view/[YOUR_CHOSEN_PAGE_NAME_GOES_HERE] URL without ads (as far as I know).
    But I'm not sure about the license, you should read it before you use it (business-related usage).
     
  2. Mazak

    Mazak

    Joined:
    Mar 24, 2013
    Posts:
    222
    VERY NICE!

    Thanks
     
  3. stigmamax

    stigmamax

    Joined:
    Jun 30, 2014
    Posts:
    62
    I knew portal. My question was : where is generated "Height to Village" ??
     
  4. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,121
    Has there been any success using MapMagic runtime generated terrains with MegaSplat? IE: zero terrain data in the editor. I can setup the MegaSplat integration prior to runtime, specify the shader as custom/MegaSplat in MapMagic, and textures will apply on runtime generation, yes?
     
  5. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,674
    stigmamax, It's just a portal replacing a final height output in demo scene. You will have to create an input Portal and connect it to the same output demo's Height Out connected.
    malkere, almost it, but you will have to use MegaSplat output generator instead of Textures one.
    BTW both MegaSplat and RTP generators are now available out-of-the-box, you will not have to download and install anything.
     
    Mazak likes this.
  6. Mazak

    Mazak

    Joined:
    Mar 24, 2013
    Posts:
    222
    Wright, Which do you like better?
     
  7. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,674
    Well, it depends. If you are going to use more than 8 land texture sets consider using MegaSplat, but RTP has the better visual result of blending 3+ channels in one place. Personally I would prefer working with MegaSplat, I find RTP a bit over-complicated.
     
  8. stigmamax

    stigmamax

    Joined:
    Jun 30, 2014
    Posts:
    62
    Sorry but I do not understand how to make a flat area.
     
    Last edited: May 2, 2017
  9. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,121
    Agreed. I'm looking to use lots of textures as well.

    What I'm concerned with is the runtime generation aspect. Do you notice it adding to the generation time with the conversion from MapMagic to MegaSplat? Or is not something really noticeable?
     
  10. trilobyteme

    trilobyteme

    Joined:
    Nov 18, 2016
    Posts:
    303
    I'm starting to get some good results using MapMagic and RTP together, but in order to enable tessellation I need to "Prepare Height & Normal Texture for Tessellation" via menu option in Relief Terrain Pack tools. This function requires me to specify source terrain data, as seen below:

    RTP_HN_Map.png

    Problem is, the MapMagic terrain data does not show anything:

    MM_TerrainData.png

    Is it possible to export MapMagic data into something that I can use with RTP to enable tessellation?
     
  11. Dorian-Dowse

    Dorian-Dowse

    Joined:
    Jun 2, 2016
    Posts:
    94
    RTP Problem. I've locked my terrain to do some hand editing using the Unity terrain tools. While I can edit trees and grass, I can't edit textures. There are no textures attached to the terrain. The RTP component is on the MapMagic parent and Unity's terrain system can't access it. I tried copying RTP down to the terrain, but it wiped all the textures back to base.

    How can I hand edit RTP textures in Map Magic?
     
  12. KIR99

    KIR99

    Joined:
    Feb 21, 2017
    Posts:
    19
    Hey there,

    I ran into a simular issue regarding MapMagic + Relief Terrain Pack and Crux AI Spawner,

    With Crux, it's designed to read terrain textures straight off the terrain. With M.M. + RTP all of the textures are gone from the terrain object (rendering no spawning) when there is visible terrain textures on the terrain, is there any way i can apply the mapmagic textures right into the terrain objects in order for Crux to read?

    Any help would be appreciated, thanks! :)
     
  13. trilobyteme

    trilobyteme

    Joined:
    Nov 18, 2016
    Posts:
    303
    I'm curious about that as well, I would like to hand paint a pathway texture to wander through a woods.
     
  14. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,674
    trilobyteme, you can export terrain data to asset file using this editor function:

    Code (CSharp):
    1.  
    2.        void ExportTerrainData (Terrain terrain)
    3.        {
    4.            if (!export) return;
    5.            export = false;
    6.  
    7.            string path= UnityEditor.EditorUtility.SaveFilePanel(
    8.                "Save Terrain as Unity Asset",
    9.                "Assets",
    10.                "ExportedTerrain.asset",
    11.                "asset");
    12.            if (path!=null && path.Length!=0)
    13.            {
    14.                path = path.Replace(Application.dataPath, "Assets");
    15.  
    16.                Terrain terrain = GetComponent<Terrain>();
    17.                float[,,] splats = terrain.terrainData.GetAlphamaps(0,0,terrain.terrainData.alphamapResolution, terrain.terrainData.alphamapResolution);
    18.  
    19.                UnityEditor.AssetDatabase.CreateAsset(terrain.terrainData, path);
    20.                terrain.terrainData.SetAlphamaps(0,0,splats);
    21.                UnityEditor.AssetDatabase.SaveAssets();
    22.            }
    23.        }

    Note that somehow just exporting with CreateAsset removes splat map information, but this code has already a workaround for that. This script downloaded here: https://www.dropbox.com/s/tnb3v1s6r5h1ss0/ExportTerrainData.cs?dl=0

    Just assign it to the terrain object and press "export" - it works like a button.

    MapMagic 1.8 will have this functionality built-in, terrain will be exported with a button next to the Lock.

    Dorian-Dowse, KIR99, RTP uses a special textures called control maps instead of terrain splatmap information, so MapMagic does not generate or assign terrain splatmap data in RTP Output - just to avoid unnecessary calculations, it does not duplicate the Texture Output work.
    If you still need terrain's splatmap you should use Texture Output along with a RTP Output. However
    I'm not sure if it is possible in 1.7, but it will work in 1.8.
    Hold on, it will be released this week.
     
  15. trilobyteme

    trilobyteme

    Joined:
    Nov 18, 2016
    Posts:
    303
    If I copy/paste the above into a new C# script called ExportTerrain.cs (saved in MapMagic/Scripts folder), I get this hard error:

    Assets/MapMagic/Demo/Scripts/ExportTerrain.cs(2,0): error CS1525: Unexpected symbol `void'

    But going to the dropbox URL and saving the ExportTerrainData.cs file and importing into my project worked... sort of. It drags onto the terrain object and shows the export checkbox. When I check it, I am prompted for a save location/name. After I click that, Unity 5.6.0p3 crashes completely.

    When I restart Unity, it appears that the file was created. So I go through the RTP steps to create and save the file, turn on tessellation and then apply the file... but the terrain is scaled improperly to a height of 300 (my MapMagic settings are a max height of 200m). Manually changing to 200 in the Relief Terrain panel appears to fix it - I'm not sure if it just didn't save my MMWG value because it crashed while creating the file, or if the export process just assumes the default max height instead of what is entered in the MapMagic settings.

    Hooray for the feature becoming built-in with MapMagic 1.8!
     
  16. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    785
    Hi, I have a question here:
    I want to use different ambient sounds for different biomes, and enable ocean's wave sound procedurally due to player's location.
    I think I can use my island mask generated by noise node in MM, if I can output the result with X & Z axis info into my own scripts. Donno how to do it, any suggestions?
     
  17. KIR99

    KIR99

    Joined:
    Feb 21, 2017
    Posts:
    19


    I can confirm that you are able to ride a texture output behind the RTP output and it worked for me completely fine. :) With the terrain texture output connected to RTP's output (via same texture) it's able to take that terrain texture data and apply it to the terrain object which then Crux is easily able to read it!

    Thank you so much for the suggestion, you saved the day! :D
     

    Attached Files:

  18. Kev00

    Kev00

    Joined:
    Dec 6, 2016
    Posts:
    178
    Hi

    I have a few questions about this asset.

    Firstly, my rpg game has a need for a zoomed out auto generated world map. So I'm looking for an asset that looks great from a distance.

    At the moment, my game is using a hexmap that is basically a grid that overlays on top of a unity terrain. Each hex defines the type of terrain that is underneath it. In addition, I'm generating this hexmap at runtime. I would like to use the hex map as a basis for the terrain generator. In other words, I want to create random terrain that matches what was generated in the hex map (above it) at run time.

    Alternatively, I can reverse this procedure and use the underlying terrain as a basis for the hex map. Of course, I would need some mechanism to determine what type of terrain is under a particular hex.

    I noticed that most of the functionally is editor based, but I'm wondering how much can be accessed in code. Is there any API documentation available? I'm assuming that I could configure most of the parameters/constraints for the world map in the editor and somehow have map magic auto generate a unique map at run time. Is this possible with map magic?

    Thanks.
     
  19. trilobyteme

    trilobyteme

    Joined:
    Nov 18, 2016
    Posts:
    303
    Watching further into the island tutorial, I saw the answer for painting paths... just lock the terrain and paint normally - excellent!

    I'm in the process of adding rocks to a scene now, and the tools all work really well. One question about the adjust node - the rotation adjust affects only one axis. Is there a way to be able to rotate on all three? For example, with my rocks and boulders, the models can all be rotated on any angle and still look good (as opposed to a tree or some other object).
     
    PeterB likes this.
  20. Dorian-Dowse

    Dorian-Dowse

    Joined:
    Jun 2, 2016
    Posts:
    94
    I found some time to do some testing with biome blending. Grass and textures blend fine, but trees don't.

    The first pic here shows a simple gradient blend of two biomes. Each biome has a scatter node plugged into a tree generator. The trees have a hard cut off at 50%.

    biomeBlending3.JPG

    The second pic shows the same blend but instead of a biome, the tree output is on the top level, and the texture output is plugged into the probability input of the scatter node. The trees blend nicely.

    biomeBlending4.JPG

    In conclusion, blending of biome trees is currently not working. The difference seems to be the probability input is not being addressed when in a biome.
     
  21. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,674
    Dorian-Dowse, that's what I've made for biome objects blending in 1.8:

    Objects could be blended in 4 different modes:
    • Sharp;
    • Additive Random;
    • Normalized Random;
    • Scale.
    The scene used for all of the images contains two biomes: "mountains" and "planes". Both biomes have absolutely the same scatter generator with the same seed ()however it's not mandatory), but different objects to output: pine tree for mountain and yellow birch for the plane.
    Scene.jpg

    Sharp
    Uses only a biome mask value to determine what object should be set. If biome mask value at object's coordinates is higher than 0.5 then the object is used, otherwise it is discarded. This results in a crisp biome look, and can conflict with a smoothly blended terrain textures, but gives a determined non-random control over objects placement and eliminates the chance to set two objects at the same coordinates.
    Sharp.jpg

    Additive Random
    This algorithm applies an object only if some random value (unique for an object coordinate) is higher than biome mask value.
    Additive.jpg

    Compared to Sharp mode this method has a drawback: it assumes that some objects can appear at the areas almost (but not 100%) filled with the other biome. It is okay if a pine will grow on a grass and birch will be placed in the mountains like it is shown on the image, but for some other objects it could be unacceptable. Consider using Sharp mode in these cases.

    Normalize Random
    When using the normalized biomes (i.e. the sum of all biome values at any coordinate is equal to 1) the effect is almost equal to Additive Random. But if biomes for some reason not normalized this mode will make sure that the objects density never exceeds a values set in biome generators. This will also remove spawning of a several objects in the same position. For instance, a new scatter generator was added atop of the biomes, and it uses the same seed and count values.
    SpheresNormalized.jpg

    Scale
    Changes the objects size depending on the biome values:
    ScaleDifferentSeed.jpg

    Some more information on wip wiki.

    trilobyteme, to rotate an object in 3 axis all of the object generators that change object transition like adjust or split should have 5 parameters. I still consider that it's very non-intuitive interface mess. Imagine working with split 3 rotation values. Mostly this is needed to rotate an object along a terrain normal, and this is the feature that will be included in 1.8 (with a toggle).

    Kev00, there is no hex generator out-of-the-box, but you can create your own: instructions. When you get familiar with custom generators I suppose you could take a Voronoi generator and modify it so it will produce hex grid instead of squares with uniformity 1. Just an idea, though.
    This hex generator could be used as a biome mask for different terrain styles.
     
    trilobyteme and Exbleative like this.
  22. Dorian-Dowse

    Dorian-Dowse

    Joined:
    Jun 2, 2016
    Posts:
    94
    That sounds fantastic. Looking forward to it.

    So these blend modes would apply equally to grass and textures?
     
  23. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,674
    Yes, Normalized Random mode blends objects between biomes similarly to Grass and Textures outputs.

    jessejarvis, just fixed it :) Pull the update!

    And since we a talking about 1.8 beta: are there beta testers with a Mac? Have you ever experienced this issue: context menu disappears after a second or two
     
  24. jessejarvis

    jessejarvis

    Joined:
    Aug 9, 2013
    Posts:
    286
    I experienced it on Windows. To be frank, it's refreshing the whole project constantly. And it detects all plugins (RTP specifically) when I don't have it installed. If I right click in the map magic editor window to try to choose an output or something, or even go to open Visual Studio, it refreshes and closes my context window or visual studio project.
     
  25. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,674
    Oh, so that's not the Repaint event! Pull the update, pull the update, it's fixed!
     
  26. jessejarvis

    jessejarvis

    Joined:
    Aug 9, 2013
    Posts:
    286
    But I am LAZY I don't wanna pull the update! Nah kidding. Pulling now.

    Edit: Awesome. Everything works great. Testing it now with stuff, I just did the first Voxelmap5/MapMagic YouTube tutorial and it's awesome. Hopefully you do those Objects/Grass tutorials soon :D I'd love to get some trees and such in there. I tried it myself but I must be missing something, never spawned any.
     
    Last edited: May 8, 2017
  27. ar333

    ar333

    Joined:
    Jul 26, 2014
    Posts:
    14
    Anyone know how to achieve this effect on the cliff layer using noise?
    Did it with grass but just cant get it to work on the cliff.
    http://imgur.com/a/8ZxLW
     
  28. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,674
    Hi all forum readers, I would like to draw your attention to a game one of the MapMagic users, Jay, is making: it's called Exo One and it's backing on Kickstarter now. Jay has made a video describing the using of MapMagic some might find helpful:
    You can find more in this post.

    I'm pretty sure that this project worth backing, and yep, I'm honored that MapMagic is used in projects like this one!


    ar333, could you please clarify what effect you are trying to achieve? Are you trying to make noise-masked sand atop of cliff texture?
     
    Exbleative and malkere like this.
  29. ar333

    ar333

    Joined:
    Jul 26, 2014
    Posts:
    14
    Just trying to use a noise mask to blend between 2 textures, this helps with tiling and creates a more random look for the terrain textures.
    Got it right with the grass but can't get it to work with the cliff.
     
  30. Dorian-Dowse

    Dorian-Dowse

    Joined:
    Jun 2, 2016
    Posts:
    94
    Getting close to finished. I thought I'd share my Editor screen. This is a recreation of precolonial Botany Bay in Sydney. MapMagicEditor_Kamay.JPG
     
  31. trilobyteme

    trilobyteme

    Joined:
    Nov 18, 2016
    Posts:
    303
    Wow, that looks pretty elaborate... and incredibly well organized. I look forward to seeing some pics from the finished project.
     
  32. Dorian-Dowse

    Dorian-Dowse

    Joined:
    Jun 2, 2016
    Posts:
    94
    Here's a pic of the Banksia scrub biome with the Wetland biome in the background. running.JPG
     
  33. trilobyteme

    trilobyteme

    Joined:
    Nov 18, 2016
    Posts:
    303
    That looks really nice, great work!
     
  34. gegebel

    gegebel

    Joined:
    Jan 29, 2014
    Posts:
    469
    Could someone show me how they managed to remove grass around trees ? I'm trying to use Stamp, but I'm not getting my head around how to configure it to work.
    I made a tree portal and set it as Positions in Stamp, now what do I put in Stamp and where does Output go ?
     
  35. Dwight_Everhart

    Dwight_Everhart

    Joined:
    May 11, 2014
    Posts:
    123
    @Dorian-Dowse Wow, very impressive work! Thanks for sharing.
     
  36. trilobyteme

    trilobyteme

    Joined:
    Nov 18, 2016
    Posts:
    303
    @gegebel I believe the node you want to look into is called Subtract. I believe it's covered in the manual, and also in the long island tutorial video.
     
  37. gegebel

    gegebel

    Joined:
    Jan 29, 2014
    Posts:
    469
    Substract works well with objects, it's of no use with grass as far as my tests went.
    Stamp also has substract, but no matter how I configure it, it's not working.
    A simple graph with only trees and the stamp would already help me a lot, but it seems either no one managed to do it, or no one cares to show how. I'm not sure which one is worse though.
     
  38. trilobyteme

    trilobyteme

    Joined:
    Nov 18, 2016
    Posts:
    303
    Ah, that may be possible, I don't use the flat plane billboard grass. Perhaps load the Island Tutorial demo scene and pick apart its node graph? I recall that having billboard grass and trees.
     
  39. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,674
    gegebel, you can use Blob Generator for that. It paints blobs under your objects, but being inverted that blob map could be used as a mask to remove grass:
    SubtractGrass.jpg
    Blend Generator looks slightly different now, just assign grass do default (additive) layer and blob mask to upper layer (and switch it's mode to subtract).

    Dorian-Dowse, that looks promising! Feel free to post more screenshots here!
     
  40. gegebel

    gegebel

    Joined:
    Jan 29, 2014
    Posts:
    469
    Thanks Wright, works like a charm. Just what I needed. In the other Thread you said to use Stamp and I didn't get it to work. Thanks again.
     
  41. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    785
    Hi, Wright.
    I'm using uNature with mapmagic, the author of uNature made it compatible with MM, but it requires the most recently version of MM, the asset store version is not compatible with uNature. I've sent you my order number and email address through PM, can you send me the new version?
     
    gegebel likes this.
  42. gegebel

    gegebel

    Joined:
    Jan 29, 2014
    Posts:
    469
    Could you tell me how well it works? I was looking for this solution too. Would be cool if you could give an update once you got both to work together.
     
  43. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,121
    still some bugs, but it's working fine. I plan to use it when both compatible versions are pushed to the store.
     
    gegebel likes this.
  44. gegebel

    gegebel

    Joined:
    Jan 29, 2014
    Posts:
    469
    How did you manage to actually keep the FPS up with many trees in sight in your game? I seem to have problem with tree colliders really hitting the FPS. Apparently there is no collider culling for trees. Or I didn't manage to make it work.
     
  45. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,121
    None of my trees have built-in colliders on them. A tree manager system, some which are on the asset store, will only load colliders around the player as necessary. I also use SpeedTrees which use LODs which only have colliders on the top level, so anything that is not at max res doesn't have a collider in game.
     
  46. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    785
    uNature uses pooling system to only show up to 15 colliders for the nearest trees (to your main camera), so this saved a lot of performance.
    uNature for now is not making any tree optimation, but the author said he will start to optimize the trees when current works are done.
    Now I'm planning to use altTrees system for tree optimization, but that asset is not compatible with mapmagic yet, it uses its own system for trees and tree placements, I think it may not be very difficult to write a new output node in MM to output trees data into altTrees system directly. This is only a theory by far, haven't tested it yet.
     
    malkere likes this.
  47. Dorian-Dowse

    Dorian-Dowse

    Joined:
    Jun 2, 2016
    Posts:
    94
    @Harekelas I've just bought uNature. I'll be looking at integrating it when the new MM version drops. I'm also keen to look at altTrees too. But MM integration would be a requirement.
     
    malkere likes this.
  48. trilobyteme

    trilobyteme

    Joined:
    Nov 18, 2016
    Posts:
    303
    I just got the notification that MapMagic 1.8 has been released - congratulations!!!!!

    I've been doing some testing with the beta version, and really love it. I am having a problem locking a MapMagic terrain so I can paint a path texture on it (using Unity 5.6.1f1 on a Mac), but hopefully that will be resolved soon.
     
    Last edited: May 16, 2017
    Exbleative likes this.
  49. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,674
    Yes, version 1.8 has been just released.

    It brings out-of-the-box compatibility with
    And here are some other new features and improvements:
    • New Noise Generator with turbulence and simplex algorithms;
    • World offset feature to prevent floating point issues;
    • New Objects Output blending modes between different biomes;
    • Built-in terrain data store feature (terrain data could be stored as standard .terrain file);
    • Automatically incline objects to terrain feature;
    • Random seed on playmode start feature;
    • Faster "Square Cells" and "Hex Cells" scatter algorithms;
    • Object Output now can preserve initial prefab scale and rotation values (useful for 90-degree rotated objects exported from 3DS Max);
    • All of the Legacy Generators could be created from a Legacy list;
    • Objects preview lag fixed;
    • Fixed aliased effect in stamp generator;
    • Generators are now stored alphabetically in Create list;
    trilobyteme, if you have no pin/lock/export frame displayed when clicking a button try resetting Unity layout.
     
  50. Exbleative

    Exbleative

    Joined:
    Jan 26, 2014
    Posts:
    204
    Amazing feature list, can't wait to try!! <3 Map Magic!
     
unityunity