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

    Dolmek

    Joined:
    Jun 28, 2015
    Posts:
    12
    @Wright Hi, I tried the code, but it say that "src.offset, src.size, src.resolution" in "SpatialHash dst = new SpatialHash(src.offset, src.size, src.resolution)" the name src does not exist in the contest.
    What is missing?
     
    Last edited: Jan 19, 2021
  2. RakNet

    RakNet

    Joined:
    Oct 9, 2013
    Posts:
    313
    @Wright Do you have some kind of showcase? We are using Map Magic for our randomly generated terrains. We have 4 biomes, ice, forest, hills, and desert. You can see some of these in the trailer
    https://store.steampowered.com/app/980640/Empire_of_Ember/

    Also, please message me if you want a Steam key. We've giving a limited number of free keys to the general population but they will be gone by the time you get this message.
    https://store.steampowered.com/news/app/980640/view/5196558685228269373
     
  3. Dolmek

    Dolmek

    Joined:
    Jun 28, 2015
    Posts:
    12
    @Wright look like both "SpatialHash dst = new SpatialHash(src.offset, src.size, src.resolution)" and "Vector2 pos = new Vector2(src.offset.x + src.size.x / 2f, src.offset.z + src.size.z / 2f);" need src variable. Problem is in the Example you posted here and in https://gitlab.com/denispahunov/mapmagic/-/wikis/MM1/Scripting_faq that variable is missing, I tryed some option but nothing was working, can you please help?
     
  4. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,549
    After my next game update I'll be testing the move to mapmagic 2 (I bought the whole set in anticipation) but for now I am still using map magic 1 and like to share pics. Thank you for all of your great work on the map magic projects and I hope that you are staying healthy and happy

    5C07FC35-A305-4CF5-8B00-B559E4E37A48.jpeg A2761B35-6765-4329-BCB3-5318923D0E88.jpeg BFCE9CE1-C6F5-47D9-AB83-941C70F89B6A.jpeg
     
  5. Daniel-Talis

    Daniel-Talis

    Joined:
    Dec 10, 2011
    Posts:
    425
    Early Walt Disney :) it looks really professional.. great work and good luck with the project.
     
    protopop likes this.
  6. secondsight_

    secondsight_

    Joined:
    Mar 2, 2014
    Posts:
    163
    Hey !
    I´ve got a problem. Recently setup a fresh new project using Unity 2020.1 and MapMagic 1.10.9.
    Now when I right click and hover over create -> the menue does not show up. Same with preview.
    The focus is instantly taken over by the main window.
     
  7. Stardog

    Stardog

    Joined:
    Jun 28, 2010
    Posts:
    1,886
    Check if it's this problem. If so, it's a Unity bug. Test it by trying to assign a material to a renderer from the pop-up list.
     
  8. secondsight_

    secondsight_

    Joined:
    Mar 2, 2014
    Posts:
    163
    Updated to Unity 2020.2.5 in hope it would fix it.
    No, it only seems to happen in map magic. I also noticed I get an error in import:

    upload_2021-2-21_0-46-52.png


    Edit:
    Found this on githlab today. I think this is the same issue ?
    https://gitlab.com/denispahunov/mapmagic/-/issues/323
    https://gitlab.com/denispahunov/mapmagic/-/issues/345


    I have tried MM1 with Unity 2020.x now 3 different PCs. On every machine I get the same issue. So at the moment MM1 is simply not working for me. Am I the only one here having this issue ?
     

    Attached Files:

    Last edited: Feb 22, 2021
  9. dmenefee

    dmenefee

    Joined:
    Oct 14, 2019
    Posts:
    142
    Hi. In my testbed project, I deleted the MapMagic directory and imported the new assets (MM, Biomes, Objects, Splines). I updated via Asset Store, so they're the latest. I'm seeing these compilation errors:

    Assets/MapMagic/Compatibility/VegetationStudio/VSProMapsOut.cs(96,10): error CS0117: 'Graph' does not contain a definition for 'OnBeforeOutputFinalize'
    Assets/MapMagic/Compatibility/VegetationStudioObjects/VSProObjectsOut.cs(98,10): error CS0103: The name 'SkipOnBiome' does not exist in the current context
    Assets/MapMagic/Compatibility/VegetationStudioObjects/VSProObjectsOut.cs(100,13): error CS1061: 'VSProObjectsOut' does not contain a definition for 'MoveRotateScale' and no accessible extension method 'MoveRotateScale' accepting a first argument of type 'VSProObjectsOut' could be found (are you missing a using directive or an assembly reference?)
    Assets/MapMagic/Compatibility/VegetationStudioObjects/VSProObjectsOut.cs(139,10): error CS0117: 'Graph' does not contain a definition for 'OnBeforeOutputFinalize'

    The testbed project used to work fine.
     
    ElevenGame likes this.
  10. HP

    HP

    Joined:
    Nov 20, 2012
    Posts:
    80
    I think you mean MapMagic 2?
    This thread is for MapMagic 1.

    You can get a fix for the errors here: https://forum.unity.com/threads/rel...al-land-generator.875470/page-17#post-6872732
     
    dmenefee likes this.
  11. dmenefee

    dmenefee

    Joined:
    Oct 14, 2019
    Posts:
    142
  12. RakNet

    RakNet

    Joined:
    Oct 9, 2013
    Posts:
    313
    In Unity 2020.2.7f1 in the original map magic (newest version)
    As soon as I hover over create or preview, the menu disappears..

    This used to work in Unity 2020.1, I didn't change any relevant code
     
  13. FlightOfOne

    FlightOfOne

    Joined:
    Aug 1, 2014
    Posts:
    659
    This looks really cool! Are you streaming your terrain via MapMagic?
     
    protopop likes this.
  14. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,549
    thanks, and yes, MapMagic handles all the terrain streaming really well:)
     
    P_Jong and FlightOfOne like this.
  15. baaleos

    baaleos

    Joined:
    May 12, 2018
    Posts:
    12
    Anyone know if Voxeland is compatible with MapMagic2?
    Eg: Generate terrain - and then dig at runtime?
     
  16. tranceemerson

    tranceemerson

    Joined:
    Apr 10, 2017
    Posts:
    5
    this invite is expired.
     
  17. GambitMonkey

    GambitMonkey

    Joined:
    Apr 5, 2016
    Posts:
    65
    Does anyone know a way of getting what Biome layer a terrain tile is being generated for in MM2?

    I can get the terrain tile and data with the OnTerrainApplied event and I can see the Biome layers, but haven't figured out which layer the generated tile used.

    Any ideas?

    Thanks in advance!
     
  18. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    GAH. With Map Magic 2 - wrong thread

    So. Say. 3 years later... someone still wanted to do this. Don't judge.

    and they setup such a noise - how would such a person - increment the noise offset based on the world tile location in a multiple terrain setup. I don't see any easy ways to pump data into the X or Y or the noise, And I don't see any low-hanging "world space" nodes either.

    How do other people do this then?

    Hi res diagram enc... upload_2021-6-30_1-4-33.png
     
    Last edited: Jun 30, 2021
  19. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    GAH. With Map Magic 2 - wrong thread


    Bug. Add a custom Spline output. Delete it. You can't.

    upload_2021-6-30_1-19-10.png

    stuck with it then forever?


    Bug 2: upload_2021-6-30_3-24-41.png

    Code (CSharp):
    1. Thread failed: System.Exception: Couldn't upsize: src Den.Tools.CoordRect: offsetX:-513 offsetZ:-513 sizeX:1024 sizeZ:1024 is less than dst Den.Tools.CoordRect: offsetX:-16 offsetZ:-16 sizeX:545 sizeZ:545
    2.  at Den.Tools.Matrices.MatrixOps.Upsize (Den.Tools.Matrices.Matrix src, Den.Tools.Vector2D srcOffset, Den.Tools.Vector2D srcSize, Den.Tools.Matrices.Matrix dst) [0x00171] in D:\REPOS\AOTA-Small\Assets\MapMagic\Tools\Matrix\MatrixOps.cs:539
    3.  at MapMagic.Nodes.MatrixGenerators.Import200.ImportWithEnlarge (Den.Tools.Matrices.MatrixWorld src, Den.Tools.Matrices.MatrixWorld dst, MapMagic.Terrains.Area area, MapMagic.Products.StopToken stop) [0x000f7] in D:\REPOS\AOTA-Small\Assets\MapMagic\Generators\Matrix\Runtime\MatrixInitial.cs:423
    4.  at MapMagic.Nodes.MatrixGenerators.Import200.Generate (MapMagic.Products.TileData data, MapMagic.Products.StopToken stop) [0x0013a] in D:\REPOS\AOTA-Small\Assets\MapMagic\Generators\Matrix\Runtime\MatrixInitial.cs:375
    5.  at MapMagic.Nodes.Graph.GenerateRecursive (MapMagic.Nodes.Generator gen, MapMagic.Products.TileData data, MapMagic.Expose.Override ovd, MapMagic.Products.StopToken stop) [0x001ed] in D:\REPOS\AOTA-Small\Assets\MapMagic\Nodes\Graph.cs:913
    6.  at MapMagic.Nodes.Graph.Generate (MapMagic.Products.TileData data, MapMagic.Products.StopToken stop, MapMagic.Expose.Override ovd) [0x00039] in D:\REPOS\AOTA-Small\Assets\MapMagic\Nodes\Graph.cs:856
    7.  at MapMagic.Terrains.TerrainTile.Generate (MapMagic.Nodes.Graph graph, MapMagic.Terrains.TerrainTile tile, MapMagic.Terrains.TerrainTile+DetailLevel det, MapMagic.Products.StopToken stop) [0x0004b] in D:\REPOS\AOTA-Small\Assets\MapMagic\Terrains\TerrainTile.cs:681
    8.  at MapMagic.Terrains.TerrainTile+<>c__DisplayClass40_0.<StopEnqueueTask>b__0 () [0x00000] in D:\REPOS\AOTA-Small\Assets\MapMagic\Terrains\TerrainTile.cs:634
    9.  at Den.Tools.Tasks.ThreadManager.TaskThreadAction (Den.Tools.Tasks.ThreadManager+Task task) [0x00000] in D:\REPOS\AOTA-Small\Assets\MapMagic\Tools\ThreadManager\ThreadManager.cs:138
    10. UnityEngine.Debug:LogError (object)
    11. Den.Tools.Tasks.ThreadManager:TaskThreadAction (Den.Tools.Tasks.ThreadManager/Task) (at Assets/MapMagic/Tools/ThreadManager/ThreadManager.cs:141)
    12. System.Threading.ThreadHelper:ThreadStart ()

    Doesn't like you trying to scale up imported map data. (Yes, I read the error, needs scaffold)
     
    Last edited: Jun 30, 2021
  20. stigmamax

    stigmamax

    Joined:
    Jun 30, 2014
    Posts:
    226
    Hi,
    I have this error with Unity 2021.1.11f1 and MapMagic 2.1.5
     
  21. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    Not to be a dick... But... I am guessing it is actually assigned right?
    What graph is that. Can we see a screenshot of the intended request? Not really enough detail to go on there.
    Looks like the graph is literally not assigned in the little box but could just be the terrain texture type being wrong - combined with something else. or something else. hard to see without more info
     
    Last edited: Jul 21, 2021
  22. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    Fun fact:

    Must have a default constructor or my graph won't load?

    I am completely guessing that your serialiser? is expecting one? no idea why it is embedding this class of mine in that. Perhaps because it references a map magic node thingy... upload_2021-7-21_17-12-14.png

    this is all I can think

    upload_2021-7-21_17-13-12.png

    Anyway. word the wise. Your graph suddenly doesn't load? Check for this. Caught me out.

    EDIT: I forgot to add. There is always the possibility that I am being a complete idiot. Never rule that out
     
    Last edited: Jul 21, 2021
  23. stigmamax

    stigmamax

    Joined:
    Jun 30, 2014
    Posts:
    226
    I just did a new project with Unity 2021.1.11f1 URP and MM2 2.15 without doing anything else. Does MM2 work with this version of Unity?
     
  24. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
  25. stigmamax

    stigmamax

    Joined:
    Jun 30, 2014
    Posts:
    226
    Sorry !
    Thanks for the new link.
     
    Duffer123 likes this.
  26. montyjack

    montyjack

    Joined:
    Jan 10, 2014
    Posts:
    43
    Hey - just got Mapmagic 2. Looks great so far, although I was wondering - I'm going to have a 3x3 terrain map with a large specifically shaped valley running up the center. How would I get an Import node to span multiple tiles, since I'm importing the valley heightmap?
     
    twobob likes this.
  27. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
  28. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,549
    This is a MapMagic issue but im leaving this on both forums in case this helps someone using MapMagic 1 and Microsplat :)

    I updated Microsplat and then had this MapMagic 1 error:

    Assets/MapMagic/Generators/CustomShaderOutput.cs(1439,36): error CS0246: The type or namespace name 'MicroSplatTerrain' could not be found (are you missing a using directive or an assembly reference?)

    I fixed it by editing CustomShaderOutput.cs and adding:

    using JBooth.MicroSplat;
     
    secondsight_, MegaCo and twobob like this.
  29. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    good man!

    Good man
     
  30. JaredThomson

    JaredThomson

    Joined:
    Nov 15, 2013
    Posts:
    16
    I assume the bundle images are just the individual asset images and this is just an error, right? Or are biomes not included?

    upload_2022-1-7_14-13-32.png
     
  31. SSL7

    SSL7

    Joined:
    Mar 23, 2016
    Posts:
    336
    Hello Denis,

    Upgraded from 1.10.09 to 1.10.10 and I get a lot of errors in MapMagicWindow.cs (which is the only script updated anyway.


    Assets\MapMagic\Editor\MapMagicWindow.cs(863,57): error CS0029: Cannot implicitly convert type 'void' to 'object'

    Assets\MapMagic\Editor\MapMagicWindow.cs(868,106): error CS1503: Argument 2: cannot convert from 'Item[]' to 'System.Func<object>'

    Assets\MapMagic\Editor\MapMagicWindow.cs(912,77): error CS1739: The best overload for 'Item' does not have a parameter named 'disabled'

    Any clues? Thanks
     
  32. Vespy

    Vespy

    Joined:
    Oct 16, 2014
    Posts:
    6
    Is there any way to clamp these pathfinding points together? I can't seem to find a fix. Also is there a way to have only 1 singular road generated throughout all the tiles?
     

    Attached Files:

    • exmm.png
      exmm.png
      File size:
      449.2 KB
      Views:
      247
  33. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,226
    Seems to be a screenshot copied from MapMagic 2 Core. Biomes module is included in Bundle, and this screen is taken from the Badlands scene. This scene is also included, together with graph and textures. Will check if the screens are relevant for Bundle, thanks for pointing that out!

    Oh, it's MapMagic 1. The last update has a new create window copied from MapMagic 2 as far as I remember. I will take a look what's gone wrong here.

    Unfortunately you can't make the road going from one tile to another without a hack (like additional margins for Scatter). But I'm working on cluster system that can fix this.

    About connecting points that have close horizontal positions but different vertical - I can see your use case. Will think about adding a Weld node that takes X and Z coordinates or something.
     
  34. Xenio29470

    Xenio29470

    Joined:
    Oct 31, 2021
    Posts:
    1
    Hey ! I would like to know if there's a limit of locks in a map magic terrain ?
     
  35. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,226
    MMWG has no locks. You might be talking about MM2.

    I have not set any limitation on this, theoretically you can have 2 billions. But I have not tested maximum number as well. The sane amount looks like a hundred for me.
     
  36. jnbbender

    jnbbender

    Joined:
    May 25, 2017
    Posts:
    479
    I was wondering if I am missing something. The problem occurs in Map Magic 1 & Map Magic 2. All I am doing is creating an initial MapMagic object and then try to "pin" other terrains. When I click "pin" I get nothing. I cannot add any additional terrains. I am using 2021.3.3
     
  37. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,549
    Do you have GIZMOS turned on in your scene view? If they are off you won't see the outline when you mouse over a pinnacle area, and creating a new terrain by pinning won't work.

    Screen Shot 2022-05-29 at 6.47.32 PM.png

    If that doesnt help, try reseting your layout factory settings to default. This will remove your saved window configurations, but you could restore them manually after.
     

    Attached Files:

  38. jnbbender

    jnbbender

    Joined:
    May 25, 2017
    Posts:
    479
    That might have been it. Not sure if I did or not but got 'em now. Thanks.
     
    protopop likes this.
  39. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,549
    After I generate a terrain in MM1 I run a post process script that adds a road to each terrain.

    It modifies the terrain height map so once I make it it is permanent until the terrain regenerates itself.

    I notice sometimes terrains just hide instead of being destroyed (which is cool)

    How can I listen to know when a terrain tile that already exists is regenerated, like if I go far away then come back sometimes it isn't regenerated but just unhidden. This way I can only regenerate roads when a terrain is generated free or regenerated. I dont want to berates a road on a terrain that already has one.

    FTBPCt_XwAAG_4z.jpeg
     
    jnbbender likes this.
  40. SSL7

    SSL7

    Joined:
    Mar 23, 2016
    Posts:
    336
    Upgraded to MM 1.10.10 from 1.10.9 and I get a lot of errors:


    Assets\MapMagic\Editor\MapMagicWindow.cs(925,9): error CS1061: 'Item' does not contain a definition for 'subItems' and no accessible extension method 'subItems' accepting a first argument of type 'Item' could be found (are you missing a using directive or an assembly reference?)

    Assets\MapMagic\Editor\MapMagicWindow.cs(927,41): error CS1503: Argument 1: cannot convert from 'Item' to 'Den.Tools.GUI.Popup.Item'

    Assets\MapMagic\Editor\MapMagicWindow.cs(863,57): error CS0029: Cannot implicitly convert type 'void' to 'object'

    Any solutions?
     
  41. VladKostinWG

    VladKostinWG

    Joined:
    Jun 7, 2022
    Posts:
    1
    MapMagic Brush is not working in 2021.2 and 2021.3!
    Only works in 2020.3. I tested everything in clean new projects.
     
  42. SSL7

    SSL7

    Joined:
    Mar 23, 2016
    Posts:
    336
  43. franck_Extriple

    franck_Extriple

    Joined:
    Oct 27, 2017
    Posts:
    20
    Hi.

    (on Unity 2019.4.10 with current latest Mapmagic 2 at date 2.1.10)
    There is an error in console:

    Assets\MapMagic\Tools\Segs\SplineMatrixOps.cs(51,6): error CS1503: Argument 1: cannot convert from 'UnityEngine.Vector2' to 'Den.Tools.Vector2D'
    Assets\MapMagic\Tools\Segs\SplineMatrixOps.cs(52,6): error CS1503: Argument 2: cannot convert from 'UnityEngine.Vector2' to 'Den.Tools.Vector2D'
     
  44. dclipca

    dclipca

    Joined:
    Oct 30, 2021
    Posts:
    22
    Using the Objects plugin, how does one instantiate trees as GameObjects, not trees?
     
  45. dclipca

    dclipca

    Joined:
    Oct 30, 2021
    Posts:
    22
    Outputs -> Objects is usable with trees
     
  46. Flapman

    Flapman

    Joined:
    Aug 15, 2010
    Posts:
    84
    Hello all, I just bought Map Magic but am unable to import a RAW Heightmap file. It does not show up as an option in the new maps directory. I have a custom map I want to import. I might be missing something. Can someone help?
     

    Attached Files:

  47. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,171
    Did you create an imported map, and then put the import node in the graph?

    https://gitlab.com/denispahunov/mapmagic/-/wikis/MatrixGenerators/Import

    Right click in your project, choose "Create/Map Magic/Imported Map"?
     
  48. Flapman

    Flapman

    Joined:
    Aug 15, 2010
    Posts:
    84
  49. Liminal-Ridges

    Liminal-Ridges

    Joined:
    Oct 21, 2015
    Posts:
    255
    @Wright does infinite generation worth with imported heightmaps?
     
  50. Stardog

    Stardog

    Joined:
    Jun 28, 2010
    Posts:
    1,886
    Has anyone got grass working with 2022.2? Unity changed the grass painting recently, so maybe that's why I can't get it to show.
     
    protopop likes this.