Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Black Star

Strange but maddening projectile issue [MBF21]

Recommended Posts

I coded this Plasma Rifle replacement that uses the function A_WeaponProjectile. It works just fine most of the time, except for the fact that it fires its projectiles slightly off center all the time. Offsets are centered and everything, I have no values assigned to the projectile call function, meaning no angle/spread/etc is present. Trying to shoot an enemy that's to my left or right sends the projectiles a bit too far in that direction sometimes, but especially so when autoaiming upwards (sometimes missing enemies entirely). Tested with Odamex and Doom Retro, both ports exhibit the same behaviour. I've even checked against Xaser's Vesper (which uses the same function) and every projectile that calls the function is perfectly centered even with autoaim, despite the fact I am using the same exact function with the same parameters. I feel like it's gaslighting me and I'm not a fan of it, haha. Any help is appreciated.

Share this post


Link to post

Silly thought, are the sprites aligned? Most of the stock doom weapon HUD sprites are fairly off center towards the right.

Share this post


Link to post

I had a weird problem that sounds like that with a monster projectile, I still have no idea why.

Have you written it from scratch or did you inherit it? I didn't inherit it and projectile spawned off, to this day I'm not sure why.

Share this post


Link to post
15 hours ago, Tarvis said:

Silly thought, are the sprites aligned? Most of the stock doom weapon HUD sprites are fairly off center towards the right.

Oh yeah. In fact, I even did the same alignments as the vanilla plasma on both the weapon itself and the projectile (that's the weapon it replaces). Same thing.

 

5 hours ago, ViolentBeetle said:

I had a weird problem that sounds like that with a monster projectile, I still have no idea why.

Have you written it from scratch or did you inherit it? I didn't inherit it and projectile spawned off, to this day I'm not sure why.

The first iteration of it was done from scratch, then I inherited from the plasma ball (since it replaces the plasma rifle). Nothing.

Share this post


Link to post
4 hours ago, Black Star said:

Oh yeah. In fact, I even did the same alignments as the vanilla plasma on both the weapon itself and the projectile (that's the weapon it replaces). Same thing. 

Well, the vanilla plasma rifle is misaligned, so that might not be the way to go.

Share this post


Link to post

How fast is the projectile?  I seem to recall from back in the day, with DeHackEd at least, if you gave a projectile higher than a certain speed it would start aiming strangely.

Share this post


Link to post
2 hours ago, ETTiNGRiNDER said:

How fast is the projectile?  I seem to recall from back in the day, with DeHackEd at least, if you gave a projectile higher than a certain speed it would start aiming strangely.

40.

 

2 hours ago, Tarvis said:

Well, the vanilla plasma rifle is misaligned, so that might not be the way to go.

I've tried all sorts. A little off to the left, to the right, up, down...

Share this post


Link to post

As mentioned by ETTiNGRiNDER, your projectile speed is too fast, which causes wonky behavior. A good rule of thumb is that the projectile speed should not be faster than twice its radius. You can get away with deviating from this rule (mostly by reducing the radius, not by increasing speed), but it's mostly trial and error to find a good balance. Personally, I've never used a projectile faster than 32.

Share this post


Link to post

That was indeed the culprit. ZDoom has a similar caveat with the projectile speed but I didn't know vanilla had a more restrictive one, thank you.

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
×