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

Yacht Dice: Fix logic (again) so that score doesn't drop when receiving item #4044

Merged
merged 142 commits into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
142 commits
Select commit Hold shift + click to select a range
89b6d2e
Add the yacht dice (from other git) world to the yacht dice fork
spinerak May 24, 2024
10ea81d
Update .gitignore
spinerak May 24, 2024
fe196db
Removed zillion because it doesn't work
spinerak May 24, 2024
4903fb8
Update .gitignore
spinerak May 24, 2024
c94f231
added zillion again...
spinerak May 24, 2024
59e8f30
Now you can have 0 extra fragments
spinerak May 24, 2024
f19689f
Added alt categories, also options
spinerak May 24, 2024
55821d0
Added item categories
spinerak May 24, 2024
ae68fa0
Extra categories are now working! :dog:
spinerak May 24, 2024
7c1a68a
changed options and added exceptions
spinerak May 24, 2024
7c2b3df
Testing if I change the generate.py
spinerak May 24, 2024
d39f665
Revert "Testing if I change the generate.py"
spinerak May 24, 2024
49c6983
ignore gitignore
spinerak May 24, 2024
5820b1f
Delete .gitignore
spinerak May 24, 2024
bc5b064
Update .gitignore
spinerak May 24, 2024
343dce1
Update .gitignore
spinerak May 25, 2024
aed6696
Update logic, added multiplicative categories
spinerak May 25, 2024
d854023
Changed difficulties
spinerak May 25, 2024
796b17b
Update offline mode so that it works again
spinerak May 25, 2024
807405c
Adjusted difficulty
spinerak May 28, 2024
1a8d807
New version of the apworld, with 1000 as final score, always
spinerak May 28, 2024
43d102b
Changed yaml and small bug fixes
spinerak May 30, 2024
65e8703
no changes, just whitespaces
spinerak May 31, 2024
979f30f
changed how logic works
spinerak May 31, 2024
b51dcfb
Changed logic, tweaked a bit too
spinerak Jun 1, 2024
67fb4fb
Preparation for 2.0
spinerak Jun 1, 2024
c687368
logic tweak
spinerak Jun 1, 2024
975fd04
Logic for alt categories properly now
spinerak Jun 5, 2024
8b558bd
Update setup_en.md
spinerak Jun 5, 2024
7f2df9f
Update en_YachtDice.md
spinerak Jun 5, 2024
7355bfa
Merge pull request #1 from ArchipelagoMW/main
spinerak Jun 5, 2024
3da552d
Improve performance of add_distributions
spinerak Jun 5, 2024
2604054
Formatting style
spinerak Jun 5, 2024
d570ba6
restore gitignore to APMW
spinerak Jun 5, 2024
0464631
Tweaked generation parameters and methods
spinerak Jun 6, 2024
be65762
Version 2.0.3
spinerak Jun 6, 2024
1e935fb
Comments and editing
spinerak Jun 6, 2024
e8aaf22
Merge pull request #2 from ArchipelagoMW/main
spinerak Jun 6, 2024
97c37a3
Renamed setup guide
spinerak Jun 6, 2024
93e6715
Improved create_items code
spinerak Jun 7, 2024
864e36c
init of locations: remove self.event line
spinerak Jun 7, 2024
1aff595
Moved setting early items to generate_early
spinerak Jun 7, 2024
29b8ced
Add my name to CODEOWNERS
spinerak Jun 7, 2024
41cd899
Added Yacht Dice to the readme in list of games
spinerak Jun 7, 2024
3e8d89f
Improve performance of Yacht Dice
NewSoupVi Jun 7, 2024
3d7f23b
newline
NewSoupVi Jun 7, 2024
a3c9fb7
Improve typing
NewSoupVi Jun 7, 2024
676e876
This is actually just slower lol
NewSoupVi Jun 7, 2024
7fa48ea
Merge pull request #3 from NewSoupVi/pr/3482
spinerak Jun 7, 2024
78c198b
Update worlds/yachtdice/Items.py
spinerak Jun 7, 2024
f6fbf22
Apply suggestions from code review
spinerak Jun 7, 2024
c647c89
Update Options.py
spinerak Jun 7, 2024
3d30b3b
Merge branch 'main' of https://github.com/spinerak/ArchipelagoYachtDice
spinerak Jun 7, 2024
064c929
Styling
spinerak Jun 7, 2024
17402a5
finished text whichstory option
spinerak Jun 7, 2024
526733d
removed roll and rollfragments; not used
spinerak Jun 7, 2024
25df8e5
import; worlds not world :)
spinerak Jun 7, 2024
6250923
Option groups!
spinerak Jun 7, 2024
da820cc
ruff styling, fix
spinerak Jun 7, 2024
99dbcb0
ruff format styling!
spinerak Jun 7, 2024
2d66fd8
styling and capitalization of options
spinerak Jun 7, 2024
0d35411
small comment
spinerak Jun 7, 2024
2c3a4da
Merge branch 'main' into main
spinerak Jun 7, 2024
13340aa
Cleaned up the "state_is_a_list" a little bit
spinerak Jun 7, 2024
4e56a07
RUFF :dog:
spinerak Jun 7, 2024
5188d78
Changed filling the itempool for efficiency
spinerak Jun 8, 2024
7f298e6
:dog:
spinerak Jun 8, 2024
d31d6b2
Removed plando "fix"
spinerak Jun 10, 2024
5bb2883
Changed indent of score multiplier
spinerak Jun 10, 2024
06f105e
faster location function
spinerak Jun 10, 2024
a1acff3
Comments to docstrings
spinerak Jun 10, 2024
a823962
fixed making location closest to goal_score be goal_score
spinerak Jun 10, 2024
da26408
options format
spinerak Jun 10, 2024
aa0886c
iterate keys and values of a dict together
spinerak Jun 10, 2024
4839bf4
small optimization ListState
spinerak Jun 10, 2024
93812bb
faster collection of categories
spinerak Jun 10, 2024
03ba657
return arguments instead of making a list (will :dog: later)
spinerak Jun 10, 2024
e2f0567
Instead of turning it into a tuple, you can just make a tuple literal
spinerak Jun 10, 2024
17d9f66
remove .keys()
spinerak Jun 10, 2024
570af1a
change .random and used enumerate
spinerak Jun 10, 2024
40ef9aa
some readability improvements
spinerak Jun 11, 2024
0aa2b31
Remove location "0", we don't use that one
spinerak Jun 11, 2024
3626525
Remove lookup_id_to_name entirely
spinerak Jun 11, 2024
7a9b3e2
.append instead of += for single items, percentile function changed
spinerak Jun 11, 2024
b1ed50e
remove ) too many
spinerak Jun 11, 2024
42e9af2
Removed sorted from category list
spinerak Jun 11, 2024
34f2c1a
Hash categories (which makes it slower :( )
spinerak Jun 11, 2024
12ecd9f
Revert "Hash categories (which makes it slower :( )"
spinerak Jun 11, 2024
353a676
temporary push: 40% faster generation test
spinerak Jun 12, 2024
cd68860
Add Points item category
spinerak Jun 13, 2024
e11aba1
Reverse changes of bad idea :)
spinerak Jun 13, 2024
1789824
ruff :dog:
spinerak Jun 13, 2024
9290191
Use numpy and pmf function to speed up gen
spinerak Jun 13, 2024
5e8a219
Revert "Use numpy and pmf function to speed up gen"
spinerak Jun 14, 2024
5ce9194
Step inbetween to change the weights
spinerak Jun 14, 2024
42034af
Changed the weights to make it faster
spinerak Jun 14, 2024
4a5a799
Adjusted max_dist, split dice_simulation function
spinerak Jun 14, 2024
3c9c16d
Removed nonlocal and pass arguments instead
spinerak Jun 14, 2024
5269312
Change "weight-lists" to Dict[str, float]
spinerak Jun 14, 2024
18897e8
Removed the return from ini_locations.
spinerak Jun 14, 2024
b5c596a
Choice options; dont'use .value (will ruff later)
spinerak Jun 14, 2024
5089df1
Only put important options in slotdata
spinerak Jun 14, 2024
6342335
Merge branch 'main' into main
spinerak Jun 14, 2024
0c020d9
:dog:
spinerak Jun 14, 2024
e8fd7ca
Add Dict import
spinerak Jun 14, 2024
090859a
Split the cache per player, limit size to 400.
spinerak Jun 14, 2024
7d21ec9
:dog:
spinerak Jun 14, 2024
2018406
added , because of style
spinerak Jun 14, 2024
0327b60
Merge branch 'main' into main
spinerak Jun 14, 2024
17ac22e
Update apworld version to 2.0.6
spinerak Jun 15, 2024
d122181
Merge branch 'main' into main
spinerak Jun 16, 2024
577fb74
Multiple smaller code improvements
spinerak Jul 6, 2024
d93e62b
:dog: ruff
spinerak Jul 6, 2024
1b570d4
Merge branch 'main' into main
spinerak Jul 6, 2024
36c1c8d
Mostly minimize_extra_items improvements
spinerak Jul 20, 2024
676dfd4
ruff :dog:
spinerak Jul 20, 2024
19966a4
Removed printing options
spinerak Jul 23, 2024
45776e1
Reworded some option descriptions
spinerak Jul 30, 2024
fd1997a
Merge branch 'main' into main
NewSoupVi Aug 21, 2024
ee2f6c8
Yacht Dice: setup: change release-link to latest
spinerak Aug 21, 2024
43b081f
Several fixes and changes
spinerak Sep 4, 2024
a3e4ec4
:dog:
spinerak Sep 4, 2024
0a61ef1
Merge branch 'main' of https://github.com/ArchipelagoMW/Archipelago i…
spinerak Sep 4, 2024
74522c7
Merge pull request #5 from spinerak/ArchipelagoMW-main
spinerak Sep 4, 2024
dc831eb
Revert setup to what it was (latest, without S)
spinerak Sep 4, 2024
09b26e2
remove temp weights file, shouldn't be here
spinerak Sep 4, 2024
d8cc7f6
Made sure that there is not too many step score multipliers.
spinerak Sep 4, 2024
1626605
Merge pull request #6 from ArchipelagoMW/main
spinerak Sep 10, 2024
7a5a3f8
add filler item name
spinerak Sep 10, 2024
59eadb0
Merge pull request #7 from ArchipelagoMW/main
spinerak Sep 19, 2024
e9432f9
Textual fixes and changes
spinerak Sep 19, 2024
c2f7d67
Remove Victory item and use event instead.
spinerak Sep 19, 2024
f983f74
Revert "Remove Victory item and use event instead."
spinerak Sep 19, 2024
604f6ac
Revert "Textual fixes and changes"
spinerak Sep 19, 2024
8421523
Remove Victory item and make it an event instead
spinerak Sep 20, 2024
a59ebcd
Merge pull request #11 from ArchipelagoMW/main
spinerak Oct 9, 2024
13b0e61
Yacht Dice logic fix, no decreasing score when obtain item
spinerak Oct 9, 2024
f4c12e8
Logic fix: Revert max_tries and mults, change ordering
spinerak Oct 11, 2024
fff115a
Remove spaces :^)
spinerak Oct 11, 2024
ea8f827
Updated weights that are stochastically ordered by dice/roll
spinerak Oct 13, 2024
a3351f2
Swap for-loops to increase performance
spinerak Oct 14, 2024
4872284
Remove options with 0 chance from list
spinerak Oct 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions worlds/yachtdice/Rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,15 @@ def dice_simulation_strings(categories, num_dice, num_rolls, fixed_mult, step_mu
return yachtdice_cache[player][tup]

# sort categories because for the step multiplier, you will want low-scoring categories first
categories.sort(key=lambda category: category.mean_score(num_dice, num_rolls))
# to avoid errors with order changing when obtaining rolls, we order assuming 4 rolls
categories.sort(key=lambda category: category.mean_score(num_dice, 4))

# function to add two discrete distribution.
# defaultdict is a dict where you don't need to check if an id is present, you can just use += (lot faster)
def add_distributions(dist1, dist2):
combined_dist = defaultdict(float)
for val1, prob1 in dist1.items():
for val2, prob2 in dist2.items():
for val2, prob2 in dist2.items():
for val1, prob1 in dist1.items():
combined_dist[val1 + val2] += prob1 * prob2
return dict(combined_dist)

Expand Down
Loading
Loading