0000601: A_SpriteOffset

These are not rejected - but are not considered highly important right now.

Moderator: GZDoom Developers

0000601: A_SpriteOffset

Postby Xaser » Sun Apr 30, 2017 7:23 pm

https://mantis.zdoom.org/view.php?id=601
Code: Select allExpand view
Summary   0000601: A_SpriteOffset
Description   A_SpriteOffset is like A_WeaponOffset, except it applies offsets to the Actor's world sprite (relative to whatever offsets are set on the sprite lump itself, of course). 'Nuff said... ish.

- - -

I did some research a while back on if this is is reasonably doable in-engine (since sprite offsets are stored in the texture and I'm not sure if there's some easy+performant way of snagging an additional offset from the Actor as well), but my results were inconclusive. It came to mind again, so I figure it's worth posing the question to the experts to get a hard yes/no.

Side-note: My own use case is to oust the TEXTURES shenanigans I'm doing in DamNums [ https://forum.zdoom.org/viewtopic.php?f=46&t=55048 ] to get multi-digit numbers to work without futzing with aligning each digit in world-space, relative to the player, in a multiplayer-safe fashion. Yukko.

[BTW, I know we're in "feature freeze" mode; just getting a bead on if this is even engine-feasible before pursuing other avenues of exploration for DamNums.]
User avatar
Xaser
anarchivist
 
 
 
Joined: 20 Jul 2003

Re: 0000601: A_SpriteOffset

Postby Graf Zahl » Sun Apr 30, 2017 7:23 pm

This will be a bit tricky. The offset is a texture property so messing around with it can become a problem if textures are getting replaced and afterward the offsets no longer match.

Definitely not for 3.0.
User avatar
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: 0000601: A_SpriteOffset

Postby Xaser » Sun Apr 30, 2017 7:23 pm

"Tricky" is more promising than "Impossible". :P

[Pre-disclaimer for the below text: I could be misunderstanding how something works, since this part of the codebase is all pretty new to me.]

The troublesome bit conceptually is that it doesn't seem safe to actually modify the offsets on the texture -- if you've got two imps side-by-side displaying TROOA1 and one of them calls A_SpriteOffset, wouldn't it affect both actors? Seems more like the question would be "Can we pass this piece of actor data to the renderers?"

Looking into it a bit more, this at least seems easy to do in the software renderers (standard and SoftPoly) since the relevant functions both have AActor pointers handy for consumption. It's GL I'm worried about.
User avatar
Xaser
anarchivist
 
 
 
Joined: 20 Jul 2003

Re: 0000601: A_SpriteOffset

Postby Major Cooke » Thu Jul 18, 2019 11:12 am

I just had a thought. I've been doing projectile offsets incorrectly since the very beginning. Then again, so has Doom in some cases. This would most definitely explain why projectiles can sink in about half way into the ground and clip, before exploding. It's all because the sprites are mostly centered at the Z position.

Now I feel stupid for having contended to such a mistake.

Graf: Where can I find the information about sprite offsets? I think I'll take a crack at making apply on a per-actor basis, where it just takes the actor's SpriteOffset vector2 and shifts the sprite's rendering position, if it's an actor.
User avatar
Major Cooke
Do unto others as you would have unto you. Judge yourself first.
 
Joined: 28 Jan 2007

Re: 0000601: A_SpriteOffset

Postby Rachael » Thu Jul 18, 2019 12:38 pm

All actors are drawn from the feet up, including projectiles. So the collision box for a projectile typically looks nothing like its sprite.

And yes, that does mean Doom kind of did it wrong, all along.

If you tried to correct this though, you would at the very least have to offset the spawn height of the projectiles a bit to make up for it, otherwise it would just look plain weird.
User avatar
Rachael
Webmaster
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle
Graphics Processor: nVidia with Vulkan support

Re: 0000601: A_SpriteOffset

Postby Graf Zahl » Thu Jul 18, 2019 1:27 pm

Doom did so many things wrong that trying to fix them will do more harm than good.
User avatar
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: 0000601: A_SpriteOffset

Postby Major Cooke » Thu Jul 18, 2019 2:05 pm

I wouldn't be trying to correct anything. I'd just be introducing a function that allows a bit of extra offsetting. Specifically only for actors. That's why I was asking where the code is for offsets, maybe I can try passing in those coordinates somehow.
User avatar
Major Cooke
Do unto others as you would have unto you. Judge yourself first.
 
Joined: 28 Jan 2007


Return to On Hold Suggestions

Who is online

Users browsing this forum: No registered users and 0 guests