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

shapez: Implement New Game #3960

Open
wants to merge 146 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
146 commits
Select commit Hold shift + click to select a range
ea6565b
Copied Clique's world folder to have something to work with
BlastSlimey Jul 31, 2024
a792ad4
Replaced copied world structure with templates from docs
BlastSlimey Aug 1, 2024
16110e1
Wrote list of items with groups, list of locations with regions, and …
BlastSlimey Aug 4, 2024
33b2a21
Merge pull request #1 from ArchipelagoMW/main
BlastSlimey Aug 4, 2024
f8231ce
Regions, entrances, presets, completed init, and other small changes
BlastSlimey Aug 5, 2024
f825172
Merge remote-tracking branch 'origin/main'
BlastSlimey Aug 5, 2024
607eb88
Delete item groups
BlastSlimey Aug 5, 2024
bf18664
Small fixes
BlastSlimey Aug 5, 2024
7dfb6cf
Different fixes
BlastSlimey Aug 5, 2024
9f8f389
Added Shapesanity, changed options regarding achievements, changed cr…
BlastSlimey Aug 7, 2024
e171894
More changes
BlastSlimey Aug 11, 2024
e940ee0
More changes, temporarily removed achievements
BlastSlimey Aug 12, 2024
acac25a
Ordered location list, changed building logic, fixed ShapezWeb loadin…
BlastSlimey Aug 14, 2024
4be8e8b
Expanded shapesanity (2-1, 1-1, one attribute - four attributes)
BlastSlimey Aug 14, 2024
18ea248
Early useful option, spoiler path generating, level/upgrade bundles, …
BlastSlimey Aug 17, 2024
d077540
Throughput levels ratio option, more diverse traps, spoiler path gene…
BlastSlimey Aug 17, 2024
feb1ec6
More presets
BlastSlimey Aug 18, 2024
9d460cd
Fixed Issues with tests
BlastSlimey Aug 18, 2024
0ffd433
Merge pull request #2 from ArchipelagoMW/main
BlastSlimey Aug 18, 2024
5e36772
Idk why this was changed so let's not touch anything
BlastSlimey Aug 18, 2024
c335b48
Renamed upgrade categories
BlastSlimey Aug 18, 2024
5928bba
Enhanced options docs, specified return type everywhere
BlastSlimey Aug 18, 2024
8c57707
Cleaned unnecessary option.value calls
BlastSlimey Aug 18, 2024
df9d482
Completed item descriptions
BlastSlimey Aug 18, 2024
e27ea3d
Game info doc name, Rotator (180) wrong name, illegal preset value
BlastSlimey Aug 23, 2024
1b4bcab
Fixed type annotation compatibility for python 3.8
BlastSlimey Aug 23, 2024
eb88dbe
Finished docs
BlastSlimey Aug 23, 2024
84e197e
Cleaned Choice options comparison
BlastSlimey Aug 24, 2024
e63ed98
Added locked belt and extractor option
BlastSlimey Aug 24, 2024
196c05a
Reworked and added logic types
BlastSlimey Aug 26, 2024
104e86e
Fixed building order shuffling
BlastSlimey Aug 26, 2024
195a9df
Fixed Category (+random) Upgrade logic error
BlastSlimey Aug 26, 2024
1dc125d
Fixed error from unused import
BlastSlimey Aug 26, 2024
1f76a49
Merge branch 'ArchipelagoMW:main' into main
BlastSlimey Aug 26, 2024
706312e
Fixed level logic type random phase calculation
BlastSlimey Aug 26, 2024
74f9669
Fixed late upgrade logic in category types
BlastSlimey Aug 26, 2024
c172ca1
Changed some rich text in options docs
BlastSlimey Aug 26, 2024
48437f8
Renamed level logic type random to random_steps
BlastSlimey Aug 26, 2024
b38ae20
Merge branch 'ArchipelagoMW:main' into main
BlastSlimey Sep 2, 2024
c10bf57
Fixed logic types category (+random) duplicates
BlastSlimey Sep 2, 2024
1b16b09
Merge remote-tracking branch 'origin/main'
BlastSlimey Sep 2, 2024
fd2ec5e
Merge branch 'ArchipelagoMW:main' into main
BlastSlimey Sep 4, 2024
966681e
Shapez: Universal Tracker integration
axxroytovu Sep 4, 2024
5c143df
Fixed type annotation for python 3.8 in interpret_slot_data
BlastSlimey Sep 5, 2024
87071f0
Expanded shapesanity to complete single layer
BlastSlimey Sep 5, 2024
82d975f
Updated shapesanity amount option
BlastSlimey Sep 5, 2024
37d52db
Fixed type annotation of shapesanity dicts
BlastSlimey Sep 5, 2024
ef4f8a5
Changed and added logic to efficiency iii goal
BlastSlimey Sep 5, 2024
8b45446
Re-added achievements as locations
BlastSlimey Sep 5, 2024
f1d0c10
Fixed included locations adding achievements
BlastSlimey Sep 5, 2024
66d8e28
Rewrote region connections
BlastSlimey Sep 6, 2024
33e8094
Fixed missing achievements in all_locations
BlastSlimey Sep 6, 2024
9da0454
Added building variants to region logic
BlastSlimey Sep 6, 2024
c92c836
Added options preset "most vanilla"
BlastSlimey Sep 6, 2024
e00df77
Merge branch 'ArchipelagoMW:main' into main
BlastSlimey Sep 6, 2024
5a2c6b0
Added split inventory draining trap option
BlastSlimey Sep 6, 2024
70ff903
Split shapesanity 2-1-1
BlastSlimey Sep 6, 2024
0cc7c94
Updated docs
BlastSlimey Sep 6, 2024
b007e95
Merge remote-tracking branch 'origin/main'
BlastSlimey Sep 6, 2024
092f970
Fixed category random logic type index out of bounds
BlastSlimey Sep 6, 2024
9ccbe42
Updated shapesanity cheat sheet in docs
BlastSlimey Sep 6, 2024
5497b52
Fixed category (+random) logic type
BlastSlimey Sep 6, 2024
60875e8
Added missing slot data for achievement options
BlastSlimey Sep 6, 2024
46ffcf9
Changed client seed range
BlastSlimey Sep 7, 2024
9c47471
Fixed achievements needing blueprints
BlastSlimey Sep 8, 2024
e5e9a51
Fixed some achievements to menu region
BlastSlimey Sep 8, 2024
1ecbbbb
Fixed missing comma
BlastSlimey Sep 8, 2024
32a3805
Added Switch Item and Level 20 Additional 2 location
BlastSlimey Sep 8, 2024
e622d41
Merge branch 'ArchipelagoMW:main' into main
BlastSlimey Sep 8, 2024
f065143
Fixed Menu Region construction
BlastSlimey Sep 8, 2024
e947601
Merge remote-tracking branch 'origin/main'
BlastSlimey Sep 8, 2024
f33537c
Fixed Menu Region double appending to region list
BlastSlimey Sep 8, 2024
4e34673
Merge branch 'ArchipelagoMW:main' into main
BlastSlimey Sep 8, 2024
d9048f8
Cleaned up code styling
BlastSlimey Sep 8, 2024
8688c87
Removed quad cutter from logic
BlastSlimey Sep 8, 2024
835983a
Fixed blueprint achievements logic
BlastSlimey Sep 8, 2024
8b73304
Fixed shapesanity 2-sided singles names
BlastSlimey Sep 9, 2024
21e3c5d
Remove concept.txt
BlastSlimey Sep 9, 2024
b09b9cf
Made shapesanity logic more precise
BlastSlimey Sep 9, 2024
f48a82f
Fix shapesanity reqrite leftovers
BlastSlimey Sep 9, 2024
83f9c04
Fixed draining traps never being generated
BlastSlimey Sep 10, 2024
1a33405
Added get_filler_item_name
BlastSlimey Sep 10, 2024
beef240
Merge branch 'ArchipelagoMW:main' into main
BlastSlimey Sep 10, 2024
cc930fe
Merge remote-tracking branch 'origin/main'
BlastSlimey Sep 10, 2024
501e4ba
Removed unused Level 1000 check
BlastSlimey Sep 11, 2024
d5e6edc
Added lite apworld
BlastSlimey Sep 11, 2024
ddaae98
Added lite apworld unit tests
BlastSlimey Sep 11, 2024
51f83aa
Small fixes
BlastSlimey Sep 11, 2024
068a10c
Changed lite world multidata name
BlastSlimey Sep 12, 2024
4c3d2f9
Fixed lite not receiving checks properly
BlastSlimey Sep 12, 2024
4e8a5c3
If I had a penny for every backwards compatibility issue that made me…
BlastSlimey Sep 12, 2024
a073ff5
idk
BlastSlimey Sep 12, 2024
767261f
Removed lite world, Reworked shapesanity locations, reduced goal_amount
BlastSlimey Sep 14, 2024
75e4014
Added more tests
BlastSlimey Sep 14, 2024
7936bb2
Merge branch 'ArchipelagoMW:main' into main
BlastSlimey Sep 14, 2024
441bdab
Added location aliases
BlastSlimey Sep 15, 2024
242b2d8
Added world description
BlastSlimey Sep 16, 2024
8a0bdae
Relocated and cleaned shapesanity initialization, fixed addshapesanit…
BlastSlimey Sep 16, 2024
a323a29
Fixed shapesanity cheat sheets not showing
BlastSlimey Sep 16, 2024
7befd1f
Merge branch 'ArchipelagoMW:main' into main
BlastSlimey Sep 16, 2024
4984ec4
Small shapesanity alias change
BlastSlimey Sep 16, 2024
3dd8064
Merge remote-tracking branch 'origin/main'
BlastSlimey Sep 16, 2024
65f7456
Fixed shapesanity ratios miscalculation
BlastSlimey Sep 16, 2024
ee5cdc3
Removed unused achievement slot data
BlastSlimey Sep 17, 2024
6d31295
Added UT aliases for achievements
BlastSlimey Sep 18, 2024
59f1f14
Merge branch 'ArchipelagoMW:main' into main
BlastSlimey Sep 18, 2024
fcfce04
Added player to option error for mam goal
BlastSlimey Sep 19, 2024
38dac6f
Minor cleanups from first review
BlastSlimey Sep 19, 2024
01cab56
Merge branch 'ArchipelagoMW:main' into main
BlastSlimey Sep 19, 2024
032cb59
Cleanups from second review
BlastSlimey Sep 19, 2024
a32f7a0
Added max_levels_and_upgrades value for easier adjusting
BlastSlimey Sep 19, 2024
8f5f958
Merge remote-tracking branch 'origin/main'
BlastSlimey Sep 19, 2024
9d8aa7f
Replaced shapesanity pool generator with pregenerated json file
BlastSlimey Sep 19, 2024
2a889a6
Fixed file not found and typo
BlastSlimey Sep 20, 2024
5908832
Actually fixed file not found
BlastSlimey Sep 20, 2024
d53e725
Changed shapesanity pool from json to py file
BlastSlimey Sep 20, 2024
3685f86
More cleanups and more comments
BlastSlimey Sep 20, 2024
813e600
Adding some location descriptions (part 1)
BlastSlimey Sep 21, 2024
608ec8e
Fixed randomized buildings order for levels and upgrades not being ra…
BlastSlimey Sep 21, 2024
0cefea7
Added tests for world instance specific values
BlastSlimey Sep 22, 2024
e794f6c
Removed placeholder values from world instance specific attributes
BlastSlimey Sep 22, 2024
b313ce9
Moved max_levels_and_uprgades and max_shapesanity to easy-to-edit jso…
BlastSlimey Sep 24, 2024
647c622
Changed preset and test values of goal_amount and shapesanity_amount …
BlastSlimey Sep 24, 2024
78e1a61
Added tutorial for changing datapackage options
BlastSlimey Sep 24, 2024
cc25eed
Add belt and extractor to precollected if not locked
BlastSlimey Sep 26, 2024
1ae1f80
Raise an OptinError when locking belt and extractor without including…
BlastSlimey Oct 1, 2024
9479ff0
Raise an error if there are more guaranteed item than available locat…
BlastSlimey Oct 1, 2024
379c83f
Merge branch 'ArchipelagoMW:main' into main
BlastSlimey Oct 1, 2024
1ef5cfe
Add Universal Tracker to optional software in setup docs
BlastSlimey Oct 18, 2024
86af336
Small upgrade regions change
BlastSlimey Oct 25, 2024
6dae9c3
Enhanced item classifications based on player options
BlastSlimey Oct 26, 2024
72443cb
Added allow_floating_layers option and cleaned up some toggle option …
BlastSlimey Oct 27, 2024
79585b9
Merge branch 'ArchipelagoMW:main' into main
BlastSlimey Oct 28, 2024
e1ecc38
Added instructions for reconnecting to english setup doc
BlastSlimey Oct 29, 2024
07aeeaa
Added instructions for reconnecting in german setup doc
BlastSlimey Oct 29, 2024
4ef11f4
Added missing space in doc
BlastSlimey Oct 29, 2024
13405a5
Included compact merger and splitter as alternatives to belts in logi…
BlastSlimey Oct 31, 2024
41240a3
Small option description change
BlastSlimey Nov 10, 2024
392db97
Why did nobody tell me how to not make everything a class attribute
BlastSlimey Nov 10, 2024
66398e0
Merge branch 'ArchipelagoMW:main' into main
BlastSlimey Nov 10, 2024
fbb1e6d
Merge branch 'ArchipelagoMW:main' into main
BlastSlimey Nov 16, 2024
ea5b518
Yet another category(_random) upgrade logic change
BlastSlimey Dec 2, 2024
eb86f08
Merge remote-tracking branch 'origin/main'
BlastSlimey Dec 2, 2024
b6497a4
Typo
BlastSlimey Dec 2, 2024
d1436a8
Force balancers, tunnel, and trash to not appear in UT regen
BlastSlimey Dec 3, 2024
09d3cef
Merge branch 'ArchipelagoMW:main' into main
BlastSlimey Dec 5, 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
332 changes: 332 additions & 0 deletions worlds/shapez/__init__.py

Large diffs are not rendered by default.

Empty file added worlds/shapez/data/__init__.py
Empty file.
130 changes: 130 additions & 0 deletions worlds/shapez/data/generate.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
import itertools
import time
from typing import Dict, List

shapesanity_simple: Dict[str, str] = {}
shapesanity_1_4: Dict[str, str] = {}
shapesanity_two_sided: Dict[str, str] = {}
shapesanity_three_parts: Dict[str, str] = {}
shapesanity_four_parts: Dict[str, str] = {}
subshape_names = ["Circle", "Square", "Star", "Windmill"]
color_names = ["Red", "Blue", "Green", "Yellow", "Purple", "Cyan", "White", "Uncolored"]
short_subshapes = ["C", "R", "S", "W"]
short_colors = ["b", "c", "g", "p", "r", "u", "w", "y"]


def color_to_needed_building(color_list: List[str]) -> str:
for next_color in color_list:
if next_color in ["Yellow", "Purple", "Cyan", "White", "y", "p", "c", "w"]:
return "Mixed"
for next_color in color_list:
if next_color not in ["Uncolored", "u"]:
return "Painted"
return "Uncolored"


def generate_shapesanity_pool() -> None:
# same shapes && same color
for color in color_names:
color_region = color_to_needed_building([color])
shapesanity_simple[f"{color} Circle"] = f"Shapesanity Full {color_region}"
shapesanity_simple[f"{color} Square"] = f"Shapesanity Full {color_region}"
shapesanity_simple[f"{color} Star"] = f"Shapesanity Full {color_region}"
shapesanity_simple[f"{color} Windmill"] = f"Shapesanity East Windmill {color_region}"
for shape in subshape_names:
for color in color_names:
color_region = color_to_needed_building([color])
shapesanity_simple[f"Half {color} {shape}"] = f"Shapesanity Half {color_region}"
shapesanity_simple[f"{color} {shape} Piece"] = f"Shapesanity Piece {color_region}"
shapesanity_simple[f"Cut Out {color} {shape}"] = f"Shapesanity Stitched {color_region}"
shapesanity_simple[f"Cornered {color} {shape}"] = f"Shapesanity Stitched {color_region}"

