How to make "smart" enemies?
jblb2424
Member Posts: 65
Hello :P
My game I am currently making is very simple; a guy with a sword fights other enemies with various weapons(sword, bows, ect.). However, I am having trouble with making my enemies seem intelligent and adding human qualities to them. Does anyone have any tips towards giving my enemies intelligence to seem human? I can give my enemies simple behaviors to react to my character's actions, but it seems robotic and predicable. Any tips? Thanks!
My game I am currently making is very simple; a guy with a sword fights other enemies with various weapons(sword, bows, ect.). However, I am having trouble with making my enemies seem intelligent and adding human qualities to them. Does anyone have any tips towards giving my enemies intelligence to seem human? I can give my enemies simple behaviors to react to my character's actions, but it seems robotic and predicable. Any tips? Thanks!
Comments
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
Lots of options, but here's a freebie. On your hero "attack" trigger, whenever he does the attack, have it set a variable to attack=1. Then, on your monster, set an actor attribute integer for BlockChance.
Then still on the monster actor, have a rule that triggers whenever HeroAttack = 1.
in the first line of the rule, have it set the chance of blocking. Say you want a 33% chance of block... you have it set the block chance by doing a random roll. so do Change attribute BlockChacne to random(1-3).
This will set the BlockChance to 1, 2 or 3.
Then have a nother rule that says
If BlockChance = 2
Then
Do block (come up with a block animation, and dont let them take damage this turn, or have them take reduced dmg
Else
Do nothing.
Then after the rule, change the attribute HeroAttack back to 0 to reset it for the next attack.
So to recap the logic, what will happen is every time the hero attacks, it turns on the HeroAttack trigger, then monster will do a random 1-3 roll on if to block if the HeroAttack =1, If it gets a 2, then it blocks, if not, it does nothing. Then you turn the HeroAttack back off.
This concept can be applied to tons of reactive abilities or features. The triggers can be from tons of different sources.
I just got done with a marathon night of GS so im still in programming mode, i hope this all made sense. Goodluck!!
Dwarf Miner
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS