Thank you for taking the time to read my question, I will try to keep it as concise as I can.
I am making a 2D-platformer game. I am in the process of programming AI that can intelligently traverse their terrain. AI are able to jump, in a fashion similar to many other 2D-platformers:
- When the AI jumps, it is given a fixed initial Y-Velocity.
- The AI has a flexible time where it may ignore gravity to give it a variable jump height/air time. (This mimics the way that the player is able to jump, where the player character may jump higher if the player holds down the jump-button longer.)
- After this time expires, or the AI "releases the jump button", gravity begins to affect the jump arc. The acceleration rate of gravity is also constant.
- The velocity on the X-axis is constant.
Question: How would an AI find the minimum amount of time that it will have to "hold down its jump button" to clear an expanse between a starting jump point, and a desired target?