OBD:BINA/OBJC/CMBT: Difference between revisions

From OniGalore
< OBD:BINA‎ | OBJC
Jump to navigation Jump to search
m (→‎Alarm behavior: cosmetics)
m (added family to footer template call)
 
(25 intermediate revisions by 6 users not shown)
Line 1: Line 1:
{{OBD OBJC Header|align=center|type=CMBT|prev=CHAR|next=CONS|name=Combat profile|onistuff=b_cb}}
{{OBD OBJC Header | align=center | type=CMBT | prev=CHAR | next=CONS | name=Combat Profile | stuff=b_cb}}




----
==File description==
----
===General settings===
http://www6.fh-eberswalde.de/user/dkriesch/onistuff/images/bin_r_cb.gif
[[image:bin_r_cb.gif]]
 
 
{{Table}}
{{OBDth}}
{{OBDtr| 0x00 | 4CC      |FF0000| 43 4A 42 4F | OBJC      | objects }}
{{OBDtr| 0x04 | int32    |FFFF00| B0 0D 00 00 | 35628    | length (in bytes) to end of OBJC from here }}
{{OBDtr| 0x08 | int32    |00FF00| 27 00 00 00 | 39        | object list version }}
{{OBDtr| 0x0C | int32    |00FFFF| B4 00 00 00 | 180      | size of the following object in bytes }}
{{OBDtrBK|First object (black outline)}}
{{OBDtr| 0x00 | 4CC      |FFC8C8| 54 42 4D 43 | TBMC      | combat }}
{{OBDtr| 0x04 | int32    |FFFFC8| 70 01 00 00 | 368      | object ID }}
{{OBDtr| 0x08 | int32    |C8FFC8| 00 00 00 00 | 0        | object flags }}
{{OBDtr| 0x0C | float    |C8FFFF| 13 55 5F C3 |-223.332321| x-position of handle }}
{{OBDtr| 0x10 | float    |C8FFFF| D4 A8 8E 41 | 17.832436 | y-position of handle }}
{{OBDtr| 0x14 | float    |C8FFFF| C3 05 E9 C2 |-116.511253| z-position of handle }}
{{OBDtr| 0x18 | float    |FFC8FF| 00 00 00 00 | 0.000000  | x-rotation of handle in degrees }}
{{OBDtr| 0x1C | float    |FFC8FF| 00 00 00 00 | 0.000000  | y-rotation of handle in degrees }}
{{OBDtr| 0x20 | float    |FFC8FF| 00 00 00 00 | 0.000000  | z-rotation of handle in degrees }}
{{OBDtr2|0x24 | char[64] |FFC800| Stand_and_Fire          | name }}
{{OBDtr| 0x64 | int32    |C800C8| 00 00 00 00 | 0        | combat ID (looked up from [[OBD:BINA/OBJC/CHAR|Character.BINA]]) }}
|}


