Creature AI
Posted: Sat Jun 19, 2010 4:04 am
So, I have been working out a quick layout for how monsters AI could work in Dungeon Master, 3D or not..
Start Sleeping:
When fatigue or hp < 25 %
When fear < 50 %
No enemies in sight
At least one follower awake and fatigue or hp > 5 %
(While eating, view and smell are reduced 100%)
Stop Sleeping:
When fatigue and hp >= 100 %
When food < 25 %
Friend nearby makes warning
Getting damaged
Start Eating:
When food < 25 %
No enemies in sight
When fear < 50 %
(While eating, view and smell are reduced 50%)
Stop Eating:
When food >= 100 %
Enemies in sight
Start Guarding:
No other friends are guarding
At least on friends are sleeping or eating
When food > 10 %
When fatigue > 10 %
(While guarding, view and smell are increased 50%)
When fear < 25 %
Stop Guarding:
When food < 10 %
When fatigue < 10 %
When enemies in sight (make warning)
No friends are sleeping or eating
Start Fleeing:
When enemies in sight and..
Enemy value (0% - 100%)
Fear value (0% - 100%)
when (Enemy value) * (Fear value) are higher than 75 %
Stop Fleeing:
When no enemies in sight
Enemy value (0% - 100%)
Fear value (0% - 100%)
when (Enemy value) * (Fear value) are lower than 40 %
Start Playing:
When bored > 75 %
When friends bored > 75 %
Stop playing:
When bored <= 0 %
When friends bored <= 0 %
Start Attacking:
when (Enemy value) * (100% - (Fear value)) are higher than 50 %
Stop Attacking:
when (Enemy value) * (Fear value) are higher than 75 %
Start Following Enemy (not attacking):
when (Enemy value) * (100% - (Fear value)) are higher than 25 %
(While following, view and smell are increased 50%)
End Following Enemy:
when (Enemy value) * (100% - (Fear value)) are lower than 5 %
Rang values (highest priority to do):
Fleeing 100
Attacking 85
Guarding 40
Eating 20
Sleeping 20
Playing 10
Following Enemy 10
These last values can always be changed depending on the monster type. And I think this is here the real AI comes into play by changing them a bit randomly and that the creatures maybe change them by him self by learning what works best for him..
Start Sleeping:
When fatigue or hp < 25 %
When fear < 50 %
No enemies in sight
At least one follower awake and fatigue or hp > 5 %
(While eating, view and smell are reduced 100%)
Stop Sleeping:
When fatigue and hp >= 100 %
When food < 25 %
Friend nearby makes warning
Getting damaged
Start Eating:
When food < 25 %
No enemies in sight
When fear < 50 %
(While eating, view and smell are reduced 50%)
Stop Eating:
When food >= 100 %
Enemies in sight
Start Guarding:
No other friends are guarding
At least on friends are sleeping or eating
When food > 10 %
When fatigue > 10 %
(While guarding, view and smell are increased 50%)
When fear < 25 %
Stop Guarding:
When food < 10 %
When fatigue < 10 %
When enemies in sight (make warning)
No friends are sleeping or eating
Start Fleeing:
When enemies in sight and..
Enemy value (0% - 100%)
Fear value (0% - 100%)
when (Enemy value) * (Fear value) are higher than 75 %
Stop Fleeing:
When no enemies in sight
Enemy value (0% - 100%)
Fear value (0% - 100%)
when (Enemy value) * (Fear value) are lower than 40 %
Start Playing:
When bored > 75 %
When friends bored > 75 %
Stop playing:
When bored <= 0 %
When friends bored <= 0 %
Start Attacking:
when (Enemy value) * (100% - (Fear value)) are higher than 50 %
Stop Attacking:
when (Enemy value) * (Fear value) are higher than 75 %
Start Following Enemy (not attacking):
when (Enemy value) * (100% - (Fear value)) are higher than 25 %
(While following, view and smell are increased 50%)
End Following Enemy:
when (Enemy value) * (100% - (Fear value)) are lower than 5 %
Rang values (highest priority to do):
Fleeing 100
Attacking 85
Guarding 40
Eating 20
Sleeping 20
Playing 10
Following Enemy 10
These last values can always be changed depending on the monster type. And I think this is here the real AI comes into play by changing them a bit randomly and that the creatures maybe change them by him self by learning what works best for him..