Bullet Tracer Spawning

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: Bullet Tracer Spawning

Re: Bullet Tracer Spawning

by Major Cooke » Sat Jul 16, 2016 7:31 pm

Re: Bullet Tracer Spawning

by Blue Shadow » Sat Jul 16, 2016 6:40 pm

constants.txt wasn't updated to include the new flags.

Re: Bullet Tracer Spawning

by Major Cooke » Sat Jul 16, 2016 10:07 am

Re: Bullet Tracer Spawning

by Major Cooke » Fri Jul 15, 2016 9:15 am

Okay, that's done now. The P_LineAttack will only spawn if both a projectile name is supplied and the missile actually spawns.

Anything else?

Re: Bullet Tracer Spawning

by Graf Zahl » Wed Jul 13, 2016 6:46 am

No. But you call that stuff even when you do not need it. Do it inside a check for spawning a projectile.

Re: Bullet Tracer Spawning

by Major Cooke » Wed Jul 13, 2016 6:45 am

So back to the old requirement of +ALWAYSPUFF then?

Re: Bullet Tracer Spawning

by Graf Zahl » Wed Jul 13, 2016 12:39 am

I think this is mostly ok, but there's one problem:

This code

Code: Select all

			if (!puff)
			{
				temp = true;
				puff = P_LineAttack(self, bangle, range, bslope, 0, NAME_Hitscan, pufftype, laflags | LAF_NOINTERACT);
			}
which appears to be exclusively for the bullet tracer parts is called unconditionally. This needs to be changed. P_LineAttack is a very expensive call that should be avoided if not needed.

Re: Bullet Tracer Spawning

by Graf Zahl » Tue Jul 12, 2016 12:00 pm

No, but the last change was just before I left for vacation. Will have to review this a bit before merging.

Re: Bullet Tracer Spawning

by Major Cooke » Tue Jul 12, 2016 11:53 am

Is this still waiting by any chance?

Re: Bullet Tracer Spawning

by Xaser » Sun Jul 03, 2016 10:27 pm

Since I hadn't actually responded yet: code seems good to me after the latest commit, FWIW.

Re: Bullet Tracer Spawning

by Major Cooke » Wed Jun 22, 2016 6:34 pm

Ah, keen eyes Xaser. Thanks!

And fixed.

Re: Bullet Tracer Spawning

by Xaser » Wed Jun 22, 2016 6:29 pm

Finally got a chance to sit down play around with this, and I noticed a couple of issues:
  • thingdef_codeptr.cpp line 1652: "bangle" and "bslope" should be "angle" and "slope"
  • thingdef_codeptr.cpp line 1932: "bangle" and "bslope" should be "angle" and "slope"
  • p_map.cpp line 4099: should use single &, not double &&
Here's a quick test wad showcasing the oddities that result. There's a Chaingun and Rocket Launcher replacement in slots 4 and 5 (summon "ChaingunTest" and "WeirdGun", respectively"). Both weapons' primary fires exhibit aim issues (point at an enemy or the sky), and the chaingun's secondary fire deals no damage since the double && accidentally sets the NOINTERACT flag on the real puff.

I fixed the 3 issues in my local environment, and after that, the test wad (and the rest of my mucking about) all works as expected.

Nothing else seems awry, and the feature's fun to play with, so "whoop!" there. :P

Re: Bullet Tracer Spawning

by Major Cooke » Sun Jun 19, 2016 10:26 am

Puffs no longer require +ALWAYSPUFF. Also cleaned up the code quite a bit in A_FireBullets and A_CustomBulletAttack.

@StrikerMan780: This is meant to replace that kind of stuff indeed.

Re: Bullet Tracer Spawning

by StrikerMan780 » Thu Jun 16, 2016 11:11 pm

I actually made clever, and quite clean tracer code a while back, no ACS required. Just A_Warp and some switching of pointers. Works with weapons that have spread. However, a native implementation would be nice, since there's two downsides to my simple implementation: Offsets don't consider floor clipping, nor crouching. It also doesn't adjust if different player classes have different shooting heights. However, if you don't need to worry about that last one, it's fine in most cases.

If anyone wants to know how I did it, let me know and I'll post examples later. (Currently very busy).

Re: Bullet Tracer Spawning

by Major Cooke » Sun Jun 12, 2016 8:51 pm

Not to mention you'd have to call A_CheckSight just to kill off the tracer properly, too. A_CheckLOF cannot return the distance from something it hits unfortunately...

Top