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

Projectile deals damage multiple time in 1 tic?

Question

Posted (edited)

Is there a way to make projectiles deals a damage with the same base damage multiple times up on impact, preferably with dehacked and not having to use zdoom/gzdoom?

For example, a baron fireball dealing a random damage between 1 and 8, 8 times, so that it is still 8-64 damage to player upon impact but the damage follows a gaussian distribution centered at 32 damage, instead of an uniform distribution?

I just want to reduce the randomness of doom in some way.

 

Thanks.

 

Edit: I tried the multiple projectile method, it did work quite well and seemed very promising.

Specifically, I cannibalized the twitching corpse on stick decoration for 2 frames and 6 unused frames that WhackEd gave me.

I don't know exactly if the thing was centered exactly on 32 damage (Boom prng btw), but after manually doing 50 tests (I know that isn't a lot, but too lazy to compile a sourceport to count it for me), it does seem to vaguely kinda follow a normal distribution, which is more than enough for me.

(Mean is 34.9, stddev is 8.3)

image.png.66d51f3fe55375cbb86ff9a58e0f9748.png

 

This is the zip with the BEX and the map that I tested it on, just in case anyone is interested.

Thank you all for answering my question.

 

Edited by snotface : question answered

Share this post


Link to post

8 answers to this question

Recommended Posts

  • 1

The best way I can think of would be to just have the baron shoot 8 projectiles at once. This does mean the shot will sometimes appear to go "through" enemies that are weak enough to die from less than 8 of them, but that could be seen as a feature rather than a bug :)

There are other possibilities but I don't think any of them will be easy or particularly serviceable when compared to just piling up projectiles and calling it a day. You could try getting the projectile to perform a melee attack (or several) when it hits... not sure if this will work but it could prevent the ripper effect. But, you would still be sacrificing some frames, and I don't think any actors' melee damage is affected by the "damage" field other than the lost soul? But then again, projectiles do take the "damage" field into account? I've never tried this but it's really the only other solution I can think of, other than perhaps using the archvile flame effect to deal the damage, but that sounds like sacrificing more than you are gaining.

 

10 minutes ago, Dark Pulse said:

Not possible with DeHackEd. DeHackEd can only shuffle around existing code, it can't create entirely new stuff.

 

What you're looking for sounds more like you want to mod the RNG table. This is totally possible (just hex edit the EXE), but note that more advanced ports actually no longer use this RNG table - they've come up with others that are significantly more random, starting from Boom onwards.

 

DeHacked doesn't "shuffle" any code. It only changes some of the numbers and strings within the code.

While the OP's idea may not be doable exactly as stated, there are definitely workable solutions.

Share this post


Link to post
  • 1
Posted (edited)
1 hour ago, snotface said:

Is there a way to make projectiles deals a damage with the same base damage multiple times up on impact, preferably with dehacked and not having to use zdoom/gzdoom?

For example, a baron fireball dealing a random damage between 1 and 8, 8 times, so that it is still 8-64 damage to player upon impact but the damage follows a gaussian distribution centered at 32 damage, instead of an uniform distribution?

I just want to reduce the randomness of doom in some way.

 

Thanks.

Not possible with DeHackEd. DeHackEd can only shuffle around existing code, it can't create entirely new stuff.

 

What you're looking for sounds more like you want to mod the RNG table. This is totally possible (just hex edit the EXE), but note that more advanced ports actually no longer use this RNG table - they've come up with others that are significantly more random, starting from Boom onwards.

 

Of course, such a mod will then only properly work with the modded EXE. That's the tradeoff.

 

There was a topic on it a couple of years back: 

 

Share this post


Link to post
  • 0
31 minutes ago, magicsofa said:

The best way I can think of would be to just have the baron shoot 8 projectiles at once. This does mean the shot will sometimes appear to go "through" enemies that are weak enough to die from less than 8 of them, but that could be seen as a feature rather than a bug :)

There are other possibilities but I don't think any of them will be easy or particularly serviceable when compared to just piling up projectiles and calling it a day. You could try getting the projectile to perform a melee attack (or several) when it hits... not sure if this will work but it could prevent the ripper effect. But, you would still be sacrificing some frames, and I don't think any actors' melee damage is affected by the "damage" field other than the lost soul? But then again, projectiles do take the "damage" field into account? I've never tried this but it's really the only other solution I can think of, other than perhaps using the archvile flame effect to deal the damage, but that sounds like sacrificing more than you are gaining.

 

 

DeHacked doesn't "shuffle" any code. It only changes some of the numbers and strings within the code.

While the OP's idea may not be doable exactly as stated, there are definitely workable solutions.

Thank you, I will try to implement the multiple projectile thing, though I think that projectiles passing through monsters won't really be a problem since corpses have collision for a few tics and will blow up all excess projectiles. I'm just a little worried about performance a slaughtermap and the revenant's homing or non homing projectiles splitting up.

