WorldOffset field

Like feature suggestions, but you've actually written code to make it happen. More likely to make it into the game than some random request in feature suggestions.

Moderator: GZDoom Developers

Forum rules
Please see Code submission guidelines

GZDoom Status:
Image

Legacy Status:
Image Image

QZDoom Status:
Image
User avatar
TehRealSalt
Posts: 141
Joined: Thu Apr 03, 2014 10:25 am
Graphics Processor: nVidia (Modern GZDoom)

WorldOffset field

Post by TehRealSalt »

Pull Request

Adjusts the thing's 3D position on render side. This allows for adjusting a thing's visual position without impacting their hitbox. I wanted to do something like this as a hit-stun effect for my TC (although I ended up rolling with a different effect because I couldn't do this). However I still think this can be a incredibly useful feature.

This is an example script that gives the Doom imp fireball a crazy spinning effect, ala Shotzo's bullets from Kirby: https://mega.nz/file/K2IVASBZ#58jjARYMO ... I4YXHyYTUw

(I am relatively inexperienced with GZDoom's codebase, mostly have dug around with vanilla Doom, so please let me know if there's anything important I missed.)
User avatar
Major Cooke
Posts: 8089
Joined: Sun Jan 28, 2007 3:55 pm

Re: WorldOffset field

Post by Major Cooke »

I could certainly appreciate this, especially when it comes to actors with +NOINTERACTION and not moving which are the most optimized of them all.

However I'm curious. Does the sprite render when the image is, say, around a corner and out of sight of the original actor?

Take this for example. Pretend the player is some regular actor, and the map spot is the projected location with WorldOffset. Does the image render appropriately and de-render if out of sight based on WorldOffset?

Second, what about interpolation?
User avatar
Nash
 
 
Posts: 17320
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia

Re: WorldOffset field

Post by Nash »

Also, does it handle portals correctly?

(I didn't check the code, currently occupied, it's just a quick passing remark)
User avatar
TehRealSalt
Posts: 141
Joined: Thu Apr 03, 2014 10:25 am
Graphics Processor: nVidia (Modern GZDoom)

Re: WorldOffset field

Post by TehRealSalt »

I haven't checked if it works for crazy offsets or portals. Doesn't interpolate at all though.

I was mostly aiming to make a "3D" version of SpriteOffset that would work with models, and I'm pretty sure it doesn't handle any of those cases either. I could look into supporting it later tonight though.

Return to “Code Submissions”