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

    cmart

    Joined:
    Jul 10, 2012
    Posts:
    109
    Can someone please explain how to prevent objects from spawning on each other? For instance, I would like to take the output from the flatten generator and then turn that into a mask for a different probability spawner. Also, is possible to get a radius without flatten, and feed that into a mask?

    I am pretty sure I figured this out once upon a time, but the method to create these masks has slipped my mind. Any help is much appreciated it :)
     
  2. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,659
    Harekelas, the final seed is a combination of a global seed and local generator seed. Changing a global seed does not replace local seed with the global one so all of the generators get the same value. If you do not want a global seed to affect your generators simply do not change it, leave it as it is.

    Twiixyfr, it would be handy if you could create an issue, and post a screen of your graph to it.

    cmart, you can use Subtract Generator to remove one types of objects spawning within some range from the others:
    SubtractOverview.jpg SubtractOverview_a.png
    assign the objects you want to remove as Input (previously called minuend), and the reference objects as Subtrahend.
     
  3. yrucrem

    yrucrem

    Joined:
    Aug 5, 2013
    Posts:
    17
    Hello @Wright

    Thank you for the hints about flattening rectangular patches on the map! Unfortunatelly I still struggle with this issue, and I hope that you or one of the guys in this thread could help me out with some further advice.

    Those are the steps you suggested trying:

    Which lead to the following graph:
    1-graph.jpg

    The maps using only the normal flattening, the stamp map used as a mask for the blend generator, and the belding result look like this respectively:
    2-flatten-only.jpg 3-stamp-only.jpg 4-blended.jpg

    I experimented quite a bit with the values of the generators, but most of the time, I get either no flat areas at all, or absolutely straight edges, and not the kind of fallof from the flatten generator.

    My hope is, that I misunderstood some of the steps described above. I also did some reading in the manual, but I could not find any hints, on how to create the desired effect.

    Any help and hints would be greatly appreciated!

    Best regards,
    Patrick
     
    Last edited: Jun 10, 2017
  4. cmart

    cmart

    Joined:
    Jul 10, 2012
    Posts:
    109
    Perfect, thanks Wright!
     
  5. Dwight_Everhart

    Dwight_Everhart

    Joined:
    May 11, 2014
    Posts:
    123
    I'm trying to design a coastal area where two biomes meet. One biome is for the land. It has trees and rolling hills. The other biome is for the ocean floor. Its elevation is much lower than the land biome. MapMagic is blending the height maps of the two biomes nicely, producing a gentle slope into and under the water. However, it is also placing trees under the water.

    I tried using a Curve node to restrict trees to be placed above the water line, but this didn't work, because the Curve node can only work with the height map the biome generates, not the final height map that results from the blended biomes. Nothing inside the biome's graph has any information about where the mixture of the two biomes will place the final terrain. As far as the Curve node knows, all elevations are above sea level.

    I also tried changing the Biome Blend value for the trees to sharp, but this didn't help, probably because the transition between the land and sea is a gradual mix of biomes. I can't use a sharp transition, because that would produce a sudden drop in the terrain. I want a gradual slope to the ocean floor.

    Is there some way for a graph to know the final height values produced from mixing biomes? If not, is there any way to keep MapMagic from placing trees under the ocean?

    This issue also prevents using the Shore node to generate a shoreline, since neither biome graph knows what the final height map resulting from the mixing of the biomes will be.

    I suspect there are only two solutions: writing a script to remove trees that are placed underwater or creating a biome just for coastal areas. In fact, I think the later is the only solution to make the Shore generator work.
     
    Last edited: Jun 5, 2017
  6. SSL7

    SSL7

    Joined:
    Mar 23, 2016
    Posts:
    296
    getting this error after upgrading to 1.8.1 and tried to make a build:

    Assets/MapMagic/Main/Chunk.cs(269,13): error CS1061: Type `UnityEngine.Terrain' does not contain a definition for `bakeLightProbesForTrees' and no extension method `bakeLightProbesForTrees' of type `UnityEngine.Terrain' could be found. Are you missing an assembly reference?

    worked fine on 1.8
     
  7. intrus18

    intrus18

    Joined:
    May 31, 2017
    Posts:
    3
    Hi, I haven't purchased the application yet, I've been watching the tutorials you created @Wright but still have some questions. I'm very new to Unity, less than one month of use, but I have a background in software development so things are making sense quickly.

    How would you go about utilizing Map Magic to generate worlds completely programmatically?

    I noticed that we use a very neat node system and create the procedural world with layers- I guess I'm a bit confused as to how we use that to spawn a unique environment without going through that manual process every time?

    Thanks!
     
  8. jessejarvis

    jessejarvis

    Joined:
    Aug 9, 2013
    Posts:
    286
    Essentially you'll want to go through that manual process only for each environment/biome. Once a Biome is setup it's procedural and endless, but that manual process is needed to make sure you don't end up with spiky terrain or terrible environments. It's procedural and endless but it's not automatic. It just needs some fine tuning at the beginning, and then it can be used infinitely.

    This is if I am understanding your question correctly.
     
    intrus18 likes this.
  9. intrus18

    intrus18

    Joined:
    May 31, 2017
    Posts:
    3
    Thanks @jessejarvis, I was watching this particular video from the author -
    where he creates multiple biomes then blends them together into one larger terrain.

    I noticed in the video, there was just one node being used and that node already had everything set up in it; terrian, textures, assets. Was this node a prefab of some sort that can be reused programmatically after creating it?

    My question is just that - "It just needs some fine tuning at the beginning, and then it can be used infinitely." - If it's not too much trouble, can you give a quick example of how to access it in code?

    Thanks again
     
  10. Sander1991

    Sander1991

    Joined:
    Aug 25, 2014
    Posts:
    162
    I can not build my game cause of mapmagic. I am using unity 5.6.1f1. These are the errors:
    Code (CSharp):
    1. ArgumentNullException: Argument cannot be null.
    2. Parameter name: key
    3. System.Collections.Generic.Dictionary`2[UnityEngine.Transform,System.Collections.Generic.List`1[MapMagic.ObjectPool+Instance]].Add (UnityEngine.Transform key, System.Collections.Generic.List`1 value) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/Dictionary.cs:391)
    4. MapMagic.ObjectPool.OnAfterDeserialize () (at Assets/MapMagic/Main/ObjectPool.cs:339)
    5. UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()
    6.  
    Code (CSharp):
    1. ArgumentNullException: Argument cannot be null.
    2. Parameter name: key
    3. System.Collections.Generic.Dictionary`2[UnityEngine.Transform,System.Collections.Generic.List`1[MapMagic.ObjectPool+Instance]].Add (UnityEngine.Transform key, System.Collections.Generic.List`1 value) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/Dictionary.cs:391)
    4. MapMagic.ObjectPool.OnAfterDeserialize () (at Assets/MapMagic/Main/ObjectPool.cs:339)
    5. MapMagic.MapMagic.OnAfterDeserialize () (at Assets/MapMagic/MapMagic.cs:381)
    6. UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()
    7.  
    Can you help me?
     
  11. intrus18

    intrus18

    Joined:
    May 31, 2017
    Posts:
    3
    @Sander1991 Looks like you are passing a NULL key parameter to the method. Step through your code and see what happens prior to that method call *whatever it is*, it's erroring out because the parameter is null.

    Try something like this:

    if (!string.IsNullOrEmpty(key) )
    Debug.Log ("KEY OK");
    else
    Debug.Log ("KEY NULL");

    Maybe give us a bit more context here, shows a bit of the method call?
     
  12. Sander1991

    Sander1991

    Joined:
    Aug 25, 2014
    Posts:
    162
    @intrus18 Thanks, but I do not even touch his method. It is something MapMagic side.
     
  13. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,659
    yrucrem, try using this node configuration:
    SquareStampsGraph.png SquareStamps.jpg

    dlevel, here is a quick fix (copy to MapMagic\Main\Chunk.cs replacing the older file).

    intrus18, this node is a biome itself. Consider it as a folder containing a separate graph that could be masked using biome mask map. You can save the graph data using "Store" or "Store as Copy" buttons in the General Settings - data, and then assign this data to a biome in a different graph. One biome I've used is the demo scene, two others were from the project I was working on.

    Sander1991, does this happens in a clear project? I've just tried to make a build both in 5.6.1 and 5.4.5 encountered no problems except the one dlevel mentioned. So I need some more information about how to reproduce this bug.
    PS try the fix mentioned above - it was not made to solve this problem, but who knows if it may help.
     
  14. Sander1991

    Sander1991

    Joined:
    Aug 25, 2014
    Posts:
    162
    @Wright It is easy to fix. Just add:
    Code (CSharp):
    1. if(prefab != null)
    to the Objectpool file at line 339 and I was fine. I did not encounter any furhter issues after it. Everything got further instantiated, so I guess this is the fix ;)
     
  15. mh114

    mh114

    Joined:
    Nov 17, 2013
    Posts:
    291
    Hi @Wright and others! I have a question about the terrain resolution setting. On the MapMagic evaluation demo, the resolution setting worked intuitively as it should, i.e. only affecting the resolution of the output terrain, not the shape. Now, we purchased MM and much to our disappointment, it seems the resolution works differently. It seems to scale the noise as well, so it is no longer useful for keeping the resolution down to, say, 256 while working and then upping it to 512 for the final terrain. Because the noise scales the terrain is vastly different, only the corner near the origin is the same. This feels very counter-intuitive to me.

    I can work around it by adjusting the noise size accordingly, so for example with the default settings use 200 for 512 and 100 for 256 to have the same terrain shape. Is this a bug or a feature? In any case, I'm hoping for a change towards the old behaviour, where the noise scale didn't change with the resolution. :)
     
  16. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,118
    you can use this in a custom noise generator:
    just copy the generator, but with this added into it to compensate for any resolution.

    Code (CSharp):
    1. int multi = 1024 / MapMagic.MapMagic.instance.resolution;
    2. ...
    3. result = noise.LegacyFractal(x * multi, z * multi, detail);
    1024 being the max in this case. so 1 will = 1. at 512 1 will = 2 so calculations will spread out for the same look across all resolutions
     
    Last edited: Jun 7, 2017
  17. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,659
    Sander1991, this could happen if the prefab is not included in build (or was removed somehow before the scripts compile). Does it really happens with the prefab? Anyways I'll add a guard clause for that.

    mh114, it's a new Noise Generator behavior. Yeah, I must admit that it's really counter-intuitive and not very convenient. I will see what I can do with it, guess I'll take malkere's advice and add 512/terrainResolution factor (but not in coordinates - they are ints, this will fail on <1024, but in scale value).
    BTW you can use the old noise algorithm (Legacy - Noise 1.7) that is resolution-independent.
     
    Last edited: Jun 7, 2017
  18. secondsight_

    secondsight_

    Joined:
    Mar 2, 2014
    Posts:
    132
    I´ve updated to 1.81 in a clean project. I have noticed that changing the terrain resolution also changes the terrain height ? Is that supposed to be ? At least I have never noticed this and it also makes not much sense to me. So, is it a bug ?

    Here are to shots to show this: http://imgur.com/a/EKL02

    Edit: I´ve just read the threads above according to the new noise generation behaviour. This seems to be also my problem. From what I´ve gathered:
    If I raise the terrain resolution, the previous noise function tiling is kept. So I would have manually change all noise sizes in my scene to keep the terrain that I want just in higher resolution ?

    This change does not make any sense to me from a useability standpoint. To the opposite: My old terrain are now useless (even broken) when I change the resolution, because it totally changes the look. Before changing the resolution just added details to an already existing terrain and it kept the topology.
    Will downgrade to an older version now.

    It was okay before, why the change ?
     
    Last edited: Jun 7, 2017
  19. reduktion

    reduktion

    Joined:
    Sep 27, 2012
    Posts:
    22
    Hi

    My game crashes on launch on iOS as soon as I add a simple Objects Output with a scatter (see screenshot). When I remove the connection between the Object Output and the scatter, everything works fine.

    Any guesses what might be going on?
    Screen Shot 2017-06-07 at 12.54.23.png Screen Shot 2017-06-07 at 12.48.17.png
     
  20. yrucrem

    yrucrem

    Joined:
    Aug 5, 2013
    Posts:
    17
    Great, thank you so much! I really need to get a hang of that curves, they definitely make or break quite a lot :).

    Thanks again and best regards,
    Patrick
     
  21. Dwight_Everhart

    Dwight_Everhart

    Joined:
    May 11, 2014
    Posts:
    123
    @Wright Any thoughts on my problem with placing trees whose elevation is affected by the mixing of two biomes? Or on how to create a shoreline where a land biome and an ocean biome are mixed? These problems seem like general issues that would affect many things where biomes are mixed. They could be solved if there were a way for nodes to know what the final elevation of an object or terrain will be after the biomes are mixed, but I imagine that would be problematic, since MapMagic probably fully evaluates each biome before mixing the results.
     
  22. jessejarvis

    jessejarvis

    Joined:
    Aug 9, 2013
    Posts:
    286
    Oh, and anybody can answer this one, but I want to stop certain textures from appearing below a certain value. How do I achieve this?

    Mainly I want to stop the cliff textures from appearing in the ocean/water.
     
  23. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,118
    That's what curves are for. Feed your final height output into a portal and name it height. Then feed a height output portal into a curve that starts from x0.5,y0, and goes to x1,y1. Now take whatever is generating your cliff texture and add that height curve as a mask. If you can't add it as a mask on the final stage just create a curve and leave it as a normal straight incline between your cliff and your texture node but add the mask to the curve.

    that assumes your water starts at 0.5 or 500 if your terrain is 1000. so adjust that to whatever you need it to be. I find it helps to use quite a few curves to make sure things go to zero where you want the too otherwise there's usually a little 0.01 blended in and you end up getting a little grass on some rocks or a tree in the snow, etc.
     
    trilobyteme likes this.
  24. Exbleative

    Exbleative

    Joined:
    Jan 26, 2014
    Posts:
    204
    Is there any upgrade notes for custom generators? I'm a highly average coder and don't know what to do to get rid of these errors. I went from around V1.7 to 1.81:

    'ChanceMapGenerator' does not implement inherited abstract member 'Generator.OnGUI(GeneratorsAsset)'

    'ChanceMapGenerator.Generate(Chunk, Biome)': no suitable method found to override
     
  25. Exbleative

    Exbleative

    Joined:
    Jan 26, 2014
    Posts:
    204
    I'm getting a similar error after upgrading from 1.7, but wasn't using terrain alignment for objects. I'm using 1.8.1:

    Thread Error: System.IndexOutOfRangeException: Array index is out of range.
    at MapMagic.Matrix2`1[System.Single].get_Item (Int32 x, Int32 z) [0x00001] in E:\Exbleative\EXO-ONE\UnityProjects\EXO-ONE-5.6\Assets\MapMagic\Main\Matrix2.cs:486
    at MapMagic.NoiseGenerator1.Generate (CoordRect rect, MapMagic.Results results, Size terrainSize, Int32 seed, System.Func`2 stop) [0x002e8] in E:\Exbleative\EXO-ONE\UnityProjects\EXO-ONE-5.6\Assets\MapMagic\Generators\LegacyGenerators.cs:329
    at MapMagic.GeneratorsAsset.GenerateWithPriors (MapMagic.Generator gen, CoordRect rect, MapMagic.Results results, Size terrainSize, Int32 seed, System.Func`2 stop) [0x000b2] in E:\Exbleative\EXO-ONE\UnityProjects\EXO-ONE-5.6\Assets\MapMagic\Main\GeneratorsAsset.cs:656
    at MapMagic.GeneratorsAsset.GenerateWithPriors (MapMagic.Generator gen, CoordRect rect, MapMagic.Results results, Size terrainSize, Int32 seed, System.Func`2 stop) [0x00057] in E:\Exbleative\EXO-ONE\UnityProjects\EXO-ONE-5.6\Assets\MapMagic\Main\GeneratorsAsset.cs:644
    at MapMagic.GeneratorsAsset.GenerateWithPriors (MapMagic.Generator gen, CoordRect rect, MapMagic.Results results, Size terrainSize, Int32 seed, System.Func`2 stop) [0x00057] in E:\Exbleative\EXO-ONE\UnityProjects\EXO-ONE-5.6\Assets\MapMagic\Main\GeneratorsAsset.cs:644
    at MapMagic.GeneratorsAsset.GenerateWithPriors (MapMagic.Generator gen, CoordRect rect, MapMagic.Results results, Size terrainSize, Int32 seed, System.Func`2 stop) [0x00057] in E:\Exbleative\EXO-ONE\UnityProjects\EXO-ONE-5.6\Assets\MapMagic\Main\GeneratorsAsset.cs:644
    at MapMagic.GeneratorsAsset.Generate (CoordRect rect, MapMagic.Results results, Size terrainSize, Int32 seed, System.Collections.Generic.HashSet`1& changedTypes, System.Func`2 stop) [0x00183] in E:\Exbleative\EXO-ONE\UnityProjects\EXO-ONE-5.6\Assets\MapMagic\Main\GeneratorsAsset.cs:307
    at MapMagic.GeneratorsAsset.Calculate (CoordRect rect, MapMagic.Results results, Size terrainSize, Int32 seed, System.Func`2 stop) [0x00011] in E:\Exbleative\EXO-ONE\UnityProjects\EXO-ONE-5.6\Assets\MapMagic\Main\GeneratorsAsset.cs:222
    at MapMagic.Chunk.ThreadFn () [0x0005a] in E:\Exbleative\EXO-ONE\UnityProjects\EXO-ONE-5.6\Assets\MapMagic\Main\Chunk.cs:207
    at MapMagic.ThreadWorker.ThreadFn () [0x00020] in E:\Exbleative\EXO-ONE\UnityProjects\EXO-ONE-5.6\Assets\MapMagic\Main\ThreadWorker.cs:501
    UnityEngine.Debug:LogError(Object)
    MapMagic.ThreadWorker:ThreadFn() (at Assets/MapMagic/Main/ThreadWorker.cs:525)
     
  26. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,118
    I think the input for Generate has changed so you're not providing enough variables. I copied a newer generator and re-worked it to look like my old custom generators as there were changes like you mention that wouldn't let me just throw them in anymore. Most of that stuff you don't have to mess with though, depending on what you're doing. Just so long as the result gets the attention you want it to have.
     
  27. SSL7

    SSL7

    Joined:
    Mar 23, 2016
    Posts:
    296
    Is there any way to change textures of grass/trees etc. and don't affect the locked terrains transformation? That would be handy because i have my locked terrain with the village etc. and now i want to change density/textures etc. and if I unlock the terrain i will lose all the transformation changes which are a lot.
     
  28. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,118
    MapMagic just generates the terrain, then it's a normal unity terrain. You can go to the terrain itself and change the grass and textures etc. I'm not sure if changing the grass will clear it, but I don't think so, it should just change the prototype without resetting the data. Try it in a blank scene first if you want to be sure though.
     
  29. SSL7

    SSL7

    Joined:
    Mar 23, 2016
    Posts:
    296
    hi @malkere! Yes this is what I do, and it works, but now I have the problem that if I want to change the density of trees, for example, is not possible, I use mapmagic to also have some events on trees (in the exact position they spawn) so it helps a lot.
     
  30. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,118
    @dlevel Well, you could always write a script to go through and save your heightmap data, it's just a jagged float array. Then make all the changes you want to map magic, lock the terrain, and reapply the heightmap data. Or tree data, or grass data, or whatever. They're all just float arrays.

    @Wright That would probably be a pretty loved feature. An option to export/import heightmap data to a file, or tree data, or splat data etc. Pretty easy for a programmer like Wright, but not for everyone.
     
    SSL7 and The_Uber_Rasta like this.
  31. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    782
    I got the global seed's meaning now, but the problem is: legacy noise node seeds have no effect now.
    And I always get this error as long as Mapmagic is in the scene:

    windAsset.GetInstanceID () == 0 || windAsset == wind
    UnityEditor.DockArea:OnGUI()
     
    Last edited: Jun 8, 2017
  32. secondsight_

    secondsight_

    Joined:
    Mar 2, 2014
    Posts:
    132
    Hey again,
    Another thing I have noticed a few times is that the slope does not work correct. All values below 1 degree result in errors. I´ve already encountered this while assigning a texture from 0 to 10 degrees. If I use the value 0, the texture does not show up at all.

    Now I was able to reproduce this with grass leaves. I want grass be scattered from 0 to 10 degrees. Strangly, the grass is also rendered on steep slopes. This is the case until I set the first value to 0.5 or higher.

    Here are three shots documenting this
     
    malkere and Dwight_Everhart like this.
  33. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    782
    It's an old issue, I use 10 to 90 degree and then use invert node to choose 0 to 10 degree areas.
     
  34. jessejarvis

    jessejarvis

    Joined:
    Aug 9, 2013
    Posts:
    286
    I took the Island demo and am trying to convert it into Voxeland, but even though I set the terrain height to 1,000 it's not updating. In fact I even set it to 0 and it's still not updating. Is there a setting I am missing?



    Edit: I also haven't figured out grass yet either, trying to fiddle around with that.

    Edit 2: Is there a way to give the terrain a shader so that certain textures are vertex color, like grass being different shades of green, etc?
     
    Last edited: Jun 8, 2017
  35. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,659
    Thanks everyone for the feedback! I'd like to ask you to use Issues Page to report all of the issues found, or at least duplicate your post with an issue report. This way I can track all of the bugs, fix them rapidly and ask for additional information about each one of them. Thanks in advance!

    If this is could be related with a noise issue, have you tried a quick fix? I'm trying to change the resolution using the fixed version and it seems that it does not change the height.

    I don't think that the access from the graph to the final height is possible. The reason is that MM generates all of the biomes first, and then blends them together creating a final height. I suppose that it would be possible to make all of the biomes generate height, and generate objects only after it's blended, but this will make a system too complicated. I'm thinking of other solutions like:
    - prohibit object spawn below some certain level in object output - I don't like it because it's not universal solution
    - use different masks for height and objects (as well as trees, grass and textures) - I like it but I'm not sure that it will solve the problem;
    - post-process the spawned objects using mapMagic.OnApplyCompleted(Terrain terrain) event. Not a very elegant solution, but at least it works.
    Maybe someone from MM users have a better idea?

    Speaking about floating objects - I was not able to reproduce it. Please take a look if the steps I took to reproduce it were right.

    What is the ChanceMapGenerator? I suppose it's a third party custom node - if so I could fix it and place on MM wiki, but I need a permission from the author.

    Yep, I plan to change the way lock work - instead of locking all of the Output Generators you will be able to select what outputs should be locked - for instance, you can lock textures and let the grass generate.

    That's the one I was not aware of. Don't hesitate to report an issue (and it would be great if you could use the issues page)! From time to time I encounter some bugs and fix them, but reporting an issue will greatly speed up the fixing process :)

    That's why it is legacy now. I can't add a seed to the noise generator that is already used by numerous people since it will break all of their generate results. That's why I create a new noise generator, moving the old one to legacy tab. You can use the new noise, but don't forget resolution fix.

    Could you please share the scene? I will appreciate if you could use the issues page.

    Does connecting just a noise generator to the Voxeland Output changes anything?

    Are you talking about preview?
    Preview.jpg
     
    Dwight_Everhart and malkere like this.
  36. Exbleative

    Exbleative

    Joined:
    Jan 26, 2014
    Posts:
    204
    Yes, it's a 3rd party generator, but that was just an example - all the 3rd party generators I'm using (that other people have created) have these two errors. I thought it'd be easier for me to try and fix them rather than track down the authors and ask them to update :)
     
  37. yrucrem

    yrucrem

    Joined:
    Aug 5, 2013
    Posts:
    17
    Hello @Wright

    I am starting to feel a bit cursed with my rectangular flattening. I recreated the exact graph you posted in your previous answer (at least as far as I can see), but there are not flattened areas at all. The Flatten node does its work, only as long as I do not use the output from the Stamp as a mask. So I can get the circular flat areas, but as soon as I use the mask, the result looks just like the original terrain.

    This is my version of the graph (and next to it is yours for reference).
    1-graph.jpg SquareStampsGraph.png

    These are the output of the Stamp node, the output of the Flatten node without setting the mask, and the final result respectively.
    3-stamp-only.jpg 2-flatten-only.jpg 4-result.jpg

    Although I do not think that this granularity makes too much of a difference, the slope in the Curve attached to the Simple Form starts at x = 0.15 and reaches its maximum value at x = 0.55. The fallof in the Flatten node starts at x = 0.0 at reaches its maximum at x = 0.5.

    This is a brand new scene in a fresh project, where I did not change any other settings of the Map Magic object. I am not sure if this information helps, but since I am getting kind of desperate, I will also add that I am using Unity 5.6.1f1 (64-bit) and Map Magic 1.8.1 on Windows 7.

    If there is any other information I could provide, I will happily do so. Should this be an actual issue of Map Magic, I will of course also create one on the gitlab page.

    Again thanks in advance for your help, and best regards!
    Patrick
     
    Last edited: Jun 9, 2017
  38. Sander1991

    Sander1991

    Joined:
    Aug 25, 2014
    Posts:
    162
    @Wright Is it possible to generate something like that on the unity terrain? So I mean the borders.


    I was trying to achieve something like that with an alpha texture but it does not work how I like. If this is possible, can you show me a simple example of the nodes, how to get something like that?
     
  39. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,659
    yrucrem, here is the exported version of my node graph. Unfortunately I have not saved that scene, so I've just created it once again - so some values may vary. I'm also using MM 1.8.1 with Unity 5.6.1 on Windows 7 (however I'm pretty sure id does not depend on OS or Unity version).

    Exbleative, was it made for MM 1.7? If so I'm going to update "creating custom generator" tutorial on wiki, it might help to fix this generator. Or should I make a special tutorial like "upgrading custom generator"?

    Sander1991, I'm not sure what you exactly trying to achieve? Do you mean to make these streams (are they streams?) with MM? To be honest, I don't quite get what is shown on the picture, sorry :) What is it's scale?

    EDIT: Patrick, just an idea: are you using a terrain that is located not in 0,0? In this case try Simple Form wrap mode to "Tile".
     
  40. Exbleative

    Exbleative

    Joined:
    Jan 26, 2014
    Posts:
    204
    Yeah, they all worked in 1.7. A Creating Custom Generator tutorial in the wiki would be good. Perhaps just some quick notes on how to upgrade?
     
  41. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,118
    You mean the cracks in the area where the green and brown come together? I you're using noise to create the brown over the green or vice versa, you could setup a curve using the same noise and only capture the part where it is blending between green and brown and use it generate the cracks. then add that output in a blend to the brown, or subtract it in a blend from the green.
     
  42. yrucrem

    yrucrem

    Joined:
    Aug 5, 2013
    Posts:
    17
    Hello @Wright

    Thank you very much for the quick response, and all your effort!

    Unfortunatelly even the imported graph does not yield the expected result, but this:
    1-result-from-imported-graph.jpg

    Aside from slight variations in the exact forms, the "intermediate" results (just the stamps, and flattening without mask) look like the screenshots in my previous post. Could this perhaps be because of some general MM or even Unity settings? All my tries were done on a fresh project, where I only added the MM object and edited the graph, I did not change any other settings (also the Unity3D installation itself is quite fresh, and I don't think I changed any possibly relevant settings there).

    These are the settings of the MM object (split in two because the general section is quite long):
    2-general-settings.jpg 3-other-settings.jpg

    The MM object is indeed at 0,0. I tried setting the wrap mode to "Tile" anyway, but to no avail.

    I also attached my scene and the node graph, and would be ever so thankfull, if you could try if this works for you. And if so could you please attach a screenshot of the result?

    View attachment square-flatten-scene+graph.zip

    I am aware that I get a bit tedious, and I really appreciate your patience and support. Sorry, if some of the questions seem rather stupid, but my desperation beats my shame for asking dumb questions currently :).

    Thanks again and best regards,
    Patrick
     
  43. Dwight_Everhart

    Dwight_Everhart

    Joined:
    May 11, 2014
    Posts:
    123
    Thank you for your thoughts on blending biomes. I realize this is a difficult issue, due to the way Map Magic produces biomes before blending them. There's no easy solution. Using different masks might be a good solution, but this would only help with objects, not generators that affect the height map, like the Shore generator.

    Perhaps you could allow some generators to be applied after the biome mixing is done, maybe by adding outputs to the Biome nodes. Those outputs could then be processed by other nodes, like the Shore node. If the Biome node produced an output of the final height map, the Shore generator could then be applied to that output.

    Without outputs like that, to generate a shoreline, I think I will need to create a coastal biome between the ocean and the interior landmass and ensure that no biome blending is occurring at sea level. That might be difficult, though, since I don't know which side of the biome the ocean will be on. I'll come back to the shoreline issue later. What I have now is good enough for developing a beta of my game.

    For now, I am removing the trees in OnApplyCompleted(), and that works fine.

    I was unable to reproduce this issue with Map Magic 1.8.1 on Unity 5.6.1p2. Looks like it is fixed!
     
    malkere likes this.
  44. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,659
    yrucrem, odd thing. Downloading your scene, will take a look at it this evening.

    Dwight_Everhart, will think about the neat way to solve this. Thanks for checking the floating objects issue!
     
    Dwight_Everhart likes this.
  45. twodave

    twodave

    Joined:
    Sep 26, 2016
    Posts:
    24
    Oops, I think I used the wrong thread, let's try here instead:

    Hi @Wright :)

    Are there any plans to extend the generation types to include 3D noise sources, ie simplex with three dimensions? I'm interested in having the voxeland output accept 3D noise for placement of blocks in a layer, but before I try to embark on that myself, wanted to check if you had any plans for it.

    I was probably going to add a new Inout type which handled Matrix3 data, and extend the voxeland output side with a new absolute-3d mode which accepted the full 3D data. It would allow volumes of block types to be created, absolute layer type doesn't quite do it as it really ends up with only one layer of variable thickness, not overlapping multiple volumes.

    Thanks!
     
    malkere likes this.
  46. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    782
    What you need is a terrain shader with height blend features. Check this: http://u3d.as/9uD
     
    Dwight_Everhart likes this.
  47. RandomDevil

    RandomDevil

    Joined:
    Dec 15, 2016
    Posts:
    11
    @Wright and @jbooth
    Is there any documentation on using the MegaSplat output in MM yet? My company has me testing the new features and I'm having some trouble getting it working and I wanted to check before writing too much.

    For those of you out there trying to use it, I've been able to follow the steps in jbooth's videos to convert a terrain to MegaSplat, then just put the resulting material into MM as a custom material.

    @Wright I also have some notes from our software developers that I wanted to share and see what you think. Cases can be made at your request.

    To preface, our developer has made a script that pins each terrain tile and exports its data one at a time (11 threads when applicable). Direct from the developer: When a Throw is caught in method ThreadWorker:ThreadFn(), an error is logged but the task is started again in UpdateThreads(). In our case, the thread later throws again and this repeats forever until the coordinate is unpinned. [This is in reference to a tile that was having an issue and would never render]

    They go on to say that, when a tile finishes, it signals that it has and we can pick that up with our script, but when it fails, nothing is sent that we can detect. This was found with the option to angle objects to the terrain angle having that bug early on in 1.8. So, they have this suggestion: Add a user event for task failures (when processing a pinned coordinate). Then the user’s code can decide what to do next.For example: public static event ChangeEvent OnFailed; public static void CallOnFailed (Coord coord) { if (OnFailed!= null) OnFailed (coord); }

    The last suggestion is beyond me to elaborate on: Add the pinned coordinates to the Debug.LogError() message inside the Catch block in ThreadWorker:ThreadFn().

    If either of you feel communication is better via email, please let me know what email address(s) to send to and we can continue the conversation there.

    Thanks.
     
    Last edited: Jun 13, 2017
    Dwight_Everhart likes this.
  48. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,311
    I managed to fix this by just deleting the WrGlobalDefineSwitcher.dll that is included with MapMagic. I'm not sure what it was used for (switching global defines I'd guess ;) ) but it apparently kept changing the defines by deleting a bunch of them, which would force a recompile, which would make all the other assets that change the defines in the normal way (just appending themselves if not there), which would force a recompile, which would cause WrGlobalDefineSwitcher to run again and delete them, etc, etc.
     
  49. Darren_Therrien

    Darren_Therrien

    Joined:
    Jun 30, 2016
    Posts:
    33
    OK everyone. Have a bit of an issue. I have gone through the hour plus tutorial a few times and all was well using a half hazard map shape and all was working as expected. Very cool. Pretty good at using the app but now I have run into this. I started a new project, re-imported the app and created the exact shape I needed for my landscape but now I am getting a huge problem when importing the raw file created in Photo shop. Newest version and same place I created the original following the tutorial with no issues. All of a sudden I am getting a warning and ... well see images. I am stumped. Can anyone help? I did the lighting thing going to window/lighting and hit generate .Nothing different. I tried several times with different created height maps but same issue. First of all, not very experienced with photoshop but I did use a ping file set up with proper background color etc. Googled everything to make it right but that was the first time I got this. After that just creating as video explains all are like this now. Not sure if that has anything to do with it or not just throwing it out there. Warning.png WTF.png WTF2.png

    Reinstalled Unity and fixed lighting warning but still getting strange terrains.
     
    Last edited: Jun 14, 2017
  50. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,659
    twodave, yep, I have plans for implementing Voxel object Input/Output, but I'm going to make it after the Splines support. And I think I will use compressed Voxeland data instead of Matrix3 - the last one consumes too much memory (like the standard Matrix multiplied by quarter of terrain height).

    Hm, that makes sense. I'm adding it in my to-do list.

    I think it's better use GitLab for that. You can event create merge requests to make further MM versions compatible with your project. Just email me GitLab accounts of the developers so I could open an access to repository.

    makeshiftwings, there was an issue with the switcher in Beta, but I've fixed it. Do you still experience endless compilations loop?

    Darren_Therrien, LightingData warning is seems to be not related to the issue - it just says that light was saved in old format for demo scenes to make them compatible with 5.4.x, and will be re-calculated once you open the scene.

    I guess that the problem is in file save in Photoshop. It should be 1-channel (grayscale), 16bpc with PC byte order. Please check if you are working in RGB or grayscale mode in Image - Mode.
     
unityunity