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

    skipw20

    Joined:
    Nov 5, 2015
    Posts:
    4
    That's good to know - I'll avoid using the blur tool and just move right along.
     
  2. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,657
    tanoshimi, unfortunately there is no way to call generate function for some area or vector3 in current version - and no easy way to add it - but it will be possible in the upcoming version. This feature was needed to make mm work with Voxeland, and I've got to turn it all upside down for that - it took plenty of time, but now it seems to work. It will be possible to call generate function for some tiny area once a minute (for instance), and read map values from results dictionary<generator,matrix>

    RandomDevil, Im not very experienced with RTP, it seemed to me that it can support up to 8 textures, but I might be wrong. I will check it out when get back to my PC.

    Thanks for the hint, l think I'll add GIMP data support with inverting out of the box.

    yrucrem, you can try using flatten generator along with a stamp with rectangular simple form source. Unfortunately I cannot create a graph example now, but try to describe a way to do it:
    - Simple Form generator is set to pyramid mode and tile wrap
    - It's output is adjusted with curve to get a square shape
    - this map is used as an input map for the stamp generator. Stamp object input is using the same node the flatten generator does
    - resulting map with stamps is used as a blend generator mask that combines flatten circles (with extended radius) and original height.
    I guess it all sounds confusing, but I cannot make a screenshot now )
     
    yrucrem and malkere like this.
  3. tanoshimi

    tanoshimi

    Joined:
    May 21, 2013
    Posts:
    292
    Thanks for the reply - that's good to know. For the time being, I've used a custom generator that simply places regularly-spaced prefabs across the terrain, each completely empty except for a simple member variable of the biome that created it.
    At runtime, I perform a FindObjectsOfType<TerrainMarker>() and look at the biome of the two closest markers. If they're the same, I'm definitely in that biome. If they're different , I blend between the two based on the relative distance to each marker. It works pretty well!
     
    malkere likes this.
  4. Black-Spirit

    Black-Spirit

    Joined:
    Sep 14, 2013
    Posts:
    56
    Hi Wright,which generator has this option. Cant seem to find it.

    I also have run into a bit of a problem. The moment I add a Network Identity to my player controller, map magic stops working.

    I get this

    NullReferenceException: Object reference not set to an instance of an object
    MapMagic.MapMagic.GetCamPoses (UnityEngine.Vector3[] camPoses) (at Assets/MapMagic/MapMagic.cs:302)
    MapMagic.MapMagic.Update () (at Assets/MapMagic/MapMagic.cs:204)


     
  5. MattyWS

    MattyWS

    Joined:
    Jan 24, 2013
    Posts:
    70
    Screenshot013.png Now that I'm getting the hang of placing objects with the scatter and forest nodes, Map Magic is really shining. :) It has taken me a while to get used to though, you may want to consider some more up to date or written tutorials with screenshots on the nodes and results. Otherwise though, it's an amazing terrain tool!
     
    dashasalo and malkere like this.
  6. MattyWS

    MattyWS

    Joined:
    Jan 24, 2013
    Posts:
    70
    Oh also I don't know about other people but about objects, I can't get them to scatter with random rotations which would be nice, as you can see in that screenshot above there are rocks that are at the exact same angle. :(
     
  7. iddqd

    iddqd

    Joined:
    Apr 14, 2012
    Posts:
    413
    MM only rotates the y axis. An option to rotate x,y,z would be great, especially for things like rocks.
     
  8. tanoshimi

    tanoshimi

    Joined:
    May 21, 2013
    Posts:
    292
    If you just want a random rotation, that's pretty trivial to do in the Start() method of a script on your rock prefab.
     
    iddqd likes this.
  9. ksam2

    ksam2

    Joined:
    Apr 28, 2012
    Posts:
    1,001
    I'm getting crazy please help. I spend 5 hours to figure out what's wrong but no luck, textures of terrains doesn't match correctly. Please look below pic.
     

    Attached Files:

  10. iddqd

    iddqd

    Joined:
    Apr 14, 2012
    Posts:
    413
    Yeah i guess that's also a good way to do it.
     
  11. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,115
    what texture scale are you using? are you using RTP?
     
    ksam2 likes this.
  12. ksam2

    ksam2

    Joined:
    Apr 28, 2012
    Posts:
    1,001
    Yes I'm using RTP with default setup. I'm not noob with terrain matters but can't figure out why this looks like this.
     
  13. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,115
    @ksam2 it looks like one of your terrains is using RTP and the other one isn't to be honest. RTP engine should be on a parent object, ie: the mapmagic gameobject, with the children inheriting it's use. What happens if you turn the layer brightness to zero? if only one of the terrains goes dark there's something not applying RTP to the other terrain you need to look into.
     
    ksam2 likes this.
  14. iddqd

    iddqd

    Joined:
    Apr 14, 2012
    Posts:
    413
    Hello @Wright

    I'm creating a custom node and would like to use GetComponent<Renderer>().bounds in the Generate method. Since this isn't allowed in a side thread, does MM possibly have a solution for me? :)

    Thanks
     
  15. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,115
    @iddqd is there a way for you to call and store that data prior to threading? ie: using the delegates at the end of the manual to call and store a static variable before the generators start up. The generators can call the data, they just can't use the Unity Engine which GetComponent is a part of.
     
  16. Dorian-Dowse

    Dorian-Dowse

    Joined:
    Jun 2, 2016
    Posts:
    94
    I was getting the same issue as ksam2, so I set up an easily reproducible test case. This uses the default Map Magic start file, pins a second terrain, then previews a noise output on the terrain.
    MMSeams.JPG
     
  17. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,657
    Dorian-Dowse, ksam2, does this happens in a playmode? Does "Rebuild all" fixes it?

    iddqd,
    Yap, there is. It's not very straightforward, though: in MapMagic.cs there is a method
    Code (CSharp):
    1.         public void PrepareGenerators ()
    2.         {
    3.             if (generatorsPrepared) return;
    4.  
    5.             foreach (TextureInput tin in gens.GeneratorsOfType<TextureInput>()) tin.CheckLoadTexture();
    6.             //more will follow
    7.  
    8.             generatorsPrepared = true;
    9.         }
    Instead "//more will follow" add something like:
    Code (CSharp):
    1. foreach (CustomGenerator g in gens.GeneratorsOfType<CustomGenerator>()) g.SomePrepare();
    Yeah, I've got to make an event of that.

    Black-Spirit, I'm talking about Height Output

    I could reproduce the bug with Network Identity. It disables the game object, I don't really know why. I'll fix this for the new version, for now you can use the second temporary camera with lower priority (depth) in scene.

    MattyWS, in case you want to incline your objects along terrain - take a look at this post.
     
  18. RandomDevil

    RandomDevil

    Joined:
    Dec 15, 2016
    Posts:
    11
    I think I might have found a bug, but I'm not sure. It deals with the flatten tool and the reason I'm not sure is because there's nothing in the manual about it.

    If I studied the forum correctly, the stamp node was turned into two different nodes; stamp and flatten. This is conjecture based off what I have read and the node controls in the manual. The issue I'm having is with the node itself.

    (Reformatted for clarity. Sorry if sentences are bad)
    1. I can add it [Flatten] to the graph,
    2. Connect the height map to the canvas,
    3. The output will connect to the Height output
    4. And the Output will connect to a portal for use elsewhere.
    5. Attempt to connect anything to the Objects input and it won't accept input from anything; even a default scatter.
    Now, I remove the node and add a new one back.
    1. This time I attempt to hook up the "Objects" input first and it works!
    2. Add the heightmap to the canvas input
    3. Add the Output to Height output
    4. Add the Output to a portal....now it won't connect to the portal.

    I've tried all the different combos, but no luck. Am I connecting nodes together that it's not expecting? I'm just trying to get the result as pictured in the manual, in the last image for the Stamp node where it shows the output for "Canvas: enabled; Max Height: off."

    Thanks.
     
  19. Dorian-Dowse

    Dorian-Dowse

    Joined:
    Jun 2, 2016
    Posts:
    94
    I was getting a distinct line in play mode, but was able to virtually eliminate it by changing the default 15 tile size to 8.
     
  20. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    782
    @Wright
    hi there,
    I'm using MapMagic with RTP. For RTP only support 8 textures per terrain, I wanna know if the biomes feature of MM requires all biomes only use 8 textures in total or I can use 8 textures for each biome and blend them together with RTP'S features?
    Will the textures blend between different biomes?
     
  21. tanoshimi

    tanoshimi

    Joined:
    May 21, 2013
    Posts:
    292
    RTP supports 8 textures per *pass*. There is no limit on the number of passes (and therefore textures)
     
  22. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    782
    Sadly yes it does have limits, 8 textures per terrain tile. Just comfirmed by Tomaszek the author of RTP :(
    Seems cross pass height blend is something too difficult or performance comsuming...
     
  23. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,115
    I saw his answer too. It's interesting because you certainly can add more than 8 textures with basic terrains, I just added 10 to test it out, but RTP uses a lot of combining and tricks to make those 4-8 layers as fast as possible, so I guess it's one or the other.... the far filtering and distance overlay stuff in RTP is totally essential to my project so... will try to use those textures to their fullest with details and what not.
     
  24. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    782
    yes you can add more than 8 textures to a terrain, but when you add RTP script to the terrain, the extra textures will be shown as black blocks. At least it's in my case...
     
  25. iddqd

    iddqd

    Joined:
    Apr 14, 2012
    Posts:
    413
    Great that worked, thanks!
     
  26. tanoshimi

    tanoshimi

    Joined:
    May 21, 2013
    Posts:
    292
    Ah, sorry for misinformation. I always assumed using RTP increased the usable texture count, not reduced it!
     
  27. Mazak

    Mazak

    Joined:
    Mar 24, 2013
    Posts:
    217
    Hi,
    Something happed and now all of a sudden my terrains will not accept raycasts - its like its being ignored.

    When I look in the terrain collider the data is empty ?

    What did I do wrong?
     
  28. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,115
    There is a check box to turn the terrain collider off in MapMagic. Did you click that by accident?

    @Mazak edit: the terrain collider says None? Or is a blank name? What's your raycast code? Are you using an immediate Debug.Log after the if statement to see if it gets called at all, and the hit.transform.name?
     
    Last edited: Feb 18, 2017
  29. Mazak

    Mazak

    Joined:
    Mar 24, 2013
    Posts:
    217
    I checked that all ready, both the terrain and Mapmagic are checked.
     
  30. Thewigit

    Thewigit

    Joined:
    Feb 18, 2017
    Posts:
    2
    Hi guys! i was wondering if anyone could help me out: i am trying to make an oasis using map magic around a lake on a desert island. I know i need to mask it somehow to get the grass textures in the right place. How do i do this?
     
  31. Jesus

    Jesus

    Joined:
    Jul 12, 2010
    Posts:
    484
    If you've got a 'map' (if you can preview and the lake turns green and the rest red) where the lake is; or grayscale image where the lake is white and the rest of the island is black, then you simply blur it. Then, subtract the lake from the blurred image, and then use the curve tool to control the falloff of the grass around the oasis.
     
  32. Ramulos

    Ramulos

    Joined:
    Feb 19, 2017
    Posts:
    55
    Hello Wright, I've been following the forum for a while now and its clear you put alot of effort into both products. Was wondering if you had an expected release date for the Voxeland integration or maybe beta access. Waiting on that to buy voxeland. Any idea?
     
  33. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,657
    RandomDevil, in some cases linking nodes is prohibited to prevent infinite loop - when one generator uses results of a generator linked to it. I don't know why infinite loop test works in case of a simple scatter, but if you could make a screenshot of your graph it will help a lot.

    Yep, I can see that RTP uses only two control textures with 8 channels.
    Unfortunately there is no way to optimize RTP texture count per-terrain, the texture should be in list even if it is not used. So RTP Output has no "skip blank texture" optimization.

    Mazak, do terrains have "terraion collider" component? Is there any data assigned in Terrain Data slot (when the data is assigned, but it's name is blank it will have an empty name, its okay. If no data is assigned there should be "None (Terrain Data)" ).

    Ramulos, I'm still busy with Voxeland. It had a lot of features that were added literally in years, it's very hard to bring them all to new version at once. If everything goes well I'll release Voxeland beta version in two or three weeks.
     
    malkere and iddqd like this.
  34. slimshader

    slimshader

    Joined:
    Jun 11, 2013
    Posts:
    138
    Hey! How to achieve a snow texture layer but only above certain height level?
     
  35. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,115
    That's pretty basic stuff dude, did you watch the tutorials and read the manual? Highly recommended. No harm asking just sayin'.
    Setup a height portal and feed that into a curve. The curves x represents what the height portal is feeding into it, the y represents how the curve will change it. So if you want to change the output to only be for high parts move all the y on your curve down to zero until x>=0.7 and then it slopes sharply upward. Then feed the curve output into your snow texture.
     
    tanoshimi likes this.
  36. slimshader

    slimshader

    Joined:
    Jun 11, 2013
    Posts:
    138
    I am new to MM I admit, but I have watched the tutorials and read the docs. Texturing examples were based on terrain "shapes" rather than heights, that is why I asked. What you said makes sense for me tho so thanks.
     
    malkere likes this.
  37. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,657
    In two words: just use curve node with steep curve attached to your height nodes:
    HeightSelectorByCurve.jpg
     
    slimshader likes this.
  38. tanoshimi

    tanoshimi

    Joined:
    May 21, 2013
    Posts:
    292
    The Noise Generator has been deprecated as (Legacy) I see. Does that mean we have exciting new Noise modules coming...? :)
     
  39. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    782
    @Wright Dose this mean we can only use 8 textures for all biomes? If so I will not use RTP in my project, for I'm designing 4 different landscape each have 3 identical biomes. 8 terrain textures for all of them is just impossible :(
     
  40. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,115
    The limitations of RTP do not imply limitations on MapMagic necessarily, unless you are using RTP. MapMagic can support more textures than 8 per biome. RTP cannot. What you really need to consider though is the performance impact that any choice has on your project. If you're running 9 textures on a terrain using standard shaders, Unity has to basically draw the terrain three times every frame instead of just once. If that's not a problem then no big deal, but that is a big problem for a lot of people.
     
  41. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    782
    I'm not going to use more than 8 textures in one terrain tile. But there will be 8 different textures in another boime, I'm using MapMagic's biomes feature, don't know how does it handle the textures in different biomes.
    And MegaSplat uses a different splat algorithm that allows 256 textures in one pass, really like to see MM be compatible with MegaSplat!
     
    ftejada likes this.
  42. ftejada

    ftejada

    Joined:
    Jul 1, 2015
    Posts:
    537
    Hi

    I am very interested in your asset Map Magic but I would like to know

    What plans do you have for MapMagic to be compatible with MegaSplat? Will it be soon?

    regards
     
    RandomDevil likes this.
  43. tanoshimi

    tanoshimi

    Joined:
    May 21, 2013
    Posts:
    292
    What do you mean "compatible with"? Megasplat works with Unity terrains. MapMagic generates Unity terrains. According to the asset store description, it's already compatible...
     
    ftejada likes this.
  44. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,115
    Das a lotta textures! I'm gonna have to look into that.
    I'm pretty sure MapMagic features are not designed to work with RTP. They could be set up to do so, but RTP tends to run on a parent, that all the children inherent settings from. For lots of biomes you'd probably need an RTP material instance per terrain, and that's really not what it's built for... I think...
     
  45. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,657
    I'm experimenting with simplex noise and turbulence.

    In this video Jason (author of MegaSplat) uses it on MapMagic terrain. It's a non-dynamic terrain, though.

    You can use any number of textures with standard terrain shader - at least I've checked that more than 15 works.
    And note, that if a texture is not used on some MM chunk terrain (for example, it belongs to the different biome) it will not be applied to this terrain.
     
    ftejada and malkere like this.
  46. Jesus

    Jesus

    Joined:
    Jul 12, 2010
    Posts:
    484
    wait what

    Is this some new sorcery or have I missed this in the notes somewhere before?

    Also, does this work with RTP and other things? I've been using the default Unity shaders for now and limited myself to 12 textures because a 13 would mean (what I thought would be) a fourth pass. But, if I can keep some biomes away from others so that there'd never be all of them at once (eg: no snow/etc at the equator tiles) I get away with Unity drawing one less terrain?
     
  47. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,115
    Try it out yourself. It does not work with RTP, RTP won't let it. But if you only have two textures on a specific terrain even though there are 20 in your node graph MapMagic will only apply the two. RTP requires static positioning of textures in its array so you can't pick and choose unless you want a different instance of RTP for each situation.
     
  48. inflame

    inflame

    Joined:
    Jul 31, 2014
    Posts:
    24
    Help generate Island 15-20 square km
    I will be very grateful to you
     
  49. tanoshimi

    tanoshimi

    Joined:
    May 21, 2013
    Posts:
    292
    Not sure if it's always been the case, but it's definitely not new. Terrain chunks only reference the textures used on those chunks.
     
  50. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    782
    Thanks for the reply, and I was talking about RTP with MM, does the biomes feature support RTP? will it allow every biomes use 8 RTP textures or the whole map uses the same textures set?
    And want to know if MM can support Megasplat in runtime?
    Megasplat uses a different splat algorithm that allows 256 textures in one pass and it has fantastic tessellation and height blend. But it can not use standard terrain splat info, it need conversion in editor witch made it impossible to work on runtime generated terrains.
    Really love to see MM have an output module that can export the splat info directly to Megasplat's system and make it possible for run time! What do you think?
     
    Last edited: Feb 24, 2017
unityunity