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

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    Maybe you could disable the MapMagic script when you save?
     
  2. stigmamax

    stigmamax

    Joined:
    Jun 30, 2014
    Posts:
    312
    Hi Denis,
    Very strange behavior
    IslandTutorial Demo:
    Panel height:
    Node Erosion:
    if I increase sediment of 0.8 to 1, all the ground is under water.
    But when I reset it to its original value (0.8), it remains flattened!
    Why ?
     
  3. txarly

    txarly

    Joined:
    Apr 27, 2016
    Posts:
    197
    doesn´t work, still regenerates when i enable it in the new project.Any other idea?
     
  4. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    what if you turn off all the outputs in the graph editor by clicking the eye in the upper left before you save. Then even if it tries to regenerate there should be no updating of height/etc. ?
     
  5. stigmamax

    stigmamax

    Joined:
    Jun 30, 2014
    Posts:
    312
    The only solution is to reload the scene. It is not practical at all.
     
  6. txarly

    txarly

    Joined:
    Apr 27, 2016
    Posts:
    197
    thanks for the help, but doesn´t work, even disabling the eye(visibility).The terrain data seems to be created in runtime or don´t know how, the fact is that in the new project my terrains appear blank, so the only way is to regenerate them and this updates the manual editions.In other assets like Landscape Builder you can edit the terrains manually and there is an option to export only the terrain and depencies and objects inside them, creating a new blank project with the edited terrains so you can continue working on them .It would be nice to have a similar option in map magic,i don´t know if would be so difficult to implement.
     
  7. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    Ah.. I thought they were showing up for you before regenerating. In my experience if you remove the script, then reapply the script it doesn't recognize the terrains and creates new ones. I think it only saves the references with the scene.
     
  8. stigmamax

    stigmamax

    Joined:
    Jun 30, 2014
    Posts:
    312
    A other problem : The stones have no collider and this is not realistic. I added a mesh collider to the stones but we always pass through!
     
  9. tanoshimi

    tanoshimi

    Joined:
    May 21, 2013
    Posts:
    297
    @Wright - Do you have a list of known bugs? I'm getting the following after entering play mode with Debug mode enabled (which I like because it really helps to visualise the generate/remove distances), but I'm fairly sure it's been reported before so you might already know about it:

    Generate Thread Error:
    System.ArgumentException: An element with the same key already exists in the dictionary.
    at System.Collections.Generic.Dictionary`2[System.Type,System.Int64].Add (System.Type key, Int64 value) [0x0007e] in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/Dictionary.cs:404
    at MapMagic.Extensions.CheckAdd[Type,Int64] (System.Collections.Generic.Dictionary`2 dict, System.Type key, Int64 value, Boolean replace) [0x00025] in C:\Users\alast\Projects\Unity\NOME\Assets\MapMagic\Main\Extensions.cs:247
    at MapMagic.HeightOutput.Process (MapMagic.Chunk chunk) [0x0049b] in C:\Users\alast\Projects\Unity\NOME\Assets\MapMagic\Generators\OutputGenerators.cs:128
    at MapMagic.Chunk.ThreadFn () [0x00444] in C:\Users\alast\Projects\Unity\NOME\Assets\MapMagic\Main\Chunk.cs:293
    UnityEngine.Debug:LogError(Object)
    MapMagic.Chunk:ThreadFn() (at Assets/MapMagic/Main/Chunk.cs:301)
     
  10. tanoshimi

    tanoshimi

    Joined:
    May 21, 2013
    Posts:
    297
    Also (and this is another thing I'm sure I've seen mentioned), what's the cause/solution for differences in lighting along edges where terrain chunks meet? Like here - this is using Unity 5.6, latest MM, in a brand new scene with all default settings (single directional light):

    mm.png
     
  11. kilik128

    kilik128

    Joined:
    Jul 15, 2013
    Posts:
    909
    got black result on 5.6 with texture

     
  12. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,276
    makeshiftwings,
    I've got a better idea. I think I'll make a universal scripting output. It will not set any terrain data, but will call a static event with a Matrix (or texture) argument. If your script is listening to this event you can do absolutely anything with the map received with no need to write custom output. Output generators are much more complex that the standard ones, and they are mainly unique, so there could hardly be a template for them.

    txarly, You can export terrain data using the script from this post. It could be downloaded here. Just assign it to the terrain object and press "export" - it works like a button.
    I plan to make this script built-in in the next MapMagic version.

    stigmamax, I've just tried to reproduce sediment bug in MM beta and it seems that everything works fine. That's strange since I have not touched erosion, but I've checked several times.

    Speaking about the stone colliders - if you have assigned mesh collider in a prefab you should have it appeared on all of the stones automatically, MapMagic is not involved in that process. Have you assigned a mesh to mesh collider? Can you see green wire lines on stones objects when they are selected?

    stigmamax, tanoshimi, are you taking part in 1.8 beta? I like to see your bug reports, but it could be more helpful if you could find bugs in the upcoming version. Since it's about a matter of days for submitting it I plan to fix only the most urgent bugs in 1.7 and concentrate on 1.8.
    If you'd like to get access to beta please specify your forum name in a form.

    @all: since I've reached a maximum number of users for my Bitbucket plan I'm going to expunge all of inactive users who showed no activity. Unfortunately I cannot add everyone who sign a form to Bitbucket repository, but just 50 of you. Sorry folks :(
    Next time I will be using GitHub, seems there's no limitation on users count.

    kilik128, there's too little information to reproduce this issue. Were the terrains black when you created a new MapMagic object? I guess it's not an initial graph since you have textures assigned. When the terrain became black? Could you post your graph screenshot here? Does this happens in demo scenes? Is any terrain custom shader assigned?
    And odd thing that you have textures assigned, but still nothing displays. Do you have any lights in scene?
     
  13. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,350
    That sounds great. Basically I just want to be able to grab the map that's input into the node and then do something with it (generally convert it into an image and save it as a png or assign it to some component). In my case they all only need to happen after everything is done generating on the terrain and they don't directly affect the base terrain data.
     
  14. kilik128

    kilik128

    Joined:
    Jul 15, 2013
    Posts:
    909
    i found it's happen when curve got constant tangent
     
  15. tanoshimi

    tanoshimi

    Joined:
    May 21, 2013
    Posts:
    297
    I'm using v1.7, but have completed the form for 1.8 beta access as suggested. If that lets me submit/track active issues that would be brilliant, thanks @Wright!
     
  16. stigmamax

    stigmamax

    Joined:
    Jun 30, 2014
    Posts:
    312
    Denis,
    I have two questions :
    - Will the manual be updated?
    - Will there be videos tutorials for version 1.7 or 1.8
    Thanks
     
    tanoshimi likes this.
  17. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,276
    kilik128, well, I assume that strange things can happen when using a constant tangent because it internally sets tangent values to zero. I will check why clamping the value to 0.01f - 1f range does not work for 1.8.

    stigmamax, yes, I plan to make a wiki page with documentation for 1.8. Speaking about video tutorials - I doubt that I will record the new video from scratch, but I will edit the current one: change a fragment about blend generator and remove any mention about floor generator.
     
  18. the3dhermit

    the3dhermit

    Joined:
    Mar 25, 2014
    Posts:
    10
    Hi.I have a question. I already have 4 terrains with RTP asset on them, with all textures needed and tuned as I like. Hight, splat and color maps was generated in world machine.Can I use your tool just for grass and trees placement, based on my hight map or mb some kind of mask map, without messing something on my terrains?
     
  19. stigmamax

    stigmamax

    Joined:
    Jun 30, 2014
    Posts:
    312
    Hi,
    I have a hard time preventing grass or trees from growing on a texture. For example I put "Beach" for the bottom of the water and I do not want trees at the bottom of the water. What is the method to follow?
    thank you in advance
     
  20. Silvermurk

    Silvermurk

    Joined:
    Apr 29, 2016
    Posts:
    164
    Somewhy Reletive height stoped working after project re-opening.
    And i don`t seem to find a way to fix it(
    https://ibb.co/mqfUo5

    UPD Looks like it forgets the heightmaps.
    So unlinking raw input, linking noice and relinking raw input back in fixed it.
    But doing so on every restart is a little uneasy(
     
    Last edited: Apr 20, 2017
  21. Dorian-Dowse

    Dorian-Dowse

    Joined:
    Jun 2, 2016
    Posts:
    95
    I often get trees dropping down to zero height. I find hitting the "Force Generate All" button usually fixes it.
     
  22. Dorian-Dowse

    Dorian-Dowse

    Joined:
    Jun 2, 2016
    Posts:
    95
    I'm having an issue with blending biomes. I have a Mangrove biome with Mangrove speedtrees and Mangrove roots as a grass. The pics show the mask on the terrain with the trees cutting off hard at what looks to be about 50%, while the grass spreads out all the way to 0% and even into the pure red. It makes it had to manage biomes when the grass and the trees don't follow the same area.

    Ideally I'd like the tree density to drop off with the mask rather than a hard line, but I understand that MM might not work that way. It would be good if the trees and grass were consistent.

    I've had problems with rampart grass in general overlapping into other biomes. Need a lawnmower.

    BiomeBlending1.JPG BiomeBlending2.JPG
     
  23. tanoshimi

    tanoshimi

    Joined:
    May 21, 2013
    Posts:
    297
    It's your trees that look wrong rather than your grass, I'd say, but hard to tell. Can you post your MM graph? Have you tried blending two biomes - one pure grass and trees and one neither to see how they blend?
     
  24. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,276
    ttham, this is the feature that is often requested. Currently MapMagic generates all of the terrains from scratch, so there is no way to do it. I plan Heightmap, Splatmap and Objects Input nodes, but do not expect them in an upcoming update.

    Silvermurk, could you please paste a screenshot of your graph or mail me the scene (or graph data)?

    Dorian-Dowse, changing the trees/objects density gradually can result in appearing some objects where the biome mask probability is very low, but not zero. It will seem that these objects belong there by mistake. You've noticed the same situation with grass, but with the objects it will be even more noticable. I'm thinking about a special user-defined falloff for trees/objects or switchable gradual/sharp random, but it does not seem to be the elegant solution.
    To make grass follow the trees you should increase biome mask contrast using curve generator. However, this will make textures and height transitions more sharp too.
     
  25. Mazak

    Mazak

    Joined:
    Mar 24, 2013
    Posts:
    226
    GPU - are there any plans to covert MM to using the GPU?
     
  26. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,276
    What for? Performance reasons?

    I'd like to mention that not everything that run on GPU is automatically fast. I've made some experiments with the compute shaders and found out that it could be accelerated only with a flexibility loss - for instance, have to give up using multiple output connections. The reason I prefer multithreading to GPU calculations is that it fits dynamically generated infinite terrain better. GPU generating usually looks great in the editor, but in playmode, when GPU load is usually 100% it can squeeze graphics calculations and produce a some lag. While in most cases the processor cores are not so loaded (maybe except the main unity thread), which allows to use them almost unnoticeable.

    MapMagic uses multithreading instead, calculating all of the generators asynchronously in a several separate threads, and just applies final the result in a main thread. Calculating terrain is mostly fast (dozens milliseconds per generator per thread) except some generators like erosion, which can take up to several seconds. All the generating runs in a background and creates no lag in game.
     
    tanoshimi, malkere and ElroyUnity like this.
  27. Mazak

    Mazak

    Joined:
    Mar 24, 2013
    Posts:
    226
    That is what I wanted to know :)

    Thank you.
     
  28. Mazak

    Mazak

    Joined:
    Mar 24, 2013
    Posts:
    226
    Is there a way to generate the terrain surrounding the current one with a lower level of detail?

    IE: Current terrain is 2048x2048 height map, 1st terrain away (8 outside ones) 512x512hm, 2 terrains away 64x64hm

    This would help fill in the outside areas when my camera is above the terrain. This would also help me not force the outside of my terrain to be a mountain.
     
  29. RakNet

    RakNet

    Joined:
    Oct 9, 2013
    Posts:
    315
    Map Magic doesn't work with RTP plugin, when using Relief Terrain Pack v.3.3g

    1. Empty Scene
    2. 3D object / map magic
    3. In the inspector, click "Show Editor"
    4. Right click in the editor, click create / output / rtp
    5. Click "Perform All Automatically"

    Crash

    NullReferenceException: Object reference not set to an instance of an object
    ReliefTerrainEditor.PadTex (UnityEngine.Texture2D splat, Int32 padding, Boolean updateMips) (at Assets/ReliefPack/Editor/ReliefTerrain/ReliefTerrainEditor.cs:5394)
    ReliefTerrainEditor.PrepareAtlases (Int32 which) (at Assets/ReliefPack/Editor/ReliefTerrain/ReliefTerrainEditor.cs:5197)
    ReliefTerrainEditor.OnInspectorGUI () (at Assets/ReliefPack/Editor/ReliefTerrain/ReliefTerrainEditor.cs:260)
    UnityEditor.InspectorWindow.DrawEditor (UnityEditor.Editor editor, Int32 editorIndex, Boolean rebuildOptimizedGUIBlock, System.Boolean& showImportedObjectBarNext, UnityEngine.Rect& importedObjectBarRect) (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1236)
    UnityEditor.DockArea:OnGUI()
     
  30. rsklnkv

    rsklnkv

    Joined:
    Sep 8, 2012
    Posts:
    62
    Main reason is amount of parallel units available for parallelization
    We are constantly looking for TerrainComposer2 alternatives and MM workflow fits our needs way better than any other solution on the market (maybe except Houdini), but currently generation time on MM is 300x compared to TC2 (we did similarly looking terrain on both technologies). We need to have our 8k by 8k world (split by 4x4 sub-terrains) to be built in a reasonable time, but currently it's not possible with MM and rather fast with TC2 (takes couple of seconds for a whole world)

    EDIT: also, as I just verified - I'm not getting any significant boost from changing Max Threads from 2 to 4/8/32. CPU load remain same as well as calculation time
     
    Last edited: Apr 22, 2017
  31. stigmamax

    stigmamax

    Joined:
    Jun 30, 2014
    Posts:
    312
    Hi,
    I know that I can use "stamp" but I did not find an explanation or tutorial with an example. I just want to flatten a piece of land to put a house.
    Thanks for your help
     
  32. tanoshimi

    tanoshimi

    Joined:
    May 21, 2013
    Posts:
    297
    +1 for using multithreading rather than GPU. Most projects I've worked on have been GPU-bound as it is, and moving terrain generation onto the GPU too would certainly make performance worse!
     
  33. Silvermurk

    Silvermurk

    Joined:
    Apr 29, 2016
    Posts:
    164
    Maybe it, something that was answered before, but is there a way to make something grow "here"? mean at exactly one place, not the whole mask of whole map?)
    Or it suposed to be done with unity foilage paint tool?)
     
  34. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,276
    stigmamax, here, with this page I'm starting MapMagic Generators wiki. If you'd like to see practical example take a look at the village creation tutorial.

    BTW I'm goint to migrate to GitHub, but I must admit that I don't like GitHub wiki: public wikiы cannot be a part of private repository, and it's image features are poor (no thumbnails, full-size image cannot be shown by clicking on it). Neither I like google docs because of their low performance. It would be great if anybody could advise a handy web document hosting.

    Silvermurk, currently there is no way to determine that place. I have a plans to make some sort of "Input Generators" giving MapMagic the ability to modify already existing terrains, but still it's just a plan.
     
    slimshader and Dwight_Everhart like this.
  35. Dwight_Everhart

    Dwight_Everhart

    Joined:
    May 11, 2014
    Posts:
    123
    Thank you for creating the wiki! MapMagic's documentation is good, but I find learning how to use anything is much easier with examples. That's especially true for MapMagic's generators. I only wish I could see the full-sized images on the wiki. It's hard to read pictures of the graphs.
     
  36. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,276
    Yeah, the images are full size. You can view them by dragging in new tab in browser. But GitHub wiki does not allow them to be viewed just by clicking, an I must admit it's very inconvenient.
     
    Dwight_Everhart likes this.
  37. Dwight_Everhart

    Dwight_Everhart

    Joined:
    May 11, 2014
    Posts:
    123
    Oh, nice! That worked. Opening the images in a new tab allowed me to view them full size. Thanks!
     
  38. trilobyteme

    trilobyteme

    Joined:
    Nov 18, 2016
    Posts:
    309
    I'm just getting started with MMWG, and from what I can tell the RTP plugin only allows 4 textures. RTP is capable of 8 or even 12 textures on a terrain, is there a way to get the plugin to support the additional layers, or am I just restricted to using the first 4 with MapMagic?
     
  39. trilobyteme

    trilobyteme

    Joined:
    Nov 18, 2016
    Posts:
    309
    Scratch that, I'm making progress. It defaulted at only 4 textures even after I had added 8 to the first terrain, but after playing around in the MM panel a bit it's showing 8. I'm still having trouble getting the plugin to work, but that is almost certainly user error on my part (very new). I'll look through tutorials and previous pages and see what I can figure out.

    RTP issues aside, I am really loving this tool!
     
    Dwight_Everhart likes this.
  40. TrustBird

    TrustBird

    Joined:
    Apr 22, 2017
    Posts:
    2
    Good job :), i have one question how do i spawn a certain number of objects, for example want to insert one object in the entire map and / or one object on each of the separation.
     
  41. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    @Silvermurk @TrustBird To place something specifically is very easy in script. Wright or someone could write a generator to do that, but really if you're just trying to place something specific that's a line or two of code on any monobehavior. Would you like help doing it that way?
     
    TrustBird likes this.
  42. stigmamax

    stigmamax

    Joined:
    Jun 30, 2014
    Posts:
    312
    Denis,
    Flatten disappeared (I use version 1.7). I have to use stamp instead? But it has no curve!
    On the tutorial it is not explained how the Portal In (Height to village)
     
  43. Dorian-Dowse

    Dorian-Dowse

    Joined:
    Jun 2, 2016
    Posts:
    95
    I will do some experimenting soon. I've had a deadline so haven't had time. Just delivered my first MM based terrain and I'm pretty happy with the result.
     
  44. Dorian-Dowse

    Dorian-Dowse

    Joined:
    Jun 2, 2016
    Posts:
    95
    I have some questions about the RTP plugin.

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

    2. I'm using 8 textures. The bottom texture has no input and seems to be on by default. It ends up bleeding through all the textures. Is there a way to control this texture?
     
  45. trilobyteme

    trilobyteme

    Joined:
    Nov 18, 2016
    Posts:
    309
    The only tutorial I could find for MMWG and RTP was an older quick piece that Denis did on earlier versions of MapMagic (as well as RTP), between the slightly different UI and low resolution I had some trouble sorting it out, but eventually got there... and I got 8 layers working as well. I recorded a tutorial walking through the process in 1.71 (with RTP 3.3g) on higher resolution, hopefully it helps!

     
    Mazak and Wright like this.
  46. trilobyteme

    trilobyteme

    Joined:
    Nov 18, 2016
    Posts:
    309
    I'd like to request support for alttrees at some point down the road. I have been using Speedtree and love trees, bushes, and grasses I've been making, but found that when I used Speedtree grass it quickly overwhelmed Unity's terrain system and performance suffered. After converting the grasses and bushes to alttrees, I am back to getting excellent performance, but it requires brushing on the objects.
     
  47. Dorian-Dowse

    Dorian-Dowse

    Joined:
    Jun 2, 2016
    Posts:
    95
    Second that. Trees is my biggest limiting factor. I can't get the vegetation density I want with Speedtrees.
     
  48. trilobyteme

    trilobyteme

    Joined:
    Nov 18, 2016
    Posts:
    309
    You can get better performance out of your Speedtrees in Unity 5.4 and above with instancing. I discovered that getting that to work takes a bit more work than it seems. Not only do you need to untick 'bake light probes for trees' on your terrain settings, you also need to go into each tree, and each LOD setting, and then uncheck 'Use light probes' - then apply the settings. Once I did that, I was able to get results I was happy with on the trees themselves, but when it came to bushes and grasses, the density was just too much.

    I'm still right at the very basic part of learning to add objects and trees to my MMWG project (and just trying to wrap my head around biomes), I'll have to experiment to see what kind of density and performance I can get.
     
    Dwight_Everhart likes this.
  49. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,276
    Thanks! It looks nice, but it has such a drawback as ads. It's okay for the free service, though.

    stigmamax, take a look for the Flatten generator in the Objects list.
    You can find more about portals in the manual.

    trilobyteme, whow, thanks a lot for the video! It really explains everything far better than I can!
    As far as I know uNature supports trees too, and it is already integrated with MapMagic in beta. Anyways I wrote to AltTrees developer asking for voucher exchange.