[ZScript / Decorate] A_SpriteOffset odd behaviour [SOLVED]

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)

[ZScript / Decorate] A_SpriteOffset odd behaviour [SOLVED]

Postby difficultoldstuff » Thu Jun 23, 2022 3:45 pm

Hello once again! Think I have a quirk for finding weird behaviors and oddities...

Today I was playing with the A_SpriteOffset action, designing some actors that slowly sink into the pool of liquid and disappear after some time. Decided to use this action as the most rational and efficient way of moving the graphic down instead of animating it, when I noticed something... Not entirely expected. The sprite slowly lowered as expected but up to a certain point. Then they... stopped, only to later resume to sink in, but chaining their offset dramatically in one big jump, instead gradually. Some even rose up instead of going down! Having hard time finding other examples or discussion about this action, so... any ideas or input on this odd behavior would be a godsend!

This is a minimal example of this odd bug, tested on GZDoom 4.8.0 / OpenGL / Hardware Renderer:

Code: Select allExpand view
class SinkyActor : Actor
{
    double yOffset;

    States
    {
        Spawn:
            HEAD A 35;
            HEAD A 0 A_SpriteOffset(0.0, yOffset);
            HEAD A 0
            {
                invoker.yOffset += 1.0;
                console.printf("OFFSET: %d", invoker.yOffset);
            }
            Loop;
    }
}


Using an int, float or double as the offset doesn't really matter it seems. Thank you for any input and cheers (dev beer)!

Edit: formatting, more info.
Last edited by difficultoldstuff on Fri Jun 24, 2022 4:22 am, edited 1 time in total.
difficultoldstuff
 
Joined: 17 Jul 2020
Twitch ID: difficultoldstuff
Operating System: Windows Vista/7/2008 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: [ZScript / Decorate] A_SpriteOffset odd behaviour / bug.

Postby Blue Shadow » Thu Jun 23, 2022 5:04 pm

My guess it's something to do with sprite clipping.
User avatar
Blue Shadow
 
Joined: 14 Nov 2010
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: ATI/AMD (Modern GZDoom)

Re: [ZScript / Decorate] A_SpriteOffset odd behaviour / bug.

Postby difficultoldstuff » Thu Jun 23, 2022 5:57 pm

Excellent! Indeed, with gl_spriteclip set to "Never" or "Smart" it performs just as expected, while "Always" and "Smarter" make it quite unpredictable. Thank you for the input Shadow, it'd take me weeks to figure out to look into OpenGL options. I assume there's no way of forcing it to behave a certain way if the value is set to 2 or 3 (3 being the default), so apparently it's not a bug, just a quirk.
difficultoldstuff
 
Joined: 17 Jul 2020
Twitch ID: difficultoldstuff
Operating System: Windows Vista/7/2008 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support


Return to Scripting

Who is online

Users browsing this forum: No registered users and 2 guests