fishfolk / punchy

A 2.5D side-scroller beatemup, made in Bevy

Home Page:https://fishfolk.github.io/punchy/player/latest

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Improve AI targeting

64kramsystem opened this issue · comments

Description

The AI of the current enemies is a bit too fuzzy - in some circumstances, it's even hard to make oneself killed (the enemies go around, but struggle to focus on the player).

  • Improve targeting
  • Choose one player to target (see comment), instead of going back and forth

Alternatives & Prior Art

No response

Yeap, the "AI" right now was more of a "show off the animations and make sure our damage works" thing than something we will keep this way.

Currently all the AI does is select random player, then select a random point within a certain range of that player, then walk there. On arriving, the AI chooses randomly to either attack or wait for a few frames.

I think a good first step to improving the AI would be to change the way targeting works. Right now targets are selected randomly from the list of players, but a nice improvement would be to give enemies a range within which they will target a player, and have them select the player that is closest to them within that range as their target.

With #198 merged I think the only thing we'd want before closing this is having enemies pick the closest fighter to them to attack.

Right now if I have fishy and sharky stand at opposite ends of the course, the enemies kind of walk back and forth between the two of them a lot of the time.

With #198 merged I think the only thing we'd want before closing this is having enemies pick the closest fighter to them to attack.

Right now if I have fishy and sharky stand at opposite ends of the course, the enemies kind of walk back and forth between the two of them a lot of the time.

Makes sense. I'm unassigning myself and setting is as small scope, in case somebody would like to pick something easy. If nobody does, I'll come back to it 😄

I'll claim this, was already looking on the code about it and completed it.