feat: add CuriousAlgorithm and CuriousPlayer - #16
Open
trethore wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds Curious, a new skill point solver still focused on having the best performances possible.
What changed
In this PR you can find:
CuriousAlgorithmand registered it in the algorithm registry.CuriousPlayer, a lightweight player implementation used by the new algorithm.New algorithm
Curious Algorithm is the more aggressive version of Starving Goblin. It keeps the same fast paths for free items, positive-only items, and safe early returns, but adds heavier caching around prepared equipment data so repeated runs avoid decoding the same items again.
When negative bonuses are present, Curious still only rechecks the requirements that can actually be affected by those negatives. Before falling back to the pruned DFS, it also tries a greedy pass to catch common cases without opening the full search.
It performs especially well when the same player or equipment prefix is reused, since it can restore precomputed arrays, free-item aggregates, requirement masks, and impact masks instead of rebuilding everything from scratch.
Of course, the best thing to do is to see the algo source code by yourself!
Validation
Tests pass for Curious.
Benchmarks:
Ran with
.\gradlew.bat jmh "-PjmhArgs= -wi 1 -i 1 -f 1"