Original Post
Hi all GD.Net!
I'm new to AI programming (except pathfinding) but, as always, I'm doing my homework ;)
Now, I started to develop an action adventure game which I would describe it for it's mechanics as being in the middle between Kingdom Hearts and Prince of Persia 2008.
As in KH, players are teamed with 3 members.
And finally the time for the AI has come.
I'm using state machines, so far I'm really happy with it. For the two allies I have a "TeamMember" state which is working wonderfully, my partners are very believable mates and feel interactive.
For NPC enemies, I have an "Alert" state, which is a WIP as of today, but it's going in the right direction. For now they stand still with and when an enemy (i.e. the player) enter it's LOS it goes into "Battle" mode. In the future they will support patrolling. Another state (not written yet) will be called "Search" which happens when the NPC losts sight of the player's whereabout, and is looking for him to engage again (I find the idea of walking straight to the player's position as if it were a psychic or see through walls even when he's hiding horrendous) .
TeamMembers when engage their enemies, also go into the "Battle" state.
The game mechanics will allow melee attacks (with combos, already implemented), and magic attacks (close or distant, not implemented yet). There is a defend button. If the character hit the defend button with right timing, he will counter the attack (the combo is broken and both opponents are able to take a counter measure).
With this introduction to better understand how my game works, here comes the question of the topic:
Now what are your thoughts on the "Battle" state?, I want to hear your opinions.
Randomly smashing the attack button with random combo combinations until target is dead, eventually firing some magic seems stupid.
I was thinking of alternating proactive and reactive behaviors based on the following conditions:
* If the enemy is too aggressive in it's attack (many combos in a row, immediately started attacking), go to reactive mode. Most likely this means looking at what the player is doing or going to do, and play defensive, with a low random chance of countering.
* If the enemy is attacking, use some randomness to i.e. 1/4 of the time to go into proactive mode. But maintaining consistency with this randomness (don't switch to proactive in the middle of a defense, that would turn the reactive behavior useless and stupid). If the enemy is blocking or doing nothing, also go into proactive. The proactive state means choose a combo/spell and start smashing, while constantly evaluating if the enemy is about to perform something that could potentially change us to reactive. Note when two attacks clash, either both get damaged and blasted away, or only one attack prevails. The latter most likely scenario due to the game's logic.
What are your thoughts? Do you spot any potential problems with this design? Do you think I'm in the wrong direction?
So far the only problem I spot is that I have to be careful when my AI teammates battle against an NPC, they don't go both into reactive mode, teasing each other who's gonna start the first attack.
(By the way, the AI teammates can be replaced by cooperative multiplayer, but single player needs the AI)
I'm open to suggestions
Thanks
I'm new to AI programming (except pathfinding) but, as always, I'm doing my homework ;)
Now, I started to develop an action adventure game which I would describe it for it's mechanics as being in the middle between Kingdom Hearts and Prince of Persia 2008.
As in KH, players are teamed with 3 members.
And finally the time for the AI has come.
I'm using state machines, so far I'm really happy with it. For the two allies I have a "TeamMember" state which is working wonderfully, my partners are very believable mates and feel interactive.
For NPC enemies, I have an "Alert" state, which is a WIP as of today, but it's going in the right direction. For now they stand still with and when an enemy (i.e. the player) enter it's LOS it goes into "Battle" mode. In the future they will support patrolling. Another state (not written yet) will be called "Search" which happens when the NPC losts sight of the player's whereabout, and is looking for him to engage again (I find the idea of walking straight to the player's position as if it were a psychic or see through walls even when he's hiding horrendous) .
TeamMembers when engage their enemies, also go into the "Battle" state.
The game mechanics will allow melee attacks (with combos, already implemented), and magic attacks (close or distant, not implemented yet). There is a defend button. If the character hit the defend button with right timing, he will counter the attack (the combo is broken and both opponents are able to take a counter measure).
With this introduction to better understand how my game works, here comes the question of the topic:
Now what are your thoughts on the "Battle" state?, I want to hear your opinions.
Randomly smashing the attack button with random combo combinations until target is dead, eventually firing some magic seems stupid.
I was thinking of alternating proactive and reactive behaviors based on the following conditions:
* If the enemy is too aggressive in it's attack (many combos in a row, immediately started attacking), go to reactive mode. Most likely this means looking at what the player is doing or going to do, and play defensive, with a low random chance of countering.
* If the enemy is attacking, use some randomness to i.e. 1/4 of the time to go into proactive mode. But maintaining consistency with this randomness (don't switch to proactive in the middle of a defense, that would turn the reactive behavior useless and stupid). If the enemy is blocking or doing nothing, also go into proactive. The proactive state means choose a combo/spell and start smashing, while constantly evaluating if the enemy is about to perform something that could potentially change us to reactive. Note when two attacks clash, either both get damaged and blasted away, or only one attack prevails. The latter most likely scenario due to the game's logic.
What are your thoughts? Do you spot any potential problems with this design? Do you think I'm in the wrong direction?
So far the only problem I spot is that I have to be careful when my AI teammates battle against an NPC, they don't go both into reactive mode, teasing each other who's gonna start the first attack.
(By the way, the AI teammates can be replaced by cooperative multiplayer, but single player needs the AI)
I'm open to suggestions
Thanks