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

WorldOffset field

Postby TehRealSalt » Sat Jul 24, 2021 6:45 pm

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
TehRealSalt
ヽ(◕ᴥ◕)ノ
 
Joined: 03 Apr 2014
Discord: TehRealSalt#6754
Github ID: TehRealSalt
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia (Modern GZDoom)

Re: WorldOffset field

Postby Major Cooke » Sat Jul 24, 2021 7:28 pm

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
Major Cooke
QZDoom Maintenance Team
 
Joined: 28 Jan 2007

Re: WorldOffset field

Postby Nash » Sat Jul 24, 2021 10:49 pm

Also, does it handle portals correctly?

(I didn't check the code, currently occupied, it's just a quick passing remark)
User avatar
Nash
Twitter/Facebook/Youtube: nashmuhandes
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Twitch ID: nashmuhandes
Github ID: nashmuhandes

Re: WorldOffset field

Postby TehRealSalt » Mon Jul 26, 2021 7:17 am

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.
User avatar
TehRealSalt
ヽ(◕ᴥ◕)ノ
 
Joined: 03 Apr 2014
Discord: TehRealSalt#6754
Github ID: TehRealSalt
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia (Modern GZDoom)


Return to Code Submissions

Who is online

Users browsing this forum: No registered users and 0 guests