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

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,276
    Thanks! I plan to make biomes as a nested generators or a generator groups. The biome intensity would be set using the standard map like noise or heighmap. Imagine a generator with a map input and it's own "Show Editor" button - that will be a biome node.

    Thanks! You can get 1.3 beta by emailing me your order number. I'm testing a new beta version now, so I'll send you it in a day or two.

    MM you've bought isn't going anywhere, so enjoy your vacation! And I'll be done with a new version meantime.

    hike1, evaluation version uses a compiled dlls, so it is not replaced with a full one. Just remove the old version before and upgrade.
    The point of MM is that it does not use a prepared terrain, generating it in playmode. It's more of a terrain generator than a streamer. You can still use a Raw Input generator as a base for the terrain, but note that all of the fine detail should be procedural. Using huge detailed raw files is a wrong approach. You can get more info of the way Raw Input could be used in the beginning of this tutorial:
     
  2. b4c5p4c3

    b4c5p4c3

    Joined:
    Jan 4, 2013
    Posts:
    537
    ------- EDIT -------

    After a while it started working just fine.


    I bought MapMagic yesterday and i'm trying to follow the tutorial video but i can't get the "Pin Terrain" to work. I click the button and in the scene view i click several times and nothing happens. No error in the console, nothing.

    Also if i change the Resolution to 1024 and then to 32 Unity crash. (it's Unity 5.3.4f1 btw)
     
    Last edited: May 25, 2016
  3. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,276
    Odd thing. Do you remember what happened before it started to work? Maybe Unity restart or interface layout reset?

    What MapMagic version are you using? This bug was fixed in 1.2, and I've just checked it again and could not reproduce. You can see the version number in "About" section. If you downloaded MM recently and have not used the evaluation version you should get v1.2, but I need to make sure in it before I'll start to dig further.

    2 all who sent me beta requests: I do receive your requests, but I've encountered some interface bugs, and I'll write back to you as soon as I fix them.
     
  4. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,514
    Probably answered already but didnt want to read the whole thread - any future Voxeland integration?
     
  5. tgienger

    tgienger

    Joined:
    Jul 18, 2013
    Posts:
    45
    Does map magic have the ability to loop terrain and send the player to the other side of the map? World Streamer has this ability and I can't think of what to call it at the moment, but basically being able to walk in one direction and end up back at your starting place.

    On that note, I guess I could create the terrain with map magic and then use the world streamer tool to handle position. Just thought I would ask as it would save a step :)
     
  6. terravires

    terravires

    Joined:
    Mar 27, 2013
    Posts:
    103
    Well I looked into sending you that scene file and was horrified to see a problem... it was 22MB of data. My typical scenes are around 600Kb or less. However, with any map magic stuff the files are 13 - 22MB in size.

    Digging into the .scene file (since it's too large to send via email) and your spalt map serialization is filled with thousands of lines(over 5,000) of this:
    Code (CSharp):
    1.  
    2.   m_DetailDatabase:
    3.   - bounds:
    4.         m_Center: {x: NaN, y: NaN, z: NaN}
    5.         m_Extent: {x: NaN, y: NaN, z: NaN}
    6.       layerIndices:
    7.       numberOfObjects:
    8.  
    But 99% of the data appears to be from some array gameobject with data called "matrix" This object has over 1 million lines of text filled with mostly "- 0" with few random float data.

    This is now causing me problems with normal save functions in unity throwing up access deined errors when moving temp files of my scene file.

    I've already asked in my email, but where do we get access to 1.3 with the different serialiation? I also really need to move to 5.4 as 5.3 is bugged to hell most of my fixes are either in 5.4 or delayed until 5.3.6 which won't be out for some time.
     
  7. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,276
    It's planned, but it will not be soon.

    MapMagic generates terrain linearly. Theoretically it could use tiled noise and tiled voronoi generators, but they are not provided out-of-the-box.
    In this case you'll have all of the terrains baked. It is ok when the size of your scene is small, in other case I'd like to recommend you taking the look at this script. If offsets all of the world to the player position, but I guess it could be changed to make a world loop. Just an idea.
    However there is one more problem - you can get a seam between the end of the world and it's beginning. And here I'm out of ideas.

    terravires, I cannot say for sure what causes that until I'll see a scene. Probably it is the Raw Input generator. Something is definitely not right as the Island Demo scene with all the terrains unpinned is 655Kb in size. You can zip a file (and looks like it can be compressed densily) or use dropbox - to fix this bug I have to work with it.
    Please note that for the pinned terrains all of the data is stored in scene. This takes about 3-5Mb per terrain. If you are using a .raw file as a base for the terrain it will be also stored in the scene.

    BTW I wonder why so many devs are switching to the Unity version which is officially is not stable yet. I can understand using it for test purposes, but to move all of the pipeline to Beta seems to be a bit early. Maybe it has the old bugs fixed, but I have encountered the new ones where 5.3 worked without any problems. One of those prevents using Objects Output the way it should work, so I had to look for a workaround. Unity released B19 recently, hope it has this drawback fixed :)
     
    LaneFox likes this.
  8. tgienger

    tgienger

    Joined:
    Jul 18, 2013
    Posts:
    45
    I can already loop terrains, I was just thinking about using your tool for creation because it's just so nice. I didn't think about the seam. Not sure how to handle that.
     
  9. Smokas

    Smokas

    Joined:
    Mar 7, 2016
    Posts:
    114
    For me main reason was Retina support.
     
    Last edited: May 27, 2016
  10. Ascensi

    Ascensi

    Joined:
    Sep 7, 2013
    Posts:
    579
    @Wright I bought MM on a Unity sale a couple days ago. I thought I would grab it quick as I was unsure if MM would have to be purchased separately to be installed along side with Voxeland for Voxeland MM integration.

    My concern is that I have a Voxeland terrain I'd like to use with MM's more controlled object distribution (trees grass etc) and I wonder will the Voxeland I assign with MM will automatically create nodes of the generation settings that I originally set in Voxeland?

    I understand you're still planning at this stage but this might give you an idea how to integrate it so existing projects can benefit -if you haven't already thought of this.

    I also plan to use World Streamer, TOD for real-time night and day and the displacement shader if it all works. So out after I have a finalized terrain I would likely bake to mesh.
     
  11. CommunityUS

    CommunityUS

    Joined:
    Sep 2, 2011
    Posts:
    240
    I have a weird Generate Thread Error: (below) that only shows up when I fly in a specific direction. using endless terrain. My resolution is 64, and terrain size is 2000. Height 270.
    counts at:
    stone 250
    bush 100
    trees 15
    tress 15

    Generate Thread Error:
    System.IndexOutOfRangeException: Array index is out of range.
    at MapMagic.Matrix2`1[System.Single].get_Item (Int32 x, Int32 z) [0x00000] in C:\Users\Chad\Desktop\Unity 5\MMAC\MapMagicAC\Assets\MapMagic\Main\Matrix2.cs:276
    at MapMagic.ForestGenerator1.Generate (MapMagic.Chunk chunk) [0x00298] in C:\Users\Chad\Desktop\Unity 5\MMAC\MapMagicAC\Assets\MapMagic\Main\ObjectGenerators.cs:753
    at MapMagic.Generator.GenerateRecursive (MapMagic.Chunk tw) [0x000bc] in C:\Users\Chad\Desktop\Unity 5\MMAC\MapMagicAC\Assets\MapMagic\Main\Generator.cs:328
    at MapMagic.Generator.GenerateRecursive (MapMagic.Chunk tw) [0x00038] in C:\Users\Chad\Desktop\Unity 5\MMAC\MapMagicAC\Assets\MapMagic\Main\Generator.cs:312
    at MapMagic.Generator.GenerateRecursive (MapMagic.Chunk tw) [0x00038] in C:\Users\Chad\Desktop\Unity 5\MMAC\MapMagicAC\Assets\MapMagic\Main\Generator.cs:312
    at MapMagic.Generator.GenerateRecursive (MapMagic.Chunk tw) [0x00038] in C:\Users\Chad\Desktop\Unity 5\MMAC\MapMagicAC\Assets\MapMagic\Main\Generator.cs:312
    at MapMagic.Generator.GenerateRecursive (MapMagic.Chunk tw) [0x00038] in C:\Users\Chad\Desktop\Unity 5\MMAC\MapMagicAC\Assets\MapMagic\Main\Generator.cs:312
    at MapMagic.MapMagic+Chunk.ThreadFn () [0x000d6] in C:\Users\Chad\Desktop\Unity 5\MMAC\MapMagicAC\Assets\MapMagic\MapMagic.cs:614
     
    Last edited: May 27, 2016
  12. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,276
    I think there should be used a Raw Input and a tiled textures instead of the noise or voronoi maps - at least for the base rude detail. For example one map is tiled once, more detailed one is tiled four times, and more fine details could be done using the procedural maps, the seam will be neglected with terrain welding.

    Hi Ascensi, it's really nice to see one of the most active Voxeland users in this thread!
    MapMagic began as just and extended Voxeland generator, but it went far from it. Now literally all of the algorithms are more or less changed compared to their originals. So it will not be possible to reproduce exactly the same result with per-block accuracy. You will be able to recreate the map that looks more or less likely to the default Voxeland generator. I'm not sure that the automatic converter would be helpful in this case.

    productofself, I will test object generators on the low-resolution terrains. It would help a lot if could send me your scene and provide with some information in what direction and what distance should I fly to reproduce the bug. Thanks in advance.
     
  13. CommunityUS

    CommunityUS

    Joined:
    Sep 2, 2011
    Posts:
    240
    ok i sent you a pm with dropbox link
     
  14. Ascensi

    Ascensi

    Joined:
    Sep 7, 2013
    Posts:
    579
    @Wright you said: "You will be able to recreate the map that looks more or less likely to the default Voxeland generator. I'm not sure that the automatic converter would be helpful in this case."

    Ok so what if I have my terrain formed the way I like it from Voxeland but just want to use the distribution of objects(trees, rocks, grass etc) and not regenerate the land? would this be possible?
     
  15. CommunityUS

    CommunityUS

    Joined:
    Sep 2, 2011
    Posts:
    240
    i haven't picked up voxeland yet, but from the forums i can see you can export a heightmap? can you export the map and use it as a input in some way? base texture type of path here
     
  16. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,276
    I have prepared the new 1.3 beta version, so all who mailed me asking for it - check your inboxes.
    It works fine with Unity 5.4b19, except one substantial thing: Object Output apply is very slow in Unity 5.4 because of extremely low performance of Transform.parent assignment operation in the upcoming Unity version. Object Outputs in demo scenes are turned off.

    Ascensi
    , to place objects on the Voxeland terrain MM should know such information like heightmap and splatmap - in case of Voxeland it is the block types. So there should be a special Voxeland input, which makes a system rather complicated. I do not deny that it could be done, but I've got to make some straight simple system to start with first.

    productofself, as far as I understand you are going to generate a heightmap with MM, export it to texture and then load it with Voxeland? It is possible, you can export terrain with third party tools and load it with Voxeland. But it is far from the full scale integration, as this will not make Voxeland generate the land in playmode, and it is not possible to generate and export the internal voxel structure.
     
  17. Hakazaba

    Hakazaba

    Joined:
    Jul 1, 2015
    Posts:
    119
    Hey, I'm thinking of buying this asset, though i am wondering that the possibilities are in regard to runtime generation and changes to terrain during run time in a way which would be saveable.
     
  18. Keywise

    Keywise

    Joined:
    Mar 21, 2015
    Posts:
    36
    I really like Map Magic. Starting from the default setup, what steps would you recommend for making a round moon craters (circular ridge) on a flat terrain?
     
  19. hike1

    hike1

    Joined:
    Sep 6, 2009
    Posts:
    401
    Do you have any plans to make your own subtitles? Not that I can't understand you, but it would be a help, especially for the hard of
    hearing. These google- auto generated
    ones aren't much help, except as comedy :--]
     

    Attached Files:

  20. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,276
    Hakazaba, didn't get it, could you spell it out for me?

    Keywise, I plan to make some adjustments to stamp generator to make such things as craters instinctively and easy. Right now you can try making non-detailed noise and adjust it with curve... but the results would be rather poor.

    hike1, when it comes to subtitles I guess I'll start with a long island tutorial as it is being watched ten times more often than any of the others.

    Btw 2all: To make it easier to explain the 1.3 new features I decided to make a short videos displaying them. I will publish them from time to time up to the version release. This is the first one devoted to the Node Groups:
     
    Last edited: May 30, 2016
    Hellhound_01, Keywise and docsavage like this.
  21. Ogoku

    Ogoku

    Joined:
    Feb 10, 2015
    Posts:
    6
    Hi,
    first of all: Thanks for this great asset!

    But I got a question, is there any way to achieve a low poly terrain, like PolyWorld is using?

    Regards
    Ogoku

    Edit: Give me that group thing! xD
     
  22. docsavage

    docsavage

    Joined:
    Jun 20, 2014
    Posts:
    1,021
    This looks good. If easy to implement I would add a collapse window option to shrink the groups.
     
    stevenson likes this.
  23. DiscoFever

    DiscoFever

    Joined:
    Nov 16, 2014
    Posts:
    286
    Same question as @Ogoku really interested in a 'LowPoly' style output (with vertex color) and collision :)
     
  24. Deadlyapples

    Deadlyapples

    Joined:
    Dec 30, 2013
    Posts:
    54
    Just a few questions. I know some have answers but I just want to be 100% sure on them.

    1. Does this work in conjunction with World Streamer for creating worlds that are very large.

    2. Can I pin / bake all the terrain pieces when I am happy with the terrain as apposed to having them generate each time I move the character to them as I plan on having building in the game and that would mean that all the terrain would have to be fixed so when the worlds unload the builds created by players remain on them etc etc.

    3. Is it possible to create a large continent for example, with different biomes on them. Like beaches, forests, swamps, deserts, valleys, canyons, lakes etc. Not sure how to get my head around how that would work.
     
  25. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,276
    I've never played around with PolyWorld, so I do not know if it uses the standard terrain or not. On some screenshots I can see a Terrain component, but it's too little to be sure. You can try free evaluation version to see if it will work with PolyWorld, and meanwhile I'll try to arrange a voucher swap with PolyWorld makers.

    From the user's point of view I can see two problems here:
    - it will be hard to determine where do the connections go and where they are coming from in a collapsed group because the inputs and outputs would be hidden;
    - each time the user restores the group to full-size it will overlap with the other generators and groups, so it will be hard to adjust it.
    I'm thinking about the group variable scale. For example, all the group with all the generators could be scaled down 2 times, so it will be displayed like a zoomed-out graph. And the maximum editor zoom will not be limited to 1, so you can zoom to the group and edit it in a usual way.

    It can create the worlds that are very large even without World Streamer. But if you'd like to, you can pin (bake) all of the terrains and do anything that could be done with a standard terrain. If a World Streamer can work with standard terrains then it can stream MM terrains.

    Still no. I have plans to implement this feature, but yet it is not available. You can generate different heighmaps, and then blend them using some huge-sized noise to make a biome, but I guess it will not be convenient to maintain such a huge graph, so I plan to make something to make it handy.


    Here is the other feature from upcoming version devoted to the generator (and group) cloning, saving and loading. It works well except one glitch that I have to deal with - on window repaint the connections are not updated for the very first frame:
     
    Hellhound_01 likes this.
  26. Smokas

    Smokas

    Joined:
    Mar 7, 2016
    Posts:
    114
    I interested in this feature too - IMO the question was not if MM can work WITH PolyWorld, but - can MM generate low poly like terrain (similar to PolyWorld). Just some hints needed IMO :)
     
  27. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,276
    As far as I can see PolyWorld converts the standard terrain to low poly one using it's terrain converter tool. MapMagic does not have such a converter build in, because, obviously, I don't aim to replicate all the plugins at the Asset Store. So, to generate low poly terrain you'll have to use PolyWorld anyways - or it's equivalent.
     
  28. Smokas

    Smokas

    Joined:
    Mar 7, 2016
    Posts:
    114
    Denis, it is not about converting - it is about how to use MM to GENERATE low poly looking terrain. What generators to use, what parameters should be set and so on. Just your ideas as the author of MM.
     
  29. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,276
    Yeah, I got it - just trying to explain that low poly look with flat faces and sharp edges could not be achieved with the standard terrains with regular grid and smooth normals. It is not the matter of the generators and other settings - terrain should be converted to mesh to get the low poly look.

    Here is what awaits you in 1.3: the new Stamp Generator
     
  30. Exbleative

    Exbleative

    Joined:
    Jan 26, 2014
    Posts:
    216
    Yessssssss!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
     
    Smokas likes this.
  31. ibyte

    ibyte

    Joined:
    Aug 14, 2009
    Posts:
    1,047
    Hi Denis, I have tried PM you for the beta but no response. Thanks.
     
  32. TJHeuvel-net

    TJHeuvel-net

    Joined:
    Jul 31, 2012
    Posts:
    838
    Is it also possible to generate non-square terrains? And what about not creating a terrain at all, can i read out the values of a nodegraph in script, without a terrain being created? I'd like to generate some very specific stuff.
     
  33. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,276
    ibyte, sorry, I've mailed the beta link to everyone who contacted me via email, but private messages slipped my mind.

    TJHeuvel.net, you can intercept apply data (such as float[,] for heightmap or float[,,] for splatmap) using the OnApply event. Then you can process data the way you want - cut a non-square areas or use it to build mesh or other stuff.
     
    ibyte likes this.
  34. TJHeuvel-net

    TJHeuvel-net

    Joined:
    Jul 31, 2012
    Posts:
    838
    Thanks!
     
    Wright likes this.
  35. Hellhound_01

    Hellhound_01

    Joined:
    Mar 5, 2016
    Posts:
    102
    Im still working on the river generator in my limited spare time. There is much to be done, but for a first try not bad. Actually I take two points from opposite edges and perform an a* pathfinding between both points. On each step I
    regarding the height difference between the actual node and his neighbor as cost weight to influence the search by the gravity effect of water (a step downhill will reduce the cost while an uphill movement creates an extra penalty). Here is a first impression of my actual work:


    @Wright I've actually a strange problem with the elapsed time on path calculation. It tooks 52344ms to find the path at the image. This is too long. For test I've used a simple path walk through without weights from upper left corner to lower right corner on a 256x256 node grid. This requires less than 12ms in a unit test, in MM the same search consumes 14.566ms.

    I've figured out that this is happend when I iterate through the MM Matrix in this way:
    Code (CSharp):
    1.         public override void Generate(MapMagic.MapMagic.Chunk tile)
    2.         {      
    3.             if (tile.stop) return;
    4.  
    5.             // Use input values if given, otherwise use default
    6.             Matrix src = (Matrix)input.GetObject(tile);
    7.             if (src == null) src = tile.defaultMatrix;
    8.  
    9.             // determine the tile border value
    10.             Coord cmin = src.rect.Min;
    11.             Coord cmax = src.rect.Max;
    12.  
    13.             // create the grid
    14.             AStar.Node[,] grid = new AStar.Node[cmax.x, cmax.z];
    15.          
    16.             // create destination matrix
    17.             Matrix dst = new Matrix(src.rect);
    18.  
    19.             for (int x = cmin.x; x < cmax.x; x++){
    20.                 for (int z = cmin.z; z < cmax.z; z++){
    21.                     grid[x, z] = new AStar.Node(x, z);
    22.                     dst[x, z] = src[x, z];
    23.                 }
    24.             }
    25.  
    26.             var astar = new AStar(grid, new AStar.Heuristics(CalculateTraversalCost));
    27.             var path = astar.FindPath(new AStar.Point(10, 40), new AStar.Point(255, 255));
    28.  
    29.             foreach (var node in path){
    30.                 dst[node.X, node.Y] -= 0.0225f;
    31.             }      
    32.  
    33.             if (tile.stop) return;
    34.             output.SetObject(tile, dst);
    35.         }
    If I replace the loop on the matrix by a standard loop, the same algorithm only consumes 16ms in MM:



    Code (CSharp):
    1.         public override void Generate(MapMagic.MapMagic.Chunk tile)
    2.         {      
    3.             if (tile.stop) return;
    4.  
    5.             // Use input values if given, otherwise use default
    6.             Matrix src = (Matrix)input.GetObject(tile);
    7.             if (src == null) src = tile.defaultMatrix;
    8.  
    9.             // determine the tile border value
    10.             Coord cmin = src.rect.Min;
    11.             Coord cmax = src.rect.Max;
    12.  
    13.             // create destination matrix
    14.             Matrix dst = new Matrix(src.rect);
    15.  
    16.             var columns = 256;
    17.             var rows = 256;
    18.  
    19.             AStar.Node[,] grid = new AStar.Node[columns, rows];
    20.             for (int c = 0; c < columns; c++)
    21.             {
    22.                 for (int r = 0; r < rows; r++)
    23.                 {
    24.                     grid[c, r] = new AStar.Node(c, r);
    25.                     dst[c, r] = src[c,r];
    26.                 }
    27.             }
    28.  
    29.             var astar = new AStar(grid, new AStar.Heuristics(CalculateTraversalCost));
    30.             var path = astar.FindPath(new AStar.Point(10, 40), new AStar.Point(255, 255));
    31.  
    32.             foreach (var node in path){
    33.                 dst[node.X, node.Y] -= 0.0225f;
    34.             }
    35.            
    36.  
    37.             if (tile.stop) return;
    38.             output.SetObject(tile, dst);
    39.         }
    Any Idea why this is happend?
     
  36. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,276
    I don't see anything criminal in the first algorithm. Except, maybe
    This will not work with the terrain positioned anywhere except 0,0 since it uses rect max instead of rect size. But it does not matter to the performance.

    Let me make it clear: the first algorithm takes 14 seconds? Not milliseconds?

    EDIT: just a guess, if your terrain is placed somewhere at 2048,1024 then you are creating ~2300,1300 grid. This will surely take much more time to calculate than a 256,256 one.
     
  37. Hellhound_01

    Hellhound_01

    Joined:
    Mar 5, 2016
    Posts:
    102
    To simplyfy my tests I only generate the river for a pinned terrain at position 0,0. If anything is working as excepted and looks like charm, I will racking my brain out about edge crossing, and continuous path generation at neigbour tiles.

    Yes it takes more than 14 seconds and more if I loop through the matrix. I've checked the values, also on matrix loop there is only a loop range from 0 to 256 as expected. I've no idea where the performance gap is comming from, it's just a loop with same ranges and value access.

    Edit: I've added the actual classes to my watershed dev-branch, to give you access to full source code if required. https://bitbucket.org/Hellhound_01/mapmagic-extensions.git.
     
    Last edited: Jun 4, 2016
  38. ibyte

    ibyte

    Joined:
    Aug 14, 2009
    Posts:
    1,047
    Hi Denis, I open a new scene and deleted the old trial package, installed the new beta package and then opened my old scene. Now my nodes are gone. Any way to recover that?
     
  39. Hellhound_01

    Hellhound_01

    Joined:
    Mar 5, 2016
    Posts:
    102
    Okay problem solved. After remove anything and set up the project new I got constant results. Maybe there was a caching problem with unity or something else.
     
  40. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,276
    ibyte, could you please send me the scene? Just make sure that it was not saved in MM Beta - this can remove all the generators irretrievably.

    Hellhound_01, glad you've sorted that out!
     
  41. Hellhound_01

    Hellhound_01

    Joined:
    Mar 5, 2016
    Posts:
    102
    @Wright Actually the path-finding takes round about 437ms on a 256x256 grid with a diagonal distance heuristic. For first tries not bad and acceptable. Maybe I could optimize this later by extending the a* algorithm to regard jump points. Have you an idea how i could carve out the path to form a more realistic river bed?
     
  42. DiscoFever

    DiscoFever

    Joined:
    Nov 16, 2014
    Posts:
    286
    For 1.3: Regarding the new 'Stamp' utility; using raw input, can I use individual pixels to 'place' objects ?

     
  43. DiscoFever

    DiscoFever

    Joined:
    Nov 16, 2014
    Posts:
    286
    Pretty interesting stuff here ! I've tried your generating bit I can't get it to work.
    I have put it like the following before last height output; but I get an "Array is out of index" exception.

     
  44. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,276
    Well, I would rather do it in three steps:
    1. Created a new matrix;
    2. Filled it with rect size values (256, for instance);
    3. Then stroke the path with values of zero;
    4. Spread the values in four sides (left to right, top to bottom and vice versa) using the formula:
    Code (CSharp):
    1. next = Mathf.Min(next, previous+1);
    This way we will create a distance matrix, each pixel will store the closest Manhattan distance to path;
    5: And then process the distance matrix using some curve falloff.

    Stamp Generator takes "objects" (spatial hash) as input, not the "map" (matrix). But it is possible to create a custom generator that will convert white pixels to objects positions.

    I've just submitted 1.3 for review, so the Beta is over and soon every user can update MapMagic to use it with Unity 5.4b, multiple cameras, groups, saves, loads, etc. And new generators: Blob, Flatten, new Stamp and Simple Form.
     
  45. ibyte

    ibyte

    Joined:
    Aug 14, 2009
    Posts:
    1,047
    @Wright, unless you want to see my scene for a technical reason it doesn't have enough content in order for you to take the time to fix/revive it. I figured I would just ask you if there was something simple I could do. That does beg the question what is the correct way to upgrade Map Magic in the future? I run into this all the time (in other packages) where either i end up with duplicate (if installing over top) or missing scripts (if i remove the old package first).
     
  46. DiscoFever

    DiscoFever

    Joined:
    Nov 16, 2014
    Posts:
    286
    If i need to make a desert and then a canyon; since i cannot have 2 map magic instances running, what's the best workflow you suggest ? make first, then import and use stitching tools ?
     
  47. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208
    Will you be including this in the next update?



     
  48. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,276
    Personally when I test MapMagic in a test project before submitting it as beta or release I always remove the previous version. But I guess that the most stable way is to upgrade the package and perform a clean install only when something unexpected arises.

    You are talking about biomes - a feature that I'm currently thinking over. It's not possible yet, but I plan to implement it.

    It is the scene from a game project I'm working on. The textures I've used were not made by me and I have no rights to sell them with a MM asset. But I can share the graph so you can make the similar scene with your own content.
     
  49. Hellhound_01

    Hellhound_01

    Joined:
    Mar 5, 2016
    Posts:
    102
    @Wright Thanks for your thoughts. Actually I try a slightly different approach:

    1. Based on a given possible width (W) of the river I determine the four neighbour pixels for each waypoint for W/2 in each direction
    2. Determine Manhattan distance (d) of those pixels
    3. Lower the terrain slightly deeper by N units : N * Mathf.Sqrt((W-d)/W)
    Generally I try to get a river bed nearly like this one: http://archive.gamedev.net/archive/reference/programming/features/randomriver/page2.html. If this result is not like I expect, I will give your curve falloff a try.

    @PetaLaChatte I will try it out today in the late evening. Please regard that the watershed generator is an early development state and only works with a single pinned terrain at position 0,0.
     
  50. DiscoFever

    DiscoFever

    Joined:
    Nov 16, 2014
    Posts:
    286
    Can I simply have 2 heightmaps and subtract / combine them ? Like if i have a height map with a river and one terrain, how can I morph them ? Should I write a 'Add' generator ?