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

SongList: reworked search logic #24

Closed
wants to merge 1 commit into from
Closed

Conversation

f1nzer
Copy link

@f1nzer f1nzer commented Jan 26, 2024

Firstly, thank you for the fantastic mod!

I'm not proficient in C++, and I'm an absolute noob in quest mod development, but here's my attempt to enhance the search functionality. Currently, it performs poorly and most of the time it is nearly impossible to find songs by artists or by song name, in my opinion. Also, from time to time, there are some random results at the top.

I checked the algorithm and was a bit surprised with a woogabooga logic. The scoring was calculated based on some questionable conditions. Additionally, I believe sorting shouldn't impact the scoring at all; it should only reorder entries that were filtered previously (by ignoring any scores retrieved before).

Better song search for the BetterSongSearchQuest!

So, here are the changes I made:

  • introduced a new prefix-based search algorithm with a super simple scoring logic. Ideally it should be bm25 or tfidf (and maybe Trie for prefix search), but it is enough for now to go with a simple logic (IMHO)
  • if there are multiple words in your query, then it is treated as an AND operation over multiple prefix searches
  • added a Relevance sorting option (default) that currently uses scores (weights), but later on, it could be improved by including extra weights based on other properties (for example, rating might slightly affect the score).
  • reworked how sorting options work: no more extra sorting weights; it now reorders the matches according to the sorting options.

I understand that this is a port of the desktop mod version, and I'm not sure if it's okay to change the logic to be completely different from how it was implemented there.

Anyway, please try the new logic locally and let me know if it really works better than before or not (at least now I can find songs 😄)

fixes #17

offtop:
I'm facing an issue with the ./copy.ps1 script on windows (quest3):

adb: error: failed to copy 'build/libBetterSongSearch.so' to '/sdcard/Android/data/com.beatgames.beatsaber/files/mods/libBetterSongSearch.so': remote fchown failed: Operation not permitted
build/libBetterSongSearch.so: 1 file pushed, 0 skipped. 136.2 MB/s (8060032 bytes in 0.056s)
Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.beatgames.beatsaber/com.unity3d.player.UnityPlayerActivity }
Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.beatgames.beatsaber/com.unity3d.player.UnityPlayerActivity }
Warning: Activity not started, intent has been delivered to currently running top-most instance.

Maybe you know how to resolve the issue with the failed copy operation? The mod is disabled after this. Instead of this, I am currently building the qmod file and patching via QuestPatcher.

@FrozenAlex
Copy link
Collaborator

For now we are in the process of porting BSS to 1.34.2, some of your suggestions will make it into the final release but I feel like the search becomes a bit too simple. Can't really test it right now though cause I don't have 1.28.0.
You can join the efforts by joining BSMG server. Quest version development chat is in quest-mod-dev channel

@FrozenAlex
Copy link
Collaborator

I decided that this search search algorithm does not really fit the mod, I want the ranking to be as close to the PC version as possible. I will be looking into making it better, it seems like the original algo port just has some bugs that need to be addressed. Sorry for the long delay on the decision. For now I am closing this pull request.

@FrozenAlex FrozenAlex closed this Jul 22, 2024
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.

Song Searching is Whackadoodled
2 participants