Let me know what you think.
Spoiler:(sorry if the formatting gets screwed up; I typed this in notepad at home)
Proposal for Better Monster A.I. capabilities in DECORATE:
These modifiers for DECORATE would allow the creator greater control over his monsters.
For example, in a tactical mod, this would allow a smart player to draw enemies to one end
of a level, while circling back and coming in from behind. It would also make "stealth" mods
possible, as the monsters can be configured to ignore enemies that are in darker areas of the
level. The same applies to hearing. This can also be configured to make monsters that look
for the player, or monsters that forget about the player when they can't find him. I hope all
of these make sense.
NOTE:
lu = Light Units
mu = Map Units
au = Angle Units
Vision Modifiers: The monster would see the exact same as the player, and objects
not clipped to fadecolor would be visible, with these modifiers.
If none of these modifers are set, monsters see as normal. Setting one will set undefined modifiers to default values.
Spoiler:Hearing Modifiers: Fairly self-explainatory. Setting +AMBUSH makes these values useless.
/ vision_amplifier x \ //x = Amount lightlevel is increased/decreased for monster's sight
\ vision_damper x / //example: *vision_amplifier 24* //Monster treats lightlevel of 160lu like 184lu.
//example: *vision_damper 24* //Monster treats lightlevel of 160lu like 136lu
//Default x=0
vision_threshold x //x=How visible enemy must be to be sighted, above color clipping.
//example: *vision_threshold 25* //enemy will be seen if it's brightness is at least
//25 percent above fadecolor clipping.
//Default x=0
vision_chance x //x=chance out of 100 of seeing enemy if above conditions are met.
//Default x=100
If none of these modifers are set, monsters hear as normal. Setting one will set undefined modifiers to default values.
Spoiler:Behavior Modifiers: These flags define how a monster will behave towards enemies and others.
hearing_range x //x=maximum Range in mu that monster will hear sounds (weapons, falls, etc).
//Default x=512
hearing_falloff x //x=Range in mu below *hearing_range* that is subject to hearing_chance
//Default x=128
hearing_chance x //x=Chance out of 100 that sounds in *hearing_falloff* range will be heard
//Default x=50
The chase flags are mutually exclusive.
If none of these modifiers are set, monsters behave as normal.
Spoiler:---------------
persistence x //x=How many *A_Chase* steps monster will iterate through with anything
//other than *CHASE_STUPID*
look_change x //x=angle to change by when using *CHASE_RANDOM
search_raduis x //x=Radius to move around in when using *CHASE_SEARCH*
+CHASE_STUPID //If enemy is lost, monster will go to last place enemy was seen/heard, then
//go back into SPAWN state.
+CHASE_RANDOM //Monster will go to last place enemy was seen/heard, then
//continue on for *persistence* steps, changing direction by *look_change*
//degrees every SEE state. After *persistence* time is up, monster
//reverts to SPAWN state.
+CHASE_SEARCH //Monster will move in *search_radius* area for *persistence* iterations.
//Zero point is where the player was last seen.
+EMPTY_AVOID //Prevents monster from going into an area where it can see the whole room.
//For example, a bright dead-end hall with no alcoves and no enemies.
//If the hall has an opening, though, the enemy will continue down because it
//cannot see everything.
+REMEMBER //Doesn't pass over one area many times while searching.
EXAMPLES
---------------
Spoiler:
ACTOR Realistic_Imp : DoomImp 10500 //Behaves intelligently and can see a bit better than player
{
Vision_Amplifier 16 //Sees 16lu above room lightlevel
Vision_Threshold 30 //Will see player if at 30% or more brightness above clipping
Vision_Chance 75 //A 75% chance of seeing player when above conditions met
Hearing Range 512 //Will hear sounds up to 512mu away
Hearing_Falloff 256 //Begins loosing clarity at 50% of hearing range
Hearing_Chance 80 //80% chance of hearing player if range > falloff distance
Persistence //Will iterate SEE state this many times while searching
Search_Radius 256 //Will randomly patrol a circle with a 256mu radius from zero
+CHASE_SEARCH //Initiates smart search behavior as described above
+WALL_AVOID //Only looks if it cannot see the whole area.
+REMEMBER
}
ACTOR Blind_Imp : DoomImp 10501 //Good hearing, but can't see jack. Wanders around a bit.
{
Vision_Damper 64
Vision_Threshold 95
Vision_Chance 25
Hearing Range 1024
Hearing_Falloff 768
Hearing_Chance 95
Persistence 5
Look_Change 8
+CHASE_RANDOM
}
ACTOR Deaf_Imp : DoomImp 10502 //Slightly better sight than Realistic_Imp, but can't hear anything
{
Vision_Amplifier 32
Vision_Threshold 20
Vision_Chance 90
Hearing Range 64
Hearing_Falloff 0
Hearing_Chance 25
Persistence 30
Search_Radius 128
+CHASE_SEARCH
+WALL_AVOID
}
ACTOR Realistic_Zombie : ZombieMan 10503 //Realistic means bad eyes, poor hearing, and pathetic intelligence
{
Vision_Damper 48
Vision_Threshold 60
Vision_Chance 75
Hearing Range 256
Hearing_Falloff 128
Hearing_Chance 50
+CHASE_STUPID
}
ACTOR Smarter_Zombie : ZombieMan 10504 //Searches around more, sees and hears slightly better
{
Vision_Damper 40
Vision_Threshold 55
Vision_Chance 80
Hearing Range 270
Hearing_Falloff 136
Hearing_Chance 55
Persistence 12
Look_Change 48
+CHASE_RANDOM
}
