Search Unity

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

    fenix6390

    Joined:
    Nov 28, 2017
    Posts:
    20
    собтвенно вот о идеи о которой говорил

    Ну тогда идея для следующей версии map magic ).

    1) скажем будет кнопка рядом с pin и lock с каким то названием

    2) с помощью этой копки можно пометить какой то террайн

    3) размещенные объекты на помеченном террайне будут включены в генерацию на других террайнов с учетом размещения по высоте

    4) выбрав помеченный терайн таким образом была возможность задать минимальную дистанцию между созданием объекта на следующем террайне,

    т.е. все объекты которые не клоны на этом помеченном террайне будут включены в генерацию на основе оригинального объекта по высоте и дополнительной настройке в террайне дистанции которая будет отвечать за минимальную дальность размещения.


    на выходе получится что можно будет пометить несколько террайнов, разместить на них необходимые объекты на определенной необходимой высоте, и задать дистанцию в самом терайне, думаю что это будет полезно для программы которая создает ландшафт размещает объекты определенными образами камни деревья, а с такой функцией можно будет и домики и нпс и все что угодно размещать, очень полезно было бы.




    Well then idea for the next version of map magic).

    1) say there will be a button next to pin and lock with some name

    2) with the help of this kopka, you can mark some kind of terrine

    3) the placed objects on the marked terrain will be included in the generation on other terraces taking into account the location along the height

    4) trusting therapy and the possibility of holding a minimum distance between the creation of an object on a subsequent terrain,

    those. all objects that can not be included in the generation, depending on how it will be responsible for the minimum distance.

    the output will be that you can mark several terrains, place the necessary objects on them at a certain required height, and set the distance in the terrain itself, I think it will be useful for the program that creates the landscape places objects with certain images of the stones trees, and with this function it will be possible and houses and nps and anything you want to place, it would be very useful.
     
  2. fenix6390

    fenix6390

    Joined:
    Nov 28, 2017
    Posts:
    20
    Это вроде как когда с водой мыкался
    Assertion failed: Material doesn't have a float or range property '_WaveScale'
    UnityEngine.Material:GetFloat(String)
    UnityStandardAssets.Water.Water:Update() (at Assets/Standard Assets/Environment/Water/Water/Scripts/Water.cs:210)


    Это вроде как с деревьями ( но не та где пропадали .. пока еще не воспроизвел ошибку с пропаданием, пытаюсь воспроизвести )
    The tree PineMed3 must use the Nature/Soft Occlusion shader. Otherwise billboarding/lighting will not work correctly.

    Unable to open Assets/MapMagic/Demo/Trees/Pine/Meshes/PineMed3.FBX: Check external application preferences.


    The tree PineMed3 must use the Nature/Soft Occlusion shader. Otherwise billboarding/lighting will not work correctly.
    UnityEngine.TerrainData:set_treePrototypes(TreePrototype[])
    MapMagic.<Apply>c__Iterator2:MoveNext() (at Assets/MapMagic/Generators/OutputGenerators.cs:1311)
    MapMagic.<Apply>c__Iterator1:MoveNext() (at Assets/MapMagic/Main/GeneratorsAsset.cs:553)
    MapMagic.<ApplyRoutine>c__Iterator0:MoveNext() (at Assets/MapMagic/Main/Chunk.cs:234)
    MapMagic.ThreadWorker:CoroutineFn() (at Assets/MapMagic/Main/ThreadWorker.cs:604)
    MapMagic.ThreadWorker:UpdateApply() (at Assets/MapMagic/Main/ThreadWorker.cs:176)
    MapMagic.ThreadWorker:Refresh() (at Assets/MapMagic/Main/ThreadWorker.cs:143)
    MapMagic.MapMagic:Update() (at Assets/MapMagic/Main/MapMagic.cs:261)





    Это с зависанием
    Assertion failed: Invalid AABB result
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)




    это с негенерацией карты
    MissingReferenceException: The object of type 'Terrain' has been destroyed but you are still trying to access it.
    Your script should either check if it is null or you should not destroy the object.
    MapMagic.SplatOutput+<Apply>c__Iterator2.MoveNext () (at Assets/MapMagic/Generators/OutputGenerators.cs:551)
    MapMagic.GeneratorsAsset+<Apply>c__Iterator1.MoveNext () (at Assets/MapMagic/Main/GeneratorsAsset.cs:553)
    MapMagic.Chunk+<ApplyRoutine>c__Iterator0.MoveNext () (at Assets/MapMagic/Main/Chunk.cs:234)
    MapMagic.ThreadWorker.CoroutineFn () (at Assets/MapMagic/Main/ThreadWorker.cs:604)
    MapMagic.ThreadWorker.UpdateApply () (at Assets/MapMagic/Main/ThreadWorker.cs:224)
    MapMagic.ThreadWorker.Refresh () (at Assets/MapMagic/Main/ThreadWorker.cs:143)
    MapMagic.MapMagic.Update () (at Assets/MapMagic/Main/MapMagic.cs:261)
    UnityEditor.EditorApplication.Internal_CallUpdateFunctions () (at C:/buildslave/unity/build/Editor/Mono/EditorApplication.cs:127)



    Вот собственно вроде бы все ... ни слова не понятно че тут пишут, надеюсь будет полезно.

    А по поводу использования blend .... методом научного тыка проверяю что с чем работает и к чему приводит ... когда пробовал понятия не имел для чего он ... я же с английским не силен ...))
     
    Last edited: Dec 11, 2017
  3. fenix6390

    fenix6390

    Joined:
    Nov 28, 2017
    Posts:
    20
    в том тутореале вы растягивали воду как я понял и у нее все равно есть граница разве нет? т.е. пробежав те 15 км она закончится как я понял по видео ... сейчас еще раз пересмотрю
     
  4. fenix6390

    fenix6390

    Joined:
    Nov 28, 2017
    Posts:
    20
    Пока пробовал воспроизвести ошибку с пропаданием деревьев вот такую ошибку встретил

    Spinner Error: System.InvalidOperationException: Cannot start thread while application domain is being unloaded.
    at (wrapper managed-to-native) System.Threading.Thread:Thread_internal (System.MulticastDelegate)
    at System.Threading.Thread.Start () [0x00034] in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Threading/Thread.cs:834
    at MapMagic.ThreadWorker.UpdateThreads () [0x0019d] in D:\Project2\New Unity Project\Assets\MapMagic\Main\ThreadWorker.cs:304
    UnityEngine.Debug:LogError(Object)
    MapMagic.ThreadWorker:UpdateThreads() (at Assets/MapMagic/Main/ThreadWorker.cs:315)
    MapMagic.ThreadWorker:ThreadFn() (at Assets/MapMagic/Main/ThreadWorker.cs:563)
     
  5. cfloutier

    cfloutier

    Joined:
    Jul 30, 2009
    Posts:
    35
    Hello. i'm really impressed by this tool.
    I'm interessed by the infinite terrain generation. to make a generated fly simulator;
    In VR.
    And I've met my first trouble. During generation, the processor use too many resources and the Vr experience is spoiled.
    My fps moves from 120 to 30-40

    Is there any way to lighten the generation process. I mean to make it take a longer time and taking less resources.

    I've tried to change the tthread priority but it just doesn't change anything.

    thanks in advance
     
  6. fenix6390

    fenix6390

    Joined:
    Nov 28, 2017
    Posts:
    20
    вот ошибка которая при провале деревьев ( эта ошибка отличается от той что выше про деревья писал )
    с трудом конечно но получилось вызвать провал деревьев.

    The tree PineMed3 must use the Nature/Soft Occlusion shader. Otherwise billboarding/lighting will not work correctly.
    UnityEngine.TerrainData:set_treePrototypes(TreePrototype[])
    MapMagic.<Apply>c__Iterator2:MoveNext() (at Assets/MapMagic/Generators/OutputGenerators.cs:1311)
    MapMagic.<Apply>c__Iterator1:MoveNext() (at Assets/MapMagic/Main/GeneratorsAsset.cs:553)
    MapMagic.<ApplyRoutine>c__Iterator0:MoveNext() (at Assets/MapMagic/Main/Chunk.cs:234)
    MapMagic.ThreadWorker:CoroutineFn() (at Assets/MapMagic/Main/ThreadWorker.cs:604)
    MapMagic.ThreadWorker:UpdateApply() (at Assets/MapMagic/Main/ThreadWorker.cs:224)
    MapMagic.ThreadWorker:Refresh() (at Assets/MapMagic/Main/ThreadWorker.cs:143)
    MapMagic.MapMagic:Update() (at Assets/MapMagic/Main/MapMagic.cs:261)
    UnityEditor.EditorApplication:Internal_CallUpdateFunctions()
     
  7. vonpixel

    vonpixel

    Joined:
    Oct 2, 2012
    Posts:
    31
    This worked perfectly! Thank you.
     
  8. DiscoFever

    DiscoFever

    Joined:
    Nov 16, 2014
    Posts:
    286
    Is there a simple way to use the output of MapMagic as a float array without having to draw the terrain ? I want to use it with my own voxel engine. I've seen the Voxeland example but I don't understand it.
     
  9. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,276
    Unfortunately this can't be done. At least in MapMagic scope.
    К сожалению, так сделать не получится. По крайней мере в рамках MapMagic.

    This one means you are using non-standard tree shader. It's a warning, as far as I remember, and could be ignored.
    Это означает лишь то что на дерево наложен нестандартный шейдер. Если мне не изменяет память, это warning, на него можно не обращять внимания. Юнити просто сообщает это во избежание вопросов "почему у меня странно выглядят лоды деревьев".

    Something has happened with the PineMed3.fbx file - it could not be opened. It's broken or locked from read somehow. Try placing this model manually, without using MM.
    Что-то случилось с PineMed3.fbx, почему-то юнити не может его открыть. Он поломан или как-то защищен от чтения. Попробуйте просто поставить эту модель на сцнене (без ММ).

    This one means that the terrain was removed. This can happen if you manually delete the terrain in playmode without unpinning it.
    Это говорит о том что террейн был удален. Может случиться если удалить террейн вручную, без кнопки pin.

    You can move the water plane with a script, making it take the camera position on X and Z axes.
    Можно двигать воду скриптом, заставляя ее принимать координаты камеры по осям X и Z.

    When does this error occur? I guess on closing Unity, but clarifying to be sure.
    В каких случаях эта ошибка пишется? Предполагаю, что при закрытии юнити, но хотелось бы знать точно.

    Try switching off the Max Threads Auto toggle, and set the Max Threads number to 1 (in General Settings). This will force MM using one thread only.

    There is a way to get access to map (called Matrix) directly, but you have to use your own generator (node) to do that. Here is the article describing the way it works.
     
  10. PsY4

    PsY4

    Joined:
    Apr 6, 2013
    Posts:
    2
    Hello ! What a great tool you have here...

    I'm just making my first infinite terrain from scratch : a moon-like terrain.

    I'm facing an issue where craters only stamp on first generated terrain, not on others :


    Here are my nodes :

    I think i missed someting in using the stamp generator... can you help me ?
     
  11. fenix6390

    fenix6390

    Joined:
    Nov 28, 2017
    Posts:
    20
    я лишь описал то что было в логе ошибок, увы но ни чего другого не писало при тех багах что показаны на видео.

    на счет терайна соль в том что в ручную то не удалял на видео это видно

    на счет Spinner Error: юнити не закрывал, ошибка очень редко проскакивает эта, раза 3 видел ее не больше,
    от чего точно появляется не знаю.

    Хоть что нибудь из перечисленных ошибок вам помогло?
     
  12. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,276
    You've got to set the Simple Form node's Wrap Mode to tile or pingpong. This will create cone on all the terrains, and thus will create a map for the Stamp.

    BTW I'd like to recommend increasing Scatters's Safe Borders value to prevent it from placing craters at the edges. This will prevent seams between the terrains.

    I plan to look into MM bugs tomorrow - I'm going to fix all of the bugs from Issues page, and try to reproduce the issues you've mentioned too.

    Я собираюсь заняться багфиксом завтра - пройтись по всем багам с гитлаба, а также попытаться воспроизвести проблемы что вы указали.
    Кстати, не могли бы вы добавить туда:
    - Spinner Error: System.InvalidOperationException
    - и MissingReferenceException: The object of type 'Terrain' has been destroyed
    Просто на всякий случай, чтобы не забыть. Там можно писать на русском :)
     
  13. PsY4

    PsY4

    Joined:
    Apr 6, 2013
    Posts:
    2
    Great ! that did the trick ! Thx for your help and advice ;)
    Another weirg results of the stamp, all my craters have the same height, even if they are scaled down by the Adjust bloc :

    Any advice on how i can make small craters be shorter than large one ?
     
    BackwoodsGaming likes this.
  14. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,276
    Hmm... Kinda omission. I don't know a nice way to do it.

    EDIT: added a special Height Factor in Stamp node - works similarly to the Size Factor, except it sets the height of the stamp. With the value 1 stamp heights will be scaled with the object size. Value 0 will keep the same height for all of the stamps. Will be available in the next version (or downloaded here if you don't like to wait).
     
    Last edited: Dec 14, 2017
    wetcircuit likes this.
  15. boysenberry

    boysenberry

    Joined:
    Jul 28, 2014
    Posts:
    365
    Until you develop an integration for MicroSplat, is pinning terrains pretty much the only way to keep the MicroSplat components on?
    I am also using Vegitation Studio and see that is can replicate as a child object. I am thinking about attaching a script to it that attaches the MicroSplat component to see if that'll work until you have something.
    Any suggestions on best practices for getting components like the MicroSplat component to replicate to all terrains?

    Also, I am thinking if all of the terrains in a scene share the same textures and I setup the MicroSplat material on the main 'root' terrain maybe I can just have MapMagic replicate that material for all the terrains and I'm good, right? I am just not sure if the terrains, once unpinned, will retain their texture data correctly. Will they?

    Thanks in advance,
    Boysenberry
     
    Last edited: Dec 16, 2017
  16. camta005

    camta005

    Joined:
    Dec 16, 2016
    Posts:
    320
    Denis would it be possible for you to expose the 'Reflection Probes' settings for the base terrain, in the Terrain Settings for MapMagic. I have discovered that not having control over how reflection probes are blended for generated terrains can cause seams between terrains.
     
  17. boysenberry

    boysenberry

    Joined:
    Jul 28, 2014
    Posts:
    365
    I am curious, can we use any of the terrains as the "root" terrain? I am liking an area for spawning that is off of 0,0 and would like to span a character from that terrain, but am not sure if it will effect Vegetation Studio if I use the terrain at say -2,-1 as the "root" I setup Vegetation Studio on.

    Also, I was told there was a callback when a terrain was created I might be able to use for creating components on the newly created terrain. If so, what is the best way to use it?

    Lastly, for now, If I would like to have a character randomly spawn at runtime in any of the unpinned terrains, can I do it and if so how?

    I just saw this:
    How do I prevent my character to falling while the terrain gets generated on the start?
    https://gitlab.com/denispahunov/mapmagic/wikis/Scripting_faq

    Which answers some of this I think...
     
    Last edited: Dec 16, 2017
  18. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,276
    If only there was a way to use MicroSplat on non-pinned terrains it would not have to be integrated. You can try assigning MicroSplat to MM object and turn on "Copy components to terrains" but I bet this will not work.

    I'll do it

    I don't quite get it what do you mean under "root" - are you going to make all the terrains children of some particular terrain object?

    Use OnApplyCompleted event:
    Code (CSharp):
    1.     public void OnEnable ()
    2.     {
    3.         MapMagic.MapMagic.OnApplyCompleted -= DoSomething;
    4.         MapMagic.MapMagic.OnApplyCompleted += DoSomething;
    5.     }
    6.  
    7.     public void OnDisable ()
    8.     {
    9.         MapMagic.MapMagic.OnApplyCompleted -= DoSomething;
    10.     }
    11.  
    12.     public void DoSomething (Terrain terrain)
    13.     {
    14.  
    15.     }
    16.  
    Saw that you've found it in manual after I've wrote this code, so I'd leave it here :)

    If it's non-player character then it could be spawned the way it's done with any object - using Objects Output.
    If it is playable character then it's better place it first. This will force terrain generate at player or camera position, and once the terrain is generated "fall" it to terrain. In this case the character is defining where terrain should be generated.
     
    camta005 and boysenberry like this.
  19. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    I am betting that if you call MicroSplatTerrain.SyncAll() after it copy's the components to the new terrain it'll all work. I'm not familiar with what a pinned vs. non-pinned terrain is, but it's likely that what's missing is the part that instantiates a copy of the microsplat template material and assigns it to the terrain's template material. There are cases where this would not be enough (such as with Terrain Blending, which needs a custom RGBAHalf texture for each terrain with heights/normals of the terrain baked into it), but for most things it should be enough.
     
    camta005 and boysenberry like this.
  20. boysenberry

    boysenberry

    Joined:
    Jul 28, 2014
    Posts:
    365
    It is a term used in the Vegetation Studio docs to mean the main terrain it is made to be a child of, e.g. the 0,0 terrain in their example. I am wondering if it has to be the 0,0 terrain, or if any pinned terrain will do. So for example, if I have my character on the shore of a 4x4 terrain grid it won't be on 0,0. It would seem to copy the components only in play mode vs pinning a new terrain in editor mode so I can't seem to have both terrains pinned and get the benefits of the component copying over. This brings up a different issue with terrains with POI on them that are pinned as well, do I manually add the Vegetation Components to those (all ask in their forum about this though)? So I was thinking if I want the player to start on the shore, I'll make that my 'root' terrain and have it pinned, putting the main Vegetation System object as a child of that terrain (e.g. the terrain at -2,-2). So my question then becomes will that pinned terrain work as the main (or root) terrain the Vegetation System propagates from, or does it have to be the terrain at 0,0?

    I copy and pasted the script from the git doc site and no love. Basically it changes the rigidbody as it should (as seen while debugging) but the player still falls before the terrain is built and ends up below it in the water. When I look at the terrains they seem to be created, but I am guessing too later before the player falls through. It might be from the controller (Ootii's Motion Controller with the Camera Controller as well.) I am not sure how to debug from here as to way it's still falling, but will continue to investigate, maybe I'll ask on their forum if they know how to stop the falling.
     
  21. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208
    This script works for me (placed it on the MapMagic object, and then set the Material and MicrosplatPropData that I created)

    Code (CSharp):
    1. using UnityEngine;
    2.  
    3. public class MicrosplatEvents : MonoBehaviour
    4. {
    5.     public Material MicrosplatMaterial;
    6.     public MicroSplatPropData PropData;
    7.  
    8.     public void Start()
    9.     {
    10.         MapMagic.MapMagic.OnGenerateFailed -= MapMagic_OnGenerateFailed;
    11.         MapMagic.MapMagic.OnGenerateCompleted -= MapMagic_OnGenerateCompleted;
    12.  
    13.         MapMagic.MapMagic.OnGenerateFailed += MapMagic_OnGenerateFailed;
    14.         MapMagic.MapMagic.OnGenerateCompleted += MapMagic_OnGenerateCompleted;
    15.     }
    16.  
    17.     private void MapMagic_OnGenerateCompleted(Terrain terrain)
    18.     {
    19.         MicroSplatTerrain mst = terrain.GetComponent<MicroSplatTerrain>();
    20.         if (mst == null)
    21.         {
    22.             mst = terrain.gameObject.AddComponent<MicroSplatTerrain>();
    23.         }
    24.         mst.templateMaterial = this.MicrosplatMaterial;
    25.         mst.propData = this.PropData;
    26.     }
    27.  
    28.     private void MapMagic_OnGenerateFailed(Terrain terrain)
    29.     {
    30.         Debug.Log("Generation failed for terrain: " + terrain.name);
    31.     }
    32.  
    33.     public void OnDestroy()
    34.     {
    35.         MapMagic.MapMagic.OnGenerateFailed -= MapMagic_OnGenerateFailed;
    36.         MapMagic.MapMagic.OnGenerateCompleted -= MapMagic_OnGenerateCompleted;
    37.     }
    38. }
    39.  
     
  22. boysenberry

    boysenberry

    Joined:
    Jul 28, 2014
    Posts:
    365
    Worked like a charm for me as well, thank you!
     
  23. boysenberry

    boysenberry

    Joined:
    Jul 28, 2014
    Posts:
    365
    Here is what I used to get Ootii's TP Motion Controler working with unpinned terrains correctly:
    (There is fine tuning to be had for sure.)
    (Placed on the Player as a component)
    Code (csharp):
    1.  
    2. using UnityEngine;
    3. using com.ootii.Actors;
    4. using com.ootii.Actors.AnimationControllers;
    5.  
    6. namespace EternalLife
    7. {
    8.     public class FallEnabler : MonoBehaviour
    9.     {
    10.         protected MotionController mMotionController = null;
    11.         protected ActorController mActorController = null;
    12.         protected Rigidbody mRigidbody = null;
    13.  
    14.         public void OnEnable()
    15.         {
    16.             MapMagic.MapMagic.OnApplyCompleted -= EnableFall;
    17.             MapMagic.MapMagic.OnApplyCompleted += EnableFall;
    18.  
    19.             mRigidbody = GetComponent<Rigidbody>();
    20.             mActorController = gameObject.GetComponent<ActorController>();
    21.             mMotionController = gameObject.GetComponent<MotionController>();
    22.             MotionControllerMotion lMotion = mMotionController.GetMotion<Fall>(0);
    23.             // will no longer fall
    24.             mActorController.IsGravityEnabled = false;
    25.             lMotion.IsEnabled = false;
    26.             //disabling rigidbody
    27.             mRigidbody.useGravity = false;
    28.             mRigidbody.isKinematic = true;
    29.             mRigidbody.detectCollisions = false;
    30.         }
    31.  
    32.         public void OnDisable()
    33.         {
    34.             MapMagic.MapMagic.OnApplyCompleted -= EnableFall;
    35.             mRigidbody = null;
    36.             mActorController = null;
    37.             mMotionController = null;
    38.         }
    39.  
    40.         public void EnableFall(Terrain terrain) //checks if applied terrain contains object, and enables it's rigidbody if it does
    41.         {
    42.             Rect terrainRect = new Rect(terrain.transform.position.x, terrain.transform.position.z, terrain.terrainData.size.x, terrain.terrainData.size.z);
    43.             Vector2 pos = new Vector2(transform.position.x, transform.position.z);
    44.  
    45.             if (terrainRect.Contains(pos))
    46.             {
    47.                 MotionControllerMotion lMotion = mMotionController.GetMotion<Fall>(0);
    48.                 // will fall again
    49.                 mActorController.IsGravityEnabled = true;
    50.                 lMotion.IsEnabled = true;
    51.                 // enabling rigidbody
    52.                 mRigidbody.isKinematic = false;
    53.                 mRigidbody.detectCollisions = true;
    54.             }
    55.         }
    56.     }
    57. }
    58.  
     
    BackwoodsGaming likes this.
  24. boysenberry

    boysenberry

    Joined:
    Jul 28, 2014
    Posts:
    365
    I responded in gitlab, but I'll repost here in case you see this first:

    Just a thought, does it do the same thing when you save the terrains? Maybe it's a limit on the terrain creation count in unity, like some index of terrains that reached it's limits, much like an array that reached it's upper bounds. Instead of recycling the index they keep increment it until the upper bound are reached then the memory allocation error. Just an idea.
     
  25. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,276
    I've tried stress-test MM build for a night, forcing chunk to rebuild just right after it was generated. I was using the demo scene and could not reproduce the issue - in the morning it was still generating land. I'll contact the issue reporter (it was send via email) and ask for scene or other details.

    I have not looked into Vegetation Studio integration yet, but theoretically it should work - at least here is what the VS documentation says. But since there's an issue report I've got to llok it myself.

    If the player is falling through the terrain when rigidbody is "off" (kinematic enabled) then something turns it on somehow. It might really be a motion controller, I suspect it just can't work without rigidbody. You can try logging message in EnableFall to see if it's called before the terrain is generated to see if it's really so.
     
    BackwoodsGaming likes this.
  26. boysenberry

    boysenberry

    Joined:
    Jul 28, 2014
    Posts:
    365
    Thanks I got the falling script to work and posted it above. I also figured out the VS issues with them, so I am all good there as well. I must say MapMagic is a gem, thank you!
     
  27. boysenberry

    boysenberry

    Joined:
    Jul 28, 2014
    Posts:
    365
    Just a suggestion, you might want to put something in the "Problem Solving" section on Portal drop-downs not working if a Portal name is not filled in. I created a Portal without adding a name, stepped away, forgot it was there, then when I tried to change a Portal connection later none of them worked. I was stumped until I found the Portal without a name then filled it in. I was getting a null value error in the console, but it wasn't specific enough for me to understand it was from a Portal without a name.
    Anyway, that's my feedback on that. :)
     
    malkere likes this.
  28. Aress28

    Aress28

    Joined:
    Dec 12, 2015
    Posts:
    100
    Hi i have problem with tree spawning ..i followed tutorial but the problem i get is my trees spawns everywhere underwater and on beach sand ....soil is set to grass... Trees.png
     
  29. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    even if there is 99% sand there is still some grass in your sand. even 0.01% can make a tree spawn. make sure that you are setting your grass to absolutely zero under your water line, or that sand is overriding it 100% past the water line. You probably have it curving slowly towards zero.
     
  30. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,276
    It's nice to hear that! Thanks!

    Fixed for the next version.

    Are you using Forest generator? Forest generator can create new trees, but it does not remove them - this also applies to initial seedlings. To remove them provide the same mask for the seedlings node (in case seedlings node is Scatter connect the mask to Density input).
     
  31. desukarhu

    desukarhu

    Joined:
    Jun 14, 2017
    Posts:
    27
    Hi!

    Excellent tool, been playing around with it and I'm almost happy with my first generated world.

    I have one question though, how can I create a dense large forest? I noticed that if I increase seed distance and density the forests just become square shaped since they do not travel outside the nodes borders.
     
  32. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    I think if you increase the age it will spread out further. density is also somewhat limited by seed distance, so turning it up too high will affect density I think.
    my unity won't play for some reason I'm trying to fix =[ or I'd answer properly
     
  33. desukarhu

    desukarhu

    Joined:
    Jun 14, 2017
    Posts:
    27
    Hmm, okay I think I'm misunderstanding some of the forest settings. I played around abit more and got the effect I wanted. I do have couple of other questions about the Forest tool also:

    1) How can I make sure no trees spawn on top of eachother? I've seen this happen a couple of times when in one forest there are two trees spawned inside of eachother.

    2) How can I spawn specific plants only inside forests? Like if I create a forest with the forest tool I also want to have it full of ferns and bushes for example. But I don't want to have bushes and ferns in the rest of the map.
     
  34. Freznosis

    Freznosis

    Joined:
    Jul 16, 2014
    Posts:
    298
    Sorry to be vague, but is there a reason that any scene with a MapMagic component in it is saving slow? When ever I hit ctrl+s Unity will freeze for about 10 seconds then it unfreezes and the save is successful. This is pretty annoying and makes me not want to save as often (which is bad).

    Is there anyway to speed this up? Or maybe there is a known bug for this kind of thing? It doesn't happen for me even on really big complex scenes that don't have a MapMagic component in them. There are no errors, and profiling the editor doesn't point to anything in specific.
     
  35. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,276
    You can use a Rarefy node to remove the trees that are closely located. However forest should not create two trees with the positions exactly matching (i.e. one inside the other). Could you make a screenshot?

    You can either use Propagate to scatter objects around the trees, or create a forest masks using the Blob node. Creating large blob under each of the tress will mask only the tree areas. This mask could be blurred a bit then to be more realistic.

    Actually it should not be so slow. Could you please try saving the included demo scenes? In my case it's the matter of milliseconds, I can note the saving was made just by cursor blink. S I'd like to find out whether is it related with your graph or not.
     
  36. desukarhu

    desukarhu

    Joined:
    Jun 14, 2017
    Posts:
    27
    Awesome! Thank you. I knew there had to be an easy way to do these. :)
     
  37. boysenberry

    boysenberry

    Joined:
    Jul 28, 2014
    Posts:
    365
    I am trying to make a river biome am having difficulty with selections and thought I might get some good advice here.

    Basically, I need to learn how to select areas better for modification, texturing, etc. and am not sure how to best go about it. I say best because I am sure there are a few different ways, like duplicating, then slightly resizing, to mask, etc. I've watched the video on making the island (very impressive) and was thinking I need to do something like how the beach is masked around the cliff faces to select or mask areas of interest.

    In my examples below I show the settings I am using with the result as well as as the sand portal viewed on terrain. What I'd like to be able to do is mask the terrain in the areas the rivers will flow through. In the viewed on terrain example you can see how the sand bleeds out into the terrain. I'd like to be able to mask the terrain before I use the shore generator so I can keep the shore effects limited to their areas. Similarly I'd like to be able to reverse the mask and have a biome merged in the areas the rivers don't touch.

    I imagine others are doing similar. What is the best way to get fine grained control over the masked areas, etc?

    Capture_MM1.PNG Capture_MM2.PNG
     
  38. desukarhu

    desukarhu

    Joined:
    Jun 14, 2017
    Posts:
    27
    Actually I've noticed this too, I get slowdown also when saving. It seems like map magic starts generating the world again after saving. When the save is done I look at the mapmagic window and I see the loading spinner spinning, so it's doing something and slowing unity down.
     
  39. Freznosis

    Freznosis

    Joined:
    Jul 16, 2014
    Posts:
    298
    I can confirm saving the demo scene is very quick, however my graph is less complex than the demo. It's just a simple raw heightmap-> erosion -> height
     
  40. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,276
    boysenberry, I don't quite get it: what kind of control are you going to get over what masks and what areas? If you could describe what are you going to make exactly I'll try to help you with an advice.

    It's seems to be RAW Input. Saving RAW could really take time, especially when it's resolution is 4K or more. By pressing "Save Imported RAW" you can save it once to the asset file to avoid saving it each scene save. Have you saved the imported RAW as an asset? Do you see the warning in the node that it should be saved?

    Are you using RAW Input too?
     
  41. boysenberry

    boysenberry

    Joined:
    Jul 28, 2014
    Posts:
    365
    Is that not specific enough? I am not sure what more to say. In the example I showed I even have the graph I used to make the initial 'flows' with. I am just not sure how once they're made I can mask them specifically. With the mask I'd like to be able to work in the areas the rivers will flow in independently of the areas outside of the flows. In the example, the sand bleeds out from the shore into the rest of the terrain because I haven't figured out how to mask it effectively. After I do the shore generator the sand output masks just what I am saying (as shown on the view on terrain), but I need to do that before the shore generator.
     
  42. Freznosis

    Freznosis

    Joined:
    Jul 16, 2014
    Posts:
    298
    Yes I've saved it as an asset when I saw the warning a couple days ago, but there hasn't been any change to this.
     
  43. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,276
    I'm not pretending to misunderstand you. I'm really trying to wrap my head around what exactly are you going to make. Could this be rephrased to: I'd like to mask areas by height and make this mask contrast?
    (Example).

    Could you email me the scene (with saved raw asset and it's source)?
     
  44. boysenberry

    boysenberry

    Joined:
    Jul 28, 2014
    Posts:
    365
    I wasn't sure how to ask the right way because I am not sure what ways (outside of what I tried already) exist, thus the question for guidance and the description (from my perspective) of what I am trying to do.

    I think a height specific mask would work, basically I'd want to mask everything below a certain point (or above). It would also be really handy to mask a range of heights as well. How do I do a height mask? Can I do ranges?

    I also need to learn how to smooth the edges of things, like the edges of the perlin noise depressions. I am not sure how to phrase that correctly either.

    In the picture when close to the bends created by the perlin noise the transition from the lowest point to the flat at the top is created by the first curve after the perlin noise. It leaves a jagged edge in the transition. I don't know how to keep it shallow, while making a smooth transition from the lowest point to the highest point in the curve. I am attempting to make smoother banks along the rivers. What I am getting now is a terrace like series of diagonal lines going up to the edge of the depression creating a jaggedness to the the terrain.

    It might be that I can correct that with a blur if I had the area masked correctly. So the height masking solution might be all that I need.

    Essentially I still need to learn how to use the curves better I think.
     
  45. boysenberry

    boysenberry

    Joined:
    Jul 28, 2014
    Posts:
    365
    Yep, curves are what I needed and your example was the key for me, thank you. Curves are pretty amazing. :)
     
    camta005 likes this.
  46. boysenberry

    boysenberry

    Joined:
    Jul 28, 2014
    Posts:
    365
    Is there a way you can think of to create a hexagon shape? I would like to create the main biome in the center of a hex, with each edge of the hex blending with a different biome. I saw your gradient example, but I am not sure if there is a way to create a hex. I was thinking there might be a clever way to use simple forms with blending to get the angles, but try as I might I couldn't figure out how to do it. The angles are pretty easy:
    https://upload.wikimedia.org/wikipedia/commons/3/38/Regular_polygon_6_annotated.svg

    On thinking about this more, I am guessing this will need to be my first generator. :)

    Edit: It would seem I was over complicating things. I can use the cone to create a hexagon masking situation, I believe.
     
    Last edited: Dec 23, 2017
  47. Nihilus0

    Nihilus0

    Joined:
    Jan 25, 2017
    Posts:
    52
    If I understand what you mean, Your argument is that you should mark the inner or outer area of the outline.(Gradient Borders) the matrix In MM is a Float, which consists of a value between 0 and 1. Are you trying to get a larger than 1 region or smaller than 0 area in the Matrix?

    And you mean gradient the outer and inner areas of the outline? In addition, you are saying that the width value of the gradient should be adjusted?

    When I tried to create a lake, it needed more than a simple circle. I wanted to flatten the terrain according to the outline of the lake line.

    ps. I used a translator because I am a non - English speaking person.
     
    Last edited: Dec 23, 2017
  48. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,276
    I think it's better use texture/raw inputs for such a complex shapes. Cone will do the trick too, but you will have to place 6 cones at each of the hexagon nodes, and one in the center. And then make the sum equal to 1 using the normilize node. I'm not quite sure that my explanation is clear, so I can make an example graph if you find it obscure.
     
    boysenberry likes this.
  49. boysenberry

    boysenberry

    Joined:
    Jul 28, 2014
    Posts:
    365
    I was able to get the effect with a curve masking the areas in the the depressions and outside the depressions I am using for the rivers like this:
    CaptureMM1.PNG CaptureMM2.PNG
     
    camta005 likes this.
  50. boysenberry

    boysenberry

    Joined:
    Jul 28, 2014
    Posts:
    365
    I have another question now though. How can I know if my changes to the map graph have been saved or not?
    I am not really sure what each of the buttons are for either, Reset, Release and Save as Copy. I believe I understand Save as Copy, been using that. What is release and reset though? I didn't find them in the documents (probably was looking too late at them or something).