BulletZ: Proof-of-concept universal hitscan replacement

Projects that alter game functions but do not include new maps belong here.
Forum rules
The Projects forums are ONLY for YOUR PROJECTS! If you are asking questions about a project, either find that project's thread, or start a thread in the General section instead.

Got a cool project idea but nothing else? Put it in the project ideas thread instead!

Projects for any Doom-based engine (especially 3DGE) are perfectly acceptable here too.

Please read the full rules for more details.

BulletZ: Proof-of-concept universal hitscan replacement

Postby dawnbreez » Thu Feb 15, 2018 2:07 am

Did you just say universal?

This .pk3--this ridiculously small .pk3--will replace all hitscans with projectiles. Right now it works with Doom 1/2 and Freedoom 1/2, and adding support for other hitscans should be easy, as all you need to do is add a new puff replacer that replaces any nonstandard bullet puffs and extends from BulletZPuff.

How does it work?

It's pretty simple. Using the power of ZScript, I have replaced the standard BulletPuff actor with an actor which tracks its "owner", the actor who fired it. It then sets its owner's target to itself (to simulate the spread that would have happened with the original hitscan attack) and calls A_SpawnProjectile from the owner. This causes the owner to fire a projectile toward where the hitscan landed. Finally, the bulletpuff itself has a damage type with a default damage factor of 0, meaning that the puff simply won't damage anything on its own. The result is that the bulletpuff is, for all intents and purposes, replaced with a projectile!

Screenshots?
Spoiler:


Download?

Here's the current download! Now with Smooth Doom support and a fix for the chainsaw's bullet barf.
Download!

Changelog:
Spoiler:
Last edited by dawnbreez on Fri Jun 15, 2018 3:22 pm, edited 9 times in total.
dawnbreez
 
Joined: 08 Jul 2015

Re: BulletZ: Proof-of-concept universal hitscan replacement

Postby silentw » Thu Feb 15, 2018 3:31 am

This is very interesting!
Do you have any data on execution time increases when using this? I know one of the reasons that some people have been shying away from ZScript is its speed compared to DECORATE, ACS, and native code.
User avatar
silentw
learning is not optional, STEVE
 
Joined: 20 May 2016

Re: BulletZ: Proof-of-concept universal hitscan replacement

Postby phantombeta » Thu Feb 15, 2018 3:46 am

silentw wrote:I know one of the reasons that some people have been shying away from ZScript is its speed compared to DECORATE, ACS, and native code.

ACS is probably slower, and DECORATE runs in the exact same VM as ZScript, so it has the exact same speed - in fact, all that changes between ZScript and DECORATE is the compiler frontend AFAIK. The code-generation step is the exact same, so DECORATE will have the same performance as ZScript. (or even worse performance than ZScript, since you have to rely on slow hacks in DECORATE)
User avatar
phantombeta
In the meadow of sinful thoughts, every flower's a perfect one
 
Joined: 02 May 2013
Location: The United Soviet Socialist Dictatorship of Hueland (BRASIL CARAI)
Discord: phantombeta#2461

Re: BulletZ: Proof-of-concept universal hitscan replacement

Postby jckfrbn » Thu Feb 15, 2018 5:29 am

Can't wait to try this
User avatar
jckfrbn
 
Joined: 18 Jul 2016

Re: BulletZ: Proof-of-concept universal hitscan replacement

Postby m8f » Thu Feb 15, 2018 5:46 am

Cool concept!
You say "this pk3", but there is no download link. Is it not ready yet?

If I understand this right, if someone wants only decorative bullet tracers he can set bulletpuff's damage to non-zero, and projectile's to 0, and have tracers that land exactly where hitscan hits (unlike current tracers implementation in Beautiful Doom)?
User avatar
m8f
the dreamer
 
Joined: 29 Dec 2017
Location: Siberia
Discord: m8f#0629

Re: BulletZ: Proof-of-concept universal hitscan replacement

Postby dawnbreez » Thu Feb 15, 2018 11:14 am

WHOOPS! I forgot to actually upload it! Edited the original post, but here's the link:
https://www.dropbox.com/s/zinqgqq49ggfq ... z.pk3?dl=0
dawnbreez
 
Joined: 08 Jul 2015

Re: BulletZ: Proof-of-concept universal hitscan replacement

Postby dawnbreez » Thu Feb 15, 2018 11:16 am

silentw wrote:This is very interesting!
Do you have any data on execution time increases when using this? I know one of the reasons that some people have been shying away from ZScript is its speed compared to DECORATE, ACS, and native code.


It does not have any noticeable slowdown. I can't think of a way to do it in DECORATE--maybe with ACS hackery--but it'd probably run just as smoothly. It's essentially just tacking on an A_SpawnProjectile after every A_CustomBullet.
dawnbreez
 
Joined: 08 Jul 2015

Re: BulletZ: Proof-of-concept universal hitscan replacement

Postby snarkel » Thu Feb 15, 2018 7:59 pm

Holy crud this is amazing! Might even throw this in my autoloads! I've noticed two things though, the pistol sound plays from every projectile, and the chaingunner pretty much fires like a zombieman now.
User avatar
snarkel
DECORATE is fun until you stay up past Midnight doing it.
 
Joined: 06 Aug 2014

Re: BulletZ: Proof-of-concept universal hitscan replacement

Postby Mikk- » Thu Feb 15, 2018 8:10 pm

This would be interesting if paired with Denis Belmondo's ZTracers: viewtopic.php?f=37&t=56821
User avatar
Mikk-
yooooooooooo
 
Joined: 30 Jun 2009
Location: Somewhere off Kanagawa
Discord: Mikk0451#3922

Re: BulletZ: Proof-of-concept universal hitscan replacement

Postby Spaceman333 » Thu Feb 15, 2018 10:04 pm

I'm all for universal addons/mutators and this excites me, though I'm a bit unsure how to use it.

If I read the OP right its a bit semi-universal? Like, for each seperate mod that I want to play this with, I would still need to create a patch or edit the mod itself to have special cases for each bullet type with a BulletZPuff definition?

And what about variable speed between projectiles? Like there being a difference between a pistol and a railgun, where the latter would have a much higher projectile speed in comparison. Are all projectiles going to travel at the same speed or is there a way to have some go slower or faster?
User avatar
Spaceman333
 
Joined: 13 Oct 2016

Re: BulletZ: Proof-of-concept universal hitscan replacement

Postby dawnbreez » Fri Feb 16, 2018 12:07 am

snarkel wrote:Holy crud this is amazing! Might even throw this in my autoloads! I've noticed two things though, the pistol sound plays from every projectile, and the chaingunner pretty much fires like a zombieman now.


I've removed the pistol sound from the projectile. That was an oopsie on my part; I wasn't sure if I needed to play the sound from the projectile, and was working off the DoomImpBall (which *does* play a sound at spawn) as an example.

Spaceman333 wrote:I'm all for universal addons/mutators and this excites me, though I'm a bit unsure how to use it.

If I read the OP right its a bit semi-universal? Like, for each seperate mod that I want to play this with, I would still need to create a patch or edit the mod itself to have special cases for each bullet type with a BulletZPuff definition?

And what about variable speed between projectiles? Like there being a difference between a pistol and a railgun, where the latter would have a much higher projectile speed in comparison. Are all projectiles going to travel at the same speed or is there a way to have some go slower or faster?


It should be compatible with anything that does not replace the standard bullet puff, and does not use special bullet puffs. However, like you said, all you'd need to do is add a new class that replaces the new bullet puff--I've already worked Smooth Doom compatibility into the next update, for instance. As for making some kinds of shots slower or faster, I'm not sure--it depends on whether or not railguns use different puffs. Research is needed. I'll probably try to add a setting for making the projectiles faster or slower, though. May have to 'borrow' something from Sun Damage Overdrive for that :wink:

Mikk- wrote:This would be interesting if paired with Denis Belmondo's ZTracers: viewtopic.php?f=37&t=56821


I would be happy if Belmondo used my code to make ZTracers replace hitscans more universally. However, I still need to come up with a fix for the melee bug. It wouldn't be good if my code caused his mod to give all fists bullet-punching powers. I think I have a fix for that, though.
dawnbreez
 
Joined: 08 Jul 2015

Re: BulletZ: Proof-of-concept universal hitscan replacement

Postby dawnbreez » Fri Feb 16, 2018 11:11 am

New version of BulletZ, this time with Smooth Doom support and a bugfix for the chainsaw trying to impersonate the Chaingun.
dawnbreez
 
Joined: 08 Jul 2015

Re: BulletZ: Proof-of-concept universal hitscan replacement

Postby dawnbreez » Fri Feb 16, 2018 11:47 am

Quick fix for an issue where firing into the sky would not fire a bullet. Also, support for Dead Marine! And now things bleed when hit! And sometimes walls if you hit them at the right angle with the chainsaw. I'm working on that.
dawnbreez
 
Joined: 08 Jul 2015

Re: BulletZ: Proof-of-concept universal hitscan replacement

Postby dawnbreez » Fri Feb 16, 2018 11:58 am

And another quick fix: Walls are not alive, they should not bleed. Should not. Probably.

EDIT: And another! I left a debug print in there. My bad.
dawnbreez
 
Joined: 08 Jul 2015

Re: BulletZ: Proof-of-concept universal hitscan replacement

Postby Trusty McLegit » Fri Feb 16, 2018 7:11 pm

dawnbreez wrote:I would be happy if Belmondo used my code to make ZTracers replace hitscans more universally. However, I still need to come up with a fix for the melee bug. It wouldn't be good if my code caused his mod to give all fists bullet-punching powers. I think I have a fix for that, though.

I think he meant for you to add ztracers to this mod. Maybe as a cvar?
User avatar
Trusty McLegit
 
Joined: 07 Feb 2016

Next

Return to Gameplay Mods

Who is online

Users browsing this forum: bisousbisous, jdredalert, R3DH3XX3N, Shadez12 and 9 guests