Forum rules - please read before posting.

Pathfinding problem only for some people

After putting out a demo of my upcoming game, two people have reported the same very odd pathfinding issue. However, it works as expected for most people including me, so it's very hard to track down what the issue might be.

I got video from one of the people which you can watch here:

https://drive.google.com/file/d/1oY4ilC3m7CSwELrCeR_gN9ACybukJprQ/view

As you see, the player is clicking on the left and the player is walking left as expected. But then the player clicks on the right side and instead of turning around and walking right, the character takes a wide arc across the bottom of the screen. Then the player is clicking on the left side again and even more weird things happen. The player seems to be moving randomly and also the camera which is set to track the player is not tracking the player because the player is off the screen somewhere doing who knows what at the end.

AC version 1.68.4
Unity version 2020.1.7f1

I was not able to determine anything particularly unusual about the systems of the the players who saw this issue.

Comments

  • Oh and using Unity Navigation as pathfinding method

  • Are those who do experience this issue able to recreate it reliably?

    Though it shouldn't do, the only thing I can imagine might be a factor between systems would be the frame-rate. Are the users with this issue using noticeable higher/lower-end systems compared to you?

    Let's see full details/screenshots of the scene itself, the baked NavMesh, the Inspector of the Player's root, and the Settings Manager.

    Though it's likely not directly related: I don't recommend using that old an AC version with that new a version of Unity. v1.68.4 was released long before 2020 became available, so doesn't officially support it.

  • edited January 2021

    Sorry for taking so long to get back on this. I have been quite busy.

    It does appear to be the rate at which he turns which is likely a frame rate issue. Because he moves using root motion, he takes a very wide arc when he turns for some people.

    I have chosen the option to turn before moving, and that has solved the problem for the people having it, but looks a bit clunky compared to the fluid motion with that unchecked. Is there a better solution?

  • Does he turn due to root motion, or just move forward/back? The factor by which AC will delegate turning duties to root motion can be set by the character's "Root Motion turning" field.

    Please see my questions / requests above, which I'll need in order to understand the full picture.

  • He does not turn by root motion. Only forward and back.

    It happens in ever scene of the game, but here is one of them with the baked navmesh visible
    https://ibb.co/MgQVHxX

    Player inspector:
    https://ibb.co/tbsKMJQ
    https://ibb.co/FWkFHkC

    movement settings in settings manager:
    https://ibb.co/vXFWsTS

  • Are you using a Blend Tree for the character's motion animations? This is recommended if you rely on root motion - see the Manual's "Precision movement" chapter for details.

  • I do not use a blend tree. Do you think that is the issue or just a possible thing to try? I'm not sure I want to fiddle with the fundamental way my animation controller works this close to release unless it's almost certainly the problem.

    The animation controller has been the same since the first game in the series and haven't heard of any issues until this past demo. Although, since it happens only on some computers and not most, it's possible I just didn't hear about it before.

  • I can't guarantee that's the sole cause, but the use of root motion without a Blend Tree is a cause of imprecise movement issues. I'd certainly suggest that it should at least be ruled out before anything else is considered.

    A Blend Tree allows a character to slow down more naturally as their approach their target, which can help to prevent undershooting / overshooting.

    First, however, you should attempt to reliably recreate the issue on your end. It's possible to enforce a frame rate with a custom script. Here's one I use myself:

    using UnityEngine;
    using System.Collections;
    
    public class FrameRate : MonoBehaviour
    {
    
        private int mode;
    
        private void Start ()
        {
            QualitySettings.vSyncCount = 0;  // VSync must be disabled
            SwitchMode (1);
        }
    
        private void Update ()
        {
            if (Input.GetKeyDown (KeyCode.Alpha1))
            {
                SwitchMode (1);
            }
            else if (Input.GetKeyDown (KeyCode.Alpha2))
            {
                SwitchMode (2);
            }
            else if (Input.GetKeyDown (KeyCode.Alpha3))
            {
                SwitchMode (3);
            }
            else if (Input.GetKeyDown (KeyCode.Alpha4))
            {
                SwitchMode (4);
            }
            else if (Input.GetKeyDown (KeyCode.Alpha5))
            {
                SwitchMode (5);
            }
            else if (Input.GetKeyDown (KeyCode.Alpha6))
            {
                SwitchMode (6);
            }
        }
    
        private void SwitchMode (int _mode)
        {
            mode = _mode;
    
            if (mode == 1)
            {
                Time.fixedDeltaTime = 0.02f;
                Application.targetFrameRate = 60;
            }
            else if (mode == 2)
            {
                Time.fixedDeltaTime = 0.02f;
                Application.targetFrameRate = 200;
            }
            else if (mode == 3)
            {
                Time.fixedDeltaTime = 0.02f;
                Application.targetFrameRate = 15;
            }
            else if (mode == 4)
            {
                Time.fixedDeltaTime = 0.002f;
                Application.targetFrameRate = 60;
            }
            else if (mode == 5)
            {
                Time.fixedDeltaTime = 0.002f;
                Application.targetFrameRate = 200;
            }
            else if (mode == 6)
            {
                Time.fixedDeltaTime = 0.002f;
                Application.targetFrameRate = 15;
            }
        }
    
        private void OnGUI ()
        {
            GUILayout.BeginVertical ("Button");
            GUILayout.Label ("MODE " + mode);
            GUILayout.Label ("TimeStep: " + Time.fixedDeltaTime);
            GUILayout.Label ("Target FPS: " + Application.targetFrameRate);
            GUILayout.EndVertical ();
        }
    
    }
    

    Attach that to an object in your scene, and use the number keys to switch mode. Try to find one that causes the issue to occur, and you can then see what difference a Blend Tree makes.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.