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

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    You can yes, the graph can be altered though it won't update for already generated terrains. You could also swap the data on the MicroSplat component that gets added to terrains as well.
     
    protopop likes this.
  2. secondsight_

    secondsight_

    Joined:
    Mar 2, 2014
    Posts:
    163
    Hey,

    I´m a bit in a hurry with a prototype, so I quickly ask here.
    I have this kind of multi terrain setup with external heightmaps and custom color / normal maps. Will it work without problems with Microsplat in Unity 2018.2 ? Or 2019.2 if needed.



    I´ll need it mostly for the mesh blending module of Microsplat. Will generate foilage and gameplay objects with MM afterwards.
    Thanks ! :)
     
  3. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,557
    Thank you:)

    Could you point me in the right direction or help me figure out how t do that in a script/

    I found this

    MapMagic.GeneratorsAsset mapMagicGens = MapMagic.instance.gens;

    And then do I give it the Name of the node or something , like:

    mapMagicGens.CustomShader.Material = xxx;

    or is there an Api document for this?
     
  4. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    I have added a simple "name" string variable to the generators I care about and named them, then before I start up any generation I do a
    Code (csharp):
    1.  
    2.         foreach (Generator ga in graph.list) {
    3.             if (ga is Portal) {
    4.                 Portal p = (Portal)ga;
    5.                 if (p.form == Portal.PortalForm.In) {
    6.                     if (p.name == "BasicResources") { basicResourcesPortal = p; }
    7.  
    and store references to the generators I use, like
    Code (csharp):
    1. Portal basicResourcesPortal;
    and change them/add new ones as needed. I assume it would be more or less the same for a shader generator, just have a manager object and store references to your MicroSplat data, swapping in whichever you like.
     
    protopop likes this.
  5. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,557
    This is REALY helpful. I wouldn't;t have even know where to start looking but this makes sense. Thank you.

    Its funny because I can see now how games have to pause sometimes to load things in or why we don't change certain things at runtime. This opens up more opportunities to change things at runtime with a loading screen. Maybe not for everything but being able to make big changes if needed is great.
     
    malkere likes this.
  6. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    @Wright Could you explain a little about what you call Resources.UnloadUnusedAssets(); for? In other words, what is it about MapMagic that creates the necessity for calling this? It creates a ton of outputs to the player log, which on a headless server swamps the terminal/command prompt with messages. I haven't been able to find a way to intercept the messages, so I'm hoping to remedy the need for calling Resources.UnloadUnusedAssets().
     
  7. patrickk2

    patrickk2

    Joined:
    Dec 8, 2019
    Posts:
    92
    Hello everybody!

    I would like to generate terrain that transitions over various types, when one moves along the west-east axis, but the same terrain type is generated when moving along the north-south axis (like in the illustration below).
    upload_2019-12-8_19-21-39.png
    As I see it, those individual strips would be biomes (please correct me if I'm wrong). Assuming I have the right graphs for creating the individual biomes like the beach, plains, mountains, ..., how do I make sure that the transitions only happen, when moving east to west, but for example a player who is currently in the "beach strip" and heading north will indefinitely run through the generated beach terrain?

    Any thoughts or tipps would be greatly appreciated. The same goes of course for hints and keywords on where to find helpful information about this topic in the documentation.

    Thanks in advance for your help and best regards,
    Patrick
     
  8. patrickk2

    patrickk2

    Joined:
    Dec 8, 2019
    Posts:
    92
    Hello again!

    Sorry for the double post, but my second question is so unrelated to the first one, that it seemed to fit better in a separate post.

    I have read a bit about MM2 coming out, and wanted to ask if people already owning MM1 can upgrade at a discounted price (or even free), or if one has to purchase it normally again?

    Appologies if this information was already in this thread, I did not want to scan 89 pages :).

    Thanks and best regards,
    Patrick
     
  9. camta005

    camta005

    Joined:
    Dec 16, 2016
    Posts:
    320
    You can do it by setting up a simple form with the gradient x option and then use height ranges for determining biome placement.

    Check this tutorial:
     
  10. Acatist

    Acatist

    Joined:
    Jun 7, 2016
    Posts:
    45
    Hi mate, I just bought your MapMagic but I find huge differences between what the demo videos show and what I have in the package!
    1. I can't find:
    2. Empty Graph!
    3. Template Graph!
    4. Imported Map!
    5. Video / My Graph!
    6. The editor is not like in your demo either!
    7. Also, as soon as MapMagic was installed, these warnings were generated !: Left neighbor of the terrain has a different heightmap resolution. Stop neighboring
    UnityEngine.GUIUtility: ProcessEvent (Int32, IntPtr)
    Can you explain better why this happens? How can i fix this?
     
  11. camta005

    camta005

    Joined:
    Dec 16, 2016
    Posts:
    320
    It happens when the Auto Connect setting is checked. When a neighbouring terrain is created it has a small heightmap resolution and is immediately changed to the matching resolution, but Unity still fires off a warning.

    @Wright I'm currently using Unity 2018.4 LTS and I can't open DemoScene because it was serialized with a newer version of Unity.
     
  12. Acatist

    Acatist

    Joined:
    Jun 7, 2016
    Posts:
    45
    Another thing, if you can tell me why the CTS shows me the tips of the black mountains. Apply CTS to the demo of the island to try, I found a black predominance, (attached image). If you can tell me how to solve this I would appreciate it. How can this be resolved? ... Thanks
     

    Attached Files:

  13. Acatist

    Acatist

    Joined:
    Jun 7, 2016
    Posts:
    45
    Hello again, this time I come to tell you that I have encountered a rather serious problem with the editor. I can't edit, every time I open the editor window and try to touch the elements, Unity closes unexpectedly. I am unable to edit. As a reference, I use the version of unity 2019.1.14f1
    Please give me a solution to all this because I just bought the plugin and I find it very annoying since I can't practically use it in conditions .... Thanks.
     

    Attached Files:

  14. DenisPahunov

    DenisPahunov

    Joined:
    Dec 2, 2019
    Posts:
    4
    Thanks, will look into it!

    Acatist, please check you mail, I will need some additional information on issues described.
     
  15. patrickk2

    patrickk2

    Joined:
    Dec 8, 2019
    Posts:
    92
    Hello camta005,

    thank you very much! The video looks very promising.

    Best regards,
    Patrick
     
    camta005 likes this.
  16. illinar

    illinar

    Joined:
    Apr 6, 2011
    Posts:
    863
    Hi, I'm considering getting this tool. I have a few questions.
    1. Is generation in MM multiplatform deterministic? (Important for a multiplayer game)
    2. Is runtime generation fast and multithreaded? (I don't want any performance spikes when moving fast (driving) to new tiles)
    3. Does it have tools for roads? (I need it to generate at least flattened areas for roads and buildings/cities)
    4. Is the graph powerful enough to generate a small town out of premade buildings? (That's not a strict requirement, I can generate my own stuff, I just need the terrain to conform to it.)
    5. Does it (or Unity Terrain) support holes in the ground?
    Basically I'm looking for the best tool for open world co-op game with randomly generated huge maps.

    Also World Creator is 40$ now on discount but does anyone know if it has runtime generation?
     
  17. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,267
    Oh, sorry, somehow I've got a second account logged in by default on my smartphone, so just replicate my post here:
    MM2 will have a grace period - those who bought MM1 about a month before the MM2 release will get it for free. I plan to announce when this period starts this week. All those who bought MM1 earlier can count on a significant discount.

    Yes.

    The generating itself usually takes a couple of seconds, maybe more, but yes, it's multithreaded, so there's no performance drop during it. However the last stage - applying to the terrain - could not be done not in a main thread, but it's split in several frames and there should not be lag bigger than 30ms.

    No. However there are some 3rd party MM extensions for that on the Asset Store. But if it's a key feature for you I recommend you waiting for MM2, it will have a roads tool.

    Yes.

    No, Unity Terrain does not support holes out of the box, neither does MM.

    You can try the evaluation version before buying to define if MM suits you after all.
     
    protopop likes this.
  18. illinar

    illinar

    Joined:
    Apr 6, 2011
    Posts:
    863
    I'd love to try the evaluation version (found it, downloaded it) and if it suits my project (almost sure it will), I'll go for MM2. Did I understand correctly that MM2 release is 1-2 months away?

    Also I might need to make my own terrain mesh system and persistent scattered object loading system. Would I be able to pull data from MM generator directly and easily? And assign my own data to scattered objects? Basically I just would like to get positions of all the trees (as custom objects, not Unity foliage), and to get their id's for simplicity's sake. Also getting custom terrain heatmap data, like areas where enemies can spawn, would be great.

    By the way, I think links to the "Manual" are broken on MM home page that is listed on the asset store.

    So thanks a lot for the replies and that documentation link.
     
    Last edited: Dec 10, 2019
  19. illinar

    illinar

    Joined:
    Apr 6, 2011
    Posts:
    863
    Unfortunately evaluation version doesnt compile in 2019.3 upload_2019-12-11_0-11-27.png
     
  20. Acatist

    Acatist

    Joined:
    Jun 7, 2016
    Posts:
    45
    Hi mate, try using the Enviro Sky Plugin and I find that it gives several conflicts. You could do an integration with Enviro since it is a very good plugin. Also, referring to water, you could make an integration with SUIMONO water because it is very good (it has interaction with water). Currently both give several problems, if you solve them would be perfect.
     
  21. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,267
    Well, evaluation version shouldn't compile since it is one of it's limitations, but I guess it doesn't actually make sense. I'm going to upload the new that should build with no issues.
    EDIT: done

    Just wondering what could cause a conflict. If it logs a few errors I could try fix them or find a workaround without really looking into the Sky Plugin. Could you please email me those errors?
     
    Last edited: Dec 12, 2019
  22. camta005

    camta005

    Joined:
    Dec 16, 2016
    Posts:
    320
    I started creating a height range generator so that I could use specific height range values instead of using curves all the time, to be used for things like textures, trees, grass and object placement.

    I then discovered that this already exists, it's an undocumented generator called 'Level Select'. I don't remember this being announced, which is odd because I can remember this feature being requested.

    I mention this here so that other people who are looking for this feature know where to find it, but also to say Denis if you add a new generator please also add it to the documentation :p
     
    protopop and illinar like this.
  23. illinar

    illinar

    Joined:
    Apr 6, 2011
    Posts:
    863
    Just downloaded it. Still trows the error: upload_2019-12-13_16-45-25.png
     
  24. topofsteel

    topofsteel

    Joined:
    Dec 2, 2011
    Posts:
    999
    I have a terrain from real world data. I wanted to use MM for texturing and tree placement. I thought I saw in one video you dragged existing terrain data into MapMagic? Thank you.
     
  25. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,267
    Ok, will try to pay more attention to announcing new features. The documentation will follow. I've made this generator for MM2, and it wasn't hard to convert it to MM1.

    Hmm, very odd. What is your Unity version?

    You can use the heightmap data with the RAW Input or Texture Input nodes. However they were designed to specify the base terrain shape, while detailing should be done with other MM generators - so when using large resolution like 4K some lag can occur.
     
    protopop and camta005 like this.
  26. illinar

    illinar

    Joined:
    Apr 6, 2011
    Posts:
    863
    Ahh.. Sorry, I figured it out. I had created a Terrain script in a global namespace which was overriding the builtin Terrain. It works now.
     
  27. Sylmerria

    Sylmerria

    Joined:
    Jul 2, 2012
    Posts:
    369
    Hi,

    Does MM2 will have a river tool too ?
     
  28. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,557
    I tried the level select generator out but didn’t understand how it’s working , like what range and level do. It seems to limit things to different heights depending on the range and level you choose. Do you have any insight about the generator?
     
  29. camta005

    camta005

    Joined:
    Dec 16, 2016
    Posts:
    320
    Hi Protopop, Nimian Legends is an awesome project and I'm looking forward to what you are working on now.

    The two fields for level are min height and max height and the range refers to the transition range. Try setting the range to 0 until you get your level heights are right, then experiment with increasing the range which will give a softer transition.
     
    protopop likes this.
  30. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,557
    Thanks for the help:) And thank you for the nice words. I'm having a lot of fun making my next game Wilderless and I couldn't do it without MapMagic, which is a wonderful tool.

    ELUbN1SXsAATYDp.jpeg
     
  31. illinar

    illinar

    Joined:
    Apr 6, 2011
    Posts:
    863
    Is MM or MM2 making use of DOTS? At least the job system? I heard they are making a DOTS based terrain engine now, I hope MM will support it as directly as possible.
     
  32. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    Where'd you hear that? I see a forum post from a Unity staff member "Terrain & Physics is currently not supported. We are working on a dedicated dots terrain engine that will fill the hole." but would love to hear more. Terrain is such an underdeveloped system in Unity =[
     
  33. illinar

    illinar

    Joined:
    Apr 6, 2011
    Posts:
    863
    That's all I heard as well, but it means it is in development since at least whenever that post was. (March?) And it is also linked with physics which is very actively developed. I would expect that terrain system somewhere in the next 6-12 months, but this is absolutely not guaranteed. Also the the roadmap promises the bulk of Unity features converted by the end of 2020, and terrain is most likely one of those features.
     
  34. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,267
    It's really nice to hear (and see!) you've found a good use for MapMagic! Thanks!

    I know that DOTS makes working with threads much more convenient, but actually there's no need of using it in MM. MapMagic works with theading directly through the System.Threading (and you can try enabling async/await in MM2, however it works somewhat slower, so it's more of an experiment). All of the DOTS features are more for the compiled project rather than the editor tool, but if someday Unity will open up an access to modify the terrain from non-main thread I will surely utilize this.
     
    mmaclaurin and protopop like this.
  35. Daniel-Talis

    Daniel-Talis

    Joined:
    Dec 10, 2011
    Posts:
    425
    Could MapMagic be used to build an endless procedural city? :)
     
  36. illinar

    illinar

    Joined:
    Apr 6, 2011
    Posts:
    863
    Burst compiler really is quite a miracle. It would give significant speedup compared to normal multithreading, it's more of a hyperthreading with significant low level instruction optimizations. It might not fit your use case without a lot of refactoring or extra step to compile data, since your graphs probably use a lot of references, and job system with Burst works only with non-managed objects. I just hoped you considered it.

    EDIT: But I guess I'm more interested in pulling data manually at runtime from MM in the most DOTS friendly way.

    ECS seems perfect for terrain generation system in terms of performance.
     
    Last edited: Dec 19, 2019
  37. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,267
    Yes, Unity counts it will be even faster than C++ code - even the properly written C++ code. If so it would really be a miracle.

    Well, it depends on what exactly you are going to achieve. You can make villages with the MapMagic, and theoretically it can make an endless village. However there are no special city generators for quarters, blocks of houses, streets, etc., so I'd rather say no. The city generated with MapMagic will be kinda rural, but it'll do for some purposes.
     
    illinar, Daniel-Talis and malkere like this.
  38. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,267
    I'd like to announce the beginning of the public MapMagic 2 beta test next week. It would be the analogue of MM1 evaluation version, so anyone (including the ones who have not got MM1) can download it and fiddle with it during the holidays or shortly after. I plan to release Public Beta 1 on Sunday, December 29, and PB2/RC after the festive season.

    All who bought MM1 starting on December 1 or later will get a free upgrade to MM2. All who bought it before (regardless of time) will get a 50% discount on MM2.

    The price of MM2 could be slightly higher than MM1. However the final MM2 release date still depends on the amount of bugs found and their severity, so I'd like to recommend you buying MM2 on release rather then buying MM1 now and keeping it on the shelve.
     
  39. illinar

    illinar

    Joined:
    Apr 6, 2011
    Posts:
    863
    I'm very excited to see and test the new version.

    I like the way Amplify Creations are releasing all their products. They release usually in three stages Alpha > Beta > Release. Alpha is priced at 25%, beta at 50%, etc. I got Amplify Shader Editor in Alpha for $15 and now it's 60$. So they get good sales and good reviews from the start while still developing, and that helps them get on the front page of the asset store.
     
    Last edited: Dec 21, 2019
  40. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    @Wright are you expecting performance improvements with MM2? You've done away with the "safe borders" system used for stitching neighbors together I believe you and I talked about once, right? I still get irregular results on corners/edges (in MM1) depending on which terrain comes on first.
     
    illinar likes this.
  41. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,557
    This is great news. I love MapMagic 1 and I’m super excited to try MM2.
     
  42. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,267
    Sounds interesting. I'll think of 50% discount on the pre-release version.

    Yes, there are some performance improvements. First of all it's the terrain generation performance improvement - the slowest generators were re-written using C++. For example erosion now works 5x times faster. Secondly, the total overhead of the generate process was slightly reduced. And finally, the interface improvement draws graph GUI significantly faster. Just out of interest one day I'm going to compare the new version performance with the older one.
     
    illinar, protopop and Lars-Steenhoff like this.
  43. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,557
    Will the MapMagic 2 beta work on Mac?
     
    Lars-Steenhoff likes this.
  44. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,267
    Yes. Not sure about the native code, because it's still an issue, but I'll try to fix it to the end of the week. If not - it will still work (however some generators will take longer to generate).
     
    Lars-Steenhoff and protopop like this.
  45. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,557
    That sounds great:)

    Can we install MM1 and MM2 in the same project directory? Or is the mapmagic folder name the same? It would be nice to be able to compare the two in the same project - in different scenes because I think only one instance of MM can run in a scene correct?
     
  46. illinar

    illinar

    Joined:
    Apr 6, 2011
    Posts:
    863
    I'ts hard to understand how to use MM generated results via scripts only without API reference.

    There is a Calculate() method to get the data directly. Is there an async version of that? Or can I just get small chunks out? Will it generate seamless data if I get it through Calculate by small chunks? Will output data contain any data I will set my generators to output? Are there improvements of this process in MM2?

    Use case: streaming the terrain, object placement data, and other data into my ECS systems that will generate the world with custom objects and custom (probably) terrain meshes, and additional custom generators for towns and roads.
     
    Last edited: Dec 26, 2019
    patrickk2 likes this.
  47. YolanOTHER

    YolanOTHER

    Joined:
    Oct 23, 2016
    Posts:
    47
    @Wright I'm looking for the best way to dynamically flatten the terrain under buildings added at runtime. Is there a way to regenerate just a subsection of a terrain? Is there a better way to do it overall? Here is my current process:

    1. Write custom bounds marker for objects that should have terrain flattened under them
    2. Write custom generator that finds any objects with these components attached and create spatialobjects out of them
    3. Pass these objects to the Flatten generator
    4. On new bounds object added/changed call MapMagic.instance.Generate() so the custom generator scans for changes and updates.

    So far this results in the whole terrain disappearing for regeneration which takes a few seconds. Is there a better way to do this (like above generate only that set of chunks). Or a more streamlined overall process pre MM2?

    upload_2019-12-27_13-18-7.png
     
  48. Daniel-Talis

    Daniel-Talis

    Joined:
    Dec 10, 2011
    Posts:
    425
    It's Sunday the 29th of December where I live. :)
     
  49. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,267
    MapMagic 2 Public Beta is out!

    Check this instructions page for download link and more details. Please pay attention to the bug reporting description - at least it's the purpose of the beta test.

    Theoretically you can, but I haven't tried it myself.

    Yes, you can use Calculate to generate some custom area data. It could be run in non-main thread, however it depends on you whether you will call it async or not. The data generated this way will based on the same principle as the standard chunk data - it will be seamless unless the generators require neighbor pixels - and in this case seams are masked with the safe borders.

    Everything seems to be done right, however I'm wondering how you get the objects positions in Runtime Flattener node in thread (you should probably get an error "could not be executed in non-main thread"). Don't know why the results are disappearing - is there by any chance MM removes the flatten objects markers?
     
    protopop, illinar, KeithBrown and 2 others like this.
  50. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,521
    I have one feedback about the interface, I feel that the blue title bars would look better if the font was white.

    It the same way unity uses white font when something is blue with text over it.
    Do you agree?

    OpenGraphblack.jpg


    OpenGraph.jpg