Indie Dev

Hello Guest!. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, sell your games, upload content, as well as connect with other members through your own private inbox!

Evented AI

As I am making an evented on-map battle system, this will require the creation of AI through events as well. How would you go about handling this? Personally, I envision I'm going to be using a lot of conditional branches and behaviour patterns. Eg melee enemies just get as close as they can to the player then hit, whilst ranged enemies move around until you are in line of sight, then shoot.
 

samorious

Towns Guard
Godamn man that sounds awesome! I think you are right, I also want to implement it but I have the idea its going to take a lot of time. Have any idea (if implemented) how you are going to link stats and skills to it(higher strength more damage, critical hit) and how you are going to make it so every weapon depending on its stats does different damage?

Good luck with it, if you'd like to share it I would be very happy XD
 
Basically, that stat change could be achieved through the manipulation of variables and a formula that uses the variable. Whether there is a plugin command that can get an equipped weapon's stat I don't know (this appears to be a weakness of RM as it doesn't appear to allow for this by default, just if X is equipped) - otherwise, I'd need a plugin.

The basic idea though is to say $damageToPlayer = $enemyWeaponAttack - $playerDefense

Then

$playerHealth = $playerHealth - $damageToPlayer
 

samorious

Towns Guard
Basically, that stat change could be achieved through the manipulation of variables and a formula that uses the variable. Whether there is a plugin command that can get an equipped weapon's stat I don't know (this appears to be a weakness of RM as it doesn't appear to allow for this by default, just if X is equipped) - otherwise, I'd need a plugin.

The basic idea though is to say $damageToPlayer = $enemyWeaponAttack - $playerDefense

Then

$playerHealth = $playerHealth - $damageToPlayer
aah okay cool, looking forward to see it in action
 

Essy

Towns Guard
Xy$
0.00
Depending on how crazy you want to be you could try to implement the minimax algorithm through common events and utilize it to select enemy actions.
Then you'd only need two things. 1. A list of actions an enemy can take, 2. A common event function to estimate how valuable a player action is.

This is a very eccentric suggestion.
You could get a horrendously rough estimate by making the minimax comparisons with the character/enemy a "square closer each time"
...
It's kinda hard to describe this over forum.


Conditional Branches are acceptable just less dynamic.


For other ideas check this out.
Also, welcome to your first step into the madness of AI. : )
 
Top