===Behavior part===
{{Table}}
{{OBDth}}
{{OBDtr| 0x68 | int32    |C87C64| 02 00 00 00 | 2        | long range behavior; the following values are possible (values in dec):


{|{{OBDtable}}
:00 - none
|align=center|
:01 - stare
{|{{OBDtable}}
:02 - hold and fire
|- ALIGN=CENTER BGCOLOR="#FFDDBB"
:03 - firing charge
| WIDTH=15% | <B>Raw hex</B>
:04 - melee
| WIDTH=15% | <B>Value</B>
:05 - Barabbas shoot
| WIDTH=70% | <B>Meaning</B>
:06 - Barabbas advance
|-
:07 - Barabbas melee
| BGCOLOR="#FFC8C8" | 54 42 4D 43
:08 - Superninja fireball
| TBMC
:09 - Superninja advance
| ALIGN=LEFT | combat
:10 - Superninja melee
|-
:11 - run for alarm (not used in Oni)
| BGCOLOR="#FFFFC8" | 70 01 00 00
:12 - Mutant Muro melee
| 368
:13 - Muro thunderbolt
| ALIGN=LEFT | old file ID
}}
|-
{{OBDtr| 0x6C | int32    |B0C3D4| 02 00 00 00 | 2         | medium range behavior; values as above }}
| BGCOLOR="#C8FFC8" | 00 00 00 00
{{OBDtr| 0x70 | int32    |E7CEA5| 02 00 00 00 | 2         | short range behavior (hand to hand behavior); values as above }}
| 0
{{OBDtr| 0x74 | int32    |FFDDDD| 02 00 00 00 | 2         | medium retreat behavior; values as above }}
| ALIGN=LEFT | unknown
{{OBDtr| 0x78 | int32    |64AAAA| 02 00 00 00 | 2         | long retreat behavior; values as above }}
|-
| BGCOLOR="#C8FFFF" | 13 55 5F C3
| -223.332321
| ALIGN=LEFT | x-position of ???
|-
| BGCOLOR="#C8FFFF" | D4 A8 8E 41
| 17.832436
| ALIGN=LEFT | y-position (height) of ???
|-
| BGCOLOR="#C8FFFF" | C3 05 E9 C2
| -116.511253
| ALIGN=LEFT | z-position of ???
|-
| BGCOLOR="#FFC8FF" | 00 00 00 00
| 0.000000
| ALIGN=LEFT | rotation on the x-axis in degrees
|-
| BGCOLOR="#FFC8FF" | 00 00 00 00
| 0.000000
| ALIGN=LEFT | rotation on the y-axis in degrees
|-
| BGCOLOR="#FFC8FF" | 00 00 00 00
| 0.000000
| ALIGN=LEFT | rotation on the z-axis in degrees
|-
| BGCOLOR="#FFC800" COLSPAN=2 | <TT>Stand_and_Fire</TT>
| ALIGN=LEFT | space for notes
|-
| BGCOLOR="#C800C8" | 00 00 00 00
| 0
| ALIGN=LEFT | combat ID (looked up from [[OBD:BINA/OBJC/CHAR|CJBO'''Character'''.BINA]])
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#808080"
| COLSPAN=3 | <FONT SIZE=2 COLOR="#FFFFFF">Below follows the behavior part.</FONT>
|- VALIGN=TOP
| BGCOLOR="#C87C64" | 02 00 00 00
| 2
| ALIGN=LEFT | long range behavior; the following behavior values are possible (values in dec):<BR>&nbsp;<BR>
{| BORDER=0 CELLPADDING=0 CELLSPACING=0
|- VALIGN=TOP
| ALIGN=RIGHT | 0 -&nbsp;
| none
|- VALIGN=TOP
| ALIGN=RIGHT | 1 -&nbsp;
| stare
|- VALIGN=TOP
| ALIGN=RIGHT | 2 -&nbsp;
| hold and fire
|- VALIGN=TOP
| ALIGN=RIGHT | 3 -&nbsp;
| firing charge
|- VALIGN=TOP
| ALIGN=RIGHT | 4 -&nbsp;
| melee
|- VALIGN=TOP
| ALIGN=RIGHT | 5 -&nbsp;
| Barabbas shoot
|- VALIGN=TOP
| ALIGN=RIGHT | 6 -&nbsp;
| Barabbas advance
|- VALIGN=TOP
| ALIGN=RIGHT | 7 -&nbsp;
| Barabbas melee
|- VALIGN=TOP
| ALIGN=RIGHT | 8 -&nbsp;
| Superninja fireball
|- VALIGN=TOP
| ALIGN=RIGHT | 9 -&nbsp;
| Superninja advance
|- VALIGN=TOP
| ALIGN=RIGHT | 10 -&nbsp;
| Superninja melee
|- VALIGN=TOP
| ALIGN=RIGHT | 11 -&nbsp;
| run for alarm (not used in Oni)
|- VALIGN=TOP
| ALIGN=RIGHT | 12 -&nbsp;
| Mutant Muro melee
|- VALIGN=TOP
| ALIGN=RIGHT | 13&nbsp;-&nbsp;
| Muro thunderbolt
|}<BR>&nbsp;
|-
| BGCOLOR="#B0C3D4" | 02 00 00 00
| 2
| ALIGN=LEFT | medium range behavior; values as above
|-
| BGCOLOR="#E7CEA5" | 02 00 00 00
| 2
| ALIGN=LEFT | hand to hand behavior (short range behavior); values as above
|-
| BGCOLOR="#FFDDDD" | 02 00 00 00
| 2
| ALIGN=LEFT | medium retreat behavior; values as above
|-
| BGCOLOR="#64AAAA" | 02 00 00 00
| 2
| ALIGN=LEFT | long retreat behavior; values as above
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#808080"
| COLSPAN=3 | <FONT SIZE=2 COLOR="#FFFFFF">Below follows the combat part.</FONT>
|-
| BGCOLOR="#EBEBEB" | 00 00 F0 42
| 120.000000
| ALIGN=LEFT | maximal combat range; you can make it visible with the script command <FONT COLOR="#0000FF">ai2_showcombatranges = 1</FONT>
|- VALIGN=TOP
| BGCOLOR="#8C8CCC" | 01 00 00 00
| 1
| ALIGN=LEFT | melee overide; when 1 or higher, AI automatically switches from gunfire to melee on short distance; the following values are possible (values in dec):<BR>&nbsp;<BR>0 - no<BR>1 - if punched<BR>2 - (canceled)<BR>3 - short range<BR>4 - medium range<BR>5 - always melee<BR>&nbsp;
|- VALIGN=TOP
| BGCOLOR="#FF00C8" | 00 00 00 00
| 0
| ALIGN=LEFT | if no gun; ( when 1, AI tries to run if they don't hold weapon) (when 2, unknown) (when 3 and higher, they stand and seems to have no pathfinding logic); the following values are possible (values in dec):<BR>&nbsp;<BR>0 - melee<BR>1 - retreat<BR>2 - run to alarm<BR>&nbsp;
|-
| BGCOLOR="#F0F096" | 00 00 20 42
| 40.000000
| ALIGN=LEFT | minimal combat range; you can make it visible with the script command <FONT COLOR="#0000FF">ai2_showcombatranges = 1
|-
| BGCOLOR="#00C864" | 00 00 48 43
| 200.000000
| ALIGN=LEFT | pursuit distance
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#808080"
| COLSPAN=3 | <FONT SIZE=2 COLOR="#FFFFFF">Below follows the non-combatant part.</FONT>
|-
| BGCOLOR="#00C8FF" | 58 02 00 00
| 600
| ALIGN=LEFT | panic hurt (time in 1/60 seconds)
|-
| BGCOLOR="#00C8FF" | 84 03 00 00
| 900
| ALIGN=LEFT | panic gunfire (time in 1/60 seconds)
|-
| BGCOLOR="#00C8FF" | 58 02 00 00
| 600
| ALIGN=LEFT | panic melee (time in 1/60 seconds)
|-
| BGCOLOR="#00C8FF" | B0 04 00 00
| 1200
| ALIGN=LEFT | panic sight (time in 1/60 seconds)
|}
|}
===Combat part===
{{Table}}
{{OBDth}}
{{OBDtr| 0x7C | float    |EBEBEB| 00 00 F0 42 | 120.000000| long/medium range; distance of the border between long and medium ranges; you can make it visible with the script command *ai2_showcombatranges <nowiki>=</nowiki> 1* }}
{{OBDtr| 0x80 | int32    |8C8CCC| 01 00 00 00 | 1        | melee override; see below; the following values are possible:
:0 - nothing
:1 - if punched
:2 - (canceled)
:3 - short Crange
:4 - medium range
:5 - always melee
}}
{{OBDtr| 0x84 | int32    |FF00C8| 00 00 00 00 | 0        | if no gun; behavior of AI which doesn't have a gun in its hand ( but can have it holstered); the following values are possible:
:0 - melee
:1 - retreat
:2 - run to alarm
}}
{{OBDtr| 0x88 | float    |F0F096| 00 00 20 42 | 40.000000 | medium/short range; distance of the border between medium and short ranges; you can make it visible with the script command *ai2_showcombatranges <nowiki>=</nowiki> 1* }}
{{OBDtr| 0x8C | float    |00C864| 00 00 48 43 | 200.000000| pursuit distance; see below for info }}
|}
|}




