Skip to content

Review how AIFramework might best dovetail with AnimationController #7

@SiliconOrchid

Description

@SiliconOrchid

The main issue being reported, is that the navigation class Navigation_UnityNavMesh currently hardcodes the naming of the string-parameters used to match the for forwards/sidewards exposed by the AnimationController AnimController_Humanoid. These strings are ForwardsSpeed and SidewaysSpeed - they match up correctly with the parameter in the demo AnimationController .

If Navigation_UnityNavMesh is intended to be part of a framework [that isn't meant to be edited by the consuming-developer], then it potentially poses problems if a developer wants to use a different AnimationController. A quick fix might be to make those parameter names editable by exposing them in the inspector.


Pre-emptively, I was trying to think about how the provided interface code Navigation_UnityNavMesh and AnimationController AnimController_Humanoid might be extended or completely changed.

Currently these bits seem to be intended to be part of the "Framework", rather than an developer-specific-implementation. ( E.g. I would consider the bits provided in the "Samples" to be a developer-specific-implementation.)

Going forward, an implementation using this Framework is very likely to be needing other animations (sitting, attacking, etc).


I'm not sure of a good way tackle this, but I thought some discussion points may be constructive?

Where might the contact-points between Script and AnimationController best be placed? e.g:

  • Have each module that correlates to an animation, individually have a reference to the AnimController?

    • e.g. an AI might have a "sit in chair" goal, so the corresponding "sit" action would trigger the "sit animation" appropriately
    • e.g. movement animation continues to be updated directly by the Navigation_UnityNavMesh which is part of framework
  • Have a single AnimationController "interfacing class" (the single place that has reference to AnimController).

    • Values (such as movement vectors, bools such as "isSitting") could be collected from public properties of other parts of the codebase, probably the blackboard.
    • Represents a single point of contact between script and controller. These string-based-parameters are really brittle, so it feels like having them registered in one place is likely to make debugging easier.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions