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 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.
User avatar
dawnbreez
Posts: 199
Joined: Wed Jul 08, 2015 12:29 pm

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

Post by dawnbreez »

I found a better way to solve the chainsaw bug. Probably.
Now, if a puff doesn't hit anything--not even the sky--then it simply won't appear! Thus, the chainsaw only fires bullets if the limited-range hitscan would have hit something anyway--that is, if something would be right on top of where the bullet would go.

EDIT: Unfortunately this marks the return of the sky bullet bug.
User avatar
wildweasel
Posts: 21706
Joined: Tue Jul 15, 2003 7:33 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): A lot of them
Graphics Processor: Not Listed
Contact:

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

Post by wildweasel »

I've had a look at this to implement a variation of it into Cola3, but discovered a very strange side-effect: although the mod does not alter Chaingunners at all, Chaingunners absolutely refuse to rapid-fire. They fire a single shot and then resume wandering. I can't figure out why their fire sequence is getting short-circuited, because they're not entering the pain state at all.
User avatar
AFADoomer
Posts: 1322
Joined: Tue Jul 15, 2003 4:18 pm
Contact:

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

Post by AFADoomer »

It's because the A_CPosRefire function checks to see if the target is in sight before refiring, but the BulletZPuff actor is setting the actor's target to itself (the puff), which has a spawn state duration of 0 tics, so is gone by the time the A_CPosRefire call happens (so isn't found, so no refire).

EDIT: Upping the frame duration and doing something like this (saving the shooter's real target, and restoring it after the projectile is spawned) seems to work:

Code: Select all

				Actor aimtarget = target.target; // Remember the real actor that is being aimed at
				target.target = self;
				target.A_SpawnProjectile("BulletZRound");
				target.target = aimtarget; // Restore the real target
Otherwise, with just upping the state duration, you get some weird effects as the chaingunner continuously faces whatever puff was last set as his target, and he fires wildly.
User avatar
dawnbreez
Posts: 199
Joined: Wed Jul 08, 2015 12:29 pm

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

Post by dawnbreez »

AFADoomer wrote:It's because the A_CPosRefire function checks to see if the target is in sight before refiring, but the BulletZPuff actor is setting the actor's target to itself (the puff), which has a spawn state duration of 0 tics, so is gone by the time the A_CPosRefire call happens (so isn't found, so no refire).

EDIT: Upping the frame duration and doing something like this (saving the shooter's real target, and restoring it after the projectile is spawned) seems to work:

Code: Select all

				Actor aimtarget = target.target; // Remember the real actor that is being aimed at
				target.target = self;
				target.A_SpawnProjectile("BulletZRound");
				target.target = aimtarget; // Restore the real target
Otherwise, with just upping the state duration, you get some weird effects as the chaingunner continuously faces whatever puff was last set as his target, and he fires wildly.
Noted! I'll add this to the mod ASAP.
XASSASSINX
Posts: 376
Joined: Tue Dec 20, 2016 4:53 pm
Location: MURICAA BROTHER! Just kidding, Brazil.

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

Post by XASSASSINX »

Wow! This is really good! My only complain, really, is how ugly these bullets look when firing weapons such as the SSG. Now, i think most of the people that download this mod know how to decorate and edit they bullet as they wish. But i think the bullet should be smaller (so it doens't make a barricade of bullets that block your vision) and maybe add a better trail? of course, this is just my mere opinion. But i think that making the bullet something like a 3D tracer of maybe a smaller projectile with more trail would look better.
User avatar
simpletonnn
Posts: 313
Joined: Thu Nov 13, 2014 8:20 pm

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

Post by simpletonnn »

oh wow nice job
User avatar
dawnbreez
Posts: 199
Joined: Wed Jul 08, 2015 12:29 pm

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

Post by dawnbreez »

New update, finally. I fixed the melee problem, and added the ability to adjust bullet speed!
User avatar
EddieMann
Posts: 524
Joined: Sun May 18, 2014 7:25 pm
Location: Arizona

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

Post by EddieMann »

The bullet puffs are way behind the actual shot when set on 150, don't know why.
Image

also, shooting from an alcove or whatever's practically impossible.
Image
User avatar
dawnbreez
Posts: 199
Joined: Wed Jul 08, 2015 12:29 pm

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

Post by dawnbreez »

The alcove issue is a problem, I'll have to figure out something to work around that. Probably has to do with the z-offset of the hitscan versus the z-offset of the projectile.
As for the puffs being way behind the actual projectile...that *might* be the puff trail effect. I should probably get around to implementing the fancy tracers that one guy suggested instead of my ugly trail effect.
User avatar
EddieMann
Posts: 524
Joined: Sun May 18, 2014 7:25 pm
Location: Arizona

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

Post by EddieMann »

dawnbreez wrote:The alcove issue is a problem, I'll have to figure out something to work around that. Probably has to do with the z-offset of the hitscan versus the z-offset of the projectile.
As for the puffs being way behind the actual projectile...that *might* be the puff trail effect. I should probably get around to implementing the fancy tracers that one guy suggested instead of my ugly trail effect.
It follows the "autoaim" issue, as if I moved back a bit and fired at the same position, the puffs would hit the ceiling.
User avatar
Shadez12
Posts: 102
Joined: Sat Aug 03, 2013 2:04 pm
Location: Wow

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

Post by Shadez12 »

Found this in Operation Body Count, when using railguns, this mod likes to spawn a tracer along with it.
[imgur]https://i.imgur.com/XW5vlMq[/imgur]
EDIT: Found that the racer system also affects the MDK cheat, turning it into a tracer that does little damage.
User avatar
dawnbreez
Posts: 199
Joined: Wed Jul 08, 2015 12:29 pm

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

Post by dawnbreez »

Shadez12 wrote:EDIT: Found that the racer system also affects the MDK cheat, turning it into a tracer that does little damage.
I need to figure out how GZDoom changes the damage on bullet puffs. If I'm right, it works by modifying the "damage" property of the puff...which *should* mean I can pass that to the projectile. If I'm wrong then I dunno how to fix it--to my knowledge there's no way to get the parameters of a function called by something outside of my mod. Gonna do some testing.

EDIT: Reading the "damage" variable of a puff doesn't work, but WorldThingDamaged exists. The only problem is, WorldThingDamaged only gets called when something is damaged. Which means if I read damage from WorldThingDamaged, then when you lead targets your bullets will not have a set damage amount! More work needs to be done. I should ask someone who works on the engine how exactly hitscan attacks set damage.
User avatar
Kaptin
Posts: 18
Joined: Fri Sep 07, 2018 10:59 pm
Graphics Processor: nVidia with Vulkan support

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

Post by Kaptin »

Pretty interesting mod, unfortunately, doesn't work with Smooth doom.
Blue Shadow
Posts: 4949
Joined: Sun Nov 14, 2010 12:59 am

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

Post by Blue Shadow »

To stop people from further reporting the above post as a necrobump: I've made the decision to not take any action and leave that post alone.
XASSASSINX
Posts: 376
Joined: Tue Dec 20, 2016 4:53 pm
Location: MURICAA BROTHER! Just kidding, Brazil.

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

Post by XASSASSINX »

I am probably a bit late to this thread, but has anyone fixed the tracer damage replacing the master damage? for debbuging, a zombieman that deals 500 damage with a hitscan always deals the standard (3 * random(1,3)) damage formula. Has anyone found a fix to this?
Post Reply

Return to “Gameplay Mods”