Share this post


Link to post
  • 0
Posted (edited)
1 hour ago, magicsofa said:

DeHacked doesn't "shuffle" any code. It only changes some of the numbers and strings within the code.

While the OP's idea may not be doable exactly as stated, there are definitely workable solutions.

What I mean by "shuffle" is that he can't create a new function, only modify existing ones.

 

He can change the values a Baron fireball does (i.e; he should set it to 1 since he wants 8-64 total damage), but he can't create a new function that does that distribution, and he can't change how the distribution is laid out without a different RNG table.

 

That solution does admittedly work, but the flip side is that it'd require him to take frames from other objects to make happen, which he may or may not want to do. The pistol's got two unused ones, IIRC, and that'd give him a start, but he'd still need to nick five others from elsewhere (since we can count one of the eight as being the normal A_BruisAttack).

 

Also it will fire as a small string rather than a single ball, since there's no way to make it process the states faster than 1 tic. Unless I'm mistaken, anyway. Not really done a lot of DeHackEd tinkering.

Share this post


Link to post
  • 0
31 minutes ago, Dark Pulse said:

Also it will fire as a small string rather than a single ball, since there's no way to make it process the states faster than 1 tic. Unless I'm mistaken, anyway. Not really done a lot of DeHackEd tinkering.

 

You are indeed mistaken. Just set all the frame durations to 0 except for the last one (so you can actually see the animation).

Not trying to be rude here but if you haven't done a lot of DeHacking, perhaps you shouldn't be answering questions that are specifically about it. OP explicitly stated that they wanted to use dehacked only, so "taking frames from other objects" is pretty much what they signed up for.

Share this post


Link to post
  • 0
Posted (edited)
1 hour ago, magicsofa said:

You are indeed mistaken. Just set all the frame durations to 0 except for the last one (so you can actually see the animation).

Not trying to be rude here but if you haven't done a lot of DeHacking, perhaps you shouldn't be answering questions that are specifically about it. OP explicitly stated that they wanted to use dehacked only, so "taking frames from other objects" is pretty much what they signed up for.

Which is fine, but as I said, it sounds like he also wants a wholly different thing (a different distribution of the damage), and in that sense, that's definitely not something DeHackEd can mess with - hence why I told him that it wasn't possible.

 

5 hours ago, snotface said:

For example, a baron fireball dealing a random damage between 1 and 8, 8 times, so that it is still 8-64 damage to player upon impact but the damage follows a gaussian distribution centered at 32 damage, instead of an uniform distribution?

I just want to reduce the randomness of doom in some way.

Emphasis mine. You can set the values with DeHackEd all you want, but you can't change the RNG table with it, and that'd be required for something closer to a proper normal distribution, and so Doom by default will skew slightly higher:

 

Quote

Although the table is 256 bytes long, it does not contain all of the numbers between 0 and 255 inclusive. For example, 0 appears twice and 1 does not appear at all; 145 appears five times, more than any other number. Thus the values are not uniformly distributed, but in fact they are nearly so. The mean value is 128.852, whereas it would be 127.500 if all values were equally likely. All of this suggests that the table was generated using a conventional pseudorandom number generator of reasonable quality.

So it'll skew slightly higher than that with the default RNG table if my reckoning is right. Somewhere around 33-35 damage or thereabouts on average?

 

The Baron already does 8-64 damage off its fireball; it sounds like it's the distribution of values that is the problem (and obviously that's anything but normalized):

 

Bos2FHistogram.png

 

So if he's looking for that typical sine wave of low on the 8 and 64 ends, peaking at 32, there is nothing DeHackEd wizardry can do about that. He needs a more uniform random table. Tricks like that will generally bring it down more towards that middle, but that middle is still going to be slightly high, because the table as a whole is slightly high.

Edited by Dark Pulse

Share this post


Link to post
  • 0

@Dark Pulse The original question was already past this point in the thought process. The first sentence actually asked how to get a projectile to deal damage multiple times... showing that the asker already understood the rigidity of the table and that 8d8 is more normally distributed than 1d8 x 8 

Share this post


Link to post
  • 0
22 minutes ago, magicsofa said:

@Dark Pulse The original question was already past this point in the thought process. The first sentence actually asked how to get a projectile to deal damage multiple times... showing that the asker already understood the rigidity of the table and that 8d8 is more normally distributed than 1d8 x 8 

Yeah, just was trying to say it won't be exactly a peak of 32, but slightly higher than that, since Doom's RNG table skews slightly high.

 

If that's fine by you though, then yeah, have it fire eight projectiles at once, set the damage to 1 (then it'll become 1-8 per fireball instead of 8-64), and you'll get your redone distribution.

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
×