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

    Morgrhim

    Joined:
    Jun 19, 2015
    Posts:
    9
    dst is the matrix, yes. That, min, and max are being used exactly as the example in the documentation uses them.

    Setting the values to any float does nothing to change the terrain height. I've also added some logging to test, and from what I can tell the Generate function is not actually running when I hook it up to the height output.

    I wrapped the above in an if else, checked for a null matrix, logged the heights after setting the above code, in an else have a log for an invalid matrix, and outside of the if/else just before I set the chunk I log that generation is done. None of the logging fires off.

    EDIT: As a test, I put a Debug.Log before the following lines from the Sample Generator script:

    Code (csharp):
    1.  
    2. if (src == null || chunk.stop) return;
    3. if (!enabled) { output.SetObject(chunk, src); return; }
    4.  
    The first debug fires off fine, then nothing. The first line is what is stopping the generation. If I remove it, I get: Generate Thread Error:

    This is code from the sample generator, so I am unsure of what I might need to change to get past it. It appears to be checking for a valid chunk of terrain and doing some thread checking, which seems to be what is stopping the code.

    EDIT 2: I added come more specific logging. I checked for the state of src, as that is the first thing set, and it is always returning null, but if I log the state of chunk it is not null. This leads me to think something is causing a null return in input.GetObject(chunk), but I'm not able to track down why, as link is not returning null, nor is the key check.

    EDIT 3: I think I figured it out. I'm not using another node for input and switched the mandatory flag to false. rewriting the logic to handle both cases seems to work.
     
    Last edited: Mar 15, 2017
  2. Sov3R3igN

    Sov3R3igN

    Joined:
    May 24, 2016
    Posts:
    22
    Do still need to use the RTP plugin in order for this to work with RTP? the download link is broken so i want to be sure i can use this with RTP
     
  3. Morgrhim

    Morgrhim

    Joined:
    Jun 19, 2015
    Posts:
    9
    The package download has the plugin in a zip file.
     
  4. Sov3R3igN

    Sov3R3igN

    Joined:
    May 24, 2016
    Posts:
    22
    I see that Map Magic is a amazing tool, Would this also allow me to touch up terrain manually as well? Or it’s not suited for specific local tweaking
     
  5. reocwolf

    reocwolf

    Joined:
    Aug 1, 2013
    Posts:
    182
    Man I'm so excited about MM working with Voxeland. Can't wait!
     
  6. Dorian-Dowse

    Dorian-Dowse

    Joined:
    Jun 2, 2016
    Posts:
    95
    Yes. You can Lock a terrain, which means it won't regenerate and your hand tweaks are safe.

    Denis demonstrates it in this video. Highly recommend you watch this.
     
  7. Sov3R3igN

    Sov3R3igN

    Joined:
    May 24, 2016
    Posts:
    22
    Another question i have is did anyone knows and tried to use real world terrain data to create their terrain? If so could someone please share how to? I found one tutorial but it requires to add an script to terrain and i am afraid it's going to screw things up for map magic
     
  8. Dramamine0001

    Dramamine0001

    Joined:
    Mar 23, 2014
    Posts:
    84
    Hello. New to MapMagic and running into a lot of issues. I'm about halfway through the long tutorial and keep running into issues, which mainly seem to be due to newer versions.

    I'm looking to create a series of islands similar to:
    https://forum.unity3d.com/threads/m...ite-game-map-tool.390920/page-11#post-2722339

    When I import this, there's a lot of broken connectors and I can't seem to make it do anything. Does anyone have a update version of this or something similar?

    Thanks!
     
  9. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,276
    For the current version you have to use an additional plugin. Here is the correct link to it - I would appreciate if you could point out where the broken link is posted.
    In the upcoming version RTP Output will work just out of the box, it will just disable it's functionality if RTP is not installed (this feature is not added to beta - yet).

    Try using RAW Input generator. There's an example of using it in the beginning of the video Dorian-Dowse mentioned.

    Yap, I decided to stop perfecting it and share Bitbucket repository to all the MM and Voxeland owners.

    Dramamine0001, it would be great if you could mention all of the issues you encounter. If they are bugs I'm going to fix them, if they are just not clear moment in the video I'd like to add a comments of descriptions clarifying them.
     
  10. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,276
    Early Beta Test Announcement:

    I decided to share Bitbucket repository to all the MapMagic owners to enable study and integration with user's projects. So I plan to start MM beta test soon - all owners are welcome to fill in the form. Beta version will be distributed via Bitbucket, so you'll need Bitbucket account to download it and Git client to get regular updates. Please use Bitbucket's Issies page to report problems or share your ideas (issues page is public and open for non-owners too).

    Do not expect perfect and polished product from the very beginning. There are still some issues, but I guess that some major aspects will not change.

    Whish you a nice testing!

    Beta sign-up form
     
    iddqd and ftejada like this.
  11. kulesz

    kulesz

    Joined:
    Jul 1, 2012
    Posts:
    140
    What new features are currently in beta?
     
  12. ftejada

    ftejada

    Joined:
    Jul 1, 2015
    Posts:
    695
    Hi

    It has plans to include environment deformation materials, such as those of this WreckIt asset?.

    It would be a good feature. Although I do not know if it would be possible.
     
  13. Deleted User

    Deleted User

    Guest

    Hi Dennis,

    I'm getting some slight terrain deformation along terrain chuck weld lines, is there any way to fix this issue?

    Also manually altering terrains with the Unity editor near weld lines causes unevenness and splits in the neighbouring terrains, is there a way to stop this effect. I know you can't edit multiple terrains at once in the Unity editor - can it be done with MM?

    Thanks.
     
  14. txarly

    txarly

    Joined:
    Apr 27, 2016
    Posts:
    197
    Hi,

    Is there a way to modify a part of the map (with an area modifier or a node )so i can change the height in that speficic area , or for example, place in an area a type of trees ,flowers,grass,objects,...?

    thanks
     
  15. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,276
    There's mainly internal changes to make MapMagic work with Voxeland, so new feature list is quite short:
    - voxeland support
    - new noise algorithm with simplex and turbulence modes (known bug: negative symmetry).

    I don't want to gather all of the other asset's features in one. MapMagic has it's own purpose, so the answer is no, I do not plan to include terrain deformation. I don't know if WreckIt works with MapMagic, but you can try it yourself using MM's evaluation version.

    RETRO_GEEK, I guess this deformation is caused by welding itself - when new terrain is being generated it modifies it's neighbours to weld to them. You can try setting Height Weld Margins to zero, in this case you'll get seams between chunks - they should not be larger than one unit (meter), if they are then something is wrong with your grpah, with generators "Safe Borders" values I suppose.

    Not yet, but I plan to allow using of MM as an editor tool. There's a use case as an example: you need to paint textures and add grass to terrain that you already have made (using heightmap or other tool):
    • you add MM to this terrain;
    • add "Height Input" to graph;
    • add "Texture Output" and nodes to paint your terrain, say "Cavity" and "Slope" and connect them properly with height input;
    • add "Grass Output", and connect it too;
    • generate and get terrain painted with textures automatically, and have the grass planted too.
    I plan to implement thias feature soon, maybe it will be ebven included in current beta - but I can't promise this for sure.
     
  16. Sov3R3igN

    Sov3R3igN

    Joined:
    May 24, 2016
    Posts:
    22
    So i was playing around with biomes, trying to create different terrains to link them up together with that feature, So when i load a biome and add demodata asset how do i save it? or how do i duplicate this? I can't figure out how to save a terrain map as an asset.
     
  17. ftejada

    ftejada

    Joined:
    Jul 1, 2015
    Posts:
    695
    Thanks for replying Wright

    Yes, I had already downloaded the evaluation version to test it. And I have been asked a question ...

    Is it possible, for example, to create a mountain with a set of nodes and rotate that mountain on the scene? Something like what you can do with TerrainComposer2 in the min 1:17 min of this video. I have been trying but I have not been able and in the documentation I have not found:



    regards
     
  18. txarly

    txarly

    Joined:
    Apr 27, 2016
    Posts:
    197
    Thanks, at least would be great to have the option to lock the Height map from updating so we can modify the terrains manually and export them , because in the end usually some kind of manual changes must be done in terrains.This would be good if you include in the beta or some update.If so, let me know to apply the beta.

    Again, many thanks for your work
     
  19. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,276
    ftejada, try playing a bit with an evaluation version - you'll notice that MapMagic does not work this way - there's no brush or stamp that could be rotated. MapMagic uses a node-defined logic to create infinite terrains, and this logic should be equal for all of the terrain, you cannot edit some area manually (unless it pinnede and locked, but then it's out of MM generate). If there's some mountain that could be rotated on one chunk then how other mountains on all of the infinite chunks should be handled?

    Sov3R3igN, are you talking about terrain data or the biomes nodes graph?
    In first case: 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.
    Biome grtaph is stored in scene by default, but you can save it using the "Save" button in biome generator.

    txarly, sure. It's nice to hear that I'm doing a good job!
     
  20. Sov3R3igN

    Sov3R3igN

    Joined:
    May 24, 2016
    Posts:
    22
    Not sure how to

    Not sure how to assign that script when i have it a shot ti shoot out bunch of errors in the console and it did not work. What i did i clicked on the terrain object and did add component and pasted the script in the search and it showed as new script.
     
  21. Cleverlie

    Cleverlie

    Joined:
    Dec 23, 2013
    Posts:
    219
    hi Wright, could you please improve the blend node or at least update the documentation on this node, it is incredible hard to understand how it works since you updated it to receive any amount of inputs, it is not clear how the different blending modes work, which is applied after which, how blend modes that cannot have more than 2 inputs like Mix mode works when more than two inputs are given, is really confusing and I can never make it work as I want, I have to try 30 different combinations switching layers and blending modes until what I needed pops up, I can't even know why it works, this is just a suggestion, user interface and experience are important parts on a software tool so great as yours.
     
  22. Jesus

    Jesus

    Joined:
    Jul 12, 2010
    Posts:
    502
    I've gotta second this. No idea how it works, I've tried black magic, I've tried witch doctors, I've tried sacrificial rituals, and the local goat population will never be the same. Might sound funny, but I've taken to starting with a copy of an older graph so I can just keep a copy of the legacy blend available to use.
     
    pixelsteam likes this.
  23. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,276
    What were the errors?

    Cleverlie, Jesus, ooookay... Blend node works similarly to blending layers in photoshop or gimp. Mix mode is an analog of "Normal" overlay type. But since it causes so much misunderstanding I'll try to simplify it somehow or return an old algorithm. Or make it switchable between old/new modes.
    Btw you can use the new node in a 2-layers mode, this way it will not differ from the old one.

    And I think I'll add new section in Create panel for legacy generartors, along with Maps, Objects and Outputs.
     
  24. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    I thought the blend was pretty straight forward.
    The lower (first/A) layer is the base layer. Any layers above that are applied in succession using the math method you select. Add = A + B, Subtract = A - B, etc.
     
  25. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,276
    I've got a video that might be useful to all MapMagic+Voxeland beta testers. It is a tutorial showing how does Voxeland Output work:
    And since beta test is still in progress feel free to submit a beta tester form to take part in it.
     
  26. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,521
    Freaking amazeballs.
     
  27. Cleverlie

    Cleverlie

    Joined:
    Dec 23, 2013
    Posts:
    219
    Hi Wright,

    unless it is a bug, mix mode or the layers layout doesn't behave as you said, I've tried every single combination of add/mix modes on lower and upper layers, none of them gave me the results I expect like in photoshop:

    sdfsdfs.jpg

    I'm using latest asset store version: v1.71 in unity 5.5.1f
     
  28. TylerO

    TylerO

    Joined:
    Aug 21, 2011
    Posts:
    35
    Hi @Wright I had a question about Map Magic (in relation to Voxeland 5, which I currently waiting to get access to)

    Is Map Magic deterministic? As in, if I pass in the same parameters and the same seed, will the result be the same every time?
     
  29. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    You're trying to get one noise to not be affected by the cone mask? Put the mask on the noise or the voronoi and you should have the same effect... Or are suggesting the two layers are not being properly normalized via the mix?
     
  30. Cleverlie

    Cleverlie

    Joined:
    Dec 23, 2013
    Posts:
    219

    I have two complex sets of nodes that generates two different heightmaps the two simple noises from the image are just for demostration purposes, I want to use one set in some areas and the other set in the other areas, the mask should dictate which area A is present (white pixels) and which area B is present (black pixels), from what Wright says, I should be able to do this with the blend node, both layers in mix mode and the masking texture in the mask input, legacy blend node worked fine to do this, but now it doesn't work, also you can notice I'm using a curve node to normalize and clamp the range of the simple form node, because I've found out that nodes can output ranges of color outside the range 0-1
     
  31. Jesus

    Jesus

    Joined:
    Jul 12, 2010
    Posts:
    502
    Does seem to be the case.

    At least, for now. If he changes the noise generators in the future (or something) than it might break but as far as I can tell, the same results should occur if you use the same node graph.
     
  32. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    There's lots of ways to go about that. You could use a simple form fed into a curve and again into an opposite curve, apply each curve to your separate noises, and then blend them with Add, for example.

    The way you're using the mask will blend the second layer with the first layer, but only within the mask area, so the first layer will always be there. If you want to dictate that A is only present within the mask and then B is only present outside the mask you need to use a different method.
     
  33. Cleverlie

    Cleverlie

    Joined:
    Dec 23, 2013
    Posts:
    219
    I'm using almost exactly that workaround you mentioned, but anyways, it's a workaround, in previous versions I was able to get this result with one node instead of 3+, and my initial post regarding the blend node being not very clear on how it works is still valid, you see, if it worked like photoshop layers, then I expect the node to "execute" the mix operation aka replacement of base layer with upper layer in all the white pixels of the mask, and in the black pixels the base layer should stay intact.
     
    wmpunk likes this.
  34. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    @Cleverlie What you're describing sounds to me like a "replace" not a "mix" is why I chimed in, but I see how mix + mask is the same as replace depending on how you look at it. The documents are certainly out of date too =3 Glad you found a workaround.
     
  35. iddqd

    iddqd

    Joined:
    Apr 14, 2012
    Posts:
    501
    Doesn't Photoshop overlay one layer on-top of the other by default?
     
  36. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,276
    Cleverlie, does this one works as you expect:
    BlendingMix.png

    I assume that the current version can have mix mode bug, the upcoming one will work the way shown in the image.
     
    docsavage and Cleverlie like this.
  37. Cleverlie

    Cleverlie

    Joined:
    Dec 23, 2013
    Posts:
    219
    yes, that's my expected behaviour, but seems to be a bug on v1.71, I'm getting this:
    sdfsdfsd.jpg

    so all good, I'll workaround this until next update is out, thanks Wright
     
  38. Gohans

    Gohans

    Joined:
    Dec 31, 2016
    Posts:
    9
    Hello,

    I just purchased MM, it's such a nice tool :) I have a couple questions tho ;)

    Is there any way to spawn objects depending on their position on the map width / Height... (basically i'd like to put more trees on mountains and change the kind of trees if you go to the south... etc..)

    Sorry my english is not the best,

    Thank you !
     
  39. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    @Gohans use a curve to selectively alter your height for use as a mask on your object or tree generation. Make sure you watch the tutorial on youtube.
     
  40. Jesus

    Jesus

    Joined:
    Jul 12, 2010
    Posts:
    502
    another thing you can do is use the 'simple form' node I think its called. There should be a gradient x and gradient y option you can use. Plug that into a curve, and make an appropriate ramp (so it cuts off at some point, or something). Then use that to spawn trees.
     
  41. FrikkieRSA

    FrikkieRSA

    Joined:
    Mar 30, 2017
    Posts:
    27
    Hi @Wright

    I would like to know if it is possible change the generated terrains' settings. In Trees, Details and Grass Settings the options are quite limited. I would like to have the option to force Collect Detail Patches in each terrain's general settings to False. At the moment whenever a terrain is generated the setting is defaulted to True. The reason that I require this is because of this Unity bug that still seems to not have been fixed:

    https://forum.unity3d.com/threads/u...rain-data-buildpatchmesh.249089/#post-1670616

    Thanks for creating this awesome product, I am really enjoying working with it.
     
  42. Dramamine0001

    Dramamine0001

    Joined:
    Mar 23, 2014
    Posts:
    84
  43. secondsight_

    secondsight_

    Joined:
    Mar 2, 2014
    Posts:
    163
    @Dramamine0001

    Hey,
    I´ve rebuild the island setup quickly. It should only take a few minutes for you to recreate it.
    Also please check you terrain size / height, because curves act relative to these values.


    (Closeup of the node view here)

    It bascially works like this:

    01. Create the base landmass
    02. Create big noise functions. If these are substracted from the base, it creates the flat space for the oceans
    03. Add details to the base landmass. In this case I have added a few mountains sticking out of the islands.

    Add a shore line for smoother transition and erosions to make terrain look more natural.
    After that, I have added basic textures for the terrain: Grass as a base, beach up to a certain height and rocks for a selected slope limit.
    If you want you can then add grass objects to the base grass texture layer (in my case I used Tree billboards) to add dense forests.

    You can play around with the curves and the noise sizes a lot. They will define how much landmass is generated and how big and / or fuzzy the island coasts will be.
     
  44. Dramamine0001

    Dramamine0001

    Joined:
    Mar 23, 2014
    Posts:
    84
    Thanks a ton!
     
  45. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,276
    Gohans,
    That's an example of how tree density could be adjusted with height:
    DensityByHeight.jpg
    Speaking about "Direction" generator I have it in my to-do list, but I can't promise it in the next update.

    nikolai-niedermeier,
    You can do this using OnApplyCompleted event:
    Code (CSharp):
    1.     void OnEnable()
    2.     {
    3.         MapMagic.OnApplyCompleted += DisableCollect;
    4.     }
    5.  
    6.     void OnDisable()
    7.     {
    8.         MapMagic.OnApplyCompleted -= DisableCollect;
    9.     }
    10.  
    11.     void DisableCollect (Terrain terrain)
    12.     {
    13.         terrain.collectDetailPatches = false;
    14.     }
    (assign this script to the MapMagic object)

    secondsight_, yeah, looks neat and cool. Great job!
    The only thing I can add is a simple forest:
    SimpleForest.jpg
     
    Dramamine0001 likes this.
  46. secondsight_

    secondsight_

    Joined:
    Mar 2, 2014
    Posts:
    163
    Multi-terrain setup / Worldmachine import

    I quickly want to show off a setup for muti terrain import from worldmachine. I wasn´t aware this can be done with MM or haven´t seen it used before.

    So, I had to do a mockup strategy map using existing world machine files as a base. But I did not want to buy another assets to stich terrain together. But most of all I wanted to be able to generate all kind of objects onto the terrains afterwards and use MM for this. The goal was to have the benefit of high definition color maps but also having some details when you zoom in so it does not look blurry.

    Here are the results of a first quick test:


    Luckily, since we can have mutlitple texture outputs, this was actually quit easy to setup. It fits on one screen:


    A brief discription:
    I have used a 9x9 terrain tile export in worldmachine, but deleted / ignored 3 of them for this project. So you can see a 3x2 setup above. I have exported the raw files, color maps and normal maps from world machine.

    On the left side of the node graph are the terrain, offseted according to their terrain size. On the right side are the color and normal maps, having a single output for each texture. Then I connect the textures with the terrains accordingly.
    Important is to have the texture in the second slot and not in the base (this is set to 0 opacity).

    Then I added some detail maps with a (very) low opacity on top. Here also the first slot is left empty / set to 0 (having a texture in the base slot results in some bugs for flat terrain with the height value 0.) In the example above it´s just grass and rocks for a certain slope. So when zoomed in, the terrain has some details and does not look blurry.

    So from here on all the nice features of MM can be used to generate grass, forests or other gameplay objects or add some erosion.

    I hope this might be helpful to someone !
     
  47. FrikkieRSA

    FrikkieRSA

    Joined:
    Mar 30, 2017
    Posts:
    27
    @Wright, thanks for the quick reply and the help.

    Unfortunately this does not really fix the problem. Instead of getting a spike of approximately 60ms every couple of seconds, it runs smooth until a terrain finished generating and then I get a spike of approximately 4500ms. Obviously the former is the better option. Does anyone else maybe have a fix for the Terrain.Details.BuildPatchMesh CPU spikes?
     
  48. SSL7

    SSL7

    Joined:
    Mar 23, 2016
    Posts:
    349
    Hey guys, Is there any problem if I move the MapMagic whole instance transform position? I want to bring the center of my world close to 0,0,0 instead of having the edge there (closer to origin).
     
  49. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    @dlevel you could try that in about ten seconds XD I don't think it would, but you'll start getting floating point errors just the same on anything that tries to use the local position.. Could be acceptable in your case though I'm not sure how far you have to move.. here's my personal notes on how to make MM infinite:

    THREE THINGS to fix floating point errors/ infinite placement

    to fake camera distance that uses the MapMagic.Coord system
    camPoses[0] = mainCam.transform.position + new Vector3(TerrainsData.Offset.x * 1024f, 0, TerrainsData.Offset.z * 1024f);

    to position the terrain properly OnCreate in world space
    go.transform.localPosition = coord.ToVector3(MapMagic.instance.terrainSize) - (TerrainsData.Offset * 1024f);
    and again in OnMove for movement

    This is only for proper placement, shifting the world is just a grab everything and move it script along with update my TerrainsData.Offset which is a public static variable. I use 1024 sized terrains is what the 1024 is. Hope that gets you started.
     
  50. SSL7

    SSL7

    Joined:
    Mar 23, 2016
    Posts:
    349
    Of course i did try that, and had no problems for now, but just asking to be sure to keep creating my world from this position and not find problems later on. No floating errors at this point, my world is not THAT big, just not finding any reason to have the edge on 0,0,0 instead of the center of the world. Is my thinking correct? :)