# one color && 4 shapes (including empty)
for first_color, second_color, third_color, fourth_color in itertools.combinations(short_colors+["-"], 4):
colors = [first_color, second_color, third_color, fourth_color]
color_region = color_to_needed_building(colors)
shape_regions = ["Stitched", "Stitched"] if fourth_color == "-" else ["Colorful Full", "Colorful East Windmill"]
color_code = ''.join(colors)
shapesanity_1_4[f"{color_code} Circle"] = f"Shapesanity {shape_regions[0]} {color_region}"
shapesanity_1_4[f"{color_code} Square"] = f"Shapesanity {shape_regions[0]} {color_region}"
shapesanity_1_4[f"{color_code} Star"] = f"Shapesanity {shape_regions[0]} {color_region}"
shapesanity_1_4[f"{color_code} Windmill"] = f"Shapesanity {shape_regions[1]} {color_region}"

# one shape && 4 colors (including empty)
for first_shape, second_shape, third_shape, fourth_shape in itertools.combinations(short_subshapes+["-"], 4):
for color in color_names:
shapesanity_1_4[f"{color} {''.join([first_shape, second_shape, third_shape, fourth_shape])}"] \
= f"Shapesanity Stitched {color_to_needed_building([color])}"

combos = [shape + color for shape in short_subshapes for color in short_colors]
for first_combo, second_combo in itertools.permutations(combos, 2):
# 2-sided shapes
color_region = color_to_needed_building([first_combo[1], second_combo[1]])
ordered_combo = " ".join(sorted([first_combo, second_combo]))
shape_regions = ((["East Windmill", "East Windmill", "Colorful Half"]
if first_combo[0] == "W" else ["Colorful Full", "Colorful Full", "Colorful Half"])
if first_combo[0] == second_combo[0] else ["Stitched", "Half-Half", "Stitched"])
shapesanity_two_sided[f"3-1 {first_combo} {second_combo}"] = f"Shapesanity {shape_regions[0]} {color_region}"
shapesanity_two_sided[f"Half-Half {ordered_combo}"] = f"Shapesanity {shape_regions[1]} {color_region}"
shapesanity_two_sided[f"Checkered {ordered_combo}"] = f"Shapesanity {shape_regions[0]} {color_region}"
shapesanity_two_sided[f"Adjacent Singles {ordered_combo}"] = f"Shapesanity {shape_regions[2]} {color_region}"
shapesanity_two_sided[f"Cornered Singles {ordered_combo}"] = f"Shapesanity Stitched {color_region}"
shapesanity_two_sided[f"Adjacent 2-1 {first_combo} {second_combo}"] = f"Shapesanity Stitched {color_region}"
shapesanity_two_sided[f"Cornered 2-1 {first_combo} {second_combo}"] = f"Shapesanity Stitched {color_region}"
for third_combo in combos:
if third_combo in [first_combo, second_combo]:
continue
# 3-part shapes
colors = [first_combo[1], second_combo[1], third_combo[1]]
color_region = color_to_needed_building(colors)
ordered_two = " ".join(sorted([second_combo, third_combo]))
if not (first_combo[1] == second_combo[1] == third_combo[1] or
first_combo[0] == second_combo[0] == third_combo[0]):
ordered_all = " ".join(sorted([first_combo, second_combo, third_combo]))
shapesanity_three_parts[f"Singles {ordered_all}"] = f"Shapesanity Stitched {color_region}"
shape_regions = (["Stitched", "Stitched"] if not second_combo[0] == third_combo[0]
else ((["East Windmill", "East Windmill"] if first_combo[0] == "W"
else ["Colorful Full", "Colorful Full"])
if first_combo[0] == second_combo[0] else ["Colorful Half-Half", "Stitched"]))
shapesanity_three_parts[f"Adjacent 2-1-1 {first_combo} {ordered_two}"] \
= f"Shapesanity {shape_regions[0]} {color_region}"
shapesanity_three_parts[f"Cornered 2-1-1 {first_combo} {ordered_two}"] \
= f"Shapesanity {shape_regions[1]} {color_region}"
for fourth_combo in combos:
if fourth_combo in [first_combo, second_combo, third_combo]:
continue
if (first_combo[1] == second_combo[1] == third_combo[1] == fourth_combo[1] or
first_combo[0] == second_combo[0] == third_combo[0] == fourth_combo[0]):
continue
colors = [first_combo[1], second_combo[1], third_combo[1], fourth_combo[1]]
color_region = color_to_needed_building(colors)
ordered_all = " ".join(sorted([first_combo, second_combo, third_combo, fourth_combo]))
if ((first_combo[0] == second_combo[0] and third_combo[0] == fourth_combo[0]) or
(first_combo[0] == third_combo[0] and second_combo[0] == fourth_combo[0]) or
(first_combo[0] == fourth_combo[0] and third_combo[0] == second_combo[0])):
shapesanity_four_parts[f"Singles {ordered_all}"] = f"Shapesanity Colorful Half-Half {color_region}"
else:
shapesanity_four_parts[f"Singles {ordered_all}"] = f"Shapesanity Stitched {color_region}"


