Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
Deadwing

How do I add new monsters via DEHACKED?

Recommended Posts

In DEHACKED, you may only redefine existing thing types, not add new ones. Well, you can do it with DEHSUPP, but that's only practical if you're making a wad for ZDaemon, because non-ZDoom-based ports don't support the feature at all, and modern ZDoom-based ports offer a much more advanced feature, DECORATE.

Share this post


Link to post

Oh, I see, thanks scifista42! How much can I redefine things in DEHACKED? For example, Valiant has some modified monsters, "new" monsters and new behavious. Can I change an Icon of sin, for example, to a stronger Baron of Hell?

Share this post


Link to post

It's all a matter of redefining states in the state table + properties of things in the thing table + possibly weapon properties etc. Each state in the state table has its sprite, duration, action and next state, and all states together (along with thing properties in the thing table, that include initial states for spawn, see, melee, missile animations...) define appearance and behavior of all things in the game world. You may independently redefine each state's sprite, duration, action, next state etc, and thing properties in the thing table as well, to create your own animations and behaviors within the scope of the available features. That's the basic principle. If you're just starting, you may just mess with individual thing/state properties to achieve minor modifications, but if you know what you're doing, you may restructure the system completely and it will work all to your likings.

Share this post


Link to post

I see, that looks a lot harder than DECORATE haha
Is there a tutorial where I can learn a bit more about it or I'll have to try it myself? D:

Share this post


Link to post

You probably already know Enjay's DEHACKED tutorials, which should explain how to edit the state table or thing table and provide a basic reference of the state functions etc. I don't know of any guide specifically for making monsters, but the basics should be clear: Each monster needs a Spawn animation that calls Look in a loop, a See animation that calls Chase, a Melee and/or Missile if you want it to ever attack... It helps to know that DECORATE States blocks are actually nothing more than a better viewable transcription of some specific part of the DEHACKED States table, and DECORATE actor properties are the same thing as properties in the Things table in DEHACKED.

Share this post


Link to post

It's pretty straight forwards once you are familiar with it.

Each state is just a an entry that specifies a sprite to display, a duration (in frames) to display it for, and which state to go to next once the duration is up. Each state can also have a special action to perform.

So for instance if you went to state 25 (a frame mid way through the shotgun reloading animation), and set its action to "FireMissile", you would shoot a rocket every time the shotgun reloaded.

Each thing lists which states to go to at different times. Using WhackEd4's terminology:
Spawn - Which frame to go to when the thing first spawns. This is usually an infinite looping animation.
Walk - First frame of walking animation.
Pain - Frame to show when the thing experiences pain
Melee - Frame to show when the thing wants to attempt a melee attack
etc. they are pretty self explanatory


If as you say you wanted to change the icon of sin into a stronger baron of hell, you would simply change which states the "thing" points to. You wouldn't need to change the states themselves, or any sprites. Just set the IOS's Walk, Pain, Melee, etc. states to the same numbers as the baron, change its sounds to and properties to match, and then increase its health or speed or something.

Share this post


Link to post

I agree it looks pretty hard at first, but it quickly becomes much easier when you examine one of the already existing monsters. For a start, just try to make Hell Knight shoot two times in a row instead of one. You'll probably learn a lot along the way.

Share this post


Link to post

Valiant takes advantage of how MBF has a lot of cruft (dogs, old lost soul code, old BFG firing code, red and green plasma balls, old bonus items) and some new codepointers allowing random state changes, custom spawning, custom sound playing, and custom melee damage, to do what is impossible with vanilla Doom DEHACKED.

It's still far from being as powerful as a real content definition language, but you can decide to sacrifice the bonus book and most of the beta BFG's 40 firing frames to create a monster, and nothing will be lost from the usual gameplay.

Oh, in vanilla there are some frames that you can always sacrifice without losing anything. There's a redundant marine gib sprite that's not used by anything, it's just development garbage from when the marine gib animation was getting split in half so it'd get separate things and separate sprites for the crotch+legs and the upper torso+arms+head. Then they changed the animation into getting pulped like the imps and zombies, so there's only one sprite, but there's still two states declared, they just happen to be identical, and there's no longer anything that access the second state, so you can use it. There's also a gray stalagmite that they forgot to create a mobj type for, so the sprite and frame remains unused. IIRC there's also a frame and sprite in the pistol animation that isn't used in game, so that's a third free frame.

The biggest source of frames that won't really be missed in vanilla are the Pain Elemental resurrection frames (since it doesn't normally leave a corpse behind, resurrection frames are mostly useless; but it can happen when it dies in a crusher or under a closing door or similar circumstance, if it gets squished before finishing its death animation it'll leave a puddle of blood that an arch-vile might resurrect then -- as a ghost monster unless playing in a port that fixed that bug -- so it's something that can actually happen in vanilla gameplay but it's still exceedingly rare.

And then you've got the Wolfenstein SS, hanged Commmander Keen, and Romero Head on a Stick. They don't really fit so they're common victims of DEHACKED patches' voracious appetite for more thing types and frames.

Share this post


Link to post

Dead Lost Soul itself reuses states of the Lost Soul, so you don't gain any states by replacing it - you just gain a single thing slot. Thing slots are relatively cheap to afford, but states aren't.

And Gez didn't mention states of the Item Respawn Fog, Zombieman gibbing animation (which looks the same as Shotgunguy's one and can be redirected to it to gain states), states of the Monster Spawner, Boss Cube and Spawn Fire (or, instead of the former three, at least a part of Spawn Fire's animation), and several individual easily free-able states from across the whole state table.

Share this post


Link to post

So, I'm finally messing with this thing, and it is much more simple than I expected haha

Still, I was checking Bloodstain Afrit on dechacked (wich replaces commander's keen), and I didn't get how its attack (the 5~6 mancubus shot) is activated. I've got the frames, but there's no action related to it (like FIreMissile). How does it works?

Thanks :)

I've got it lol
One question, can't I spawn an attack with different angles? (like 2 imp projectiles, one going 45º and another -45º)

Share this post


Link to post
Deadwing said:

One question, can't I spawn an attack with different angles? (like 2 imp projectiles, one going 45º and another -45º)

You can use the Mancubus attack pointers. It'll only fire the Mancubus missile, though, so you'll have to change to Mancubus fireball ( and, presumably, get rid of the Mancubus, unless you want it to be far less dangerous ) if you want to make it shoot "imp" fireballs.

Share this post


Link to post

Eeh, that's dissapointing haha I thought I would have more options. Still, thanks! I think I've got something cool haha

Share this post


Link to post

The vanilla state codepointers can't take parameters, they all have very specific hardcoded behavior. Some of the MBF codepointers (not covered by Enjay's tutorial, I think) can take parameters, though.

Share this post


Link to post

Another possible source of frames is if you set the red torches to use the green torch frames, and then use the red recolour flag.

They won't look identical to the normal red torches, but I imagine they'd be close enough.

Share this post


Link to post
NiGHTMARE said:

Another possible source of frames is if you set the red torches to use the green torch frames, and then use the red recolour flag.

They won't look identical to the normal red torches, but I imagine they'd be close enough.

That's a nice hack. Unfortunately, the red translation is the dull dark red range, not the bright red range, so it doesn't look much like a fire.

Here's for illustration a bunch of torches. First the three normal sprites, as they are in the game, then the green torch with the three standard translations, and then just for fun four other translations that gives more torchlike results but aren't possible through dehackedery. I just couldn't stop myself from making them. :)



If you're curious, save the following as textures.txt and open it in SLADE's texture editor.

Texture "TORCHES", 320, 96
{
	Patch "TGRNA0", 0, 0
	Patch "TBLUA0", 32, 0
	Patch "TREDA0", 64, 0
	Patch "TGRNA0", 96, 0
	{
		Translation "112:127=96:111"
	}
	Patch "TGRNA0", 128, 0
	{
		Translation "112:127=64:79"
	}
	Patch "TGRNA0", 160, 0
	{
		Translation "112:127=32:47"
	}
	Patch "TGRNA0", 192, 0
	{
		Translation "112:127=172:187"
	}
	Patch "TGRNA0", 224, 0
	{
		Translation "112:125=194:207"
	}
	Patch "TGRNA0", 256, 0
	{
		Translation "112:125=160:167"
	}
	Patch "TGRNA0", 288, 0
	{
		Translation "112:127=208:223"
	}
}

Share this post


Link to post

To be honest, it'd probably be worth limiting your contact with Dehacked to editing text fields and making new animated decorations. You can definitely do a lot of neat stuff with it, but only if you're absolutely willing to constraining yourself to Doom's default code pointers and all that entails.

If you do want to add new monsters and such, sticking to a more advanced port is almost certainly the better option - being able to create new actors and states without losing the vanilla ones alone is such boon, and that's before tackling how much simpler it would be to create your split-shot imp.

Share this post


Link to post

Yeah, I've done some stuff with decorate ( https://www.doomworld.com/vb/wads-mods/72046-nevasca-up-on-idgames-archives/ ), but it didn't make much success haha

People prefer vanilla these days, which IMO is a experience closer to the classic doom, even when some wads bring modified stuff. Also, decorate is usually for much more robust mods (with tons of new weapons and monsters) instead of a few tweaks of the original doom.

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
Sign in to follow this  
×