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

Weighted shuffle #56

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

Weighted shuffle #56

wants to merge 10 commits into from

Conversation

qadan
Copy link

@qadan qadan commented Aug 23, 2022

Adds a Random (Boost Unpicked) option to the list of swap modes. This fudges the randomness a bit such that the longer a game goes without being picked, the more likely it is to get picked.

Why?

For casual sessions, it can be desirable provide/showcase a broad variety that "feels" more random, even though it isn't.

How?

Picking the Random (Boost Unpicked) swap mode will cause the shuffler to hang onto a game_weights table in the config. All game weights are initialized to 0. When picking a game, the list of games to choose from is padded with copies of each game, based on its current game weight - except for the previously selected game, which is reset to 0. All games then have their weight increased by one.

New games should be accounted for, and games are removed from the weights list when they are marked complete.

Notes

The games list could get super big. But 64 bit lua is probably good for it. Could test and see if it gets nasty with a massive list over a long time if it comes to that.

@TheT113
Copy link

TheT113 commented Jul 27, 2023

I wanted to try this out, but when running the LUA I get error: "NLua.Exceptions.LuaScriptException: [string "main"]:169: invalid escape sequence near ''.'"

I am downloading the entire package directly from your branch.

@MrDannyPicard
Copy link

I'd like to use this myself but i get error:
" NLua.Exceptions.LuaScriptException: [string "main"]:169: invalid escape sequence near ''.' "

I've tried to swap this section with the original one but then i get another error on line 369, which i also try changing back to the original code, but at that point i get an error to use bizhawk v 2.6.1 (something about lua core)

Do you have any plan to fix this or should i give up?

Thanks.

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.

3 participants