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

Enemies moving while shooting in Dehacked?

Recommended Posts

So, I really wanted to make a deathmatch simulator for wads, where Marines run around and try to frag you, however unlike bots in that they cant pick up items, can't chat, don't count for frags, and other things that make them more like "decoy players" rather than bots.

An example of this can be seen here, in DEH format: http://www.doomworld.com/idgames/index.php?file=deathmatch/dmw.zip

How on earth does he get the marines to move while shooting? It's pretty amazing really since no monster in Doom seems to do this. I tried opening in in the latest WhackEd (which is awesome, by the way) but it crashed it - I assume it's in a different format or something? I'd love to figure out how he did it even so.

Can anyone shed some light on this?

Share this post


Link to post

Just a guess, but it might be possible to have Chase on the firing frames and have an extra frame for firing that takes 0 tics so it looks like it's firing while moving. This is just a theory though.

EDIT: I just gave that a spin in ZDoom and the enemies I faced stopped to fire, so it might just be a source port glitch.

Share this post


Link to post

I got an effect where I could place a Chase codepointer between two CposFire frames (for the SS Nazi) but he ended up just kind of "twitching" closer to me as he shot, rather than sliding fluently like the enemies do in that DMW.deh file above.

Maybe It's time to download Dehacked and try it in DOSbox. I really doubt it, but maybe there's some pointer/option/setting in there that isn't in WhackEd?

Share this post


Link to post

To open DMW.deh in Whacked, you first need to open the file in a notepad, find a line that says "Doom version = 19" and rewrite 19 to 21. I've found out that it works, but I have no idea why.

Doomkid said:

Maybe It's time to download Dehacked and try it in DOSbox. I really doubt it, but maybe there's some pointer/option/setting in there that isn't in WhackEd?

No, there isn't. DOS DEHACKED is only good when you want to apply a .deh patch to actually "hack" (rewrite) Doom.exe. For normal DEHACKED editing, WhackEd is all you need.

Enemies than shoot while moving are always tricky. First of all, the moving codepointer (Chase) is also responsible for calling melee and missile attack. It doesn't matter that the enemy is already in its melee or missile state, the attack can be called again anyway, possibly resulting in non-smooth animation. Secondly, FaceTarget function causes the enemy to face the player, and as a result, the enemy forgets its previous movement direction - no more fluent movement. Note that some other codepointers implicitly call FaceTarget too, such as CPosRefire/SpidRefire and all projectile-based attacks except BruisAttack.

These are the problems to deal with. The only possible solution I can think off is to have Chase function in the firing animation anyway, or just have a very short firing animation, with the risk that it could be called often, in a quicker succession than you would desire. That's actually what those DMW marines do.

Share this post


Link to post

Shameless plug for comp-dm.deh which already does this pretty well, although it would be neat if the marines did move and shoot simultaneously like you describe. What Obsidian says makes sense and I don't think it should be too difficult to achieve.

Share this post


Link to post

This is off topic, but while trying to create the cyber baron for a Boom mod I'm making, instead of staying still while doing its meelee attack, it moved and attacked at the same time. (Probably because I renamed the cyber barons meelees to the first 3 frames of the hell knights movement frame.)

On topic: maybe put a FireShotgun (just example) during an enemies moving frames.

Share this post


Link to post

As it my understanding, movement while firing is impossible in Doom and Heretic (HeXen's A_Fastchase kind of allows it)

0 tic states or calling A_Chase in a monsters first attack state may cause infinite loops or similar. Also, as mentioned A_Chase can also potentially call an attack.

I think the best that can be done is a 1 tic long missile state.

Share this post


Link to post

Thanks a bundle to everyone for all the info. I got this to kinda work right, although it still doesn't seem as smooth as it does in DMW.

I'll post a link soon, hopefully it'l help anyone else out who still uses DEH :)

Share this post


Link to post
Doomkid said:

Thanks a bundle to everyone for all the info. I got this to kinda work right, although it still doesn't seem as smooth as it does in DMW.

I'll post a link soon, hopefully it'l help anyone else out who still uses DEH :)


Rather obvious that you didn't read my profile =D

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
×