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

Merging koala's Randomizer work for 0.4.0 #40

Merged
merged 70 commits into from
Jun 13, 2024
Merged
Show file tree
Hide file tree
Changes from 47 commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
3fa0bc8
WIP link to proper entrance, anti door softlock, add back crash site,…
Avasam May 25, 2024
b69b971
Linters updates and fixes
Avasam May 25, 2024
e91603a
typo
Avasam May 25, 2024
d9e5f66
redundant return
Avasam May 25, 2024
c821721
Forgot to update requirements
Avasam May 25, 2024
cd95019
Fix altar of ages not being accessible and two non-existant transitio…
Avasam May 26, 2024
7935db1
Add unrandomized log and indicate that typings is vendored
Avasam May 26, 2024
38e6a66
test commit
May 27, 2024
81af201
moving transition_infos for easy of testing
May 27, 2024
d8fd921
create graphml file
May 29, 2024
3b917cf
bugfixes & small rewrites
May 29, 2024
3084630
typo fix, now it won't crash anymore :)
May 29, 2024
6fba948
simplification by removing troublesome levels from randomization
May 29, 2024
6b8daf7
ST_CLAIRE_DAY now has correct area_id
May 29, 2024
20953b0
Graph now has colors for important levels
May 29, 2024
ebd6c90
reduced graphml clutter a bit
May 29, 2024
d72b893
Algorithm added to guarantee all levels are linked together
May 30, 2024
8386b2e
Added support for the four 1-way transitions (correct entrance doesn'…
May 31, 2024
2d86cdc
Jaguar 1 re-enabled, to make sure we get Jaguar 2 later
May 31, 2024
41b5399
Disabled Mouth of Inti & added all missing levels to transition_infos
May 31, 2024
cf5efe1
Updated list of undesirable starting areas
May 31, 2024
1f26223
Disabled "Twin Outposts (Underwater Cave)" for now
Jun 1, 2024
0dfe92b
now starting_area has no impact on random calls
Jun 1, 2024
bb14a12
Some polishing before Merging for 0.5.0
Jun 1, 2024
f8ce2bd
Merge pull request #1 from wossnameGitHub/rando_generator_testing
wossnameGitHub Jun 2, 2024
4bc9540
Merge branch 'main' into Rando-0.5.0-merge
wossnameGitHub Jun 2, 2024
c99054e
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 2, 2024
3533d22
cleaned up set_transitions_map a bit by creating some functions + oth…
Jun 2, 2024
4fe7106
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 2, 2024
6773454
made functions for create_graphml + more small ruff fixes
Jun 2, 2024
0d545da
Merge local branch 'Rando-0.5.0-merge'
Jun 2, 2024
bcf35e1
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 2, 2024
34d89f0
made parameter types in functions explicit
Jun 2, 2024
2d7cfe4
Merge branch 'Rando-0.5.0-merge' of https://github.com/wossnameGitHub…
Jun 2, 2024
5511d62
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 2, 2024
2b61bc4
1st wave of changes made per Avasam's request
Jun 6, 2024
308fece
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 6, 2024
0609b2e
some more pyright adjustments
Jun 6, 2024
970e88b
Added all levels to LevelCRC + alphabetical order
Jun 7, 2024
0b35f4c
re-ordered levels in transition_infos.json, no functional changes
Jun 7, 2024
6cd685f
More assorted changes per Avasam's request
Jun 8, 2024
2b4df4b
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 8, 2024
c3dc3cf
single "line too long" fix
Jun 8, 2024
cd7a85a
moved all graph creation logic to it's own module
Jun 8, 2024
05d012f
All 38 missing exits added to json, and disabled in entrance_rando
Jun 8, 2024
197f0d3
Small updates to Readme & Configs descriptions
Jun 8, 2024
43723fe
typo fix: tuple( ) --> tuple[ ]
Jun 8, 2024
4cb9bb4
Apply suggestions from code review
Avasam Jun 8, 2024
ad6e68a
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 8, 2024
6175a7c
Merge branch 'main' into Rando-0.5.0-merge
Avasam Jun 8, 2024
dd62b06
Update Dolphin scripts/Entrance Randomizer/CONFIGS.py
Avasam Jun 8, 2024
db843bd
Merge branch 'main' into Rando-0.5.0-merge
Avasam Jun 8, 2024
178a84a
Post-merge fixes
Avasam Jun 9, 2024
a3f9e95
Merge branch 'main' into Rando-0.5.0-merge
Avasam Jun 9, 2024
f06f487
Fix major areas creation
Avasam Jun 9, 2024
eb757d1
Update Dolphin scripts/Entrance Randomizer/__main__.py
Avasam Jun 9, 2024
2d4c92b
even more small adjustments per Avasam's request
Jun 9, 2024
aedba85
Spoiler log now lists transitions in alphabetical order
Jun 9, 2024
aa60ba3
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 9, 2024
0ec2628
bit of linting and list comprehension
Jun 10, 2024
ee418ea
reworked disabled_exits
Jun 10, 2024
dbcc918
2 small `ruff` fixes
Jun 10, 2024
0067ab4
small update to blue text
Jun 10, 2024
3d9c14f
simplification of area.con_left
Jun 10, 2024
abbd9c4
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 10, 2024
b6ee7b5
tiny pyright fix
Jun 10, 2024
ede571c
Merge branch 'Rando-0.5.0-merge' of https://github.com/wossnameGitHub…
Jun 10, 2024
da9b454
Reorder transitin_infos based on world_infos
Avasam Jun 10, 2024
81a6740
some final(?) small changes per Avasam's request
Jun 11, 2024
83c50b3
Merge pull request #2 from Avasam/revert-transition_infos-reordering
wossnameGitHub Jun 13, 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
22 changes: 16 additions & 6 deletions Dolphin scripts/Entrance Randomizer/CONFIGS.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"""
Set your own seed, can be an `int`, `float`, `str`, `bytes` or `bytearray`.

Use `None` or any Falsy value to generate a random seed.
Use `None` or any False value to generate a random seed.
Avasam marked this conversation as resolved.
Show resolved Hide resolved

default = None
"""
Expand All @@ -15,15 +15,25 @@
"""
The ID of the Area to start in. `None` for random, `0xEE8F6900` for Crash Site.

See `transition_infos.json` for all available IDs
See `transition_infos.json` for all available IDs.

default = None
"""

LINKED_TRANSITIONS: bool = True
"""
Whether the new destination will contain an exit back to the area you came from.
Assuming both areas have as many entrances as they have exits.
If True, going through any given transition and then backing out will always result
in you returning to the area you came from (assuming it's not a one-way transition).
wossnameGitHub marked this conversation as resolved.
Show resolved Hide resolved
If False, no such guarantees are given.

default = True
"""

SKIP_JAGUAR: bool = True
"""
If True, you will completely skip both Jaguar fights.
If False, you will fight Jaguar 1 when you start a New Game (and go to STARTING_AREA afterwards),
and you will fight Jaguar 2 before fighting Pusca.

default = True
"""
Expand All @@ -32,8 +42,8 @@
"""
Whether you can buy maps in the Shaman Shop.

When maps are disabled, and using original shop prices,
the 4 lowest prices (0, 1, 2, 2) are also removed form the pool.
When maps are disabled (and using original shop prices)
the 4 lowest prices (0, 1, 2, 2) are also removed from the pool.

default = True
"""
Expand Down
22 changes: 17 additions & 5 deletions Dolphin scripts/Entrance Randomizer/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@
from lib.entrance_rando import (
highjack_transition,
highjack_transition_rando,
remove_disabled_exits,
set_transitions_map,
starting_area,
transitions_map,
)
from lib.graph_creation import create_graphml
from lib.shaman_shop import patch_shaman_shop, randomize_shaman_shop
from lib.utils import (
draw_text,
Expand All @@ -36,9 +38,13 @@
state,
)

remove_disabled_exits()
wossnameGitHub marked this conversation as resolved.
Show resolved Hide resolved
set_transitions_map()
randomize_shaman_shop()

# Create .graphml file
create_graphml(transitions_map, seed_string, starting_area)

Avasam marked this conversation as resolved.
Show resolved Hide resolved
# This is necessary until/unless I map all areas even those not randomized.
try:
starting_area_name = TRANSITION_INFOS_DICT[starting_area].name
Expand All @@ -64,8 +70,11 @@ async def main_loop():
draw_text(f"Seed: {seed_string}")
draw_text(patch_shaman_shop())
draw_text(
f"Starting area: {hex(starting_area).upper()}"
+ " (Random)" if CONFIGS.STARTING_AREA is None else f"{starting_area_name}",
"Starting area: " + (
f"{hex(starting_area).upper()} (Random)"
if CONFIGS.STARTING_AREA is None
else starting_area_name
),
)
draw_text(
f"Current area: {hex(state.current_area_new).upper()} "
Expand All @@ -80,9 +89,12 @@ async def main_loop():
if memory.read_u32(ADDRESSES.item_swap) == 1:
memory.write_u32(ADDRESSES.item_swap, 0)

# Skip the intro fight and cutscene
if highjack_transition(0x0, LevelCRC.JAGUAR, starting_area):
return
# Skip both Jaguar fights if noted in CONFIGS
if CONFIGS.SKIP_JAGUAR:
if highjack_transition(LevelCRC.MAIN_MENU, LevelCRC.JAGUAR, starting_area):
return
if highjack_transition(LevelCRC.GATES_OF_EL_DORADO, LevelCRC.JAGUAR, LevelCRC.PUSCA):
return

# Standardize the Altar of Ages exit to remove the Altar -> BBCamp transition
if highjack_transition(
Expand Down
68 changes: 55 additions & 13 deletions Dolphin scripts/Entrance Randomizer/lib/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,27 +156,69 @@ class Addresses:


class LevelCRC(IntEnum):
JAGUAR = 0x99885996
ABANDONED_CAVERN = 0xEA667977
ALTAR_OF_AGES = 0xABD7CCD8
ALTAR_OF_HUITACA = 0x70EBFCA3
APU_ILLAPU_SHRINE = 0x5511C46C
BATTERED_BRIDGE = 0x69F0CDE2
BETA_VOLCANO = 0x47508760
BITTENBINDERS_CAMP = 0x0EF63551
BUTTERFLY_GLADE = 0xCD944049
CAVERN_LAKE = 0x8B372E42
CHAMELEON_TEMPLE = 0x0081082C
COPACANTI_LAKE = 0x8147EA91
CRASH_SITE = 0xEE8F6900
PLANE_COCKPIT = 0x4A3E4058
CRYSTAL_CAVERN = 0x0DDE5470
EKKEKO_ICE_CAVERN = 0x3E7EE822
EYES_OF_DOOM = 0x9A0C8DF8
FIRE_BOMBED_TOWERS = 0xF0F99C58
FLOODED_CAVE = 0x3A811024
FLOODED_COURTYARD = 0xECC9D759
CHAMELEON_TEMPLE = 0x0081082C
GATES_OF_EL_DORADO = 0x93F89D45
GREAT_TREE = 0x3292B6C9
JAGUAR = 0x99885996
JUNGLE_CANYON = 0xDEDA69BC
JUNGLE_TRAIL = 0x7A9B3870
KABOOM = 0xE411440A
LADDER_OF_MILES = 0x619E1126
MAIN_MENU = 0x00000000
MAMA_OULLO_TOWER = 0x07ECCC35
VIRACOCHA_MONOLITHS = 0x6F498BBD
VIRACOCHA_MONOLITHS_CUTSCENE = 0xE8362F5F
ALTAR_OF_AGES = 0xABD7CCD8
BITTENBINDERS_CAMP = 0x0EF63551
MONKEY_SPIRIT = 0x02C7B675
MONKEY_TEMPLE = 0xF3B4DC8E
MOUNTAIN_OVERLOOK = 0x907C492B
MOUNTAIN_SLED_RUN = 0x1B8833D3
MOUTH_OF_INTI = 0xB8D5CE86
MYSTERIOUS_TEMPLE = 0x099BF148
EYES_OF_DOOM = 0x9A0C8DF8
SCORPION_TEMPLE = 0x4B08BBEB
NATIVE_JUNGLE = 0x0AF1CCFF
NATIVE_VILLAGE = 0x05AA726C
PENGUIN_DEN = 0x1553BBE1
PENGUIN_SPIRIT = 0x1F237F32
PENGUIN_TEMPLE = 0x1B11EC74
VALLEY_OF_THE_SPIRITS = 0x08E3C641
COPACANTI_LAKE = 0x8147EA91
APU_ILLAPU_SHRINE = 0x5511C46C
PICKAXE_RACE = 0x7A75D1A9
PLANE_COCKPIT = 0x4A3E4058
PLANE_CUTSCENE = 0x53257119
PUNCHAU_SHRINE = 0x38C7AE7D
PUSCA = 0xCFD2FE10
RAFT_BOWLING = 0x9316749C
RENEGADE_FORT = 0x0C1C3E47
RENEGADE_HEADQUARTERS = 0x1CB1432D
SCORPION_SPIRIT = 0x0305DC42
SCORPION_TEMPLE = 0x4B08BBEB
SPINJA_LAIR = 0x7652BAFC
ST_CLAIRE_DAY = 0xBA9370DF
ST_CLAIRE_NIGHT = 0x72AD42FA
ST_CLAIRE_DAY = 0x72AD42FA
STATUES_OF_AYAR = 0xA85A2793
TELEPORTS = 0xE97CB47C
TUCO_SHOOT = 0x0D72E13F
TURTLE_MONUMENT = 0x239A2165
TWIN_OUTPOSTS = 0xE6B9138A
TWIN_OUTPOSTS_UNDERWATER = 0xDE524DA6
UNDERGROUND_DAM = 0x9D6149E1
VALLEY_OF_THE_SPIRITS = 0x08E3C641
VIRACOCHA_MONOLITHS = 0x6F498BBD
VIRACOCHA_MONOLITHS_CUTSCENE = 0xE8362F5F
WHACK_A_TUCO = 0x0A1F2526
WHITE_VALLEY = 0x62548B77


SOFTLOCKABLE_ENTRANCES = {
Expand Down
Loading