Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix billboard atlas animation playing order and frame count #5997

Merged
merged 2 commits into from
Jan 1, 2025

Conversation

fluffyfreak
Copy link
Contributor

@fluffyfreak fluffyfreak commented Dec 24, 2024

Fixes #5881

It looks like we had the texture atlas selection inverted so it was playing from the "end" of the atlases animation.

I say "inverted" and "end" but these are slightly arbitrary because we define what they should be. However starting at the top-left is a reasonable convention and not an arbitrary point within the texture atlas, progressing to the top-left which is how it was behaving.

This is a handy test atlas with numbers in each slot so you can change Sfx.ini to point to it, and then instead of the explosion you can see the numbers counting up.
test_atlas.zip

Taking the above test-atlas you could see it counting down from 30 to 0, which I think most people would find odd.
image

There was also an issue with it playing only 31 out of 32 frames of animation from the animation.

Finally I added the ability to press Ctrl+F8 if you're running a dev build with devkeys enables and it will spawn an explosion billboard right atop your ship. It's purely visual but very useful for testing, for example if someone wanted to replace the existing explosion etc, and could be extended to show other effects easily.

I've tested all of this quite a bit, sadly the texture supplied in the original bug by @Miner34dev isn't suitable for use as is because it fades to the black instead of alpha, and then terminates suddenly.

@impaktor
Copy link
Member

Cool

Finally I added the ability to press Ctrl+F8 if you're running a dev build with devkeys enables and it will spawn an explosion billboard right atop your ship

Should we document this somewhere on the wiki, or could we have it bound to a button in the debug window?

@sturnclaw
Copy link
Member

However starting at the top-left is a reasonable convention

An expected convention, even. This is a good change, thank you. One minor nitpick - the comment in code mentions counting "down", but the PR appears to be changing to counting "up"; am I misreading that?

Should we document this somewhere on the wiki, or could we have it bound to a button in the debug window?

At your discretion - I'm really not worried about documenting it however, as it's strongly unlikely to be useful outside of extremely niche development/testing cases.

@fluffyfreak
Copy link
Contributor Author

fluffyfreak commented Dec 31, 2024

However starting at the top-left is a reasonable convention

An expected convention, even. This is a good change, thank you. One minor nitpick - the comment in code mentions counting "down", but the PR appears to be changing to counting "up"; am I misreading that?

I think it's just me using English badly, as all Englishmen do :D
In my head I was counting DOWN as being through the images as though they were on a film reel
but really it's UP through the indexes 🤔

I'll change it to up and make it clear that it is UP through the indexes, thanks

Actually the sprite_index is indeed counting downwards numerically from max_texture to zero. But when this is mapped to the UV coordinates using % and / this all works out as mapping to the top-left of the texture

@sturnclaw
Copy link
Member

In that light, I'll merge as-is, thanks!

@sturnclaw sturnclaw merged commit e0f5244 into pioneerspacesim:master Jan 1, 2025
4 checks passed
@fluffyfreak fluffyfreak deleted the fix-5881 branch January 2, 2025 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Atlases in Sfx.ini are played backwards
3 participants