if __name__ == "__main__":
start = time.time()
generate_shapesanity_pool()
print(time.time() - start)
with open("shapesanity_pool.py", "w") as outfile:
outfile.writelines(["shapesanity_simple = {\n"]
+ [f" \"{name}\": \"{shapesanity_simple[name]}\",\n"
for name in shapesanity_simple]
+ ["}\n\nshapesanity_1_4 = {\n"]
+ [f" \"{name}\": \"{shapesanity_1_4[name]}\",\n"
for name in shapesanity_1_4]
+ ["}\n\nshapesanity_two_sided = {\n"]
+ [f" \"{name}\": \"{shapesanity_two_sided[name]}\",\n"
for name in shapesanity_two_sided]
+ ["}\n\nshapesanity_three_parts = {\n"]
+ [f" \"{name}\": \"{shapesanity_three_parts[name]}\",\n"
for name in shapesanity_three_parts]
+ ["}\n\nshapesanity_four_parts = {\n"]
+ [f" \"{name}\": \"{shapesanity_four_parts[name]}\",\n"
for name in shapesanity_four_parts]
+ ["}\n"])
4 changes: 4 additions & 0 deletions worlds/shapez/data/options.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"max_levels_and_upgrades": 500,
"max_shapesanity": 1000
}
Loading
Loading