Search Unity

  1. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview 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. SSL7

    SSL7

    Joined:
    Mar 23, 2016
    Posts:
    349
    Hello everyone, I was taking some time off and would like to ask if we have an ETA for MM 2.0? I m waiting for the splines :D
     
  2. Cleverlie

    Cleverlie

    Joined:
    Dec 23, 2013
    Posts:
    219
    Hi @Wright, I want to report a bug in MapMagic 1.8.5, in our game we let the player choose between different maps where he can deploy a basement for a TD game, we have what we call regions, each region is a scriptableObject that contains a field which holds a GeneratorsAsset.

    so far we have three regions, each with a unique GeneratorsAsset which will make mapmagic create different types of "biomes" or landscapes.

    We use CTS for the terrain shading, thus we are using the CustomShaderOutput to work properly with CTS.

    each region has its own GeneratorsAsset, each GeneratorsAsset has a different CTS profile assigned to the CSO, we do this when the game is about to load a map:


    Code (CSharp):
    1. if (currentGeneratorsAssetCopyMM != null) Destroy(currentGeneratorsAssetCopyMM);
    2.         currentGeneratorsAssetCopyMM = Instantiate(CurrentMissionData.Region.MapMagicGeneratorsAsset);
    3.  
    4.         MapMagic.MapMagic.instance.gens = currentGeneratorsAssetCopyMM;
    5.         MapMagic.MapMagic.instance.seed = new System.Random().Next();
    6.         CustomShaderOutput.UpdateCustomShaderMaterials();
    7.  
    8.         MapMagic.MapMagic.instance.Generate(true);

    now, the problem is that when switching between generators, the public static CustomShaderOutput.ctsProfile should also change to use the specific profile saved in the Generators, but it doesn't, it gets persisted, even further, after we stop playmode and check the different GeneratorAssets saved in our disk, all of them have the same ctsProfile assigned, this is probably due to some bad management of the public static ctsProfile making all and any GeneratorAsset in the project to override or ignore it's own serialized ctsProfile with the public static one, can you provide a quick fix for this, or a workaround? thanks!
     
  3. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,281
    You'll have to create very smooth terrain with maximum incline below 45 degree (you can use Slope to check it) and then apply Terrace to it.

    I'm going to release 2.x beta in the late February - beginning of March. However do not expect much of splines - I suppose there will be only a couple of generators just to test them and find out what spline nodes should be made next.

    Feel free to use Issues page. But I'm afraid it's an expected behavior - CSO profile should be similar for all of the graph, including biomes (and I guess for all of the graphs in scene). However your biome approach seems to be so unusual that I'm surprised that it works at all. Why don't use the built-in biome feature?
     
    twobob likes this.
  4. SSL7

    SSL7

    Joined:
    Mar 23, 2016
    Posts:
    349
    Hello again,

    getting this error:
    Error generating chunk: MapMagic.Coord x:2 z:4: System.IndexOutOfRangeException: Array index is out of range.

    at MapMagic.Chunk.ThreadFn () [0x0005b] in C:\Development\Projects\\Assets\MapMagic\Main\Chunk.cs:219
    UnityEngine.Debug:LogError(Object)
    MapMagic.Chunk:ThreadFn() (at Assets/MapMagic/Main/Chunk.cs:222)
    MapMagic.ThreadWorker:ThreadFn() (at Assets/MapMagic/Main/ThreadWorker.cs:533)


    And having multiple tiles in a generator would be ideal. So I can have and + to add coordinates in the editor would be ideal.

    I was wondering how can this used for map output and not object, so I can connect it with masks (so for example flatten only works with certain tiles).
    thank you
     
    Last edited: Jan 28, 2018
  5. Gandamir

    Gandamir

    Joined:
    Nov 22, 2017
    Posts:
    36
    I need some help with a custom generator.

    Goal:
    To provide an output of 1 or 0 for a given tile to use as an input filter for the village generation. I need to spread them out to be less frequent then once per grid coordinate.

    Idea:
    To use the Scatter generator and make a TileScatter generator. The tiles that get hit by the TileScatter will generate villages, and those that don’t will not have any villages created.

    Attempt:

    Modified core code to include the Chunk data (not just Chunk.Result, etc) so that we know the Chuck space x/z location.

    Code (CSharp):
    1.  
    2.  
    3. // Determines the size of the tiles to generate for the chunk checks. 2000 will be 2000 by 2000 chunks to scatter on.
    4. public int size;
    5.  
    6. public override void GenerateWithChunk(Chunk chunk, CoordRect rect, Chunk.Results results, Chunk.Size terrainSize, int seed, Func<float, bool> stop = null)
    7.         {
    8.             Coord chunkSpaceCoord = chunk.coord;
    9.  
    10.             int chunkXoffset = Math.Floor(chunkSpaceCoord.x / (float)size).ToInt32();
    11.             int chunkZoffset = Math.Floor(chunkSpaceCoord.z / (float)size).ToInt32();
    12.  
    13.             ChunkMatrixResultLocation matrixResultLocation = new ChunkMatrixResultLocation(chunkXoffset, chunkZoffset);
    14.  
    15.             CoordRect chunkSpaceRect = new CoordRect(chunkXoffset, chunkZoffset, size, size);
    16.             Chunk.Size matrixResultSize = new Chunk.Size(16, size, size);
    17.  
    18.             Matrix scatterMatrix = new Matrix(chunkSpaceRect);
    19.             if (!enabled || (stop != null && stop(0)))
    20.                 return;
    21.  
    22. // Commented out the generation while I get indexing to work.
    23.             //SpatialHash spatialHash = new SpatialHash(new Vector2(chunkSpaceRect.offset.x, chunkSpaceRect.offset.z), chunkSpaceRect.size.x, 16);
    24.             ////initializing random
    25.             //InstanceRandom rnd = new InstanceRandom(seed + this.seed + matrixResultSize.Seed(chunkSpaceRect));
    26.  
    27.             //float square = matrixResultSize.dimensions * matrixResultSize.dimensions;
    28.             //int count = (int)(square * (density / 1000000));
    29.  
    30.             //if (algorithm == Algorithm.Random)
    31.             //    RandomScatter(count, spatialHash, rnd, scatterMatrix, stop: stop);
    32.             //else
    33.             //    CellScatter(count, spatialHash, rnd, scatterMatrix, hex: algorithm == Algorithm.HexCells, stop: stop);
    34.  
    35.  
    36.             Matrix dst = new Matrix(rect);
    37.  
    38.             Coord min = rect.Min;
    39.             Coord max = rect.Max;
    40.  
    41.             int value = 0;
    42. // I have tried several options here to get the x/z in the scatter matrix, but just can't get it right.
    43.             int xLoc = chunkSpaceCoord.x;// - (size * chunkXoffset);
    44.             int zLoc = chunkSpaceCoord.z;// - (size * chunkZoffset);
    45.  
    46. // The following throw exceptions due to index out of range, not sure why.
    47.             if (scatterMatrix[xLoc, zLoc] == 1)
    48.                 value = 1;
    49.  
    50.             for (int x = min.x; x < max.x; x++)
    51.                 for (int z = min.z; z < max.z; z++)
    52.                 {
    53.                     dst[x, z] = value;
    54.                 }
    55.  
    56.             if (stop != null && stop(0))
    57.                 return;
    58.  
    59.             output.SetObject(results, dst);
    60.         }
    61.  
    Something is off in my ScatterMatrix indexing as I get index out of range errors and I can’t seem to figure out why.

    Anyone have some ideas for me?
     
  6. Cleverlie

    Cleverlie

    Joined:
    Dec 23, 2013
    Posts:
    219

    I don't know if your biomes features work for what we need, we need to save completely different node sets with their own outputs aka cts profiles with varying number of textures (although right now all our cts profiles are made to use 4 textures only) and change them on runtime dynamically depending on "which part of the planet the user lands"
    while the biomes feature in mapmagic seems to be intended to mix different biomes, I didn't tried it though.

    why is this approach so unusual? I thought the MapMagic.instance.gens public reference is there exactly for this reason, to be able to change the set of generator nodes on runtime and allow mapmagic to create diverse terrains.

    another workaround I thought but didn't test yet is having a reference to the ctsProfile in each region object, then the code would be like this
    Code (CSharp):
    1.     if (currentGeneratorsAssetCopyMM != null) Destroy(currentGeneratorsAssetCopyMM);
    2.             currentGeneratorsAssetCopyMM = Instantiate(CurrentMissionData.Region.MapMagicGeneratorsAsset);
    3.    
    4.             MapMagic.MapMagic.instance.gens = currentGeneratorsAssetCopyMM;
    5.             MapMagic.MapMagic.instance.seed = new System.Random().Next();
    6.  
    7. // added line, after re assigning generators, we paste the ctsProfile on the public static member again
    8. CustomShaderOutput.ctsProfile = CurrentMissionData.Region.CTSProfile;
    9.             CustomShaderOutput.UpdateCustomShaderMaterials();
    10.    
    11.             MapMagic.MapMagic.instance.Generate(true);
    12.  
    what do you think? if MM is not intended to be used this way, why is there a MapMagic.gens public member and a CustomShaderOutput.ctsProfile public member? thanks
     
  7. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,281
    Cleverlie, you can assign new graph to mapMagicObject.gens, and call re-generating terrain after. However it will not change CSO static variables. As a workaround I'd like to recommend setting CustomShaderOutput.ctsProfile static variable right after assigning a new graph, but before re-generating.

    Gandamir, you don't have to change MapMagic code to remove objects on some chunks. Here is a generator that will randomly clear chunks based on chance value:
    Code (CSharp):
    1.     [System.Serializable]
    2.     [GeneratorMenu (menu="Custom", name ="Randomly Clear", disengageable = false)]
    3.     public class RandomClearGenerator : Generator
    4.     {
    5.         public Input input = new Input(InoutType.Objects);
    6.         public Output output = new Output(InoutType.Objects);
    7.         public override IEnumerable<Input> Inputs() { yield return input; }
    8.         public override IEnumerable<Output> Outputs() { yield return output; }
    9.  
    10.         public int seed = 12345;
    11.         public float chance = 1;
    12.  
    13.         public override void Generate (CoordRect rect, Chunk.Results results, Chunk.Size terrainSize, int seed, Func<float,bool> stop = null)
    14.         {
    15.             SpatialHash src = (SpatialHash)input.GetObject(results);
    16.             SpatialHash dst = new SpatialHash(src.offset, src.size, src.resolution);
    17.  
    18.             //initializing random
    19.             InstanceRandom rnd = new InstanceRandom(seed + this.seed + terrainSize.Seed(rect));
    20.  
    21.             if (rnd.CoordinateRandom(rect.offset.x, rect.offset.z) < chance)
    22.             foreach (SpatialObject obj in src.AllObjs())
    23.             {
    24.                 dst.Add(obj);
    25.             }
    26.  
    27.             output.SetObject(results, dst);
    28.         }
    29.  
    30.         public override void OnGUI (GeneratorsAsset gens)
    31.         {
    32.             layout.Par(20); input.DrawIcon(layout, "Input"); output.DrawIcon(layout, "Output");
    33.             layout.Par(5);
    34.             layout.Field(ref seed, "Seed");
    35.             layout.Field(ref chance, "Chance");
    36.         }
    37.     }
    dlevel, here is a generator that works fine:
    Code (CSharp):
    1.     [System.Serializable]
    2.     [GeneratorMenu (menu="Custom", name ="Single", disengageable = false)]
    3.     public class SingleGenerator : Generator
    4.     {
    5.         public Output output = new Output(InoutType.Objects);
    6.         public override IEnumerable<Output> Outputs() { yield return output; }
    7.  
    8.         public Vector2 pos = new Vector2(1500, 2000);
    9.  
    10.         public override void Generate (CoordRect rect, Chunk.Results results, Chunk.Size terrainSize, int seed, Func<float,bool> stop = null)
    11.         {
    12.             SpatialHash dst = new SpatialHash(new Vector2(rect.offset.x,rect.offset.z), rect.size.x, 16);
    13.             Vector2 pixelPos = pos / terrainSize.pixelSize;
    14.  
    15.             if (pixelPos.x > rect.offset.x && pixelPos.x <= rect.offset.x + rect.size.x &&
    16.                 pixelPos.y > rect.offset.z && pixelPos.y <= rect.offset.z + rect.size.z)
    17.                  dst.Add(pixelPos, 0,0,1); //position, height, rotation, scale
    18.  
    19.             output.SetObject(results, dst);
    20.         }
    21.         public override void OnGUI (GeneratorsAsset gens)
    22.         {
    23.             layout.Par();
    24.             output.DrawIcon(layout, "Output");
    25.             layout.Par(5);
    26.             layout.Field(ref pos, "Position", fieldSize:0.7f);
    27.         }
    28.     }
    If you have a limited number of objects that should be spawned you can add all of their positions similarly to pos value in the code.
     
  8. Gandamir

    Gandamir

    Joined:
    Nov 22, 2017
    Posts:
    36
    Perfect! Just what I needed! :D

    P.S. You should add all of these helper generators you make for people to the main build in a sub-category or something so everyone has access to them easily.

    Maybe a menu structure like this?
    - Map
    - Objects
    - Output
    - Helpers
    - - Map
    - - Objects
    - - Output
    - Portals
     
    twobob likes this.
  9. IronManhood

    IronManhood

    Joined:
    Jan 10, 2015
    Posts:
    3
    How would I go about making an island with multiple biomes. Like this:
    griseaUprising_map_concept.png

    I've tried using masks and the biome node but I can't get it to work like I want.
     
  10. SSL7

    SSL7

    Joined:
    Mar 23, 2016
    Posts:
    349
    How is it possible to call a seed from lets say a specific scatter while in game and have it regenerate that part?
     
    Last edited: Jan 28, 2018
  11. jnbbender

    jnbbender

    Joined:
    May 25, 2017
    Posts:
    487
    Is it possible to generate any kind of map that would be playable on a mobile platform? And if so, how?
    Thx.
     
  12. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,281
    Enjoy!

    This kind of "helper" nodes is very specific, personally I don't use any of them when create biomes to order. But here is the page where they all are gathered, so anyone can read what they actually do, copy the code to the custom generator and tweak them.

    You need to use 6 different masks - one for each of biomes.

    Note that all of 6 masks should be normalized - sum of the 6 values at the same coordinate should be equal to 1. If you don't want to bother normilizing them manually you can use the Normalize node.

    You can use map magic object seed value and ForceGenerate method - it will make terrain re-generate after seed change:
    Code (CSharp):
    1. mm.seed = newSeed;
    2. mm.ForceGenerate();
    Yes, it's possible - just keep the resolution as low as possible. Plus the standard mobile optimizations like 4 textures per terrain, minimum objects, etc.
     
    protopop likes this.
  13. SSL7

    SSL7

    Joined:
    Mar 23, 2016
    Posts:
    349
    Can I re-generate changed only and not full terrain? I would like to call a regenerate and change seed on a scatter with some random generated prefabs in map (chests for example) without having the terrain regenerate (disabled and then enabled so the player drops to void)

    https://imgur.com/a/MuqHt

    this is the part of the map I would like to call a regenerate, maybe is possible to have a timer generator that changes this scatters seed and then regenerates this part? Is it possible or am I dreaming?
     
    Last edited: Jan 30, 2018
  14. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,281
    You can't re-generate the part of the graph. But you can change the seed of scatter generator only (it's tricky, however), letting everything other generate with no difference from already existing chunks.
     
  15. SSL7

    SSL7

    Joined:
    Mar 23, 2016
    Posts:
    349
    Ok so if I change the seed of the scatter generator and re-generate the map will not disable/enable again correct? Could you please guide me to do this? I need it a lot. BTW you mean I can change the specific scatter seed? this is perfect if I can achieve it, but even if its for all scatter I believe it works too
     
  16. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,281
    Yep, it's individually for this scatter generator.
    - Enable Debug mode in settings
    - Open up your graph window. All the generators will have a number next to their names.
    - Note the number of the scatter generator. Let's say it's "n"
    - Here is the way to change it's seed
    Code (CSharp):
    1.                 MapMagic.instance.gens.list[n].seed = yourSeed;
    2.                 MapMagic.instance.ForceGenerate();
     
  17. SSL7

    SSL7

    Joined:
    Mar 23, 2016
    Posts:
    349

    is this the number? this seems to be changing all the time
     

    Attached Files:

    Last edited: Jan 31, 2018
  18. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,281
    Oops, I've been working with 2.x for too long. I forgot this feature is not released yet - it's a debug helper so I didn't focus my attention at it. I plan to release 1.9 soon, here the debug numbers could be displayed. Do you need a quick fix for that?
     
  19. SSL7

    SSL7

    Joined:
    Mar 23, 2016
    Posts:
    349
    I would love a quick fix for this, planning for an update for my testers and this is a "critical" feature I'm trying to pull off :) if its too much of a hustle I can wait of course for 1.9
     
  20. Gandamir

    Gandamir

    Joined:
    Nov 22, 2017
    Posts:
    36
    Another option for you to find the right item is to use something like this after setting the seed in the scatter to 9999. Note that this is psuedo code, but should get you close enough. :)

    Code (CSharp):
    1. var generator = (from item in MapMagic.instance.gens.list
    2.                             where item.seed == 9999
    3.                             select item).FirstOrDefault();
    4.  
    5. for(int i=0;i< MapMagic.instance.gens.list.Length;i++)
    6. {
    7.      if(MapMagic.instance.gens.list[i] == generator)
    8.      {
    9.           // Set breakpoint here to find i
    10.      }
    11. }
    Once you have i, you can use it in Wrights code:

    Code (CSharp):
    1. MapMagic.instance.gens.list[n].seed = yourSeed;
    2. MapMagic.instance.ForceGenerate();
     
  21. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,281
    Enjoy :)
     
  22. Xype

    Xype

    Joined:
    Apr 10, 2017
    Posts:
    339
    New Version of RPT totally doesn't work with Voxeland, I am sure mapmagic same issue. Now why I am here...

    Dennis just tossin this warnin out for ya, 2018.1.0b5 (i know beta version, so no biggy just heads uppin)
    Assets/MapMagic/Main/CustomSerialization.cs(261,167): warning CS0618: `UnityEngine.Keyframe.tangentMode' is obsolete: `Use AnimationUtility.SetLeftTangentMode, AnimationUtility.SetRightTangentMode, AnimationUtility.GetLeftTangentMode or AnimationUtility.GetRightTangentMode instead.'
     
  23. secondsight_

    secondsight_

    Joined:
    Mar 2, 2014
    Posts:
    163
    Hey there,
    How can I generate a exact amount of objects ? Say, three treasure chests per terrain tile.
    I remember I was able to to this with the legacy scatter node. The new one only has density, which is not as accurate as I need it to.
     
  24. Xype

    Xype

    Joined:
    Apr 10, 2017
    Posts:
    339
    Ok I did some fooling around, at least for the moment its working (my computer might explode later who knows)

    Keyframe.tangentMode was only around for like a month in 5.6 then quickly removed and every reference to it other than obsolete was scoured from the internet (I even checked every archive on the wayback machine). Anyway after finding that one archive with 1 month where it had a description they just changed it to the AnimationUtility. So far it seems (AnimationUtility.TangentMode)k is doing the trick on line 262 of customserialization.cs Please keep in mind only done like 5 minutes of testing.

    writer.WriteLine("\t<" + val.name + " type=" + val.type + " time=" + k.time + " value=" + k.value + " in=" + k.inTangent + " out=" + k.outTangent + " mode=" + (AnimationUtility.TangentMode)val.obj + "/>");

    BTW this is all in 2018.1.0b5 so not a big deal atm, just pre emptive.
     
  25. jnbbender

    jnbbender

    Joined:
    May 25, 2017
    Posts:
    487
  26. Xype

    Xype

    Joined:
    Apr 10, 2017
    Posts:
    339
    Megasplat, or if you need free for now microsplat
     
  27. jnbbender

    jnbbender

    Joined:
    May 25, 2017
    Posts:
    487
    Cool thx. Would those Yughues Ground Materials work too?
     
  28. Xype

    Xype

    Joined:
    Apr 10, 2017
    Posts:
    339
    pretty much any textures will as long as you have the dif/height and normals
     
  29. camta005

    camta005

    Joined:
    Dec 16, 2016
    Posts:
    320
    Last edited: Feb 3, 2018
  30. Xype

    Xype

    Joined:
    Apr 10, 2017
    Posts:
    339
    or if ya need free just grab microsplat!
     
  31. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,281
    Thanks! I will look into it.

    Density is just a Count value that's independent from resolution and chunk size. Consider it not a number of objects per chunk, but the number of object per square kilometer. Internally it's converted to the count value using chunk size and resolution values, and then the algorithm does not differ from the old one. So if size and resolution does not change it will create the same amount of objects per chunk. Note that if you are using scatter mask some of the objects created could be masked.

    Snow plains use demo cliff textures + a single snow texture. I've made if from a sand texture, but, unfortunately, I cannot share it since it's used in a commercial product. As well as all of the Badlands textures.

    As far as I know these textures come from megascans.se and cgtextures.com, but were just modified by a studio artist. So it worth looking there.

    It would be great if you could link those textures once you find them at badlands and snow plains page.
     
  32. secondsight_

    secondsight_

    Joined:
    Mar 2, 2014
    Posts:
    163
    Hmmm... so, it´s not possible to spawn an exact number per tile with every generation, right ? Since scattering masks the objects sometime, I cannot rely on that. But is there any other way to distribute objects not using the scattering node ? I´m not aware of one.

    And till your post I was very certain that I was able to do that in my old project with the scatter node. I remember flying around and counting objects / items. The only thing scatter changed was the position where the objects would spawn, but not mask them at all, so I could rely on that fixed number I wanted to have. But maybe I was just very lucky with the scatter seeds :)

    Any chance for a node that could generate a fixed number of onjects in the future ? I need this for distributing an exact number gameplay objects and resources over a terrain.
     
  33. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,281
    I'd like to recommend you not to rely on number of objects per chunk or anything that depends on the chunk size or resolution. In v2 you are able to plug-in already existing terrains of any size and resolution, as well as use multi-resolution terrain LODs. So I'd like to advice you using scatter anyways.

    And speaking about the mask - what if mask detail is more that the chunk size? If all the terrain is lit in "red" (zero values) it should have 3 objects on it anyways? I admit that "random" scatter mode really behaved this way, but was unified with other modes. I consider it a bug - objects should not be spawned where the mask is 0.

    However that old scatter should be somewhere in Legacy generators, so you can take it and make a custom generator of it.
     
  34. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,345
    v2? Any details on that? What's in it, release date etc?
     
  35. SSL7

    SSL7

    Joined:
    Mar 23, 2016
    Posts:
    349
    Any updates if we will have a Vegetation System Generator? The current "integration" which is fine for simple stuff (copies the VS object to every new generated tile) that @LennartJohansen made is ok, but then if you want to have biomes etc. doesn't work. It would be perfect if we could have a more native approach with an Output Node :) And with the popularity that both MapMagic and Vegetation Studio have, I think it will be the best for both :)
     
    Last edited: Feb 5, 2018
    Rowlan and boysenberry like this.
  36. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,281
    Here is what is planned for v2:
    - Interface enhancements;
    - Height, splats, objects inputs (MapMagic as an editor tool);
    - Margins to create borderless terrains;
    - Low detail terrains at horizon;
    - Native C++ generators in editor (erosion, noise, forest - Mac and Win editors only);
    - If everything goes well - a couple of test spline generators
    I plan to make GitLab beta version with all of those features stable by the end of February - beginning of March.

    Before v2 I plan a new version, 1.9, it will be mainly a bug fix version, plan to release it this week.

    I agree that VS needs a special output node. After I will make a stable v2 beta I'll make a poll what asset should be integrated first - obviously, all of the further asset integrations will be made for v2. VS has a really good chances to win.
     
    camta005 and Rowlan like this.
  37. Xype

    Xype

    Joined:
    Apr 10, 2017
    Posts:
    339
    While I am biased towards something else, considering broader usage I think VS would be the best next integration for the majority.
     
    boysenberry likes this.
  38. SSL7

    SSL7

    Joined:
    Mar 23, 2016
    Posts:
    349
    Perfect! Yeah VS is a must integration with MM, and it will win for sure, many people wait for it :)
     
  39. secondsight_

    secondsight_

    Joined:
    Mar 2, 2014
    Posts:
    163
    Hey there,

    I´m not sure if its a playmaker issue, a generation problem or my general lack of understanding of prefabs and nested prefabs... But since it happens with MM I´ll try it here:

    In my game the player can discover lighthouses that will reveal parts of the map. I´ve made a model with a trigger zone that should display a UI text and play a sound. Everything works fine, also when I dublicate the objects.
    Here is the original prefab:


    Now, when I generate the prefab and try to trigger no sound is played or text shown, it seems like Playmaker looses the requested prefabs (the sound and text object) in generated objects. Here is the generated prefab:


    When I click into that state 1 node, I can see the text object in there for a second and then it´s gone.
    Still not sure if this is a playmaker problem, something that MM does and I have never encounterd before or a general missunderstanding on my side. But since I plan to use this a lot in my project, I hope to find some help / ideas here !

    Thanks.
     
    protopop likes this.
  40. Exbleative

    Exbleative

    Joined:
    Jan 26, 2014
    Posts:
    216
    I'm curious to know how low detail horizon terrains will work. Is it some kind of LOD system? Is it for static terrains only, or will there be something for infinitely generated terrain? I imagine games like flight sims would love something that could draw large distances at low detail quickly, but can't imagine how blending high detail close chunks with lower detail distant ones would work.

    On a related note, does MM turn terrain colliders on/off as you approach them, or are they always on? Not sure if there's any performance gain to be had there?

    I'm guessing the Native C++ generators are basically faster versions of the existing ones? Got any % speed increase numbers?

    Can't wait for margins/V2 of Map Magic :)
     
  41. SSL7

    SSL7

    Joined:
    Mar 23, 2016
    Posts:
    349
    updating from 1.8.4 to 1.9 changes my map (imported same heightmap and settings are the same). What would that be the cause? no errors or anything. I ve noticed because I have flatten generator with constants and with some static objects, and now that is totally changed. Is it something to expect on updates?
     
    Last edited: Feb 8, 2018
  42. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,281
    1.9 is out, here is what it brings:
    - fix: memory allocation crash fix when using CSO in constant rebuild mode
    - fix: OnPrepareStarted was called ^2 for the number of chunks
    - fix: number of threads value and max apply time now serialized
    - World Shift: added a layer mask to exclude layers from shifting
    - World Shift: added WorldShifter.OnWorldShifted (Vector2 shift) event that's called after the world has been shifted

    secondsight_, I'm not familiar with Playmaker, so can't say anything about this issue. But I'd like to mention that the way MM places the objects in editor and playmode differs by default. In editor it creates a prefab instance, in playmode - prefab clone (prefabs could not be instantiated outside of editor, just cloned). You can turn on "Instantiate Clones" in Object Output to make MM create clones in editor. Hope it can help to find what's what causes this issue.

    It's a LOD system, but it's not a visual LOD, but a generate LOD. When new terrain starts to generate it generates it's low-resolution version fast (possibly you can force it in one frame), and then generates full-resolution terrain in a background.

    MM disables the whole terrain object, so colliders too. But it does not matter since performance does not change whether you are looking at colliders or not.

    About 2X for erosion in build, and 5X in editor. MM works much faster in build, like most of the scripts. Native plugins are always built - that's the main reason I'm going to use them.

    That should not happen. If you are bound to the older objects placement and can't accept the new one - send me the scene - I'll try to find out what generator causes it.
     
    Exbleative and protopop like this.
  43. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,562
    Sounds like some important under the hood improvements:) I'm still learning Map Magic and its all so exciting.

    Like many people here I'm working on a procedural world and am linking things into your procedural system. I was thinking of making a node/graph editor for some of my items and im wondering if you built your own, or do you have a recommendation for a good graph editor? I can see a bunch on the app store and around he internet, but im wondering if one is better than the other.

    I also think we can extend your nodes, right? I haven't looked into it, but it would be cool to try and extend it to work with things beside terrain, like generating characters procedurally put together in certain biomes from certain combos of outfit etc. I dont know if thats possible bt it sounds like it might be because of the village example and use of prefabs. Just procedural food for thought:)

    Thanks again for this really interesting and inspirational tool.
     
  44. Exbleative

    Exbleative

    Joined:
    Jan 26, 2014
    Posts:
    216
    Ok, so the low level LOD terrain resolution is set to whatever we like, ie 16 or 32 pixels instead of 256 for example for the main terrain? Are objects generated on LODs or do we have control over that? Very keen to see what kinda draw distance increase I can get. How long till I can have a play with the beta? :)

    I wondered if just having colliders enabled (regardless of looking at them) had much impact, since I know for things like large numbers of trees it's often wise to only enable colliders on the closest ones.
     
  45. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,562
    Your Biome looks absolutely beautiful - is that home made?

    The water is so blue:) I hope you figure out the Lighthouses.

    Really nice work and cool to see the variety of things you can make in Map Magic.
     
  46. delinx32

    delinx32

    Joined:
    Apr 20, 2012
    Posts:
    417
    When using custom generators, it seems like it operates once for each terrain? Is there any way to have a generator that only operates once for the whole map?

    I'm trying to integrate some procedural code I have and basically want to build a heightmap in a custom generator, then use that height map as a starting point for the rest of the map using erosion, etc.

    I can't really build my map in chunks because I'm doing things like generating the biomes, creating rivers that flow across the entire map, etc.

    I could implement it all outside of map magic, but figured it would be much easier if i could just make it a node that will re-generate whenever map magic does it's regeneration.
     
  47. secondsight_

    secondsight_

    Joined:
    Mar 2, 2014
    Posts:
    163
    Thanks very much !
    Since I´m redoing it the third time, I´m quite in training and knew how to achive that tropical look.
    The water is Aquas and weather Light is Enviro. I´ve just bought them last weekend, so this is just the basic setup.
    I´ve made my first experiments with toon textures this night. Take a look if you like: https://imgur.com/a/7DUfC



    I love about MapMagic that it´s way more than a terrain generation tool. If used in creative ways (and combines with other assets) you can pretty much generate complete game worlds. I plan to do that, once I figure out how to substain the functionalities (like the watchtowers). But I might have an idea...

    edit: wrong picture link
     
    Last edited: Feb 9, 2018
    ibyte, protopop and camta005 like this.
  48. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,562
    Thanks for sharing the image. I was actually surprised that you images almost brought a tear to my eye - i didnt think the appreciation would hit me that strongly and they are captivating. What i really love about world design, and what i try to do with my own, is that it can create a place that feels real and adventurous. The shallow blue seas and dark green sandy beaches from your images look like a place i really want to explore. You have an innate skill for world design i think. Its extra resonant because I am working on a sequel to my game BrightRidge ( http://nimianlegends.com )and its set in a sun soaked Mediterranean setting, ive been looking at pictures and you really capture the sens if the shallow coasts. reat work.

    Yeah, i agree about MapMagic being extensible. I too am trying to use it to create a procedural world and I know once you figure out the lighthouses (which you will) it will be full steam ahead. I don;t see why it could not be used for building generation with some tweaking or opening up of the api or a custom generator since it works with prefabs. It will be interesting to see what people come up with. There is also interesting work being done on procedural river generation with Cascade https://forum.unity.com/threads/submitted-cascade-rivers-lakes-waterfall-and-more.514871/ and I hoping that this can be used with the procedural generated terrain once its out - the author said he loves MapMagic so it might work.

    I used Aqua in BrightRidge but i didnt really tweak the settings, so its great to know ill be able to achieve something nice and blue like this in the sequel, I will check out Enviro too. Thanks for sharing the tips:)

    There is something about the toon texture that i like - ive always liked the handpainted textire look - i think youll need to figure out a tiling solution for when you get close up, and how you will handle that - will it be large sized toon textures from far and smaller tilled toon or realistic up close - but i can also see how a toon aesthetic could work really well in a bright and saturated landscape like this. definitely kee[ playing with it I think and see what comes up. Thats the fun with iterating is its like procedural design but made by a human and you are sometimes surprised by what you yourself can generate. BTW I use MicroSplat by Jason Booth https://assetstore.unity.com/packages/tools/terrain/microsplat-96478 for texture and really recommend it - eve the free base version can give you more terrain texture blend options from the get go. Just back up your terrains before trying any new packages if you can (i copy and paste the terrain.asset in my project folder before i make any changes)
     
    ibyte and MakeGames2 like this.
  49. SSL7

    SSL7

    Joined:
    Mar 23, 2016
    Posts:
    349
    All good, it was my mistake,after the update I had to reenter the heightmap and I placed a slightly different one. Thank you!
     
    protopop likes this.
  50. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,562
    Right now my base map is a raw input. Its cool because i can draw out my islands or continents.

    But what i i wanted to create an island or continent base map from a procedural node? Is that possible?

    Something like this - here is my raw input, but im thinking it could be like a noise mode with a gain or contrast, where you could also see the resulting map in a thumbnail. Can we already do something like this?