News Forums RAIN General Discussion and Troubleshooting Navigation mesh for 15000*15000 terrain

This topic contains 3 replies, has 2 voices, and was last updated by  rajavamsidhar 5 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #40131

    rajavamsidhar
    Participant

    HI..Im using RAIN 2.1.11.while generating navigation for 15*15 km terrain my system going to out of memory and closing unity application.my RAM is 8gb.it is showing progress bar till the end and getting hang at the end of progress bar.. any solution for this?

    #40133

    rajavamsidhar
    Participant

    hi..i posted my question in not clearly in first post.

    1st case : i used two Rain navmesh.but half part completed.when i am trying to do second part my system hanged.
    2nd case : i took 100*100 mesh size with cell size is 0.5..two parts are completed,when i am generating second one taking long time and hanging.
    3rd case : i put total terrain for two days..it is completed but application got struck and hanged. badly i closed unity3d through taskmanager.

    Finally i came to use runtime generation of navmesh with size of 1 unit.but it is not correct solution for my need..Help me out. i choose RAIN for AI of my model.from 3 weeks i’m struggling with my navmesh.

    is there any way to use unity inbuilt navmesh for RAIN. i think in background RAIN also use inbuilt navmesh may be.here is code which i used to generate navmesh in runtime

    using RAIN.Navigation.NavMesh;
    using System.Threading;
    using UnityEngine;
    public class NavmeshGenerator : MonoBehaviour
    {
        [SerializeField]
        private bool _test = false;
        [SerializeField]
        private int _threadCount = 4;
        // This is just to test the runtime generation
        public void Update()
        {
            if (_test)
            {
                GenerateNavmesh();
                _test = false;
            }
        }
        // This will regenerate the navigation mesh when called
        public void GenerateNavmesh()
        {
            NavMeshRig tRig = GetComponent<NavMeshRig>();
            // Unregister any navigation mesh we may already have (probably none if you are using this)
            tRig.NavMesh.UnregisterNavigationGraph();
            tRig.NavMesh.StartCreatingContours(tRig, _threadCount);
            while (tRig.NavMesh.Creating)
            {
                tRig.NavMesh.CreateContours();
                // This could be changed to a yield (and the function to a coroutine) although as 
                // of RAIN of 2.1.4.0 (fixed since then), our navigation mesh editor has issues with it
                Thread.Sleep(10);
            }
            tRig.NavMesh.RegisterNavigationGraph();
        }
    RAIN.Navigation.NavMesh.NavMeshRig rig = GameObject.FindGameObjectWithTag("NavMesh").GetComponent<RAIN.Navigation.NavMesh.NavMeshRig>();
    		RAIN.Navigation.NavMesh.NavMesh mesh = rig.NavMesh;
    		//clear the existing navmesh
    		mesh.UnregisterNavigationGraph();
    		mesh.StartCreatingContours(rig, 1);
    		while(mesh.Creating)
    		{
    			mesh.CreateContours();
    			System.Threading.Thread.Sleep(10);
    		}
    		mesh.GenerateAllContourVisuals();
    		mesh.RegisterNavigationGraph();
    }
    • This reply was modified 5 months, 1 week ago by  rajavamsidhar.
    • This reply was modified 5 months, 1 week ago by  rajavamsidhar.
    #40155

    Sigil
    Keymaster

    That is a very large navigation mesh, does seem like it may be beyond RAIN’s capability. I’ll do some tests and see if there is a particular place that we are hitching on that. Not positive if path finding would work well across such a large navigation mesh anyhow, but I might as well check it out.

    In the mean time, here is a post for using the Unity navigation mesh with RAIN, we’ll also be including a similar custom motor with the next starter kit (with the next version of RAIN).

    #40166

    rajavamsidhar
    Participant

    Thanks a lot for your reply.@Sigil. I stopped working with RAIN because i’m unable to generate navmesh.if you find a solution for large terrains plz post it back.i really need it.its already two months wasted daily generating my total terrain and next day it ate my system RAM.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.