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

Optimize Item Combination Function #9

Closed
dun1007 opened this issue Dec 25, 2015 · 3 comments
Closed

Optimize Item Combination Function #9

dun1007 opened this issue Dec 25, 2015 · 3 comments

Comments

@dun1007
Copy link
Owner

dun1007 commented Dec 25, 2015

Current function that handles item combo is O(n^3) with recursive call in the loop. Buying multiple items at the same time(i.e EX scroll) can cause a significant frame lag.

@dun1007
Copy link
Owner Author

dun1007 commented Dec 31, 2015

Commenting lua code out revealed that the freeze was actually due to engine trying to directly precache all soundclips used by item. So when a player tries to purchase EX scroll by shop UI, it would compile up to 15 sound events at the same time.

Possible fix is adding a separate item that replicates EX scroll, but the compromise will have to be made with UI(no longer displays component, potential lack of clarity for new players).

EDIT: ok nevermind stutter happens for any combine event, just the matter of quantity

@dun1007
Copy link
Owner Author

dun1007 commented Apr 7, 2016

Solved after game got dedi

@dun1007 dun1007 closed this as completed Apr 7, 2016
@dun1007
Copy link
Owner Author

dun1007 commented May 1, 2016

Doesn't lag anymore but may be a cause for occasional crash

@dun1007 dun1007 reopened this May 1, 2016
@dun1007 dun1007 closed this as completed Jan 11, 2017
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