Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    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. Sluta

    Sluta

    Joined:
    Aug 15, 2016
    Posts:
    42
    @Wright
    On official website Mapmagic written in Roadmap something like this:
    "- MapMagic as an editor tool: teach the plugin to work with already existing terrains. To scatter objects, to paint splatmaps according to terrain incline or cavity, to apply erosion, to plant terrains with grass, etc."

    Could you write about something more?
    I understand that it will not be possible, any switching between work in MapMagic and work with a standard tool Unity terrain. In that case, what it will involve?

    -----
    If you could, please explain also, how far reaching will be the integration MapMagic and Voxeland.

    thanks.
     
    Last edited: Oct 5, 2016
  2. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,821
    The upcoming version will have an RTP support (a special plugin required, it will be located here). I've submitted it for Unity review, so ETA is the matter of days.
    BTW it will not require RTP component on each of terrains, but just one and the only RTP component on the parent MM object.

    My bad, it's not the generator, it's just the connections split - and a couple of unnecesary generators. Instead of this:
    DemoClonesBefore.jpg

    adjust generators should be connected directly, this way:
    DemoClonesAfter.jpg

    In ideal case two adjust generators should be merged, but it's okay to use it this way.

    Imagine that you've done all the terrain sculpting work, and now want to paint terrain textures automatically using the slopes and cavity. You assign MM component, and set up the graph for painting textures using a special Height Input.
    The other use case - to plant forests around initial trees, or scatter detail objects using the Objects Input.
    Or remove grass under some manually placed houses :)

    I threw myself into a Voxeland refactoring - it is seriously requires an update - the last one was about a year ago. The new Voxeland version will get MM support and improved speed and visual quality - it will take some time, approximately two months or so.
     
    Dwight_Everhart and llJIMBOBll like this.
  3. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    576
    Appreciate this Thank you :D cant wait for update :D
     
  4. Dune2

    Dune2

    Joined:
    Sep 22, 2016
    Posts:
    38
    Auto Save MapMagic Nodes

    If you're like me, I'm tired (once is enough) of losing my Nodes data. If you're comfortable editing the MapMagic code see this Gist link for a fix. This change will need to be made to each project.

    It will save the nodes every time you Play a scene in that project to the ~Assets/MapMagic/NodeBackups That location can be changed in the AutoSave_MapMagicNodes file.

    If restoring a save, clear other nodes on editor and import, then click Force Generate All at the top.

    PS I emailed Denis about this. Hopefully he can integrate this into a future version.
     
    Last edited: Oct 6, 2016
  5. curly-brace

    curly-brace

    Joined:
    Sep 16, 2015
    Posts:
    11
    Hello,
    i'm using unity under linux and when i tried the demo, i've noticed that i'm unable to use the menu, because if i move mouse up/down, it changes the selected item on the main menu and on every opened submenu, even if pointer is located over the submenu. that makes me unable to create anything in the editor (except the first item in submenu :))

    i've tried searching this issue, but seems like it appears only under linux and windows users are happy with this great asset :D

    So i have no access to sources, because i have not purchased the asset (why purchasing if i could not use it o_O) and dunno really if you will be able to do something with it (dunno if it is a bug in linux version, or it is really some missusage of some (obsolete?) methods in you code, that create that problem under linux only)

    On the 5th page here i've found out that @ibyte had the same issue with the menu on windows 7. but it seems to disappear or what??
     
    Last edited: Oct 6, 2016
  6. tanoshimi

    tanoshimi

    Joined:
    May 21, 2013
    Posts:
    297
    @Wright - one downside of the fact that you've been spoiling us with lots of updates and new features to MM is that the documentation is now sadly behind - there's no mention of several generators - "Shore", "Blob", "Flatten" - for example, or how to use "Biomes", it still describes the old "Floor" method of adjusting objects to the terrain height, and the code example for custom generators at the bottom use incorrect function signatures.

    Are you planning to update after the latest version gets approved?
     
    pixelsteam and asilvas like this.
  7. cookimage

    cookimage

    Joined:
    Sep 10, 2012
    Posts:
    727
    Thanks that worked great ! Now I can work again! Love the asset.
     
  8. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,821
    v1.6 is out. Here is what it brings:
    • RTP support - with the additional plugin that could be downloaded here. Note that the plugin is still in beta version and has some minor drawbacks (mainly with preview). To use it unzip anywhere inside Assets folder, create RTP Output generator and follow instructions. I recommend you use the plugin with scenes with no RTP components assigned to let the RTP Output set up everything right automatically.
    • Terrain Remove Distance now is not equal to the Generate Distance. This helps to avoid a lag in case player wants to return back to the terrains he left - it will not make the terrains re-generate unless they leave the Remove Distance.
    • Map Normalize generator to create layered effect similar to the Texture Output;
    • Separate RAW Input data asset to improve serialization speed. This will remove the lag on loading big RAW images, but note that you will need to store the RAW Input generator data as a separate asset;
    • New Scatter algorithms: objects could be scattered using square or hexagonal cells - in addition to the true random scatter. This can create fast and uniform results, especially when working with high objects quantity;
    • Fixes: Stamp aliased effect, Height Output scale;

    tanoshimi
    , Yeah, I have to admit that documentation lack some of the new features. I plan to fill the gaps and migrate to wiki (as you can see google docs is very slow with the large documents).
     
    iddqd, Exbleative and malkere like this.
  9. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,156
    just because I didn't get it right away I'll add on the RTP note, it's a node, not a new game object. You add the generator in the MapMagic editor, and it will give instructions in there. To add the RTP element to the MapMagic object do addcomponant and search for engine. you want to add that, not the RTP_LOD_Manager

    also the instructions have a spelling error that says: "add the Instance Generator", but the script is called "Instant Generator"

    thanks for the update! playing with it now =D

    edit: also make sure you add the textures on the RTP script, not in the MapMagic editor or they will likely get changed to match the script when you click force generate.

    edit: the remove element, move up, and move down buttons on the normalizer do not seem to work.
     
    Last edited: Oct 7, 2016
  10. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,821
    Got it. But the script is called "Instant Updated", it's not the generator :)

    Just checked it out - it seems that there is no matter where you assign albedo textures - in RTP Output or RTP script. Did you create RTP manually or using RTP Output button? Do you have Instant Updater enabled?

    Confirmed, I'll fix that.
     
  11. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,156
    seems to be working now... I do have the instant updated enabled.
    The textures get messed up I found when you delete the terrains manually and repin them.

    I've had some problems trying to select a specific terrain, alter it's RTP settings, and click "Refresh All" seems to mess things up. Works when you stick to the parent though so far... Also saving a RTP Preset on on of the terrains won't load on the parent (MapMagic) because that is basing it's settings on MeshRenderer, whereas the terrains are Terrains....

    If I stick to the MapMagic instance only though it seems to work... still playing..
     
  12. iddqd

    iddqd

    Joined:
    Apr 14, 2012
    Posts:
    431
    Hey Denis - just wanted to say how much i appreciate your active development and steady updates on this amazing tool!
     
  13. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,156
    it wasn't doing this earlier... now I've got everything past the basemap distance rendering super dark... an old RTP problem..

    edit: seems to be interfering with the way RTP wants to use basemap settings. even with a fresh scene, fresh MapMagic terrain, as soon as I add RTP anything past the default 1000 basemap distance is super dark.
     
    Last edited: Oct 7, 2016
  14. asilvas

    asilvas

    Joined:
    Aug 10, 2016
    Posts:
    9
    @Wright I can't seem to compile 1.6 -- tried a fresh import but no luck.

    Code (CSharp):
    1. The name 'Profiler' does not exist in the current context
    Not sure where Profiler is suppose to come from, Unity or MM?
     
  15. Dune2

    Dune2

    Joined:
    Sep 22, 2016
    Posts:
    38
    Having fun with this. Thanks for this great asset.

    Question, I have these red crystals popping out of my terrain. Anyone know how to make them appear to be translucent crystals / red glass?

     
  16. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,156
    there are free crystal shaders on the asset store
    here's one: https://www.assetstore.unity3d.com/en/#!/content/3
     
  17. magicbananna

    magicbananna

    Joined:
    May 9, 2013
    Posts:
    21
    any luck with this yet mate. I cant seem to figgure it out either
     
  18. tanoshimi

    tanoshimi

    Joined:
    May 21, 2013
    Posts:
    297
    @Wright - A small feature request, please - it would be nice if adding the collider component to generated terrains could be made optional (a simple "Generate Terrain Collider" checkbox would be great).

    Currently, there seems to be no way to avoid colliders being created when new terrains are generated. This means, if you don't need the terrain collider (say you're generating distant terrains which can never be reached or, as in our case, you're adding your own custom collision mesh to terrains), the first thing you have to do in to remove the collider - using a lot of unnecessary CPU. Thanks!
     
    asilvas likes this.
  19. asilvas

    asilvas

    Joined:
    Aug 10, 2016
    Posts:
    9
    No luck (though I'm working around it by commenting out the dozens of Profiler references). I'm using the latest beta version of Unity, so not sure if it's related, or if something is missing from 1.6 to allow it to compile. Is anyone using 1.6 successfully?
     
    Last edited: Oct 8, 2016
  20. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,821
    Aha, maybe that is the reason. I cannot guarantee it working with all the Unity Betas, but I will install Unity 5.5 B6 and see if I can reproduce an error.

    Edit: here is what 5.5 B6 changelog says:
    "Profiler class moved from UnityEngine namespace to UnityEngine.Profiling"
    So MMWG is not compatible with Unity Beta 5.5 B6 (B5 should be okay).
    There is a quick fix, though: add "using UnityEngine.Profiling" as a first line in Chunk.cs, Generator.cs and MapMagicWindow.cs.

    Got it.

    Dune2, imho it's better to use objects (with Object Output generator) than terrain spikes to create those red crystals.
     
    Last edited: Oct 8, 2016
    asilvas and Dune2 like this.
  21. BigYetti

    BigYetti

    Joined:
    Apr 11, 2015
    Posts:
    26
    Using a single tile with MapMagic, say I have everything the way I want it. Terrain, erosion, textures, trees, grass, rocks, everything. And I don't want to do any further procedural generation. Is it possible to save off the terrain and all the trees and grass and rocks, and textures, etc, and remove the MapMagic? Or must I keep the MapMagic in the project permanently?

    Thank you....
     
  22. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,156
    I remove MapMagic all the time. You just remove the script and nothing changes. If you want to add it back on I find that it doesn't recognize the old terrains, do I delete them, and just repin and it regenerates them anew. You can just disable the script if you want too. You can save the MapMagic data to an asset, release it, and then go back to it later if you made changes you end up not liking, etc.
     
    Chris_Payne_QS likes this.
  23. Stanchion

    Stanchion

    Joined:
    Sep 30, 2014
    Posts:
    268
    I am getting the error "No Main Camera to deploy MapMagic" when I have "Generate Terrain Markers" around Main Camera disabled, why is this?
     
  24. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,156
    I'm getting:
    Invalid editor window MapMagic.MapMagicWindow
    UnityEditor.EditorApplicationLayout:FinalizePlaymodeLayout()
    when I try to "Maximize on Play" the Game view in a scene that does not have MapMagic in it, though MapMagic is in the project. I also do not have the MapMagic Editor tab open anywhere. ?
     
  25. Sluta

    Sluta

    Joined:
    Aug 15, 2016
    Posts:
    42
    Improperly I formulated the question :)
    I'm interested in how to combine functions MapMagic and Voxeland. For example: What in result of this integration can be done, with both packages together.
     
  26. BigYetti

    BigYetti

    Joined:
    Apr 11, 2015
    Posts:
    26
    Thanks @malkere
     
    malkere likes this.
  27. ibyte

    ibyte

    Joined:
    Aug 14, 2009
    Posts:
    969
    Anyone successfully convert a png to raw file in gimp for use with Map Magic? If so what gimp settings did you use? I have gimp 2.8.18
     
  28. Matro

    Matro

    Joined:
    Mar 15, 2013
    Posts:
    38
    When I import a raw from PS their is an issue with the tile not being snapped to the grid so it is not really at 0,0,0 it must be some kind of offset.
     

    Attached Files:

  29. ibyte

    ibyte

    Joined:
    Aug 14, 2009
    Posts:
    969
    What are the acceptable types of textures for the Texture Input node?
     
  30. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,821
    You can use any texture Unity can import. Just make sure that "Read/Write Enabled" is turned on in texture import settings (Advanced type).

    Matro, I don't really see the offset: MM object is located at 0,0,0, and, judging by the pivot position the heightmap is applied to the chunk 0,0 (the default pinned chunk). Where do you expect it to be?

    Sluta, you will be able to generate the same landscape, but it will be applied to the Voxeland object instead of Unity terrains. It will create different types of blocks using the "layered" heightmaps - i.e. a separate heightmap for bedrock layer, the other one for the ground, then there could be cliff again to add stones laying on the ground, etc. so it will be a kind of layered cake. The objects will be placed using Voxeland object type blocks. But MM will not utilize all of the Voxeland functionality - do not expect hanging cliffs, caves or flying islands - at least in the first iteration.

    Does this error occurs when you hit "Maximize on play" button, or when entering a playmode? Could you please send me the full error code?

    BigYetti, you can disable or completely remove the MM component and exclude it from build - the pinned terrains and all the objects are saved to scene and do not require it.
     
  31. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,156
    it doesn't seem to be doing it anymore... it was when I clicked Play (ctrl+p) while "maximize on play" was selected. I'll send you the full code if I see it again.
     
  32. antoripa

    antoripa

    Joined:
    Oct 19, 2015
    Posts:
    1,163
    Hi,
    I need help to spawn POI on runtime. Is there any example ?
     
  33. Stanchion

    Stanchion

    Joined:
    Sep 30, 2014
    Posts:
    268
    @Wright I am getting the error "No Main Camera to deploy MapMagic" when I have "Generate Terrain Markers" around Main Camera disabled, why is this?
     
  34. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,821
    Do you have both camera and "objects tagged" disabled, or "objects tagged" is enabled and some tag is selected? In first case you just have no camera to generate terrain around.

    You can spawn POI the same way as the other objects - using the scatter and objects output. What kind of POI would you like to spawn?
     
  35. Stanchion

    Stanchion

    Joined:
    Sep 30, 2014
    Posts:
    268
    @Wright I have camera disabled and objects tagged enabled with a tag selected.
     
  36. Dune2

    Dune2

    Joined:
    Sep 22, 2016
    Posts:
    38
    A few questions

    1) Getting "Lines" on my maps. Are there settings to adjust these? See screenshots below, you'll see horizontal and vertical lines where the terrains meet up.



    Adding an angle view, so the affected texture can be seen easily


    2) Also in the first image, the far left mountain has a flat top. How to fix these?

    3) How to keep terrain from blinking away. I've turned off "Hide Out-of-Range Terrains", but they still disappear. If I open up my map, as seen in the above images and scroll away from my player (and the player is on a generated map) then close the map, the player is falling through the world. The player's view uses the Main camera, and the Map another camera.
     
    Last edited: Oct 12, 2016
  37. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,156
    I have grass colors drastically changing at terrain lines as well.

    @Dune2 you're using the map camera to generate new terrains as you scroll the map? I can image that would turn the terrain your player is on if you scrolled to far away. "Hide out-of-range terrains" is one thing, but what is your remove range under the general settings?
    have you tried tagging the map camera and using generate around tags with it? I haven't personally.
     
  38. Dune2

    Dune2

    Joined:
    Sep 22, 2016
    Posts:
    38
    @malkere Hm, I tagged generate around "Player" and the player stays put - yay. I think the generate around "main" camera is a misnomer. Because my map camera is untagged.
     
  39. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,156
    @Dune2 there might be something underlying that is changing the Camera.main depending on how you are switching between them. I'm no expert, but maybe turning off the player camera and turning on another makes the engine automatically assume it is the main camera? or something along those lines.
     
  40. Matro

    Matro

    Joined:
    Mar 15, 2013
    Posts:
    38
    Here is a better screenshot of the offset, I did figure it out the offset was caused by my not paying attention to the tutorial that black is zero and white is one so my tile started at gray not black. All is better now, I hope that if someone else makes this mistake they will see the solution.
     

    Attached Files:

  41. Dune2

    Dune2

    Joined:
    Sep 22, 2016
    Posts:
    38
    Help with flat top terrain?

    I'm getting my terrain clipped at the top.

     
  42. Dune2

    Dune2

    Joined:
    Sep 22, 2016
    Posts:
    38
    That's really beautiful terrain, but I guess it had to go to get rid of those heights. I decreased intensity on the slope generator to get rid of the clipped tops.

    I made a Biome of my two terrains, but it isn't quite what I had thought it would be. I was hoping to stitch my terrains together with the Biome.

    How do you go about stitching different Biome's together? I really like this asset, but I don't want all my terrains to be a duplication. I was thinking Biome's would be like the following, they filling in the white between terrains.



    I'm sure this is a feature request.

    What have other people done?
    - Zone line / teleports between scene's?
    - Use a terrain stitcher from the asset shop?
     
  43. Tiny-Tree

    Tiny-Tree

    Joined:
    Dec 26, 2012
    Posts:
    1,314
    is 1.6 demos compatible with 5,4 ? when i open both 2 demo scene unity crash immediatly
     
  44. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,156
    @Dune2 the tops are caused by your height reaching the maximum terrain height before the noise height reaches it's maximum. So your terrain height is say 1000, but your noise is reaching 1000 at 0.8. Then everything between 0.8-1.0 just gets capped at 1000. If you increase your terrain to say 1250 and reduce your noise intensity from 1.0 to 0.8 you would keep the same terrain shape, but lose the mountain tops.

    Biomes are mixed together with a noise and curve usually so you've got 100% Biome A 0.0-0.4, you blend between biomes 0.4-0.6 and then have 100% Biome B 0.6-1.0 If you don't use a big noise thoise you can have heightmap A go from 0 to heightmap B at 1000 in just a few steps. In the video demo Denis is using 5000 units (5km) to blend the three biomes which are all not very steep.

    So you're map, the white spaces would be blending between grey and green in the white parts, but the biomes themselves are the grey and green.
     
    Wright and pixelsteam like this.
  45. pixelsteam

    pixelsteam

    Joined:
    May 1, 2009
    Posts:
    924
    Love this asset but... I would love to see a more detailed video breakdown of the biome aspect.
     
  46. docsavage

    docsavage

    Joined:
    Jun 20, 2014
    Posts:
    1,003
    Hi @Damien-Delmarle,

    I just tried it with 5.4.2f1 (just updated). Both demo scenes work fine. Using windows 10 64bit.

    doc
     
  47. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,156
    It's really just that an entire node graph with all it's outputs can be saved as a project resource. those resources can then be used as a single node on a new graph letting you condense all your trees/textures/grass and everything into a single point. Then you can mix and match those points with noises, map, or whatever.
     
    Wright and pixelsteam like this.
  48. pixelsteam

    pixelsteam

    Joined:
    May 1, 2009
    Posts:
    924
    Thank you Malkere!!!
     
    malkere likes this.
  49. BigYetti

    BigYetti

    Joined:
    Apr 11, 2015
    Posts:
    26
    julianr and pixelsteam like this.
  50. Crossway

    Crossway

    Joined:
    May 24, 2016
    Posts:
    420
    Can you please help me with something? I have a 25 tiles terrain and it's surround by ocean, so I need to flat the borders of my terrains! but I can't figure out how that is possible?
     
unityunity