Search Unity

MapMagic 2 - infinite procedural land generator

Discussion in 'Assets and Asset Store' started by Wright, Apr 24, 2020.

  1. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,278
    Yes, Positions node seem to be exactly what you need.

    In two words - it will generate low-res terrain for several tiles first. It will also have objects scattered and splines connected. Then each of the tiles that are generating will read the part from this big terrain, and use only the the fragment it is located at: maps will be upscaled to tile resolution, objects out of margins will be discarded, and splines will be cut.

    I will add proper explanation, documentation and video tutorials when it's finally ready. I'm experimenting with different approaches and can't say exactly which one will be finally chosen.

    Just in case - no ETA yet. It's what I'm currently working on, but I can't guarantee that it will do what is said or will be 100% released at all.

    I'm afraid there is no built-in solution for that.
     
    mick129 likes this.
  2. dragon_slumber

    dragon_slumber

    Joined:
    Jun 11, 2017
    Posts:
    30
    Ok, I've been doing a bunch of data tracking and making my way back to the source. I know that by the time ObjectsOut.Finalize is called, trns.count is 0 so nothing gets spawned. In the Editor, that's 27. Most of the UNITY_EDITOR stuff seems to be duds, ObjectsPool.InstantiateObject (204) is outright never called. Removing UNITY_EDITOR from TerrainTile, 144 didn't change anything, and the other ones all seem to either refer to UnityEditor as code, or to replace DestroyImmediate by Destroy so they seem unlikely to be the issue. Right now I'm thinking it might be something in Graph.cs, which seems to be the step before Finalize, but if you have some insight before I dive deeper, I'd love to hear it.

    Thanks.
     
  3. FuriousEX

    FuriousEX

    Joined:
    Mar 13, 2014
    Posts:
    51
    Agreed - but is there a way to expose Positions as an variable array?

    I see how to expose individual Vector3s inside a Positions node, but no way to send Map Magic a dynamic number of Vector3s.

    Thanks!
     
  4. mick129

    mick129

    Joined:
    Jun 19, 2013
    Posts:
    228
    If it is really fast at runtime, I would be curious to learn more. I was thinking to rebuild my world to go 100$ procedural at runtime. Keep us posted :)
     
  5. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,278
    Nope, there is no way to expose an array. But if you want to provide an array of positions you can use your custom node. You can start with taking Positions as a reference (right click on it -> go to code).

    It's too early to say how fast it would be, but I hope rather fast. At least all the terrains should not generate the same cluster, so it will take time only for the first one.
     
    mick129 likes this.
  6. brenchleyderek

    brenchleyderek

    Joined:
    Sep 20, 2019
    Posts:
    4
    Hi there! Looking to purchase MapMagic2 bundle, but I had a quick question. It seems like overridden variables can be accessed and re-written via code, but is it possible to enable and disable graph nodes via code? For example, can I have two curve nodes and enable/disable them based on the player's input prior to generating the map? If so, could you also disable/enable groups of nodes?

    My goal is to allow a player to generate a map based on their preferences (mountainous, canyons, plains, etc.), so the ability to enable/disable nodes, such as the terrace node or graph node, would be ideal. Thank you!
     
    Last edited: Feb 26, 2023
  7. khushalkhan

    khushalkhan

    Joined:
    Aug 6, 2016
    Posts:
    177
    Native code causing null reference in apple silicon, even downloaded the compiled library
     
  8. naileye

    naileye

    Joined:
    Oct 18, 2015
    Posts:
    6
    Are there any specific requirements for MapMagic 2, such as .NET version? Immediately after importing, it gives an error in the console. Have others encountered the same thing?: Exception: Could not find type for: MapMagic.Nodes.ObjectsGenerators.Split200+SplitLayer, MapMagic, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null.
     
    Marsdaddy likes this.
  9. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,278
    Are you using Bundle or Objects module? This error is not related with .NET version, it just means that the script is missing, probably due to some issues with package manager. Re-installing it might help, especially in a clean project.

    You can disable native code by turning off C++ Native Code in Window - MapMagic - Settings. You can also get source code and compile it for any platform you like here: gitlab or dropbox.

    Overwritten variables are not the only way to access nodes. You can get more control directly, by accessing node by id:
    • right-click node and select Generator
    • you can see the id number in list, it should be something like Id:12345
    • clicking this number will copy it to buffer so you can paste it in code or in value.
    • execute mapMagicObject.graph.GetGenerator(g => g.id==12345) will return this generator as Generator type
    • cast this generator to it's original type to get access to all of it's values, including enable.
     
  10. JohnnyRobert

    JohnnyRobert

    Joined:
    Dec 8, 2022
    Posts:
    16
    I am using Digger Pro which is compatible with MM2 but I don't know if it can be made so that it generates Caves procedurally after the world is being generated. It would also need to store those caves into the same World Seed number that the MM2 is using.

    It can dig into the terrain generated by MM2 basically so in theory this should open up a window for what I want to do but of course it's complicated because at the same time I need to carefully integrate whatever I make it do with MM2.

    Do you have any ideas if that could work or how it would work from an integration with MM2 standpoint ?
     
    Last edited: Mar 5, 2023
  11. Marsdaddy

    Marsdaddy

    Joined:
    Jan 7, 2023
    Posts:
    1
    HI, I've installed Map Magic 2 for the first time this morning and I'm getting exactly the same thing, followed by unity crashing.

    Exception: Could not find type for: MapMagic.Nodes.ObjectsGenerators.Split200+SplitLayer, MapMagic, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
    Den.Tools.Serializer.DeserializeObject (System.Int32 refId, Den.Tools.Serializer+Object[] serialized, System.Object[] deserialized, System.Object[] reuse, System.Action`1[T] onBeforeDeserialize) (at Assets/MapMagic/Tools/Serializer.cs:501)
    Den.Tools.Serializer.DeserializeObject (System.Int32 refId, Den.Tools.Serializer+Object[] serialized, System.Object[] deserialized, System.Object[] reuse, System.Action`1[T] onBeforeDeserialize) (at Assets/MapMagic/Tools/Serializer.cs:582)
    Den.Tools.Serializer.DeserializeObject (System.Int32 refId, Den.Tools.Serializer+Object[] serialized, System.Object[] deserialized, System.Object[] reuse, System.Action`1[T] onBeforeDeserialize) (at Assets/MapMagic/Tools/Serializer.cs:633)
    Den.Tools.Serializer.Deserialize (Den.Tools.Serializer+Object[] serialized, System.Action`1[T] onBeforeDeserialize) (at Assets/MapMagic/Tools/Serializer.cs:191)
    MapMagic.Nodes.GraphSerializer200Beta.Deserialize (MapMagic.Nodes.Graph graph) (at Assets/MapMagic/Nodes/GraphSerializer.cs:60)
    MapMagic.Nodes.Graph.OnAfterDeserialize () (at Assets/MapMagic/Nodes/Graph.cs:1173)
     
    Last edited: Mar 4, 2023
  12. avidwriter

    avidwriter

    Joined:
    Dec 21, 2021
    Posts:
    9
    EDIT: fixed by using a random node with density 1 for forest seedling location, then it gets generated on every tile. cool!

    I'm having an issue with MM2 with infinite terrains where trees aren't being planted on the new terrains (using Forest). Is there a way to fix this? thanks
     
    Last edited: Mar 6, 2023
  13. Tim-Wiese

    Tim-Wiese

    Joined:
    Jul 7, 2012
    Posts:
    77
    If anyone is having an issue with large graphs and Application.Tick, I found a solution that worked for us.

    The issue seems to be an issue with Unity's Undo, by removing some code that record's undo the Application.Tick went away completely.

    In GeneratorDraw.cs comment out line 226
    Tools\GUI\Editor UI.cs line 418
    GraphWindow.cs comment out line 114, 200-205
    Tools\Extensions Extensions.cs Add before line 133 if (dict != null && dict.Count > 0)
    and incase the foreach statement.

    These line numbers are different depending on your version.

    This will remove the recording of Undo's while you are working on your graph, but if you were having an issue with Application.Tick like we were then this sacrifice is worth it.

    we are using Unity 2021.3.9f1.
     
    Last edited: Mar 13, 2023
  14. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,278
    Thanks for reporting - I found out what it is. It's demo scene for Vegetation Studio VSProGraph2 that should go with objects module, but included in Core. Will fix it ASAP.

    However, this should just log an error, and doesn't seem to be causing Unity crash (at least for me for Unity 2019.4.40 and 2021.3.4). So probably there's something else. Can you please try removing Assets\MapMagic\Demo\Compatibility\VegetationStudioPro\VSProGraph2.asset from the project and try again?

    Unfortunately I haven't worked with Digger Pro, so can't advise anything on it. But if there's compatibility mentioned I guess it's worth trying to ask in Digger Pro thread?

    It's great that you could find it out! Yes, the forests won't spread to the neighbor tile, and need a seedling on it to start growing.

    Thank for sharing! Can't bring this into settings because assets with undo not working are theoretically not allowed at the Asset Store, but will add this finding into FAQ!
     
  15. Greviouss

    Greviouss

    Joined:
    May 27, 2016
    Posts:
    173
    This is just plain ol epic af, thank you so much for this one. :)
     
  16. JohnnyRobert

    JohnnyRobert

    Joined:
    Dec 8, 2022
    Posts:
    16
    @Wright

    I'd like to know how I can have each chunk (the big terrain pieces) that the asset generates to be able to be divided into 1.25m by 1.25m squares (not the terrain directly but I want the terrain to sort of work based on a grid.

    For example a chunk would have 1250x1250 meters (or a multiple of 1.25).

    I do not want the terrain to become blocky or anything like that, I just need it to follow a sort of a 3D grid which has these dimensions.

    So I guess my questions would be the following:

    Where would I go for setting up the chunk size to be XbyX as in 1250x1250 ?

    How could I make sure that anything that map magic 2 spawns such as trees are spawned right in the middle of one of the squares, even if the object covers more than just one squares ?

    It would make it so easy to do procedural generation when it comes to things such as villages and so on.

    I've attached one of my scenes as a reference of what I am looking for, if you watch closely each object occupies one or more grids but the center of the asset always correspond to the center of those grids, but if necessary I would like to have the ability to offset the placement of some of the objects if I don't want everything perfectly at the center of the grids.

     
    Last edited: Mar 13, 2023
  17. JohnnyRobert

    JohnnyRobert

    Joined:
    Dec 8, 2022
    Posts:
    16
    I already solved that issue, no worries.
     
  18. Greviouss

    Greviouss

    Joined:
    May 27, 2016
    Posts:
    173
    @Wright
    is there a way to determine what the values of a ties size are going to be before they exist on a scene
    im not 100% sure where in tile it actually generates the values im after. like i can see it but ...

    data.area.full.rect, data.area.full.worldPos, data.area.full.worldSize

    yes i know that the rect value is relative to a given tile, but i need the sizes

    id like to generate these values before i lay any tiles out there in a function that runs when my mm object initalizes.
     
    Last edited: Mar 14, 2023
  19. redhelwar

    redhelwar

    Joined:
    Feb 16, 2023
    Posts:
    7
    Hi @Wright ,

    I am getting an issue when trying to set up a grass node using the demo map:

    upload_2023-3-14_18-50-38.png

    The full stack is

    Thread failed: System.NullReferenceException: Object reference not set to an instance of an object
    at MapMagic.Locks.GrassData.Stamp (System.Int32[,] arr, System.Int32[,] stamp, Den.Tools.Coord stampOffset, Den.Tools.Coord center, System.Int32 radius) [0x00001] in C:\Users\steve\gptgaming\Assets\MapMagic\Locks\LockDatas\GrassData.cs:177
    at MapMagic.Locks.GrassData.WriteInThread (MapMagic.Nodes.IApplyData applyData) [0x00074] in C:\Users\steve\gptgaming\Assets\MapMagic\Locks\LockDatas\GrassData.cs:56
    at MapMagic.Locks.LockDataSet.WriteInThread (MapMagic.Nodes.IApplyData applyData, System.Boolean relativeHeight) [0x0000e] in C:\Users\steve\gptgaming\Assets\MapMagic\Locks\LockData.cs:82
    at MapMagic.Locks.Lock.OnOutputFinalized_WriteLocksInThread (System.Type type, MapMagic.Products.TileData tileData, MapMagic.Nodes.IApplyData applyData, MapMagic.Products.StopToken stop) [0x0008f] in C:\Users\steve\gptgaming\Assets\MapMagic\Locks\Lock.cs:143
    at (wrapper delegate-invoke) System.Action`4[System.Type,MapMagic.Products.TileData,MapMagic.Nodes.IApplyData,MapMagic.Products.StopToken].invoke_void_T1_T2_T3_T4(System.Type,MapMagic.Products.TileData,MapMagic.Nodes.IApplyData,MapMagic.Products.StopToken)
    at MapMagic.Nodes.MatrixGenerators.GrassOutput200.Finalize (MapMagic.Products.TileData data, MapMagic.Products.StopToken stop) [0x00129] in C:\Users\steve\gptgaming\Assets\MapMagic\Generators\Matrix\Runtime\GrassOut.cs:84
    at MapMagic.Nodes.Graph.Finalize (MapMagic.Products.TileData data, MapMagic.Products.StopToken stop) [0x0003f] in C:\Users\steve\gptgaming\Assets\MapMagic\Nodes\Graph.cs:965
    at MapMagic.Terrains.TerrainTile.Generate (MapMagic.Nodes.Graph graph, MapMagic.Terrains.TerrainTile tile, MapMagic.Terrains.TerrainTile+DetailLevel det, MapMagic.Products.StopToken stop) [0x0007d] in C:\Users\steve\gptgaming\Assets\MapMagic\Terrains\TerrainTile.cs:717
    at MapMagic.Terrains.TerrainTile+<>c__DisplayClass49_1.<StopEnqueueTask>b__0 () [0x00000] in C:\Users\steve\gptgaming\Assets\MapMagic\Terrains\TerrainTile.cs:669
    at Den.Tools.Tasks.ThreadManager.TaskThreadAction (Den.Tools.Tasks.ThreadManager+Task task) [0x00002] in C:\Users\steve\gptgaming\Assets\MapMagic\Tools\ThreadManager\ThreadManager.cs:138
    UnityEngine.Debug:LogError (object)
    Den.Tools.Tasks.ThreadManager:TaskThreadAction (Den.Tools.Tasks.ThreadManager/Task) (at Assets/MapMagic/Tools/ThreadManager/ThreadManager.cs:144)
    System.Threading.ThreadHelper:ThreadStart ()

    In this case, stamp is null:
    upload_2023-3-14_18-52-30.png

    I tried this with a variety of different grass textures, but all of them throw this error and won't spawn any grass. I also tried connecting this directly to the texture output with no luck. Any ideas on what could be wrong here? I saw someone had a similar issue a year ago in this thread but didn't see a resolution. thanks in advance


    The issue occurs in the GrassData.Stamp function, when we try to access stamp.GetLength(1)
    upload_2023-3-14_18-51-57.png
    upload_2023-3-14_18-50-38.png upload_2023-3-14_18-51-57.png upload_2023-3-14_18-50-38.png upload_2023-3-14_18-51-57.png
     
  20. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,278
    It's not actually MapMagic thing, but you can add a post-processing that aligns all of the spawned objects to grid. Divide all objects position with 1.25, floor the result, and then multiply back with 1.25

    It will align several close objects to one grid, though. You can remove these intersecting objects on flooring stage - floor to int, and find out if objects have similar positions.

    `data.area.full` returns the full processed tile size, with margins. If you want to know the actual size of the terrain use `data.area.active`

    Are you using locks in scene? Are they placed at existing tiles? How can I reproduce this issue?
     
    Greviouss and JohnnyRobert like this.
  21. redhelwar

    redhelwar

    Joined:
    Feb 16, 2023
    Posts:
    7
    Thanks for the response. I was using a lock, it was placed at existing tile. I ended up fixing this by unlocking the lock, changing the radius of the lock, then relocking. Not able to reproduce this by setting the radius back unfortunately
     
  22. mailfromthewilds

    mailfromthewilds

    Joined:
    Jan 31, 2020
    Posts:
    217
    I just noticed that MicroSplat node lags my MM's window/editor a lot, more than having over 100 other nodes in the same time. its mostly noticeable on DRAG with mouse's middlebutton

    I didnt notice it earlier thats why im not sure if this slowness/laggyness always happens.

    Video:
    https://www.veed.io/view/837b18b6-c2b7-432e-878f-1084d0f623f6?panel=share
    (it lags a bit more than on video)
    The graph has to be connected to MapMagic or it wont lag.


    edit:
    dont know if its coz i unpinned tile and repinned it, or coz i changed mm splat node settings, but lags are now gone
     
  23. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,278
    Glad to hear that you were able to fix the issue with the lock by changing its radius. If you encounter this issue again in the future, try to remember what exactly was done before, and please let me know so I could investigate further. Thank you for reaching out!

    MicroSplat nodes read some data from original MS script, and I can't guarantee that all of the data will be read fast. If you will find out which settings exactly could make it lag - I will appreciate if you will share these findings. Probably I can cache them or something, but again, can't promise it.
     
  24. Nick-Carver

    Nick-Carver

    Joined:
    Feb 20, 2016
    Posts:
    13
    Apologies if this has been asked before, but would it be possible to add the option to specify a custom Detail Resolution that's higher than the Heightmap Resolution? I'm wanting to generate a relatively low-res terrain but with a lot of grass details. Currently my workflow is to generate a terrain with Map Magic with a higher Heightmap resolution than I need (say 1025x1025) in order to get a Detail Resolution of 1024 and then manually resize the Heightmap resolution down to a lower res afterwards. It would be great if I could do this within Map Magic.

    Thanks.
     
  25. Tim-Wiese

    Tim-Wiese

    Joined:
    Jul 7, 2012
    Posts:
    77
    Is there any way to remove or smooth the stamp seam when using pathfinding and stamp? We've tried a number of approaches using masks, and blends and simply can't find one that works. We're currently using a infinite terrain approach.
    Thanks!
     
  26. Greviouss

    Greviouss

    Joined:
    May 27, 2016
    Posts:
    173
    @Wright
    upload_2023-3-21_9-46-27.png

    The gizmos in the lower left are supposed to be covering the world, the layout seems proper but the scaling is not there.
    how do i scale up the rects im getting from the tiles to actually cover the world?
    im using the data from the tiledata and i have tried passing it around to a few functions that look like they would achieve this but ultimately do not i think?
     

    Attached Files:

  27. stigmamax

    stigmamax

    Joined:
    Jun 30, 2014
    Posts:
    313
    when I zoom in on the terrain, I have this big flaw. What to do ?
    THANKS
     
  28. Greviouss

    Greviouss

    Joined:
    May 27, 2016
    Posts:
    173
    you are overzooming past where the camera should be
    zoom out to what should be a fair 0 (players perspective) and this will not be an issue

    i believe you can also edit the minimum draw distance for the camera to be a much smaller value and overcome this somwhat....
     
  29. stigmamax

    stigmamax

    Joined:
    Jun 30, 2014
    Posts:
    313
    I imported a raw terrain, it is certainly because of this.
    THANKS
     
    Greviouss likes this.
  30. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,278
    Version 2.1.13 is now available!
    It brings:

    New Nodes:
    - Adjust node for Splines

    Improvements:
    - Spline Scatter node sets spline direction for objects
    - Move node can move objects along object directions
    - Added support for PreserveTreePrototypeLayers

    Bug fixes:
    - Generate around tag fixed

    MapMagic works with a single resolution for all the maps - just because you can use them in different output nodes. So height resolution is the same as details internally. You can apply smoothed terrain with height resolution 4x, but it's pure smoothing that doesn't add details, and doesn't work with details. I can try to see whether it's possible to add resolution reducing as well, but it will just do the same thing you do now - generate in 1025, and then scale height down.

    It's not clear what seams are you talking about, could you please add a screenshot?

    May I ask you to clarify what are these gizmos? What values they are using and how do they get these values? Are terrain tiles located at a wrong location, or you get the wrong values in code?
     
    Astrobinary likes this.
  31. Greviouss

    Greviouss

    Joined:
    May 27, 2016
    Posts:
    173
    htere are two sets of gizmos there - one is supposed to be for a set of subcoords i am generating - to generate these i am using the int x,z coord value - insomuch as i use the x,z coord in code this gives me kinda what i want, but what i want is for those to scale over the terrain that they were derived of

    the larger of the two is supposed to be the rects of the tiles, or a grouping of a set of 3x3 tile rects even, the base values for this comes out of :

    Code (CSharp):
    1. var r = Area.GetFullDimensions(data.area.active, MMWorldCustomBaseData.instance.draftMarginTileWidth);
    2.  
    3.                 MMDictKey dk = new MMDictKey((Rect)r.rect, data.area.active.worldSize, data.area.active.worldPos, data.area.full.rect.Max.x - data.area.full.rect.Min.x, data.area.active.rect.Max.x - data.area.active.rect.Min.x);
    but again this does not stretch over the terrain as it shows,

    just to me seems like it is not scaling up properly(?) and i am not sure how to pass the base data to reflect the actual world, i can see the seperated relationship between these two measures but forthe life of me i am unsure how to coonect the two?
     
  32. stigmamax

    stigmamax

    Joined:
    Jun 30, 2014
    Posts:
    313
    is it possible to load a terrain in exr format instead of raw?
     
  33. Tim-Wiese

    Tim-Wiese

    Joined:
    Jul 7, 2012
    Posts:
    77
    The issue I was dealing with was the pathfinding seam that happens when crossing tiles. (seems like this is a common issue)
    We were able to write a custom
    node that connects the paths seamlessly now however when using stamp the seam still exists.
    I was able to work around it by using a pyramid mask solution to blend in the non pathfinding height with the stamped path at the tile seams.
    Hope that better explains.
    With the cluster system you are working on will that resolve the pathfinding tile crossing seam issue?
     
  34. Greviouss

    Greviouss

    Joined:
    May 27, 2016
    Posts:
    173
    dont think so on this - but convert from exr to raw behind the scenes first then pass that raw over to mm for importing sounds right.
     
  35. Greviouss

    Greviouss

    Joined:
    May 27, 2016
    Posts:
    173
    @Wright
    thank you for the goto code option on the context menus - when i attempt to use this feature on my custom nodes i get this error back :
    upload_2023-3-28_10-34-44.png

    my first thought was - ok so old custom nodes do not have some blah that allows them to use this as it indexes it when its saved or something, but ... not really.. seems the feature works on your nodes exclusively, which in itself especially with the majority of your nodes all in one file largely still that is very nice, but this does not seem to be the solution for custom stuff?
     
  36. Greviouss

    Greviouss

    Joined:
    May 27, 2016
    Posts:
    173
  37. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,278
    To be honest I don't clearly understand what's it about these gizmos. Is it MM returning the wrong value or is not working properly? What value is it? Or do you need any advice on how to get some value?

    Unfortunately no, you've got to convert it manually.

    There are several issues I'm aware of on connecting splines on different tiles: these are spline height difference and spline dead ends (there's no corresponding spline on neighbor tile). These two should be solved with cluster system, and the issue with stamp is not the one I'm familiar with.

    Actually haven't ever tried calling it from non-MM assembly. But probably yes, it works with MM nodes only.

    What this is about is the Pathfinding node that connects from-to segments with spline that is skirting relief obstacles such as steep slopes and makes the way like a real road should do. It's called this way because it's also using A* algorithm under the hood.
     
  38. Tim-Wiese

    Tim-Wiese

    Joined:
    Jul 7, 2012
    Posts:
    77
    Height issues sounds like the issue I was working around so glad to hear this will be resolved.

    Is there any documentation on how Align and Avoid works and the use case for them with splines? Any help would be great.

    Thanks again
    Brian
     
  39. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,983
    When pressing the button to project a nodes colours onto the map (as is shown in the tutorials for troubleshooting things and tweaking), we get a null ref inside of mapmagics code. This is using latest mapmagic 2 bundle, with latest 2021.3 LTS

    Does anyone else get this and has this been reported already? If not I'll get some log output
     
  40. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,462
    Hi fellow Map Magicians:
    I have the following situation and would love to get your suggestions how the following can be done.

    1. I have a list of 10 different pre-made biomes, each biome has it's own unique villages and game objects.
    2. At runtime, given an input NumberOfBiomesToCombine (for example: 5) I would like the system to randomly select 5 different pre-made biomes and combine into one terrain. 3. Generate roads connecting all of the villages in different biomes.
     
  41. TheSniperFan

    TheSniperFan

    Joined:
    Jul 18, 2013
    Posts:
    712
    I know this post is old, but for anyone who lands here after Googling.
    Here's how to build the MapMagic native plugins for Linux/SteamDeck:

    1. Open Matrix.cpp and #include <limits> to the includes
    2. Open MatrixOps.cpp and #include <limits> to the includes
    3. Use the following command to compile:
      Code (csharp):
      1. clang++ -std=c++14 -target x86_64-pc-linux-gnu -shared -undefined dynamic_lookup -fPIC -O3 -o x64/libNativePlugins.so *.cpp
    4. The file will be in the x64 folder
    5. Enjoy
    If you're wondering:
    1. g++ didn't want to work for me, hence clang
    2. The command is extra verbose in case your defaults are different
    3. The "lib" prefix is correct. Linux plugins have to start with that
     
    jukibom and EmeralLotus like this.
  42. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,462
    I'm going through various Tutorials included with MM bundle and I'm using URP. It seems that the only demo tutorial that works on URP is the URP demo. How to get all of the other demo tutorials working in URP?
     
  43. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,462
    I'm now testing microsplat URP 2021 with MM and going through this "Microsplat with MM video" .
    With microsplat URP, there is no option for splats. It seems that most of the tutorials for MM are focused on the old SR and not up to date with URP. Also the demos and assets also need updating for URP.

    To clarify. I need instructions on how to setup Microsplat URP 2021 materials to work with MM. The video is quite old and only shows how to setup Microsplat SR materials for MM.
     
    Last edited: Mar 31, 2023
  44. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,462
    Very cool, thanks for your findings.|
    Btw, do you know if MM works for WebGL?
     
  45. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,462
    Has anyone integrated EasyRoad3 with Mapmagic? Because that will auto generate roads and paths really well.
     
  46. TheSniperFan

    TheSniperFan

    Joined:
    Jul 18, 2013
    Posts:
    712
    I don't do any WebGL work, I'm afraid.
     
  47. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,462
    Found a solution with this video:
     
    TheSniperFan likes this.
  48. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,462
    I am trying to create a tile that fits inside of circle. Essentially I'm trying to make a floating island. So with beaches and shore line. How to setup MM so that the tile is more organic and fits into a circular form instead of being a square tile?
     

    Attached Files:

  49. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,278
    I'm not aware of this issue. Could you please post a screenshot what button are you talking about?

    I'm sorry, but I'm not able to provide documentation on Align and Avoid with splines at this time. The way these nodes work might change - at some point I'm going to change spline generators engine completely.

    You can change BiomesSet200.layers array before generate. Take a look on scripting FAQ - how to Access node with code.

    Nice, thank you! I'm adding this to FAQ if you don't mind!

    They work, but you've got to change terrain shader in demo scenes. It could be done in Terrain Properties -> Material Template. Instead of standard assigne here TerrainURP from Demo/Materials folder.

    You've got to disable Native Code in Window-MapMagic-Settings, disable drafts, use ultra-low resolution (like 65) and extremely limited number of nodes (5 maybe). WebGL applies insanely strict requirements to amount of memory used, so no way MM can work at full strength.

    you can use SimpleForm node with Cone shape as a starting point - the way it could be used shown here:
     
  50. jukibom

    jukibom

    Joined:
    Aug 31, 2015
    Posts:
    54
    Absolute genius, thank you so much! This worked! For anyone looking for a build of this lib (along with the apple silicon plugin) I've attached it to a ticket here. Just drop into MapMagic/Tools/Plugins <3
     
    Greviouss and Wright like this.