[Fixed] Hitscan & throwback

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
User avatar
LilWhiteMouse
Posts: 2270
Joined: Tue Jul 15, 2003 7:00 pm
Location: Maine, US

Hitscan & throwback

Post by LilWhiteMouse »

I've noticed with hitscan weapons that low mass enemies have a tendancy to fly torwards you when they die. I don't remember this in Doom or older versions of ZDoom.
User avatar
Biff
Posts: 1061
Joined: Wed Jul 16, 2003 5:29 pm
Location: Monrovia, CA, USA

Post by Biff »

The Heretic gargoyles often did that....I think, like a last leap at you as they die. Hmm, did I see a Wraith do that in hspawn recently?
User avatar
LilWhiteMouse
Posts: 2270
Joined: Tue Jul 15, 2003 7:00 pm
Location: Maine, US

Post by LilWhiteMouse »

It happens frequently to zombiemen and shotgunners as well, so it's not limited to avian actors. The dragon's claw/blaster seems to be the most offending weapon.
User avatar
Ultraviolet
Posts: 1152
Joined: Tue Jul 15, 2003 9:08 pm
Location: PROJECT DETAILS CLASSIFIED.

Post by Ultraviolet »

Heh. I keep misreading things. I thought you said it wasn't limited to Asian actors.
User avatar
randi
Site Admin
Posts: 7749
Joined: Wed Jul 09, 2003 10:30 pm

Post by randi »

From the source code:

Code: Select all

// make fall forwards sometimes
if ((damage < 40) && (damage > target->health)
    && (target->z - inflictor->z > 64*FRACUNIT)
    && (pr_damagemobj()&1))
User avatar
Hirogen2
Posts: 2033
Joined: Sat Jul 19, 2003 6:15 am
Operating System Version (Optional): Tumbleweed x64
Graphics Processor: Intel with Vulkan/Metal Support
Location: Central Germany

Post by Hirogen2 »

Now the question: why? It's... against the usual physics ?:)
User avatar
Chris
Posts: 2999
Joined: Thu Jul 17, 2003 12:07 am
Graphics Processor: ATI/AMD with Vulkan/Metal Support

Post by Chris »

'cuz it makes a cool effect, especially when they're on ledges? that'd be my guess :P
User avatar
LilWhiteMouse
Posts: 2270
Joined: Tue Jul 15, 2003 7:00 pm
Location: Maine, US

Post by LilWhiteMouse »

I don't really understand the source. Does it explain why the zombieman I just killed on top of the two high crates in the background is now at my feet? If he had been a projectile there's no way I could have evaded, he traveled much faster then even the Arachnotrons projectile.

Image
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Post by Graf Zahl »

Ok, here it goes:

if ((damage < 40)

Do this only if the damage inflicted is less than 40 health points.
(can't say from a picture but it seems in your case it was the case)

&& (damage > target->health)

.. and higher than the victim's health
(as in: he will be killed for sure - like your Zombie)

&& (target->z - inflictor->z > 64*FRACUNIT)

The one who shot the poor guy is standing at least 64 units below the victim
(your crate would do that!)

&& (pr_damagemobj()&1))

a little randomness so it doesn't happen always.

If all the stuff above applies the following happens
(ang is the angle of thrust being applied to the victim)

{
ang += ANG180;
thrust *= 4;
}

Just reverse the angle (push the guy forward instead of backward) and multiply the thrust force by 4 so a minor push backward is turned into a bigger push forward.
User avatar
Kappes Buur
 
 
Posts: 4208
Joined: Thu Jul 17, 2003 12:19 am
Graphics Processor: nVidia (Legacy GZDoom)
Location: British Columbia, Canada

Post by Kappes Buur »

.
If you want to "experiment" with that effect, then use the cheat 'mdk'.

This cheat, however, affects everything which can frag you, monsters or things (such as barrels).
.
Cyb
Posts: 912
Joined: Tue Jul 15, 2003 5:12 pm

Post by Cyb »

aye, hehe it's fun to accidently mdk a barrel halfway across the map and have it flung towards you and take a good chunk of health :P
User avatar
Bio Hazard
Posts: 4019
Joined: Fri Aug 15, 2003 8:15 pm
Location: ferret ~/C/ZDL $

Post by Bio Hazard »

i really think stuff should fly backward...

is there a way to do that?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Post by Graf Zahl »

Bio Hazard wrote:i really think stuff should fly backward...

is there a way to do that?

Sure!

Remove the offending code from P_interaction.cpp and recompile the whole thing! :wink:
IMHO this should only apply to flying enemies. With walking ones it really just looks odd.
User avatar
IntergalacticWalrus
Posts: 31
Joined: Mon Sep 01, 2003 2:02 pm
Location: E2M2, among the many UAC boxes

Re: Hitscan & throwback

Post by IntergalacticWalrus »

LilWhiteMouse wrote:I've noticed with hitscan weapons that low mass enemies have a tendancy to fly torwards you when they die. I don't remember this in Doom or older versions of ZDoom.
I can't see why you never noticed this in the original Doom, it happened all the time. Especially in the first episode of Doom, where there are lots of places where zombies and imps are standing on top of high edges, and killing them with bullets cause them to fall down. That's perfectly normal, it gives the game a more cinematic effect, I guess.
User avatar
HotWax
Posts: 10002
Joined: Fri Jul 18, 2003 6:18 pm
Location: Idaho Falls, ID

Post by HotWax »

I don't think the problem is that an enemy on a ledge will sometimes fall forward and thus off the ledge; that would seem to be a natural enough occurance that would happen in reality. The problem is that, apparently to ensure the victim does indeed reach and fall off the ledge, they multiply the force by a factor of 4. This might be okay for a light nudge, but if you blast someone at close range with an SSG, multiplying the already high force by 4 is going to make them move insanely fast. Even if you left the direction alone, that would look wrong. Reversing it makes matters much worse. Hitting someone full in the face with an SSG should NOT cause them to fly in YOUR direction at 50 MPH. That's just silly.

Perhaps an upper limit could be applied to the force, either as an additional condition:

if ((damage < 40) && (blah blah blah) && (force < xyz) . . .

where xyz is some abitrary amount of force. This way if you smack the crap out of someone, there's no way that the engine will decide it's a good time to make them fall FORWARD, which seems pretty logical...

or, you could apply the limit after the other calculations...

{
ang += ANG180;
if ((thrust *= 4) > xyz) thrust = xyz;
}

which would simply ensure that the corpse doesn't come flying at you like a bat out of hell.

Return to “Closed Bugs [GZDoom]”