Opponent Fish AI Implemented


It has been a long time since I have made the prototype of one of my game projects. Now that I got motivation for work on it more, I finally got one of the core features that I wanted: Opponent Fish AI

Basically, the idea behind the AI is to utilize the path-finding while combining both dynamic physics and having a virtual "game controller" direct its movement.

FeatureIntention
A* PathfindingThe base navigation system to detect the closest player to seek and then flip tail to flee when close to player. In its current implementation, the pathfinding refreshes in real time to encourage the AI to adapt themselves to better aim towards the player. Additionally, the pathfinder is also used for the flee waypoint, which may not always work.
Dynamic PhysicsThe game is built around basic 2D physics in Unity to add flavors of chaos like early Williams arcade video games, including Joust. I was originally going to implement a more restricted physics, but found that Unity's built-in physics are sufficient for this game.
Virtual JoystickThe AI fish will move based on the "virtual joystick" based on path-finding logic. Hope to expand usage of virtual joystick to do crazy things with different AI opponents as well as simulating "hardware input lag", which may come in handy for future development. That can come even handy for creating an "Attract Mode Player", which is a computer controlled player fish, but is superior to the opponent fish AI.


As a  Minimum Viable Prototype (MVP), I went ahead and implemented a basic A* pathfinding on a grid as well as putting in the basic Finite State Machine (FSM) with seek and flee. As you can see, the fish behave as intended for the most part. However, there are still many more refinements to go.


Even through I am glad to build in the foundation for opponent fish AI, there's more room for real growth.

In case you like more of the snapshots of the AI in action, there's more with plenty of behavior bugs:


Current version - I don't know why they sometimes move too fast...






A test level, not in the demo version, which I think behave more smoothly and maybe not as fast for some reason:




Anyways, feel free to download the demo and try it yourself. I encourage you to leave some feedback, especially on improving the path-finding that accounts for 2D physics and not getting suck at dead ends.

Files

fishtailPC_01_0.app.zip 31 MB
Jun 23, 2020
Fish Tail Joust Prototype.exe 635 kB
Jun 23, 2020
fishtailPC_01_0.x86_64 164 MB
Jun 23, 2020

Get Fintail Gladiator Prototype

Leave a comment

Log in with itch.io to leave a comment.