----
===Non-combatant part===
==Alarm behavior==
{{Table}}
These settings affect the behavior of an AI that's running for a console (e.g., script command '''ai2_doalarm''').
{{OBDth}}
{{OBDtr| 0x90 | int32    |00C8FF| 58 02 00 00 | 600      | panic hurt (time in 1/60 seconds) }}
{{OBDtr| 0x94 | int32    |00C8FF| 84 03 00 00 | 900      | panic gunfire (time in 1/60 seconds) }}
{{OBDtr| 0x98 | int32    |00C8FF| 58 02 00 00 | 600      | panic melee (time in 1/60 seconds) }}
{{OBDtr| 0x9C | int32    |00C8FF| B0 04 00 00 | 1200      | panic sight (time in 1/60 seconds) }}
|}
 


;Offsets relative to start of CMBT chunk
===Alarm part===
{{Table}}
{{Table}}
{{OBD_Table_Header}}
{{OBDth}}
|- align=center
{{OBDtr| 0xA0 | float   |C80040| 00 00 96 43 | 300.000000| alarm search distance }}
| 0xA0
{{OBDtr| 0xA4 | float   |C80040| 00 00 A0 42 | 80.000000 | alarm enemy ignore distance }}
| float
{{OBDtr| 0xA8 | float   |FFCD96| 00 00 00 00 | 0.000000  | alarm enemy attack distance }}
| BGCOLOR="#C80040" | 00 00 96 43
{{OBDtr| 0xAC | int32    |C8C864| 1E 00 00 00 | 30       | alarm damage threshold }}
| 300.000000
{{OBDtr| 0xB0 | int32    |C8C864| 68 01 00 00 | 360       | alarm fight timer }}
| ALIGN=LEFT | alarm search distance (defunct?)
|- align=center
| 0xA4
| float
| BGCOLOR="#C80040" | 00 00 A0 42
| 80.000000
| ALIGN=LEFT | alarm enemy ignore distance (see below)
|- align=center
| 0xA8
| float
| BGCOLOR="#FFCD96" | 00 00 00 00
| 0
| ALIGN=LEFT | alarm enemy attack distance (see below)
|- align=center
| 0xAC
| long
| BGCOLOR="#C8C864" | 1E 00 00 00
| 30
| ALIGN=LEFT | alarm damage threshold; don't exactly know what it is (see below)
|- align=center
| 0xB0
| long
| BGCOLOR="#C8C864" | 68 01 00 00
| 360
| ALIGN=LEFT | alarm fight timer; same as fight timer in [[OBD:ONCC|ONCC]], but this works while AI is in run for alarm mode
|}
|}


These settings affect the behavior of an AI that's running for a console (e.g., script command *ai2_doalarm*). For an example of how flexible the AI is when using alarm behavior, see [https://www.youtube.com/watch?v=CkzguNxjGEs this demo from Loser] where an AI completes Chapter 1.
;alarm search distance
:area around AI, where engine checks if there is some console with 40 bit (see [[OBD:BINA/OBJC/CONS|CONS]]).
;Alarm enemy ignore distance
;Alarm enemy ignore distance
:This one specifies an "ignore range". Enemies which are inside this range are NOT ignored. Ignored are those ''outside'' this range.
:This one specifies an "ignore range". Enemies which are inside this range are not ignored but AI doesn't attack them.  
::(''well, naturally'' [[User:Geyser|geyser]])
:When AI doesn't ignore it does NOT mean it attacks. It only knows when there's an enemy nearby and it tries to face that enemy while still on the move. So it runs in a weird way.
::(''that's probably meant for more efficient auto-blocking or something'' [[User:Geyser|geyser]])
;Alarm enemy attack distance
;Alarm enemy attack distance
:WHY - IS - IT - '''ZERO'''??? Seriously. It is ''really'' set to zero by default.
:Zero by default.
::(''same reason as for the weapon dodging, heh'' [[User:Geyser|geyser]])
:This one specifies an "attack range" around an AI running for an alarm. When there is an enemy inside, AI stops running for the console and attack the enemy (if AI knows about him, of course)
:This one specifies another range around an AI that's running for a console.
:Nevertheless AI still keeps in mind that it should run for the console. So when there is no enemy inside this range and fight timer runs out, AI resumes running to the specified console.
:When there is an enemy inside this range and the AI ''knows'' about that enemy (i.e., doesn't ignore it due to the "ignore" range above), it will stop running for the console and attack the enemy.
;Fight timer
:But, at the same time, AI still keeps in mind that it should run for alarm. So when there is no enemy inside this range, AI resumes running to the specified console.
:When AI, which is running for the console, is engaged in a fight and enemy manages to disappear (either by phase-cloak or simply by hiding behind some corner), AI tries to chase him or looks for him. Alarm timer specifies how long should AI chase/look for the enemy. For chasing, timer starts when the enemy is outside *Alarm enemy attack distance*. Of course when the enemy escapes even from *Alarm enemy ignore range*, AI abandons him automatically.
;Note
:So if you have "ignore range" > "attack range" > 0, you get what I was searching for (for half a year or so):
::If an enemy is running for an alarm and you get too close, they'll stop, turn and start fighting with you.
::When you are far enough (or dead), they'll resume running ^_^'.
:You don't know how wicked this feature is until you've tried it out yourself.
::^_-
;Alarm damage threshold
;Alarm damage threshold
:it has something to do with run-to-alarm abortion, but I don't quite get it.
:Specifies how long AI, which is running for the console, remembers someone hurt it. Until this timer runs away, AI doesn't tend to use console. It only stays in fight stance near console, ready to fight. If someone hurts AI which is running for the console, then escapes and then tries to hurt it again while this timer isn't finished yet, AI remembers him and initatively attacks him the moment he steps inside *Alarm enemy attack distance*.
:It looks like an amount of damage when AI exits run for alarm state and acts as usual.
----
:But damage taken while fighting someone within the "alarm enemy attack range" doesn't count.
Whole alarm logic can be tripped by:
::[[User:Loser|Loser]] 11:31, 17 December 2006 (CET)
* *ai2_doalarm* command (suitable for geyser's rugby)
* *run for alarm* (0b) behavior, altough this behavior alone does NOTHING, it just turns on *alarm search distance*. If there is no console with 40 bit in reach, AI stands still and just stares.
* *run to alarm* if no gun event ( only when AI is unarmed ), again it turns on *alarm search distance*, but this time AI can do normal actions (attack, hunt) if there is no 40 bit console within reach.
* ???Find alarm??? pm_pursue action, still unknown
----
----
:As for the "alarm damage threshold", what would make sense to me is the following:
:*an AI is supposed to run for a console
:*there's an enemy in its way (within the ranges above)
:*it stops to fight that enemy
:*it takes more damage than a certain threshold
:*it says "So long, sucker" and resumes with its alarm job
:*(''overriding'' the "attack" range, and maybe the "ignore" range as well)
:So, it's rather the opposite of your idea, Loser:
:*alarm running would have top priority
:*it's the ''fighting'' that would be aborted
:Doesn't that seem likely? I haven't checked.
::[[User:Geyser|geyser]] 15:47, 17 December 2006 (CET)
:Another possibility (perhaps more likely), is suggested by the Big Blue Bow Beta WMDD below.
:Namely, the "damage threshold" and the timer may be meant to work together
::(note that they're grouped under the "Attack If Knockdown" label)
:The idea here is that if there's a physical contact between the runner and an enemy
::(the enemy attacking the runner)
:then the runner will stop running and start defending itself
::(provided the damage it received was above the threshold)
:and will resume running after a certain delay (the timer).
:Obviously, that "attack if knockdown" logic would be somewhat redundant if the attack range is large enough.
:If an AI has already stopped running for a console and is engaging enemies, what use is the "knockdown" check?
:So I'm not sure, maybe it's the first possibility after all.
::[[User:Geyser|geyser]] 15:47, 17 December 2006 (CET)
:Boy, that is ''so'' promising for CTF and Rugby... Thankee, Loser ^^
::[[User:Geyser|geyser]] 15:47, 17 December 2006 (CET)


==Further info==
===About pursuit distance===
First of all, pursuit is NOT when you have been seen and now running away. If you do that, AI is in *combat* mode, not *pursue* mode. You are pursued only when you have NOT been seen by central vision field (see [[OBD:ONCC|ONCC]]). So if some enemy does sound that touches AI's sound detection sphere, or when some enemy interferes with AI's peripheral vision field, AI goes into pursue mode with him. In this mode AI uses special behavior for investigating. According to the EXE, possibilities are (dunno if it is in proper order, it is raw EXE rip):
:*Find Alarm
:*Keep Looking
:*Return To Job
:*Glance
:*Hunt - not implemented in Oni (accidentaly I have read error message in Manplant a few months ago saying that)
:*Move
:*Look
:*Wait
:*GoTo
:*Forget
What AI does while in pursuit mode depends on the last values in [[OBD:BINA/OBJC/CHAR|CHAR]].Go there for further info.


So...what is the pursuit distance??? It is distance that is AI allowed to travel from its original location for *pursue* purposes. Set it high and AI can run through whole level if it hears or spots something. Set it low and AI will do just a few steps in a direction of disturbing action.
----
----


==Blue Box Beta WMDD==
===About melee override===
http://www6.fh-eberswalde.de/user/dkriesch/oni/bina_combat.gif
First something about minimal shooting distance.It is in the [[OBD:ONWC|ONWC]] and determines closest range for AI to fire that weapon. If enemy goes closer, AI stops shooting and tends to run away until it reahes minimal shooting distance again.
Now if you set this minimal shooting distance higher than it is originally (for example try 200) you can have some fun chasing AIs as they are running away from you.
 
Point is that if you set melee override to some range (for example 03 - short range) and then try it, you will see that the moment you are closer than minimal shooting distance AND you are in range which enables it (short range in this example) AI will switch to melee mode instead of running away.
 
So you can make short range for example 200 units big and set min.shoot.dist. 100 units big and have melee override 03 -short range. AI will then shoot at you even if you are inside short range, but the moment you ecounter min.shoot.dist. it switches to melee.
 
How it switches back to weapon when you run away back into min.shoot.dist. is not clear. So far it happens automatically after some time. Where is timer for that??? Let us know, if you know....
 
--[[User:Loser|Loser]] 09:03, 29 July 2007 (CEST)
 
Try using ai2_report on a character, I noticed a timer next to the mode or something of that sort - Gumby :)
 
==Dialogs from level0_Tools==
 
[[Image:Tool dialog - Choose Combat.png]]
 
 
[[Image:Tool dialog - Edit Combat.png]]
 


{{OBD OBJC Footer | type=CMBT | prev=CHAR | next=CONS | name=Combat profile | family=Level}}


----
{{OBD}}
----
{{OBD TXT|align=center|size=2|onistuff=bina_combat}}
----
----
{{OBD OBJC Footer|align=center|type=CMBT|prev=CHAR|next=CONS|name=Combat profile}}

Latest revision as of 21:17, 9 December 2023

ONI BINARY DATA
AKVA << Other file types >> CBPI
BINA : Binary data
TMBD << Other BINA >> ONIE
OBJC : Objects
CHAR << Other OBJC >> CONS
CMBT : Combat Profile
XML tutorial
Overview @ Oni Stuff
OBD.png


File description

General settings

Bin r cb.gif


Offset Type Raw Hex Value Description
0x00 4CC 43 4A 42 4F OBJC objects
0x04 int32 B0 0D 00 00 35628 length (in bytes) to end of OBJC from here
0x08 int32 27 00 00 00 39 object list version
0x0C int32 B4 00 00 00 180 size of the following object in bytes
First object (black outline)
0x00 4CC 54 42 4D 43 TBMC combat
0x04 int32 70 01 00 00 368 object ID
0x08 int32 00 00 00 00 0 object flags
0x0C float 13 55 5F C3 -223.332321 x-position of handle
0x10 float D4 A8 8E 41 17.832436 y-position of handle
0x14 float C3 05 E9 C2 -116.511253 z-position of handle
0x18 float 00 00 00 00 0.000000 x-rotation of handle in degrees
0x1C float 00 00 00 00 0.000000 y-rotation of handle in degrees
0x20 float 00 00 00 00 0.000000 z-rotation of handle in degrees
0x24 char[64] Stand_and_Fire name
0x64 int32 00 00 00 00 0 combat ID (looked up from Character.BINA)

Behavior part

Offset Type Raw Hex Value Description
0x68 int32 02 00 00 00 2 long range behavior; the following values are possible (values in dec):
00 - none
01 - stare
02 - hold and fire
03 - firing charge
04 - melee
05 - Barabbas shoot
06 - Barabbas advance
07 - Barabbas melee
08 - Superninja fireball
09 - Superninja advance
10 - Superninja melee
11 - run for alarm (not used in Oni)
12 - Mutant Muro melee
13 - Muro thunderbolt
0x6C int32 02 00 00 00 2 medium range behavior; values as above
0x70 int32 02 00 00 00 2 short range behavior (hand to hand behavior); values as above
0x74 int32 02 00 00 00 2 medium retreat behavior; values as above
0x78 int32 02 00 00 00 2 long retreat behavior; values as above


Combat part

Offset Type Raw Hex Value Description
0x7C float 00 00 F0 42 120.000000 long/medium range; distance of the border between long and medium ranges; you can make it visible with the script command *ai2_showcombatranges = 1*
0x80 int32 01 00 00 00 1 melee override; see below; the following values are possible:
0 - nothing
1 - if punched
2 - (canceled)
3 - short Crange
4 - medium range
5 - always melee
0x84 int32 00 00 00 00 0 if no gun; behavior of AI which doesn't have a gun in its hand ( but can have it holstered); the following values are possible:
0 - melee
1 - retreat
2 - run to alarm
0x88 float 00 00 20 42 40.000000 medium/short range; distance of the border between medium and short ranges; you can make it visible with the script command *ai2_showcombatranges = 1*
0x8C float 00 00 48 43 200.000000 pursuit distance; see below for info


Non-combatant part

Offset Type Raw Hex Value Description
0x90 int32 58 02 00 00 600 panic hurt (time in 1/60 seconds)
0x94 int32 84 03 00 00 900 panic gunfire (time in 1/60 seconds)
0x98 int32 58 02 00 00 600 panic melee (time in 1/60 seconds)
0x9C int32 B0 04 00 00 1200 panic sight (time in 1/60 seconds)


Alarm part

Offset Type Raw Hex Value Description
0xA0 float 00 00 96 43 300.000000 alarm search distance
0xA4 float 00 00 A0 42 80.000000 alarm enemy ignore distance
0xA8 float 00 00 00 00 0.000000 alarm enemy attack distance
0xAC int32 1E 00 00 00 30 alarm damage threshold
0xB0 int32 68 01 00 00 360 alarm fight timer


These settings affect the behavior of an AI that's running for a console (e.g., script command *ai2_doalarm*). For an example of how flexible the AI is when using alarm behavior, see this demo from Loser where an AI completes Chapter 1.

alarm search distance
area around AI, where engine checks if there is some console with 40 bit (see CONS).
Alarm enemy ignore distance
This one specifies an "ignore range". Enemies which are inside this range are not ignored but AI doesn't attack them.
Alarm enemy attack distance
Zero by default.
This one specifies an "attack range" around an AI running for an alarm. When there is an enemy inside, AI stops running for the console and attack the enemy (if AI knows about him, of course)
Nevertheless AI still keeps in mind that it should run for the console. So when there is no enemy inside this range and fight timer runs out, AI resumes running to the specified console.
Fight timer
When AI, which is running for the console, is engaged in a fight and enemy manages to disappear (either by phase-cloak or simply by hiding behind some corner), AI tries to chase him or looks for him. Alarm timer specifies how long should AI chase/look for the enemy. For chasing, timer starts when the enemy is outside *Alarm enemy attack distance*. Of course when the enemy escapes even from *Alarm enemy ignore range*, AI abandons him automatically.
Alarm damage threshold
Specifies how long AI, which is running for the console, remembers someone hurt it. Until this timer runs away, AI doesn't tend to use console. It only stays in fight stance near console, ready to fight. If someone hurts AI which is running for the console, then escapes and then tries to hurt it again while this timer isn't finished yet, AI remembers him and initatively attacks him the moment he steps inside *Alarm enemy attack distance*.

Whole alarm logic can be tripped by:

  • *ai2_doalarm* command (suitable for geyser's rugby)
  • *run for alarm* (0b) behavior, altough this behavior alone does NOTHING, it just turns on *alarm search distance*. If there is no console with 40 bit in reach, AI stands still and just stares.
  • *run to alarm* if no gun event ( only when AI is unarmed ), again it turns on *alarm search distance*, but this time AI can do normal actions (attack, hunt) if there is no 40 bit console within reach.
  • ???Find alarm??? pm_pursue action, still unknown

Further info

About pursuit distance

First of all, pursuit is NOT when you have been seen and now running away. If you do that, AI is in *combat* mode, not *pursue* mode. You are pursued only when you have NOT been seen by central vision field (see ONCC). So if some enemy does sound that touches AI's sound detection sphere, or when some enemy interferes with AI's peripheral vision field, AI goes into pursue mode with him. In this mode AI uses special behavior for investigating. According to the EXE, possibilities are (dunno if it is in proper order, it is raw EXE rip):

  • Find Alarm
  • Keep Looking
  • Return To Job
  • Glance
  • Hunt - not implemented in Oni (accidentaly I have read error message in Manplant a few months ago saying that)
  • Move
  • Look
  • Wait
  • GoTo
  • Forget

What AI does while in pursuit mode depends on the last values in CHAR.Go there for further info.

So...what is the pursuit distance??? It is distance that is AI allowed to travel from its original location for *pursue* purposes. Set it high and AI can run through whole level if it hears or spots something. Set it low and AI will do just a few steps in a direction of disturbing action.


About melee override

First something about minimal shooting distance.It is in the ONWC and determines closest range for AI to fire that weapon. If enemy goes closer, AI stops shooting and tends to run away until it reahes minimal shooting distance again. Now if you set this minimal shooting distance higher than it is originally (for example try 200) you can have some fun chasing AIs as they are running away from you.

Point is that if you set melee override to some range (for example 03 - short range) and then try it, you will see that the moment you are closer than minimal shooting distance AND you are in range which enables it (short range in this example) AI will switch to melee mode instead of running away.

So you can make short range for example 200 units big and set min.shoot.dist. 100 units big and have melee override 03 -short range. AI will then shoot at you even if you are inside short range, but the moment you ecounter min.shoot.dist. it switches to melee.

How it switches back to weapon when you run away back into min.shoot.dist. is not clear. So far it happens automatically after some time. Where is timer for that??? Let us know, if you know....

--Loser 09:03, 29 July 2007 (CEST)

Try using ai2_report on a character, I noticed a timer next to the mode or something of that sort - Gumby :)

Dialogs from level0_Tools

Tool dialog - Choose Combat.png


Tool dialog - Edit Combat.png


ONI BINARY DATA
AKVA << Other file types >> CBPI
BINA : Binary data
TMBD << Other BINA >> ONIE
OBJC : Objects
CHAR << Other OBJC >> CONS
CMBT : Combat profile
Level file