Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
InsanityBringer

Hardcoded behaviors for Doom objects for DEHACKED

Recommended Posts

Posted (edited)

I'm sure this has been done before, but I tried searching the forums for a full list of hardcoded behaviors, but I didn't see anything. I kind of wanted a document that described the hardcoded behaviors Doom did to various object types based on their object IDs, so I decided to write this up. Hopefully its of use to someone doing fancy dehacked work
 

Hardcoded by object ID:
0: MT_PLAYER: Can be harmed by projectiles from other MT_PLAYER.
1: MT_POSSESSED: Spawns MT_CLIP on death.
2: MT_SHOTGUY: Spawns MT_SHOTGUN on death.
3: MT_VILE: Cannot attack if target is greater than 896 units away, will instantly change target whenever hurt, cannot be targeted by other monsters.
4: MT_FIRE: No special behavior.
5: MT_UNDEAD: Attacks more frequently at range, will not do ranged attack within 196 units (except as retaliation).
6: MT_TRACER: No special behavior, but only normal projectile that can use A_Tracer (no other sets tracer field).
7: MT_SMOKE: No special behavior.
8: MT_FATSO: On MAP07, on calling A_BossDeath, sectors tagged 666 lower to lowest when all are dead.
9: MT_FATSHOT: No special behavior.
10: MT_CHAINGUY: Spawns MT_CHAINGUN on death.
11: MT_TROOP: No special behavior.
12: MT_SERGEANT: No special behavior.
13: MT_SHADOWS: No special behavior.
14: MT_HEAD: No special behavior.
15: MT_BRUISER: On E1M8, on calling A_BossDeath, sectors tagged 666 lower to lowest when all are dead, cannot harm or be harmed from MT_KNIGHT projectiles.
16: MT_BRUISERSHOT: Speed set to 20 on nightmare, or 15 if moving to a lower skill, Cannot trigger walkover specials.
17: MT_KNIGHT: Cannot harm or be harmed from MT_BRUISER projectiles.
18: MT_SKULL: More likely to attack at range, does not lose MF_NOGRAVITY flag on death.
19: MT_SPIDER: More likely to attack at range, plays sight and death sounds at full volume, ends game when all are dead on calling A_BossDeath on E3M8, causes sectors tagged 666 to lower to lowest on calling A_BossDeath when all are dead on E4M8, cannot be harmed by explosions.
20: MT_BABY: On MAP07, on calling A_BossDeath, causes sectors tagged 667 to raise by the height of their lower texture.
21: MT_CYBORG: More likely to attack at range, has higher overall chance of attacking (95 out of 255 chance vs 55 out of 255 chance per step at greatest range), plays sight and death sounds at full volume, ends game when all are dead on calling A_BossDeath on E2M8, causes doors tagged 666 to open on calling A_BossDeath on E4M6, cannot be harmed by explosions.
22: MT_PAIN: No special behavior.
23: MT_WOLFSS: Spawns MT_CLIP on death.
24: MT_KEEN: No special behavior.
25: MT_BOSSBRAIN: No special behavior.
26: MT_BOSSSPIT: No special behavior.
27: MT_BOSSTARGET: Counted as target for MT_BOSSSPIT.
28: MT_SPAWNSHOT: No special behavior.
29: MT_SPAWNFIRE: No special behavior.
30: MT_BARREL: No special behavior.
31: MT_TROOPSHOT: Speed set to 20 on nightmare, or 10 moving to a lower skill, cannot trigger walkover specials.
32: MT_HEADSHOT: Speed set to 20 on nightmare, or 10 moving to a lower skill, cannot trigger walkover specials.
33: MT_ROCKET: Cannot trigger walkover specials.
34: MT_PLASMA: Cannot trigger walkover specials.
35: MT_BFG: Cannot trigger walkover specials.
36: MT_ARACHPLAZ: No special behavior.
37: MT_PUFF: No special behavior.
38: MT_BLOOD: No special behavior.
39: MT_TFOG: No special behavior.
40: MT_IFOG: No special behavior.
41: MT_TELEPORTMAN: Scanned for in a sector when teleported to.
42: MT_EXTRABFG: No special behavior.
43: MT_MISC0: No special behavior.
44: MT_MISC1: No special behavior.
45: MT_MISC2: No special behavior.
46: MT_MISC3: No special behavior.
47: MT_MISC4: No special behavior.
48: MT_MISC5: No special behavior.
49: MT_MISC6: No special behavior.
50: MT_MISC7: No special behavior.
51: MT_MISC8: No special behavior.
52: MT_MISC9: No special behavior.
53: MT_MISC10: No special behavior.
54: MT_MISC11: No special behavior.
55: MT_MISC12: No special behavior.
56: MT_INV: Never respawns if picked up.
57: MT_MISC13: No special behavior.
58: MT_INS: Never respawns if picked up.

