Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    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. Jesus

    Jesus

    Joined:
    Jul 12, 2010
    Posts:
    501
    you can set the waterline in the magmagic nodes too, mess with that rather than the water mesh
     
  2. AsoraX

    AsoraX

    Joined:
    May 3, 2017
    Posts:
    22


    Thats my crr. Shore setting...
    or is there any other option to create The Waterline?
     
    Last edited: Sep 20, 2017
    malkere likes this.
  3. Snownebula

    Snownebula

    Joined:
    Nov 29, 2013
    Posts:
    174
    Does anyone know what this error is and why I am getting them?


    Code (CSharp):
    1. Could not load Plugins.Layout+ILayer[] as this type does not exists anymore
    2. UnityEngine.Debug:Log(Object)
    3. Plugins.CustomSerialization:ReadClass(Int32, List`1, List`1, List`1, List`1) (at Assets/plugintools/CustomSerialization.cs:331)
    4. Plugins.CustomSerialization:ReadClass(Int32, List`1, List`1, List`1, List`1) (at Assets/plugintools/CustomSerialization.cs:384)
    5. Plugins.CustomSerialization:ReadClass(Int32, List`1, List`1, List`1, List`1) (at Assets/plugintools/CustomSerialization.cs:384)
    6. Plugins.CustomSerialization:ReadClass(Int32, List`1, List`1, List`1, List`1) (at Assets/plugintools/CustomSerialization.cs:384)
    7. MapMagic.GeneratorsAsset:OnAfterDeserialize() (at Assets/mapmagic/Main/GeneratorsAsset.cs:1129)
    8.  
    Code (CSharp):
    1. Could not load Plugins.Layout+ILayer[] as this type does not exists anymore
    2. UnityEngine.Debug:Log(Object)
    3. Plugins.CustomSerialization:ReadClass(Int32, List`1, List`1, List`1, List`1) (at Assets/plugintools/CustomSerialization.cs:331)
    4. Plugins.CustomSerialization:ReadClass(Int32, List`1, List`1, List`1, List`1) (at Assets/plugintools/CustomSerialization.cs:384)
    5. MapMagic.GeneratorsAsset:OnAfterDeserialize() (at Assets/mapmagic/Main/GeneratorsAsset.cs:1129)
    6.  
     
  4. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
  5. Snownebula

    Snownebula

    Joined:
    Nov 29, 2013
    Posts:
    174
  6. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    By looking at the videos and pictures =D A Unity Pro license costs 750$ for six months.
     
  7. SSL7

    SSL7

    Joined:
    Mar 23, 2016
    Posts:
    347
    @malkere pledged, best of luck man.
     
    malkere likes this.
  8. recon0303

    recon0303

    Joined:
    Apr 20, 2014
    Posts:
    1,634

    This is the way I was doing it, but I had an issue, in other program, I was importing to, also all other TERRAIN programs have height map exporters.. So was seeing if there was a hidden one someone where else..I got the issue fixed anyways.
    Ya I seen the save to texture, those have poor quality..hehe.. I been making height maps for over 20 years, so knew that wasn't going to work...regardless, I just used the Unity exporter, but I was looking for someothing to export the whole map fast...Unity exporter you have to do each terrain.....WHEN you have many tiles....its very slow..something to think about...Terrain Composer,2 others I can export out my whole map, same with World Creator 1 and 2... This is nice when using World Streamer... I just can't use MM, for mass exporter its to slow to do each one.......MM really could use an exporter to export all the tiles, like other programs have...
     
  9. Snownebula

    Snownebula

    Joined:
    Nov 29, 2013
    Posts:
    174
    I own pro forever.
     
  10. Snownebula

    Snownebula

    Joined:
    Nov 29, 2013
    Posts:
    174
  11. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,267
    Not yet - at least out of the box. But you can try to use the method Jesus described. When splines will be finally implemented streams and rivers will be making this way.

    The overall form of your continent could be defined with relatively low resolution RAW image assigned to RAW Input node. The masks for each biome could be created the same way too (or you can use Noise with the large size if the exact placing of each biome does not matter). Ten these biomes could be blended together the way shown in this video:


    It's on GitLab, in Beta repository. Email me your order number (and GitLab account name if you have one) to join beta.

    You need to use serial Flatten connection instead:
    SerialFlatten.png

    Is it an error (red icon) or just a console log message (white icon) when updating data from the older version? Are there any issues with the scene/graph loaded besides this message?
     

    Attached Files:

  12. SSL7

    SSL7

    Joined:
    Mar 23, 2016
    Posts:
    347
    @Wright e-mailed you my invoice yesterday, now that I found you, can you also answer me this :D : I found the GuiController that you use for the GenerateMark, is it possible to tell me what I need to change to the script to work with my scenes? Thank you
     
  13. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,267
    Sorry, I've checked the forums first, and then the emails :) Sent you an invite so you can pull beta now.

    Code (CSharp):
    1. MapMagic.ThreadWorker.IsWorking("MapMagic");
    Will return "true" if any terrain chunk is currently preparing to generate, generating or applying.
     
    SSL7 likes this.
  14. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    864
    Hi Denis!
    I'm working with my saving system and got no idea how can I save MapMagic's data into files.
    I let players create, destroy or changed gameobjects generated from MM and under each terrain tile, also I need to save the generated progress of terrains, won't want to regenerate every terrain tile player has been through as a fresh new one(this will most likely to restore any changes the player made to the terrain tile)
    So, any ideas how can I save data from MM and reload them properly?
     
  15. SSL7

    SSL7

    Joined:
    Mar 23, 2016
    Posts:
    347
    Some general questions.

    1) How many 1k tiles do you think is ok to have locked in a game?
    2) What are some good values for generate/enable/remove ranges?
    3) Max resolution recommended ?

    thank you.

    edit: a possible bug, object generator seems to enable regard scale and regard rotation to all object generators in graph if you just enable one.
     
    Last edited: Sep 20, 2017
  16. Snownebula

    Snownebula

    Joined:
    Nov 29, 2013
    Posts:
    174
    I personally would use 1 tile, I don’t know how many thousands pinned your computer can support but mine is good with about 9 total pinned, but if you are pinning thousands than that’s awesome. What kind of setup are you running if you don’t mind me asking?
     
  17. SSL7

    SSL7

    Joined:
    Mar 23, 2016
    Posts:
    347
    lol no, when i said1k tile i meant 1 tile of 1000 size :) an
     
    Last edited: Sep 20, 2017
  18. belkovandrew

    belkovandrew

    Joined:
    Nov 19, 2014
    Posts:
    22
    Hello
    I bought your asset and here are my questions:
    - my map is really huge, and when i unhide all of my tiles the scene itself goes to 2gb size... I dont really understand how is that playable, if I hide tiles and leave just few of them then in game mode my map does not generate while I explore areas but if I leave them unhide then the scene itself going crazy and lags...
    Please help

    On russian:

    • еще проблема: у нас террейн огромен, сцена в юнити весит 2 гигабайта(!) и загружается очень долго, как в этой ситуации поступить?
    • и еще мелкий вопрос : когда скрываешь кусок террейна а потом опять открываешь его, то он с нуля генерится и не сейвит изменения которые сделаны на нем. что делать? можно ли сохранять куски террейна?
     
  19. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,267
    Harekelas, belkovandrew how would you save the changes of a standard non-MapMagic terrain? I guess it could be an export of a changed area to float arrays with terrainData.GetHeights and terrainData.GetAlpahmaps and then serializing these floats in a save file.
    And once the standard terrain serialization is ready you can use it with MapMagic terrains post-processing them after generate. Use OnApply event to apply the saved data when the terrain chunk has been generated.

    Well, it depends on your target platform, terrain resolution, overall terrain size, etc. In a project I used to participate in we settled down to 8 pinned terrains - one for each big town on a map. World map was 64 sq km in size, 8*8 chunks (chunk size of 1000), resolution 512, target platform - PC only.
    BTW in version 2.0 I plan to make per-output locking: this way you can lock, for example, the splat map only, allowing heightmap or objects to be re-generated. This will greatly reduce the saved scene size if you are not going to perform complex changes.

    Try looking at the demo scenes settings. You can adhere to these rules when setting these values: enable range should be surely lesser than the camera view range (I recommend enable range + chunk size/2 = cam view range), generate range is slightly more than enable range, and remove range is about 1.25 - 1.5 times larger than enable range.
    I always recommend using as small resolution as possible - it's better to decrease the chunk size instead of increasing the resolution. 512 should work fine in most cases.

    Actually, it should - but only in playmode (around the main camera). Make sure that "Generate Infinite terrain" is enabled in settings. If it's still not generating - could you please record a video of what's happening when you travel across the terrain in playmode?
    PS it's okay to email or PM me in Russian, but since we're in a public thread there could be users who just reading it. Each post is not just a personal message, it could be helpful to those who have a similar questions and problems. I'd rather answer in English if you don't mind.
     
    SSL7 likes this.
  20. Snownebula

    Snownebula

    Joined:
    Nov 29, 2013
    Posts:
    174
    What is this:
    public class Layer : Layout.ILayer
    I am getting an error with ILayer
     
  21. Vortavasail

    Vortavasail

    Joined:
    Apr 22, 2016
    Posts:
    44
    is there something wrong with "Custom Shader Output" it crashes my game when i try to use it ?
     
  22. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,267
    Snownebula, what the error is? When does it occur? What exactly is logged in the console?

    Vortavasail, there's nothing I'm aware of. What CSO mode are you using? Does this happen in build? Does it work in editor? Does the game crash right after opening the scene or after terrain has been generated? Does it happen upon generating the first terrain? Or other random terrain? Or some particular terrain?

    Snownebula, Vortavasail, could you please open the issues for your bugs at the Issues page? If you don't want to register just email GitLab service desk to automatically add issues and assign them to me.
     
  23. Snownebula

    Snownebula

    Joined:
    Nov 29, 2013
    Posts:
    174
    I already did.
     
  24. Snownebula

    Snownebula

    Joined:
    Nov 29, 2013
    Posts:
    174
  25. Vagrod

    Vagrod

    Joined:
    Aug 4, 2017
    Posts:
    82
    Hi! I am starting to combine MapMagic and RTP, and here is a question. My terrain consists of 8x8 terrain grid (I am using streaming approach), and I want to use tessellation in RTP. In order for this to work, I must give RTP information about Height and Normal Texture. If I had one terrain piece, it's ok, but I have 64... I can't give RTP height texture of a particular piece, it makes no sense, this must be somehow done with MapMagic nodes? Or there is a way to generate some "overall height and normal map"? Or this approach is not yet supported?

    I can try to do this differently: by making single terrain piece, applying tessellation and splitting this in 64 parts for streaming -- afterwards. But I want to do this in more simple manner if it is possible.

    UPD: No, splitting terrain from one piece does not work in this case. It results in a mesh mess. It applies one given height map to every terrain piece I get after splitting. So the only way to do tessellation in case of streaming -- is to use NxN MapMagic grid. So, my question is opened.

    Maybe phong tessellation will do the job... No. I need heightmap tessellation to avoid terrain LOD popping on edges.
     
    Last edited: Sep 23, 2017
  26. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    864
    I got an issue using MM with MegaSplat:
    upload_2017-9-24_13-2-17.png

    I assigned several arrays to see the results of my textures then I deleted an array and the Custom shader output become to this. Then the whole mapmagic editor got out of function.
    Also there is an index out of range error down here.
    How do I fix this?
     
  27. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,267
    Vagrod, I suppose you have all of the 64 terrains locked in order to use streaming approach. This way you can export all of your chunks heightmaps by selecting them, and pressing Export Raw in terrain settings.
    Feel free to share you ideas of how this could be batched - from the user, interface perspective. I'm thinking of implementing batch export in v.2.0, but I have not settled it down yet.

    Harekelas, could you please paste the error from the console? It could be handy if you could paste it to the issue opened at the Issues page. If you don't want to register just email GitLab service desk to automatically add issues and assign them to me.

    Snownebula, will look into it and other bugs today.
    I really like the screenshots, especially the first one. Looks stylish! Keep up doing the good work!
     
  28. Vagrod

    Vagrod

    Joined:
    Aug 4, 2017
    Posts:
    82
    Actually, I am streaming copies of resulted terrains: I have some batch-processing scripts that prepares all terrains for streaming (adding and configuring some components, renaming terrains for streaming slicing and so on).
    The only way to achieve heightmap-based tessellation is to process every terrain separately. I will do the following: I will remove RTP node from MapMagic, switch back to textures. When generating is done, I will add RTP to one single terrain and configure it. Than I will write a tool that will allow me to batch-process all rest 63 terrains. This script will add a copy of RTP component from the first terrain to all rest, will export TerrainDatas, convert them to Tessellation Heightmaps (will use method from RTP tool) and will assign resulted image to Tessellation field of each terrain accordingly (maybe I will need to check manually that every RTP texture layer is on its place). So, at the end I will be able to fine-tune every terrain (for example, make a holes where I need it to be exactly).

    One more question) I have giant open world (64 terrains -- is only the first location of 8, not mentioning cave systems), I have Tons of trees and bushes, so I am using AltTree. This tool streams beautifully, so I have no problems whatsoever. I boosted performance up to 50 FPS, and with terrain tessellation I'll get 5-8 more. Are you planning to integrate AltTrees to MapMagic? Now it's a bit hard to draw hundreds of thousands of trees after terrain generation)
     
    Last edited: Sep 24, 2017
  29. Jesus

    Jesus

    Joined:
    Jul 12, 2010
    Posts:
    501
    That looks pretty cool - good to see MM being pushed to the limits, 64 terrains!

    Snownebula, what fog are you using for that?

    I've been going the other way - larger terrains at higher res, taking the hit on each generation time because with deferred and at least 12 terrain textures used, if I draw any more terrain passes my vert count will probably hit 9 digits.

    BTW, if we're starting to think about MM V2, I'd like to throw this into the ring.
    mm_biome_layout.png
    The way it works is that it takes in macro terrain height 'out' data (think tectonics, other 250m-1km+ scale terrain shape, top left portal) and then does the MM stuff, and outputs to several 'in' portals (aligned along the top right, for snow and cliff textures, and for biome height, could also have 'in' portals for object/tree placement points).

    These outputs are summed and assigned textures/meshes/trees/etc in a separate group. That way there's only one graph, all biomes blend seamlessly and I can keep track easily of all the outputs (textures/RTP-out, trees, etc).

    As a bonus, I can mess with the blend method to instantly turn all the terrain in the scene to one biome for testing.
     
  30. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    864
    I just figured a way to bypass this issue: I re-added enough numbers of texture arrays in the texlist profile then the Editor back to normal, though the output node is still ruined.
    I just deleted it and recreated one, then I can get back to work :)
    BTW, @Wright
    There is a very promising vegetation system under developing, and the author is trying to integrate with MapMagic.
    And now their beta version is free for testers, maybe you can go check them out, make a custom trees and grass output node for their system: Vegetation Studio
     
  31. Vagrod

    Vagrod

    Joined:
    Aug 4, 2017
    Posts:
    82
    That's right :D
    My approach of batch RTP processing actually worked. Now I am using only Textures output in MapMagic, and after generating all my terrains I'm starting my batch-RTP-script-thing that prepares everything for me, including automatically generated height-normal-tessellation maps)
    And now I can use actual height tessellation with MapMagic-generated N terrains!
    I can share this piece of code if anyone else interested in this :)
     
    Last edited: Sep 24, 2017
  32. jessejarvis

    jessejarvis

    Joined:
    Aug 9, 2013
    Posts:
    303
    Hello,

    I just recently bought SECTR - COMPLETE (for another project) and I was wondering if it can integrate with MapMagic, and how well this would work.
     
  33. username132323232

    username132323232

    Joined:
    Dec 9, 2014
    Posts:
    477
    Does MapMagic include any tools that can help in building a long fence along a given path?
     
  34. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,267
    I think I'll make a poll of the next asset to integrate - here or via google forms. Right now I'm creating a list (well, actually I'm doing an extra-urgent work with both MM and Voxeland), and I've added Vegetation Studio, AltTree and SECTR - COMPLETE to it.

    Unfortunately no. At least not yet, MM does not support splines.
     
    nxrighthere and Vagrod like this.
  35. username132323232

    username132323232

    Joined:
    Dec 9, 2014
    Posts:
    477
    Thanks for the quick response! MM rocks even without a fence wizard:)
     
  36. Vagrod

    Vagrod

    Joined:
    Aug 4, 2017
    Posts:
    82
    +1. Really need this!
     
    Last edited: Sep 27, 2017
  37. Sovogal

    Sovogal

    Joined:
    Oct 15, 2016
    Posts:
    100
    Hi Denis. I was wondering whether you had any plans to create a custom shader mode for Microsplat. I've been trying to use the generic custom shader mode (first time even looking at it), and despite documentation cannot get different textures to show on a terrain using Microsplat's shader.
     
  38. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    3,356
    Last time I used MM, I was having a hard time generating the types of islands I need. But MM does have some useful features so I was going to take another look at extensions. I'll explain the basics of what I need maybe someone can at least say if this is doable via extensions.

    So most people when you say islands, say use a mask. Masks don't work well with procedural terrains outside of some very limited scenarios. So what I need is a bunch of single terrain islands. I want to define a water level and the edges of the terrain slope to that water level.

    What would probably help most is what is the best approach to take in the context of MM. For example the first approach that comes to mind is to define the edge area, say 50 units. Then just iterate calculating a line from the center to every edge point, and adjust the terrain height from 50 units in from the edge to the water height at the edge, using a simple slope calculation.

    Can something like that be done with extensions? Also is there a better approach that comes to mind?

    FYI I'm not looking for super realistic terrains, it's more about what fits the gameplay. So in my case this means I won't have many slopes to start with, and elevation changes will primarily be more terraced (works better for a top down click to move game).
     
  39. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    3,356
    FYI the reason I want to do this in the context of MM is to make use of the other features like texturing. I'm not a newcomer to the terrain api, so another thought is it might be simpler if there was just a specific place I could plug in my own code. Not really use the extensions just be able to make my modifications at the right point in time so it doesn't interfere with MM.
     
  40. SSL7

    SSL7

    Joined:
    Mar 23, 2016
    Posts:
    347
    Vegetation Studio will win this poll easily :p waiting for this!
     
    Vagrod and trilobyteme like this.
  41. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    3,356
    Hmm so I see Masks are exposed nicely in code. So I'm guessing I could create a custom generator that applies my algorithmically created mask, and have that as the last generator in the chain before the height output?
     
  42. SSL7

    SSL7

    Joined:
    Mar 23, 2016
    Posts:
    347
    guys has anyone found a way to use the new unity NavMesh tools to buld navmesh while the terrain generates in runtime? I found the sourcetag and localbuild scripts that work, but are clunky in runtime, i prefer to have more time loading the terrain but have it with full navmesh built, instead of always calculate navmesh in runtime. Any help would be appreciated.
     
  43. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,267
    snacktime, personally I would use Simple Form cone and blend it with noise to create an island. But I've got a feeling that in your case you have shape the island based on some existing level design, so why don't
    Really, there's nothing wrong in using some low-resolution basis to guide generate algorithm (as long as you are not going to use the infinite land). Consider it as a seed for the noise.

    Sure, if you are talking about custom generator.

    We've shared beta access to our products with Lennart. I will take a look at it when I have time.
     
    LennartJohansen likes this.
  44. SSL7

    SSL7

    Joined:
    Mar 23, 2016
    Posts:
    347
    @LennartJohansen is extremely helpful, and I already have VS work on my project for WIPs and works very well even in this beta phase.
     
  45. BlairTheDizzyWitch

    BlairTheDizzyWitch

    Joined:
    May 28, 2017
    Posts:
    5
    Hello @All,

    I'm totaly in love with MapMagic but I was wondering, is there a way I can get to know via script in which biome the character is currently in and how?
     
  46. Jesus

    Jesus

    Joined:
    Jul 12, 2010
    Posts:
    501
    presumably yes. There's an asset on the asset store called crux.

    It seems to use the terrain textures, or something, to spawn animals, and can lock animals spawns to set/s of textures, which one might place via biomes. So, in a roundabout way, it seems to go MM > Unity Terrain > Terrain Textures > Crux > figure out what biome I'm in.
     
  47. SSL7

    SSL7

    Joined:
    Mar 23, 2016
    Posts:
    347
    @Wright and @AdamGoodrich one problem I have with CSO and CTS profiles is that when I use the weather Manager to have snow on the scene, it only works on pre-generated terrains and not on the runtime generated ones. I have a CTS Weather Controller on MM so it copies to every terrain.

    EDIT: I register the controllers again on every new generated terrain and it works fine now
     
    Last edited: Oct 1, 2017
  48. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,267
    If you have different texture set for each biome then I suppose that evaluating texture at given coordinates is the simplest way to do that. The thing is that MapMagic does not keep generated maps (including the biome masks) in playmode for performance reasons.
    However you will not need crux or anything to do that. You can get prototype values with terrainData.GetAlphamaps, find the most intense prototype number, get prototype with terrainData.splatPrototypes, and then simply get prototype.texture

    dlevel, ok, do I have to change anything in MM?
     
  49. Chimiboy

    Chimiboy

    Joined:
    May 1, 2016
    Posts:
    3
    Question: If I had a pre-drawn map in photoshop, how would I go about using Map Magic generate and fill up that world. Is there a way to do this using Map Magic or is that not what this tool is for? Please, if you have any sort of advice, would be much appreciated!
     
  50. Nevercallmebyname

    Nevercallmebyname

    Joined:
    Nov 18, 2013
    Posts:
    120
    you'd paint over your map in black and white to turn it into a height map