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

Casting spells too fast on Android causes crash #113

Open
collinsmith opened this issue Sep 10, 2020 · 3 comments
Open

Casting spells too fast on Android causes crash #113

collinsmith opened this issue Sep 10, 2020 · 3 comments

Comments

@collinsmith
Copy link
Owner

Casting spells too fast on Android causes crash. I think that android I/O is too slow which is causing a crash if too many spells are casted in succession. Requires more investigation, because there should be an I/O block until the asset is loaded, but the app is pushing on ahead and getting an IOOBE.

@collinsmith
Copy link
Owner Author

I'm seeing similar crashes on desktop now that I've implemented basic combat. I worked around the issue by returning valid values from the problematic function calls, but these should be reverted when this issue is resolved.

I believe this issue is related to having a dynamic number of directions based on animation. Changing animations should copy the current directions, so it looks like this is happening for invalid directions (who should default to closest direction, or 0). After solving the issue in this comment, I need to double check the original issue on android to see if it was the same problem.

@collinsmith
Copy link
Owner Author

Yea... after looking into it a bit more, I'm pretty confident this is the issue. Far less apparent on desktop due to I/O speeds being way faster. Due to how animation layers are streamed, some layers may not have the same number of directions (or frames) as needed at the time of drawing. This can be fixed in a few ways, potentially the easiest would be to simply clear the old layers when the cof changes, but what I want to try also is using bit flags to know when required layers are loaded.

I/O speedups could also alleviate this issue. I'm sure I will probably want to cache certain animations later (especially on android), but that is an optimization that I am leaving for another time when I have a better understanding of what assets are required.

6 small changes work around this issue for now to hide it.

@collinsmith
Copy link
Owner Author

collinsmith commented Sep 11, 2020

I noticed at least one specific bug which may be causing this issue with the quillrat missiles not moving. I'll look into that, since they should be. Resolved by below commit. Waiting to see how issue progresses.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant