Giter Club home page Giter Club logo

unity-movement-ai's People

Contributors

sturdyspoon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

unity-movement-ai's Issues

Flying flocking clumping issue

Hey,
When I set the flocking 3D to fly with no gravity, StayGrounded is false, the flocking objects clump together confused, especially at the center of unity space (0,0,0). It's like a gravity well. Let me know how to fix it.

It seems like they lose direction velocity when they're on top of each other.

Thanks.

NearSensor and its dependent behaviors try to access rigidbodies that have been destroyed at runtime

Great library! I've adapted it to a 3d project with movement along the x and z axes and it's working beautifully--but there's a major oversight when it comes to rigidbodies that have been destroyed after being added to the NearSensor's hashset.

I tried implementing a solution within the NearSensor script to first check if the rigidbody exists and is enabled before adding to the hashset--but that didn't address the case in which rigidbodies are destroyed after being added (such as when an enemy is killed). Cohesion, Separation, VelocityMatch and CollisionAvoidance were still trying to access the destroyed rigidbody, throwing null exceptions every frame.

I would suggest, in NearSensor-dependent scripts, at the beginning of the foreach loop iterating over members of the rigidbody hashset, to make it first check if the rigidbody at this index is null before accessing it. When I added this check, there were no more errors.

(P.S. I'd be happy to submit a pull request if you'd like to see the various tweaks I made to add this library to my project!)

debugDraw runs in builds

While profiling a game using this library on a real device, I spotted this:

2020-10-09 09_56_10-

The debugDraw coroutine in MovementAIRigidbody will take up more time per frame during more crowded segments, sometimes consuming nearly 1ms per frame. This should not be happening. Ideally, this coroutine should only be run inside an #if UNITY_EDITOR block.

flocking issues - Screen boundry

MissingComponentException: There is no 'Rigidbody' attached to the "ScreenBoundary" game object, but a script is trying to access it.
You probably need to add a Rigidbody to the game object "ScreenBoundary". Or your script needs to check if the component is attached before using it.
UnityEngine.Rigidbody.get_position () (at C:/buildslave/unity/build/artifacts/generated/common/modules/Physics/DynamicsBindings.gen.cs:1536)
Cohesion.getSteering (ICollection`1 targets) (at Assets/unity-movement-ai/Scripts/Movement/Cohesion.cs:28)
FlockingUnit.Update () (at Assets/unity-movement-ai/Scripts/FlockingUnit.cs:35)

No such issue exists for other Example scenes. I am using unity 5.3.4

Combining behaviors?

Hi! I've been having a lot of fun using this library. Thanks for sharing your great work! I'm working on making a sports game and have been considering using this library as a basis for the movement AI. I've been trying to combine different behaviors, but am having trouble getting it to work.

For example, I want to have a game object use both Arrive and Evade at the same time. Imagine a football player running towards the end zone, while also trying to move away from an incoming defender that gets close. I've seen other movement AI tutorials that use the concept of "blending" or "weighting" behaviors, so that you can combine different behaviors and give priority to one behavior over another. Sticking with my football example, I want the players top priority to be running to the end zone, but slightly changing course to try and put separation between him and an incoming defender.

I've tried adding in a "weight" variable to behaviors, and in the SteeringBasics "Steer" function, multiplying the weight by the existing "linearAcceleration" variable. I was hoping to achieve blending multiple behaviors like this, but haven't had any luck in getting it to work.

Has anyone been able to achieve blending multiple behaviors in any sort of way? Or is there something already built in to this library that would help me do this, and I have just plain missed how to do it? Any help would be greatly appreciated!

Debug library?

Hi, very impressive library! I'm trying it out right now, on the dev branch, :)

There are some references to a class called DebugDraw in Wander1.cs, which seems useful. Can you share that code?

        //		DebugDraw debugDraw = gameObject.GetComponent<DebugDraw> ();
        //		debugRing = debugDraw.createRing (Vector3.zero, wanderRadius);

Thanks!

3D Space steering?

Hey Anton!

I'd really love to use your library in a Space game I'm currently developing. I therefor need to control spaceships in 3D space. How is your progress on 3D steering? Can I use the dev branch of this library already? Or could you give me a quick advice on what's missing, then I'll implement myself.

Kindest regards
–Chris

Jumping/Climbing

Hello,

I have a voxel terrain generator (minecraft like) and your script works well on telling the AI to move to a certain point but the problem is that it doesn't climb/jump the 1 meter height blocks. I saw that there is a jump function but I guess its not implemented? Thinking how I should tell the character to jump or walk over 1 height blocks while ignoring more than 1 height blocks.

It is a really well made script for such procedural terrains, because making a dynamic navmesh is a huge pain in the a**.

TODOs list

It would be great to post some TODOs here. I would love to help with this project and that would make it way easier.

Thanks

2D Flocking Errors in Console

When 3 or more flocking units come together, it starts rapidly printing out this error message in the console:
image
D:

3D rigidbody units rotate using x as forward

Using the 3d units, the lookatdirection function seems to orient units using the x axis as forward, as they will align their x axis with the velocity direction instead of their z axis.

I've tried messing with the LookAtDirection code and haven't been able to determine the issue. The math looks right, so I don't know if the x-forward assumption is made somewhere else I haven't found. This would be useful for most applications as the assumption is that z is forward.

2D Position Offset

My 2D sprite faces upwards instead of 90 degrees to the right.. what would i need to change to get it so the forward direction is up instead of 90 degrees to the right?

The namespace `global::' already contains a definition for `Separation'

Getting the error:
The namespace global::' already contains a definition forSeparation' and also
error CS0101: The namespace global::' already contains a definition forCohesion'.
General wording in definitions is always an issue and leads to conflicts with other asset packaged. maybe you can pre-fix all your classes and references to them with umai_ and then these conflicts would be less likely to arise. Thanks though for a great library of behaviours. Works really well.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.