American Football Prototype

Hi,

I’m using the Pro version of the project and am currently prototyping a game with concepts heavily derived from American Football but there would be dynamic obstacles generated on a flat navmesh at run-time. I’m wondering if a few things are possible, and how would someone more experienced with the A* Project might approach these.
I’m currently using the RichAI to send a “Receiver” out towards a goal, with a “Quarterback” that will ‘throw’ a projectile to the ‘Receiver’ approx along the path. Currently this function looks like

using Pathfinding;
using UnityEngine;
public class WideReciever : MonoBehaviour
{
    private Seeker seeker;
    private IAstarAI ai;
    private Path path;
    public QB qb;
    public GameObject target;
    void Start ()
    {
        ai = GetComponent<RichAI>();
        destinationSetter = GetComponent<AIDestinationSetter>(); 
        qb = FindObjectOfType<QB>();
        seeker = GetComponent<Seeker>();
        ai.destination = target.transform.position;
        if (seeker.GetCurrentPath() != null)
        {
            path = seeker.GetCurrentPath();
        }
     }
    void Pass()
    {
        Vector3 heading = ai.steeringTarget;
        Vector3 currentVelocity = ai.velocity; 
        Vector3 targetPos = transform.position + heading + currentVelocity;
        qb.Throw(targetPos);
        target.Transform = targetPos;
    }
}

This works ok, but often ends far infront of the ‘reciever.’ So, ideally I need the reciever to store a path that could contain a 90 degree turn, and then be able to throw to a node in the path after the 90 degree turn, but before the reciever gets close enough to the waypoint to register the next part of the path. (I’m really looking for a way to calculate which node the ‘reciever’ will be at after a certain amount of time.)

The next issue would be a defender agent that tries to prevent the receiver from reaching his goal, bumping him off the path. Currently I just set a RichAI with the reciever as the target and it works acceptably, but I wonder if there are better ideas.

If you don’t think this project is well suited for this prototype, that’s ok, any insight is greatly appreciated!

Hi

Using a pathfinding library like this for a sports game might not be the best idea. Are those dynamic obstacles large enough (and non-convex) so that some other avoidance technique could not work better and lead to more fluid movement? I think using pathfinding is overkill in this case and will likely lead to more problems than it solves.