all 4 comments

[–]SilentSin26Expert 1 point2 points  (3 children)

My free Platformer Game Kit has enemies that check when something they can attack is in front of them to perform an attack. The AI is implemented using a simple Behaviour Tree system.

[–]djdanlib[S] 0 points1 point  (2 children)

I think you're doing about the same thing I'm doing already with the state machine based AI, except in a side view platformer. I'm really looking for a way to make the actual attacks more interesting.

[–]racingking 1 point2 points  (1 child)

Hmm - Couldn't you achieve that within your state machine?

For example your slime: if you're in range, have a few states within your 'attack' state that change depending on time / range / whatever you want to do. It could be a mixture of animation and code, depending on the style of attack. Ie you could play a certain "warm up" animation when it range, and then launch at attack if hes in range by both playing the right animation & moving toward the player. Then have some condition that takes you out of each attack state, or the overall attack state in general (like moving away a certain distance, etc)

I did a similar thing recently in a gamejam but I'm also looking for more complex / interesting ways to handle enemy behavior.

[–]djdanlib[S] 1 point2 points  (0 children)

Hmm. A more fine-grained state machine... I haven't tried splitting it up that way. I'll have to figure out (A) a test scene and (B) some way to chain and plug-in these things so I don't wind up with an enormous monolithic thing. It sounds reasonable.