Nothing beyond has any special behavior to the best of my knowledge.
Side note: In versions of doom before The Ultimate Doom and in ports with the right compat options, all monsters calling A_BossDeath can trigger map specials on E1M8, E2M8, E3M8, E4M6, and E4M8. Even in earlier versions MAP07 only works with MT_FATSO and MT_BABY though. 

Hardcoded by DoomED Number:
64, 65, 66, 67, 68, 69, 71, 84, 88, and 89 cannot be used if the game is Doom 1.

Hardcoded state behaviors:
0: S_NULL: Will delete the actor at the end of the tic.
475-489 (Demon states): Duration halved on nightmare skill, doubled when changing back.

I don't know of an easy way to check for state hardcoding, so I'm not aware of any beyond this.

 

Edited by InsanityBringer : correct even more typos aaaa

Share this post


Link to post

thanks to @fraggle for these

 

	# These states are hard-coded into the Doom source code - bits
	# of code jump to these states.
	HARDCODED_STATES = [
		# p_enemy.c:A_VileChase
		S_VILE_HEAL1,
		# p_enemy.c:A_BrainScream/A_BrainExplode
		S_BRAINEXPLODE1,
		# p_map.c:PIT_ChangeSector (crushing bodies under doors)
		S_GIBS,
		# p_mobj.c:P_XYMovement; also p_pspr.c
		S_PLAY,
		# p_mobj.c:P_SpawnPuff
		S_PUFF3,
		# p_mobj.c:P_SpawnBlood
		S_BLOOD2,
		S_BLOOD3,
		# p_pspr.c:(various)
		S_PLAY_ATK1,
		S_PLAY_ATK2,
		S_PLAY_RUN1,
		# This state cannot be modified by dehacked (causes an overrun).
		S_TECH2LAMP4,
	]

 

Share this post


Link to post

I *think* the AV not being targeted by other monsters is a property of its attack, not its thing definition. (I have nothing but experience to back this up, but I think all infighting behaviour comes down to: hitscans aggro anything, projectiles aggro outside monster species, other attacks aren't recognised as attacks, and finally HK/barons are hardcoded to behave as one species).

 

To be slightly pedantic, some of the death actions mentioned in the OP aren't 100% hardcoded, since they wait for the BOSSDEATH codepointer, which you can remove.

 

Also, thank you so much for posting the specific speed changes in nightmare. I've wondered about those for ages.

Share this post


Link to post
Posted (edited)
24 minutes ago, Girl of Satan said:

I *think* the AV not being targeted by other monsters is a property of its attack, not its thing definition.

 

It's hardcoded directly in P_DamageMobj, the function responsible for dealing damage by anything to anything and also for initiating infighting.

 

    if ( (!target->threshold || target->type == MT_VILE)
	 && source && source != target
	 && source->type != MT_VILE)
    {
	// if not intent on another player,
	// chase after this one

 

24 minutes ago, Girl of Satan said:

hitscans aggro anything, projectiles aggro outside monster species, other attacks aren't recognised as attacks,

 

When a projectile lands on a monster of the same species as the one that fired the projectile, P_DamageMobj isn't called at all, but in all other cases, it is.

Edited by scifista42

Share this post


Link to post
Posted (edited)

From what I've learned, the monster's-added-from-Doom-2's projectiles all have a hard coded ability to trigger monster-activated walk-over linedefs.

 

Love this thread though :)

Share this post


Link to post

Thanks for the responses, guys. As per Girl of Satan's post, I have amended it to specify that on death behaviors are triggered by calling A_BossDeath. Normally I would have just excluded those mentions entirely like A_KeenDeath, but the ultimate doom engine branch did hardcode what can do what which was inherited by some ports (though disableable through compat options in most of them), and in any case I think Doom 2 was always relying on mancubi and arachnotrons for the special action. I also corrected a few typos (arachnotron special uses lower texture not midtexture, baron shot projectile is 15 outside of NM, not 10).

Share this post


Link to post
1 hour ago, Fonze said:

From what I've learned, the monster's-added-from-Doom-2's projectiles all have a hard coded ability to trigger monster-activated walk-over linedefs.

More properly, they do not have a hardcoded incapability to trigger these, contrarily to the Doom 1 projectiles.

 

	// Things that should NOT trigger specials...
	switch(thing->type)
	{
	  case MT_ROCKET:
	  case MT_PLASMA:
	  case MT_BFG:
	  case MT_TROOPSHOT:
	  case MT_HEADSHOT:
	  case MT_BRUISERSHOT:
	    return;
	    break;
	    
	  default: break;
	}

 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×