Difference between revisions of "A Chase"
From DoomWiki.org
[checked revision] | [checked revision] |
(Adding new page for code pointer) |
m (→External links) |
||
(2 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
{{DISPLAYTITLE:A_Chase}} | {{DISPLAYTITLE:A_Chase}} | ||
− | + | [[File:E2M2_chaingun.png|thumb|right|Pinky demons in their chase state, moving toward their target (the player). <code>A_Chase</code> is continually called to determine whether the monsters can attack yet.]] | |
'''A_Chase''' is a [[code pointer]] used in the normal animation for various monsters. | '''A_Chase''' is a [[code pointer]] used in the normal animation for various monsters. | ||
+ | |||
+ | <code>A_Chase</code> is one of the most important code pointers implementing Doom's monster AI. After a target has been located for a monster (using [[A_Look]]), in transitions into its chase sequence, usually repeatedly looping through animation states that call <code>A_Chase</code>. The most basic thing that <code>A_Chase</code> does is to move the monster toward its target. Monsters always move in angles which are an exact multiple of 45 degrees relative to the map layout. <code>A_Chase</code> will move a monster in the same direction for several calls before sometimes picking a new direction. | ||
+ | |||
+ | <code>A_Chase</code> checks continually to determine whether it is possible to transition into one of its attack states. If the monster is sufficiently close to the player and has a melee attack, it will transition into its melee attack state. Otherwise, if the monster has a distance attack and can see the player, it may transition into its distance attack state (firing a weapon or launching a projectile). | ||
+ | |||
+ | In a network game, <code>A_Chase</code> may cause a monster to pick a new player as a target if it can no longer see its current target. Finally, it occasionally plays the monster's "active sound" if it has one - an example is the "imps nearby" sound periodically emitted by [[imp|imps]] while they are roaming. | ||
== Uses == | == Uses == | ||
Line 271: | Line 277: | ||
== External links == | == External links == | ||
* {{DoomSrc|file=p_enemy.c|line=672|text=A_Chase}} in the Doom source code. | * {{DoomSrc|file=p_enemy.c|line=672|text=A_Chase}} in the Doom source code. | ||
+ | * {{zdoomwiki|title=A_Chase}} | ||
+ | * {{eterwiki|title=Chase}} | ||
− | [[Category: | + | [[Category:Core monster AI code pointers]] |
Revision as of 18:11, 17 March 2020
A_Chase is a code pointer used in the normal animation for various monsters.
A_Chase
is one of the most important code pointers implementing Doom's monster AI. After a target has been located for a monster (using A_Look), in transitions into its chase sequence, usually repeatedly looping through animation states that call A_Chase
. The most basic thing that A_Chase
does is to move the monster toward its target. Monsters always move in angles which are an exact multiple of 45 degrees relative to the map layout. A_Chase
will move a monster in the same direction for several calls before sometimes picking a new direction.
A_Chase
checks continually to determine whether it is possible to transition into one of its attack states. If the monster is sufficiently close to the player and has a melee attack, it will transition into its melee attack state. Otherwise, if the monster has a distance attack and can see the player, it may transition into its distance attack state (firing a weapon or launching a projectile).
In a network game, A_Chase
may cause a monster to pick a new player as a target if it can no longer see its current target. Finally, it occasionally plays the monster's "active sound" if it has one - an example is the "imps nearby" sound periodically emitted by imps while they are roaming.
Uses
The A_Chase
code pointer appears in the following states in Doom's state table:
Frame number | Doom internal name | Use |
---|---|---|
176 | S_POSS_RUN1 | normal animation for the Trooper |
177 | S_POSS_RUN2 | normal animation for the Trooper |
178 | S_POSS_RUN3 | normal animation for the Trooper |
179 | S_POSS_RUN4 | normal animation for the Trooper |
180 | S_POSS_RUN5 | normal animation for the Trooper |
181 | S_POSS_RUN6 | normal animation for the Trooper |
182 | S_POSS_RUN7 | normal animation for the Trooper |
183 | S_POSS_RUN8 | normal animation for the Trooper |
209 | S_SPOS_RUN1 | normal animation for the Sargeant |
210 | S_SPOS_RUN2 | normal animation for the Sargeant |
211 | S_SPOS_RUN3 | normal animation for the Sargeant |
212 | S_SPOS_RUN4 | normal animation for the Sargeant |
213 | S_SPOS_RUN5 | normal animation for the Sargeant |
214 | S_SPOS_RUN6 | normal animation for the Sargeant |
215 | S_SPOS_RUN7 | normal animation for the Sargeant |
216 | S_SPOS_RUN8 | normal animation for the Sargeant |
323 | S_SKEL_RUN1 | normal animation for the Revenant |
324 | S_SKEL_RUN2 | normal animation for the Revenant |
325 | S_SKEL_RUN3 | normal animation for the Revenant |
326 | S_SKEL_RUN4 | normal animation for the Revenant |
327 | S_SKEL_RUN5 | normal animation for the Revenant |
328 | S_SKEL_RUN6 | normal animation for the Revenant |
329 | S_SKEL_RUN7 | normal animation for the Revenant |
330 | S_SKEL_RUN8 | normal animation for the Revenant |
331 | S_SKEL_RUN9 | normal animation for the Revenant |
332 | S_SKEL_RUN10 | normal animation for the Revenant |
333 | S_SKEL_RUN11 | normal animation for the Revenant |
334 | S_SKEL_RUN12 | normal animation for the Revenant |
364 | S_FATT_RUN1 | normal animation for the Mancubus |
365 | S_FATT_RUN2 | normal animation for the Mancubus |
366 | S_FATT_RUN3 | normal animation for the Mancubus |
367 | S_FATT_RUN4 | normal animation for the Mancubus |
368 | S_FATT_RUN5 | normal animation for the Mancubus |
369 | S_FATT_RUN6 | normal animation for the Mancubus |
370 | S_FATT_RUN7 | normal animation for the Mancubus |
371 | S_FATT_RUN8 | normal animation for the Mancubus |
372 | S_FATT_RUN9 | normal animation for the Mancubus |
373 | S_FATT_RUN10 | normal animation for the Mancubus |
374 | S_FATT_RUN11 | normal animation for the Mancubus |
375 | S_FATT_RUN12 | normal animation for the Mancubus |
408 | S_CPOS_RUN1 | normal animation for the Chaingun Sargeant |
409 | S_CPOS_RUN2 | normal animation for the Chaingun Sargeant |
410 | S_CPOS_RUN3 | normal animation for the Chaingun Sargeant |
411 | S_CPOS_RUN4 | normal animation for the Chaingun Sargeant |
412 | S_CPOS_RUN5 | normal animation for the Chaingun Sargeant |
413 | S_CPOS_RUN6 | normal animation for the Chaingun Sargeant |
414 | S_CPOS_RUN7 | normal animation for the Chaingun Sargeant |
415 | S_CPOS_RUN8 | normal animation for the Chaingun Sargeant |
444 | S_TROO_RUN1 | normal animation for the Imp |
445 | S_TROO_RUN2 | normal animation for the Imp |
446 | S_TROO_RUN3 | normal animation for the Imp |
447 | S_TROO_RUN4 | normal animation for the Imp |
448 | S_TROO_RUN5 | normal animation for the Imp |
449 | S_TROO_RUN6 | normal animation for the Imp |
450 | S_TROO_RUN7 | normal animation for the Imp |
451 | S_TROO_RUN8 | normal animation for the Imp |
477 | S_SARG_RUN1 | normal animation for the Spectre and Demon |
478 | S_SARG_RUN2 | normal animation for the Spectre and Demon |
479 | S_SARG_RUN3 | normal animation for the Spectre and Demon |
480 | S_SARG_RUN4 | normal animation for the Spectre and Demon |
481 | S_SARG_RUN5 | normal animation for the Spectre and Demon |
482 | S_SARG_RUN6 | normal animation for the Spectre and Demon |
483 | S_SARG_RUN7 | normal animation for the Spectre and Demon |
484 | S_SARG_RUN8 | normal animation for the Spectre and Demon |
503 | S_HEAD_RUN1 | normal animation for the Cacodemon |
529 | S_BOSS_RUN1 | normal animation for the Baron of Hell |
530 | S_BOSS_RUN2 | normal animation for the Baron of Hell |
531 | S_BOSS_RUN3 | normal animation for the Baron of Hell |
532 | S_BOSS_RUN4 | normal animation for the Baron of Hell |
533 | S_BOSS_RUN5 | normal animation for the Baron of Hell |
534 | S_BOSS_RUN6 | normal animation for the Baron of Hell |
535 | S_BOSS_RUN7 | normal animation for the Baron of Hell |
536 | S_BOSS_RUN8 | normal animation for the Baron of Hell |
558 | S_BOS2_RUN1 | normal animation for the Hell Knight |
559 | S_BOS2_RUN2 | normal animation for the Hell Knight |
560 | S_BOS2_RUN3 | normal animation for the Hell Knight |
561 | S_BOS2_RUN4 | normal animation for the Hell Knight |
562 | S_BOS2_RUN5 | normal animation for the Hell Knight |
563 | S_BOS2_RUN6 | normal animation for the Hell Knight |
564 | S_BOS2_RUN7 | normal animation for the Hell Knight |
565 | S_BOS2_RUN8 | normal animation for the Hell Knight |
587 | S_SKULL_RUN1 | normal animation for the Lost Soul |
588 | S_SKULL_RUN2 | normal animation for the Lost Soul |
604 | S_SPID_RUN2 | normal animation for the Spiderdemon |
605 | S_SPID_RUN3 | normal animation for the Spiderdemon |
606 | S_SPID_RUN4 | normal animation for the Spiderdemon |
608 | S_SPID_RUN6 | normal animation for the Spiderdemon |
609 | S_SPID_RUN7 | normal animation for the Spiderdemon |
610 | S_SPID_RUN8 | normal animation for the Spiderdemon |
612 | S_SPID_RUN10 | normal animation for the Spiderdemon |
613 | S_SPID_RUN11 | normal animation for the Spiderdemon |
614 | S_SPID_RUN12 | normal animation for the Spiderdemon |
636 | S_BSPI_RUN2 | normal animation for the Arachnotron |
637 | S_BSPI_RUN3 | normal animation for the Arachnotron |
638 | S_BSPI_RUN4 | normal animation for the Arachnotron |
639 | S_BSPI_RUN5 | normal animation for the Arachnotron |
640 | S_BSPI_RUN6 | normal animation for the Arachnotron |
642 | S_BSPI_RUN8 | normal animation for the Arachnotron |
643 | S_BSPI_RUN9 | normal animation for the Arachnotron |
644 | S_BSPI_RUN10 | normal animation for the Arachnotron |
645 | S_BSPI_RUN11 | normal animation for the Arachnotron |
646 | S_BSPI_RUN12 | normal animation for the Arachnotron |
677 | S_CYBER_RUN2 | normal animation for the Cyberdemon |
678 | S_CYBER_RUN3 | normal animation for the Cyberdemon |
679 | S_CYBER_RUN4 | normal animation for the Cyberdemon |
680 | S_CYBER_RUN5 | normal animation for the Cyberdemon |
681 | S_CYBER_RUN6 | normal animation for the Cyberdemon |
683 | S_CYBER_RUN8 | normal animation for the Cyberdemon |
702 | S_PAIN_RUN1 | normal animation for the Pain Elemental |
703 | S_PAIN_RUN2 | normal animation for the Pain Elemental |
704 | S_PAIN_RUN3 | normal animation for the Pain Elemental |
705 | S_PAIN_RUN4 | normal animation for the Pain Elemental |
706 | S_PAIN_RUN5 | normal animation for the Pain Elemental |
707 | S_PAIN_RUN6 | normal animation for the Pain Elemental |
728 | S_SSWV_RUN1 | normal animation for the SS Nazi |
729 | S_SSWV_RUN2 | normal animation for the SS Nazi |
730 | S_SSWV_RUN3 | normal animation for the SS Nazi |
731 | S_SSWV_RUN4 | normal animation for the SS Nazi |
732 | S_SSWV_RUN5 | normal animation for the SS Nazi |
733 | S_SSWV_RUN6 | normal animation for the SS Nazi |
734 | S_SSWV_RUN7 | normal animation for the SS Nazi |
735 | S_SSWV_RUN8 | normal animation for the SS Nazi |
Example
The following is an example of how to set the A_Chase
code pointer in a Dehacked file:
Pointer 21 (Frame 34) Codep Frame = 735
Or using BEX syntax:
[CODEPTR] Frame 1234 = Chase