Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Map Magic World Generator - a node based procedural and infinite game map tool

Discussion in 'Assets and Asset Store' started by Wright, Mar 10, 2016.

  1. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,227
    Blueberry, a Flatten generator might be what you are looking for. It makes the land around the object (for instance, the center of your town) flat.

    Hellhound_01, as far as I can see Unity does not support tree prefab rotation in any axis. Whatever is set there - the tree will be created with 0,0,0 anyways. I think it could be hacked by creating a parent prefab with zero rotation, but I'm afraid that in this case you'll deprive imposter trees.

    Acissathar, I could reproduce the problem you described. Really odd thing, grass mesh added through the Grass Output generator does not have an opacity, while the same prefab added to terrain directly has. I'll find out why it happens.
     
    Last edited: Aug 16, 2016
    Acissathar likes this.
  2. Acissathar

    Acissathar

    Joined:
    Jun 24, 2011
    Posts:
    669
    I'm glad I'm not just crazy, thank you for looking into it!
     
  3. Weezel

    Weezel

    Joined:
    Apr 20, 2013
    Posts:
    25
    This looks great! How do I import that asset file you shared? I can't find an import option.
     
    Pequisto likes this.
  4. Hellhound_01

    Hellhound_01

    Joined:
    Mar 5, 2016
    Posts:
    95
    @Wright Thanks for your hint. I've figured out that the rotation issue is an old problem of the 3dmax export and should be solved in 3ds max.
     
  5. Exbleative

    Exbleative

    Joined:
    Jan 26, 2014
    Posts:
    216
    I've recently been pushing things a bit in MM to see how far I can go before crippling performance, and I'm curious if other people have had this same experience. Basically, I seem able to push huge amounts of polygons, around 2M or so before seeing any slow down, yet if I try pushing the range that new terrains generate from 2000 to 3000, it'll probably reduce my frame rate from ~60 to 30-40.

    When pushing higher generate distance/more terrains, my poly count barely moves, so I'm guessing for whatever reason, having lots of terrain segments really kills performance. Is this pretty much right? I've got 256 res on MM with a 1000 terrain size, pixel error 10.
     
  6. tanoshimi

    tanoshimi

    Joined:
    May 21, 2013
    Posts:
    297
    My guess would be it's the terrain colliders causing the extra load, but why guess? That's what the profiler is for....
     
  7. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,227
    I don't think it's a bug that Unity should fix - it is the way 3ds max works. It has a Z axis pointed up, and Y - horizontally. There is a solution in the thread you linked - to rotate an object pivot before exporting.
    Btw I saw an "axis conversion" feature on fbx export where you can choose what axis should point up, but have not tried it yet.

    Exbleative, I guess that increasing pixel error can give a significant performance boost. Looks like the polygon amount is the bottleneck here, but tanoshimi is right, there is hard to say for sure without profiling.
     
    Last edited: Aug 18, 2016
  8. secondsight_

    secondsight_

    Joined:
    Mar 2, 2014
    Posts:
    163
    You should be able to load the nodes with right click in the MM editor window.
    No assets or texture are included, so you have to replace them with you own.
     
  9. MrIconic

    MrIconic

    Joined:
    Apr 5, 2013
    Posts:
    239
    Any insight into how you handled the spawning of your buildings?
     
  10. allpay

    allpay

    Joined:
    Mar 28, 2012
    Posts:
    31
    Hi, my manual adjustments of pinned terrain such as splat map, height, adding tress etc are disappearing at runtime generated terrains. Attached objects as a child of terrain are disappearing also.
    Any way to save these terrain datas and objects?
     
  11. tanoshimi

    tanoshimi

    Joined:
    May 21, 2013
    Posts:
    297
    That's to be expected. You need to **lock** the terrain to prevent it being regenerated at runtime.
     
  12. secondsight_

    secondsight_

    Joined:
    Mar 2, 2014
    Posts:
    163
    Thas actually very simple to do:
    I generate some noise patches of a texture onto the terrain. This will be the base for the houses. Of course the
    patches should be scattered irregulary and have a certain distant between them. Since right now I generate them on island, this simple setup shown below does the trick. On a bigger landmass the noise pattern might be very visible and needs more work (by substracting bigger noise patches for example).



    From there I just put the houses in the objects output and define which buildings should appear more often.
    Also the house density and city dispertion can be controlled here. This is just a (messy) basic setup and can be tweaked in more detail to achieve more varied results.



    I addtion, since I had implemented a time of day system, I also use mapmagic to genereate lights and glow particles
    into the city base. This can be seen here: http://imgur.com/a/2RiHQ

    Hope that helps ?
     
    MrIconic likes this.
  13. secondsight_

    secondsight_

    Joined:
    Mar 2, 2014
    Posts:
    163
    I have a problem:

    I cannot get trees to work. But I´m not sure if it´s a bug or I´m doing something very wrong.
    Tried a lot of setups (with adjust, split) and different trees.
    The trees are generated in a wrong scale, not alligning to the terrain and getting and offest from the mask I want to place it on. You can clearly see this in this shot. In the compile error it says the tree prefabs are missing. I´ve placed on tree in the scene for comparison.



    Has anyone an idea what I do wrong ?
     
  14. Exbleative

    Exbleative

    Joined:
    Jan 26, 2014
    Posts:
    216
    Just did some profiling with generate range at 4000 and 1000.

    Looks like the main difference is Camera.Render>Culling>Terrain.FlushDirty>Terrain.UpdateMaterials which goes from 10ms at 4000 distance, down to 2.5ms at 1000.

    This was all I could find on it: https://docs.unity3d.com/ScriptReference/DynamicGI.UpdateMaterials.html but I don't really get what it does.

    Polygon counts don't seem to matter a huge amount. Setting Generate Range to 2000, pixel error to 0 and drawing 2.2M polygons runs at the same speed as Generate Range of 4000 with a pixel error of 40 (500k polys).

    I couldn't see anything about colliders, at least not in at the top of the list of ms generating things. If colliders were slowing things down, I wonder if we could have an option to turn them off on the non-active terrain?
     
  15. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,227
    secondsight_, I'm curious about what was the first error in the console.
    And does it still spams an error about missing prefab when all of the tree prefabs are assigned?
    Do the trees have an offset in the prefab transform (like the position of 0,10,0)?
    It seems that everything is okay with a graph setup - except the fact that all of the 3 tree types will appear on the same positions, but they should be floored to the ground. So the error seems to be not in the graph.

    It literally updates terrains for dynamic global illumination. But this should not be called when terrains are not marked static or when GI is turned off in lighting setup.

    I guess colliders have an early culling by the bounding box, so until you are not casting thousands of rays through all of the land they should not be a problem.
     
  16. Exbleative

    Exbleative

    Joined:
    Jan 26, 2014
    Posts:
    216
    I've got all GI off and terrains aren't static either. Is there a chance shaders from Relief Terrain Pack calls it perhaps?

    Edit: Apologies, I've linked to the wrong thing. The process taking the time was Camera.Render>Culling>Terrain.FlushDirty>Terrain.UpdateMaterials which I can't actually find anything about at all. Going to see if maybe it's a terrain shader issue.
     
    Last edited: Aug 24, 2016
  17. secondsight_

    secondsight_

    Joined:
    Mar 2, 2014
    Posts:
    163
    That pretty much solved the problem. Thanks !
    For some reasons all trees had a different transform right after importing the package.
    But it could be that I ran into another problem (but I have to test that out in another scene):
    The trees don´t switch to billboards and I cannot define fade ranges. I´ll give you feedback if I cannot solve it or can reproduce this.
     
  18. Exbleative

    Exbleative

    Joined:
    Jan 26, 2014
    Posts:
    216
    I've been using some rock billboards (in Grass Billboard mode) in my Grass Output and don't want them swaying in the breeze, so I've set Bend to 0. However, I'm still seeing them swaying around. Am I missing something? Will this only work in certain modes? Or perhaps it's because I'm not using Unity's standard terrain shader?
     
  19. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,227
    Exbleative, I don't really know what Unity does in this process - but it is not related with MM - it's something about standard terrains. When I tried enabling ~500 terrain this process took only 2.5 ms for me, it's definitely less then terrain rendering.

    It really seems that grass prototype bend factor has no effect on the grass bending even if I set it directly from script, and there is no way to set it in GUI. Looks like they just forgot about that property. I'll make a bug report when I have some time, for now I think I make the same thing Unity did - just remove this property from the GUI.

    secondsight_, as far as I know Unity will use imposter trees only for those objects that have mesh renderer and filter components at the prefab itself and have no child objects. For example, objects with lod groups will not be converted to billboard trees.
     
  20. Exbleative

    Exbleative

    Joined:
    Jan 26, 2014
    Posts:
    216
    You mean a generate distance of 500 right, not 500 terrains? ;) Bummer about the grass too. I guess I'll have to settle for ultra low res rock geometry.

    I've been playing with using a texture input generator. I noticed that upping the scale over ~2-3 really increases load times. It's a 512 jpg, and have set it to advanced, read/write so there's no errors, it's just quite slow to generate, and I've had to ctrl alt del before setting this really high, like > 10.

    Turning Debug on, I can see that setting Scale to 1 = 10ms, while a scale of 4 = 120ms. Unsure if this can be improved?
     
    Last edited: Aug 26, 2016
  21. Exbleative

    Exbleative

    Joined:
    Jan 26, 2014
    Posts:
    216
    Also, playing with Simple Form, Gradient X, I'm getting this error:

    Generate Thread Error:
    System.DivideByZeroException: Division by zero
    at MapMagic.Matrix.Replicate (MapMagic.Matrix source, Boolean tile) [0x00087] in ...

    This happens when I change Scale from say 0.5 to 1 or back. Tiling is on, Intensity 1, offsets 0.
     
  22. w00dn

    w00dn

    Joined:
    Apr 28, 2010
    Posts:
    275
    Wright, thank you for this amazing asset. It's a joy to use :)

    But I have a question: How can saved graphs (MapMagic Editor -> Save All) be loaded at runtime?
    I'm trying to load a random graph every time the game starts. I tried to load one via Resources.Load("graphxyz") and assign it to MapMagic.instance.gens but couldn't get it to work. (No errors, just the default scene graph loaded)

    I'm also having trouble understanding when this all should happen. My guess would be something before the OnApply callback?

    Any help would be appreciated.
     
  23. CastryGames

    CastryGames

    Joined:
    Oct 1, 2014
    Posts:
    76
    when available biomes?
     
  24. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,227
    Thanks for your report, this bug is already fixed for the upcoming version.
    I will try to increase the performance of the scaled texture/raw input generators, but cannot promise it in the next version - it is already nearly released.

    To load new graph on scene start I'd like to recommend using something like this script:
    Code (CSharp):
    1.  
    2.   void OnEnable ()
    3.    {
    4.      MapMagic.GeneratorsAsset asset = Resources.Load<MapMagic.GeneratorsAsset>("MapMagicData");
    5.      MapMagic.MapMagic mm = FindObjectOfType<MapMagic.MapMagic>();
    6.      mm.gens = asset;
    7.      mm.enabled = true;
    8.    }
    9.  
    It could be downloaded here.

    But keep in mind that MapMagic component should be:
    - disabled (it will be enabled once the new asset is assigned) and
    - have no pinned terrains.
    And obviously MapMagicData.asset file should be stored inside the Resources folder anywhere in your project.

    I plan to submit a version that have biomes support in a day or two. Then it will take some time for Unity to review it - usually it takes up to 5 days. But if you need biomes urgently you can still send me your order num and get a beta version in return.
     
  25. w00dn

    w00dn

    Joined:
    Apr 28, 2010
    Posts:
    275
    @Wright
    Thanks, works perfectly! :D
     
  26. superme2012

    superme2012

    Joined:
    Nov 5, 2012
    Posts:
    207
    This is one fine tool you created. I aim to buy it but will PM you the reason for some feedback.
     
  27. CastryGames

    CastryGames

    Joined:
    Oct 1, 2014
    Posts:
    76
    already send mesagge for beta
     
  28. BenoitFR

    BenoitFR

    Joined:
    Jul 13, 2016
    Posts:
    5
    Hello @Wright

    I have an issue with the the forest generation in v1.4 in unity 5.4.
    I'm using a speedtree model and as soon as I let the forest scale the trees, I end up with a giant deformed model. Any ideas ?

    Cheers
     

    Attached Files:

  29. docsavage

    docsavage

    Joined:
    Jun 20, 2014
    Posts:
    1,015
    Hi @BenoitFR,

    I have not had chance to use this part of the tool yet but shouldn't the width box be selected as well as height??? Sorry if that is incorrect.
     
  30. BenoitFR

    BenoitFR

    Joined:
    Jul 13, 2016
    Posts:
    5
    Yeah true ;)
    I was in a hurry so I did not really provide all the info. If I check both the width and height, I end up with giant trees, unless I specify that the forest is 1 year old. But in this case I don't get a forest, juste 1 tree.
    And If I remove the "forest" and use the "adjust" function on the trees, they scale nicely.
     
  31. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,227
    BenoitFR, this is the way forest generator sets the tree age - each year adds 1 to the tree size value. You can use adjust generator after the forest one to adjust tree scale - or completely reset it using the absolute adjust type.

    I've submitted the "biomes" version 1.5 for Unity review today, but I will still send beta version to all who made requests - just in case somebody will find something during the review :)
     
    docsavage likes this.
  32. docsavage

    docsavage

    Joined:
    Jun 20, 2014
    Posts:
    1,015
    @Wright, Please check your private messages. thanks
     
  33. BenoitFR

    BenoitFR

    Joined:
    Jul 13, 2016
    Posts:
    5
    @Wright, thanks for you quick answer. I see how I can control it, but it still doesn't feel quite right to me. One last question then ;)

    If I deactivate the forest (pic1), I get a normal tree.
    Then I activate it with years=1 and reproductiveAge=1 and my tree is scaled up (pic2).
    Finally, i set reproductiveAge=2 and the tree scales up again (pic3). Is it working as intended ?
     

    Attached Files:

  34. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,227
    That seems to be right. Tree size is increasing each year on 1. You can reset the size with the Adjust Generator afterwards.
    I guess it can be rather confusing and not very convenient to use one more generator, so I'll make it as an option disabled by default.
     
  35. BenoitFR

    BenoitFR

    Joined:
    Jul 13, 2016
    Posts:
    5
    The scaling related to the age, I understand, thanks to your answer.
    Since I only had one kind of tree, I could not use a "split" to choose between various trees. So I used a 100 year old forest with maxAge=30, chained with "adjust", this way I can limit the gap between the smallest tree and the biggest tree.
    But why is the "reproductive age" impacting the scale ?
     
    Last edited: Sep 2, 2016
  36. w00dn

    w00dn

    Joined:
    Apr 28, 2010
    Posts:
    275
    I'm trying to swap out textures on the "Texture" output node via code before the terrain is built. Is it possible to access the nodes during runtime? I can't seem to find any information on it.

    I'm currently changing the terrain textures in the OnApply callback as explained in the manual, but that leads to heavy CPU spikes when a new terrain is built. (generating splatmaps). That even happens twice, as the textures assigned via editor will build their splatmap first, then the new ones that get added by my script do the same. It would be nice if I could just swap them out before the generator runs and builds the terrain.
     
  37. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,227
    New version, 1.5 is out.

    Change log:
    - Biome support: now you can mix different unrelated graphs in one, blending them with the biomes masks.
    - New serialization algorithm (fixed lag on connections change and generator remove, fixed nodes disappearing on changing data file outside Unity)
    - New simplified way of placing objects on the terrain height: instead of using the floor generator you can simply enable the checkbox in objects output.
    - Allowance to create multiple output generators in a single graph (in this case height output is applying additive). Now a large list of object or tree outputs could be split in several generators.
    - Editor GUI improvements:
    - the single "Generate" button is now split in two: Force Generate All and Generate Changed. The first one rebuilds terrain from scratch, the other one generates only changed generators when the Instant Generate is turned off;
    - Focus button can quickly pan the graph window to the center of the generators - it could be very useful when switching between biomes;
    - Current zoom value is displayed in top right corner. Clicking on it will return the default zoom.​
    - Custom camera objects with tags to generate terrain around;
    - Improved performance of a Raw, Texture and Simple Form generators when using a large scale.

    Scene and data upgrade procedure: despite of the new serializer v1.5 can load the scenes saved with previous versions. However some manual changes could be required:
    - All of the portal names should be re-entered. All of the portal connections remain unchanged.
    - Output layers names should be re-entered too;
    - Floor generators does not work anymore and should be removed;
    - Now to place object on terrain "Relative Height" should be enabled in Tree or Object Output generator;
    - "Use Multiple Cameras" now replaced with an tagged objects. If you want to spawn terrain around several cameras assign them some tag and turn "Spawn Around Tagged" feature on in General Settings;
    - And as usual it's better to replace all of the legacy generators with the new analogs.

    woodn, CallOnGenerateCompleted is called before an apply after all of the generate work is done. The problem is that there's no an easy way to intercept splat or prototype data from generator - and since there are now actually several splat output generators it all becomes very complicated. What are you trying to achieve - maybe there is some other easy road?
     
  38. Exbleative

    Exbleative

    Joined:
    Jan 26, 2014
    Posts:
    216
    Loving the new version! 1 question - what does "node width" do?

    *edit 2 questions!

    So Enable Range can't be higher than Ggenerate Range, however, I was just trying to test a method where I have an empty game object with a Generate Marker on it 1000 units forward from my player (as you generally travel in one direction in my game). So this way, I'd have terrain generating 1000 around my player and ~ 3000 ahead (1000 ahead with the marker + 1000 generate range from that marker + 1000 terrain size). However if I can't set enable range higher than generate range, this will never work. Unsure if it will work that great in general, but don't know if limiting enable range in this way is the best?
     
    Last edited: Sep 7, 2016
  39. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,469
    Just a random question, is there a way to generate circulation data with this generator? I mean stuff like road, river, anything that connect 2 points or create a network?
     
  40. w00dn

    w00dn

    Joined:
    Apr 28, 2010
    Posts:
    275
    Nice update, thank you @Wright !

    About my problem:
    Lets say I have 40 Textures in the Resources Folder and I want MapMagic to randomly choose 4 of those textures as the predefined slots on the "Textures" node during runtime, how would I go about that?

    As said, so far I've tried to just replace the textures on the terrain in OnApply, but that generates high CPU Spikes for every terrain that is generated.

    I used this:
    Code (CSharp):
    1. private void AssignSettingsTexturesToTerrain(Terrain terrain) {
    2.         SplatPrototype[] tex = new SplatPrototype[4];
    3.         for (int i = 0; i < 4; i++) {
    4.             tex[i] = new SplatPrototype();
    5.             tex[i].texture = terrTextures[i];    //Sets the texture ( from pre-random-shuffled list )
    6.  
    7.             //Set the size of the texture to the same size as the terrain to allow seamless textures
    8.             tex[i].tileSize = new Vector2(MapMagic.MapMagic.instance.terrainSize, MapMagic.MapMagic.instance.terrainSize);
    9.         }
    10.         terrain.terrainData.splatPrototypes = tex;
    11.     }
    I did a comparison test with the same node setup where I assigned the textures manually in the editor and without runtime switching. The CPU Spikes are much smaller and less noticeable.
     
  41. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,227
    Exbleative, theoretically there's nothing that prevents using the enable range higher than the generate one, except the limitation in the MapMagicEditor script, line 227. I didn't get clearly what are you trying to do, but you can try removing the "max" optional parameter from the layout.Field call so it will look this way:
    Code (CSharp):
    1. layout.Field(ref MapMagic.instance.enableRange, "Enable Range");
    It will set the GUI width of the node window. I've started working on this feature for the new version, and overlooked that it's already exposed in settings.

    neoshaman, nope, at least not yet. I plan to implement roads, rivers and other spline objects after the Voxeland integration, so for now do now even have an ETA for that. So if this feature is the main reason why you are going to get MM I'd recommend you to postpone at least for the time I'll start to work on it.

    woodn, maybe it's worth trying changing textures in a texture output generator?
    Code (CSharp):
    1. using MapMagic;
    2.  
    3. void OnEnable ()
    4. {
    5.     //finding the first enabled non-biome splat output
    6.     SplatOutput spOut = null;
    7.     foreach (SplatOutput g in MapMagic.instance.gens.GeneratorsOfType<SplatOutput>()) { spOut = g; break; } //_foreach_ is really needed there, it's an IEnumerable
    8.                    
    9.     for (int i=0; i<spOut.baseLayers.Length; i++)
    10.     {
    11.         spOut.baseLayers[i].splat.texture = terrTextures[i];    //Sets the texture ( from pre-random-shuffled list )
    12.     }
    13. }
     
  42. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,469
    Thanks for the answer, I effectively want to add circulation logic on top of the generator, in general that's what missing in map generation to make them gameplay worthy.

    If you want a use case, implementing a simple rogue like dungeon generation will certainly take care of most of the basis, I think it can be extended for infinite terrain.
    1. The way I understand the basis of most terrain generation is that they hash a position to a spatial range (generally square, triangle for simplex, other shape if you are courageous or experimental, it's call a cell), then they use the position as a seed to generate random data inside that range (vector for perlin at the corner, random points for worley noise), then this data is treated using fancy simple formula to fill the range with usable data (interpolation for perlin, distance comparison for worley). This allow to generate data locally without dependence on previous state or neighbor (like for simulation ex: erosion who is dependent on previous state up to the initial), and when it need the neighbor they don't cascade the dependency (for example worley noise need neighbor points data for distance comparison within its own range).
    2. Inspired by the worley process, I think we can generate an infinite rogue dungeon that would give map extra spice, especially if masked with another map (like biomes or other hash) to constrain the size. Instead of simply generating point within the range we would generate random room, then random links to the room as per rogue instead of using the worley distance check. here some quick variation:
    a. The room are bound distances check from a point (with weight bias along axis for rectangle) which we can threshold to define room (basically typical worley but without the circle distance check), then carving corridor as lines. Continuity between hash is handled by the distance check of neighbor.
    b. The room can be define as a random vector and a size, the length of the vector giving the overall shape (square at length 1) and the size give the scale. Lines are carved between room (either using the origin, or maybe generating extra door points at the wall of the room). Continuity work like worley, we "rasterized" each room base on the overlapping part after a distance check. The room can be any shape or stamp.
    c. Rooms are created inside the range using whatever method but don't overlap adjacent cell, instead we create random points on the edges, which line are connected to room generated, using same seed for adjacent cells that share the edge. Inspired by Worley we can check the neighbor state to decide validity of the point, for example if the neighbor is masked or has a certain state, we can skip the point generation for the shared edges to avoid connecting them to line.
    3. Have logic node that allow designer to create whatever circulation (line drawing) or dungeon data (room placement) they can in the model of the example in point 2. This would allow to make sophisticate city generator for example as city have recurrent patterns (the grid, the tree, the circling) that can be generated locally using variation (overall direction, size of elements, etc ...). Keeping orientation of line (origin and end points) within a cell is also super beneficial.

    One thing I have learn playing with procedural generation, is that often we must think in term of correlation rather than causation to make plausible effects. For example A river is always going down, but once the landscape is generated it's hard to place river that make sense and have control over it, the river is cause by the landscape and precipitation pattern, but the landscape correlate to the river so if we have a river orientation it become easy to create a landscape that match the river (the closer to the origin the higher), which allow to create all sorts of controlled "events" along the river (like creating waterfall where it matter). I have been working on a way to turn the typical scheduled agents simulations into a full local process, and I think I succeeded in theory (and paper test) using this methodology, it allows to have infinite unique persistent npc across infinite generations and timeline (can simulate evolution is the template is given, infinitely precise ancestry tree!), interacting with each others and travelling long distance, at zero cost for the query of the local cell (which know through a clever time hash, and some hierarchical structure, only know what is traversing it and what it is doing).
     
  43. w00dn

    w00dn

    Joined:
    Apr 28, 2010
    Posts:
    275
    @Wright Nice, that works perfectly and is barely noticeable in the framerate drop, thanks! :)
     
  44. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,227
    neoshaman, I think that a more clear use case is creating a road net with various decal crossroads - dungeon is something that is over-complicated with details such as how it will intersect the surface, weld the tunnels with rooms, etc. It's the object of the separate rather complex plugin with it's own art. Roads are easy enough to start with.

    I was thinking about worley function to place nodes, and, actually, it is the only function that will give a 100% guaranteed proper neighbour connections - like in Voronoi Generator. But yet I have not thought about the details - I plan to handle them when I'll start implementing this feature.
     
    neoshaman likes this.
  45. Sir-Spunky

    Sir-Spunky

    Joined:
    Apr 7, 2013
    Posts:
    132
    Hi!

    I just bought this and having a lot of fun already. I just want to thank you again for releasing the demo version which helped me in my decision, as I could test performance and other things in more detail before buying. I wish more asset creators would do this.

    I noticed many people are waiting for RTP support. I think I actually got it to work, although only on non-pinned runtime-generated terrain chunks. In the Inspector, I add a Relief Terrain component to the Map Magic parent gameobject. I also add a disabled Mesh Renderer component (or else RTP generates error messages). Then I set up textures in the Relief Terrain component, and let Map Magic paint those textures using the standard Textures node. The reason it works seems to be because the Relief Terrain component gets automatically copied over to all terrain chunks.
     
    Wright likes this.
  46. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,469
    I understand that! I really meant dungeon in the "asbtract" meaning of the algorithm, I thought of room not as dungeon room or structure, but something like flattening the heightmap to allow spawning any POI structures (as in the current stamp node in map magic) or a mask to change parameter for region, not something as complicated. Maybe I stuck too much with the square space as round shape could also do. (edit: adding the possibility of offseting up or down stamp for POI placement would be cool to create interesting stuff and visual, like creating cavity to spawn stuff in that mimic asteroid crater for example lol).

    Here a flat example of someone (from unity!) who implemented circulation in some form:


    Changing the points generations within each cell (regularity, number, alignment, etc ...) would allow for a great number of structure prototype at almost no additional complexity.
     
    Last edited: Sep 9, 2016
  47. ArturoSR

    ArturoSR

    Joined:
    Feb 21, 2014
    Posts:
    21
    Hello and good day, I absolutely recommend your tool, it's easy to use (after reading the documentation), but there is a node that not understand very well, where the splat node suppose to be?, I make some test and have not the desired result, even unity crash after it, so, could you show me how exactly and correctly use that node?, thanks and I mean it, your tool is great, cheers.
     
  48. Exbleative

    Exbleative

    Joined:
    Jan 26, 2014
    Posts:
    216
    Wow! I think you actually did too, because I also have after following your instructions, nice one!

    The biggest drawback I've noticed while trying to use this, is that you are basically editing most parameters blind, you can't see changes as you work. Unsure if this is a usual RTP limitation, but I could use their standalone triplanar shader and see all changes in real-time. As RTP requires extensive tweaking, it's quite a draw back! Might be able to get around it by using a premade splat, or saving a splat from MM and importing it into a pinned RTP terrain, I'm not sure.

    Also if you try and preview anything without a pinned terrain, the current version of MM will give you an error, and you won't be able to close the preview window. Just pin a terrain and close it if that happens.

    Thanks again! Back to seeing what I can do with this. Hopefully this means RTP integration won't be quite so much trouble(?).

    *edit
    Had some issues getting the pinned terrain's tiling working, but after going into the Unity Terrain component > Paint > Edit Textures, it seemed that once I'd changed the tiling numbers, subsequent changes to tiling in the RTP component then worked. Also, you can just keep the pinned terrain there once setup - it won't grab Map Magic's splats, but you'll be able to use it for real-time tweaking at least.
     
    Last edited: Sep 10, 2016
    Sir-Spunky likes this.
  49. Jiraiyah

    Jiraiyah

    Joined:
    Mar 4, 2013
    Posts:
    175
    Hi,
    I have sent a pm to you at 2nd aug 2016 but you never answered my pm, so here i will re post it :

    i'm sure you have noticed this by now, but, even with fastest computers, generating of a complex system would take time and drop the frame rate, you may sat that we can increase the generation distance, but still, the frame rate drop would be big.
    if i get the whole picture right, you are collecting information from each generator, generating a map and then pass it to the next generator or something like this, maybe you are just traversing the graph and calculate the final position per point in terrain, in both cases, this is a very bad design. many parts of this calculation should be done on threads, and only when you are going to assign stuff to unity terrain you should come back to main thread. another approach can be to generate the maps using compute shaders and then use the generated textures for noises and other stuff to work on unity terrain, this should at least give you boost on calculation parts.
    Now, the second feature that can make map magic more rich is the ability to do these stuff :
    1- add a generator that would populate the whole world with generated terrains in dimensions automatically and then hide most of them unless they are pinned, this should be done in editor, for example you can use another generator to force the system to generate a grid of 10*10 terrains and then hide them unless they are locked or pinned
    2- add another finalizing generator like the height generator, this one should convert unity terrains to mesh objects, it can have the ability to export to obj too. you can take a look at terrain to mesh asset and see what i mean by this. why am i saying this would be good?
    a) the produced mesh and it's related objects on each patch can be converted to asset bundles automatically and based on the position of the player, they would load/unload additive to the scene
    b) unity's terrain is terrible on draw calls and is impractical to work with for mobile devices. that is the main reason you see many many people go for procedural generation of terrain MESH, and your system is already half way there, only instead of putting the data to a terrain, you can produce a mesh, or, give the ability to users to convert the terrain to mesh by adding another generator

    I hope these ideas can become handy for you my friend, I can only add this, i remember that at some point i had found an online repository for noise generators using compute shaders, i lost the link so i can't share it with you, but if you search online, you should be able to find them again

    also, can i suggest that you watch my video tutorials on 3dbuzz.com under unity>rpg api core ? the first chapter is all about a robust and very very flexible node graph editor, it has few bugs but i am recording the second chapter and the first video will fix those bugs and will be free for every member of 3d buzz, maybe you like my system and switch toward using it instead of your own graph editor?
     
  50. FrozenEmpire

    FrozenEmpire

    Joined:
    Sep 10, 2016
    Posts:
    96
    Congratulations on a great looking tool which I'm considering purchasing...
    Being very new to Unity, can you advise how the handling of future updates will work
    If I purchase your tool, do I get all future updates for free, or I may have to pay for these separately ?