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

Swapping palettes causes the game to hang and crash #16

Open
Sate opened this issue Sep 1, 2024 · 4 comments
Open

Swapping palettes causes the game to hang and crash #16

Sate opened this issue Sep 1, 2024 · 4 comments

Comments

@Sate
Copy link

Sate commented Sep 1, 2024

I set up palettes and macros for SMN avatars like
/ma "Ifrit"
/tc palette change ifrit

If I boot up the game fresh and press it, the game instantly hangs and crashes. I tried putting a wait after the summon but it still hangs and crashes as soon as it tries to do the palette change.

Interestingly if I manually just cycle through my palettes once with the R2>R1 hotkey, then all of these macros and palettes work totally fine, and they keep working even if I change zones. It seems like cycling through them adds them to some memory or reference, that is missing when you open the game.

Playing on horizon client.

@ThornyFFXI
Copy link
Owner

There isn't any memory or reference that is updated when you cycle through them manually. Each image is loaded in through the code in texturecache.lua at the time of draw, if it is not already cached. Regardless of how the palette is changed, the first time the image is requested it will be loaded into a IDirect3DTexture8 and cached so that future loads don't need to load it again. Changing palettes via text command and changing palettes via the shoulder button both lead to the same code branch, which results in changing only text data that will be evaluated to draw images next time the render loop occurs. With that in mind, I'm not sure what to make of your report.

If you are using a 13th or 14th generation intel processor, I would be inclined to blame the hardware defects that have been recently brought to light. Several of the more difficult bugs we've traced down in the last year have eventually been attributed to them.

If you are not, have you reproduced the crash under controlled conditions? If you launch the game 5 times in a row, and immediately press the macro, it hangs every time? If you do the same, cycling through macro palettes first, it succeeds every time? Or, did you make this assumption based on a less controlled observation?

@Sate
Copy link
Author

Sate commented Sep 3, 2024

Using ryzen 3900x

Yes to controlled conditions best I could, loading up game and palette swap macro 100% leads to hang and crash. Doesn't matter if I change zones first or not. Cycling through succeeds every time and then allows everything to work fine for at least hours of playtime.

It's even so that I can play another job that doesn't palette swap for an hour, then swap to SMN, and if I forget to cycle through SMN's palettes and use the avatar macro it's immediate hang and crash.

Also /tc palette next works fine and counts as cycling, then allowing /tc palette change ifrit[/shiva/etc] to work without crashing.

Also just did some more tests and it seems I don't have to cycle through every palette, maybe just 1. But I definitely do have to first either cycle or /tc palette next to avoid /tc palette change ifrit[/shiva/etc] immediately hanging and crashing tho.

@ThornyFFXI
Copy link
Owner

ThornyFFXI commented Sep 7, 2024

I cannot find any relationship between using '/tc palette change' and a crash. I've attempted to replicate it on my own machine. I began by:
-Populate 8 palettes with random spells to get a variety of assets. Add a /tc palette change back to base for each spell.
-Create macros on the base palette to change to each other palette.

I tested three different ways:

  1. Reload addon. Go through the 8 palettes in order by changing from base to palette2 and back, base to palette3 and back, base to palette4 and back, and so on.

  2. Reload addon. Mash buttons rapidly, knowing each press on base palette will do a /tc palette change to another palette, and each press on another palette will go back to the base.

  3. Reload addon. Use a seperate script to send a random '/tc palette change' every single frame so it's constantly shuffling.

  4. Repeat of 3, but a totally fresh ffxi instance with nothing possibly loaded prior.

I did not have any crashes in any of these cases.

1:
https://github.com/user-attachments/assets/37794021-218f-4ba5-a004-fb66f0539922

2:
https://github.com/user-attachments/assets/20229fd2-0000-490a-8f82-c6b807f1f6ef

3:
https://github.com/user-attachments/assets/6a4a1978-9a5a-45c0-a974-e14c87131b1b

If you have any further information that you can contribute, I would love to solve this problem for people. You are not the only person to see anything like this. But, as far as I can tell, it is an issue upstream of the actual addon, and rests with dx8, your graphics driver, or your hardware.

@ThornyFFXI
Copy link
Owner

If you are able to upload the macro files you are using when the crash occurs, I would like to try to reproduce with the exact same macro set. These files are located at Ashita/config/addons/tcrossbar/charname_charid/bindings/globals.lua and Ashita/config/addons/tcrossbar/charname_charid/bindings/smn.lua

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

No branches or pull requests

3 participants
@Sate @ThornyFFXI and others