Skip to content

Pokémon Red and Blue: Version 4 update #1963

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

Merged
merged 63 commits into from
Jul 23, 2023
Merged
Show file tree
Hide file tree
Changes from 53 commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
2edae49
Pokémon R/B: Initial Stonesanity and Guard caffeine withdrawal text
Alchav Mar 14, 2023
1955c6d
Merge branch 'main' into pokemon_rb_4
Alchav Apr 22, 2023
35d0323
Pokémon R/B: Stonesanity fixes
Alchav Apr 22, 2023
420f80b
Version 4 first steps
Alchav Apr 23, 2023
37be411
Map data updates
Alchav May 17, 2023
ead342f
Split Card Key
Alchav May 18, 2023
0b241c8
Temporary Split Card Key item pool code
Alchav May 18, 2023
1f3f31d
Entrance Shuffle updates
Alchav May 18, 2023
8d98118
Merge branch 'main' into pokemon_rb_4
Alchav May 18, 2023
7fbd39f
Big commit time
Alchav May 21, 2023
74b5e22
Getting closer
Alchav May 23, 2023
0c4d173
Commit in the middle of doing split card keys because nothing matters…
Alchav May 28, 2023
a26b277
That was not supposed to be there
Alchav May 28, 2023
8c51a33
5/29 stuffs
Alchav May 30, 2023
9e3ee29
6/4 stuffs
Alchav Jun 4, 2023
df21526
6/6 stuffs
Alchav Jun 6, 2023
3669b85
6/11
Alchav Jun 11, 2023
9baa705
Shuffle warp tiles option
Alchav Jun 11, 2023
0ae4c3a
6/14 commit
Alchav Jun 14, 2023
83a4050
6/16 commit
Alchav Jun 17, 2023
bb53132
6/17 commit
Alchav Jun 17, 2023
a13b4da
6/23 commit
Alchav Jun 23, 2023
c3c92a7
Collect badges during intervene test if not full/insanity door shuffle
Alchav Jun 23, 2023
42a608a
6/23 Commit
Alchav Jun 24, 2023
84c743d
6/26 commit
Alchav Jun 26, 2023
1bb93a4
Code cleanup
Alchav Jun 26, 2023
36881bb
Remove item needed identifiers from location names
Alchav Jun 26, 2023
4ccc0ac
6/27 commit
Alchav Jun 27, 2023
82f3c6c
Improve filler item selection
Alchav Jun 28, 2023
2aa6c99
Logic fixes
Alchav Jun 28, 2023
1571636
bug fixes
Alchav Jun 29, 2023
55c9900
Require Pokedex for Elite Four
Alchav Jul 2, 2023
9fad7aa
Entrances in spoiler
Alchav Jul 6, 2023
a03f3d3
Forced early viridian gym with key items only and simple
Alchav Jul 6, 2023
16fe7c4
Generate items early
Alchav Jul 6, 2023
b6c85f7
Merge branch 'main' into pokemon_rb_4
Alchav Jul 7, 2023
2ae0e05
Move generate_items
Alchav Jul 8, 2023
14e432f
More auto hints
Alchav Jul 8, 2023
4bc9590
install as apworld
Alchav Jul 8, 2023
8d19710
Merge branch 'main' into pokemon_rb_4
Alchav Jul 9, 2023
46744bc
Move badge and gym leader TM placement from pre_fill to fill_hook
Alchav Jul 9, 2023
1faac91
Fix hint spam
Alchav Jul 9, 2023
40d3072
Improve gym leader TM moves
Alchav Jul 9, 2023
cd5bdba
Base patch update
Alchav Jul 9, 2023
ba29454
Data version 9
Alchav Jul 9, 2023
eb64996
uncomment code
Alchav Jul 9, 2023
d5fc96c
Safari Zone Deathlink bug fix
Alchav Jul 10, 2023
7ca3d40
Snorlax level pointer bug fix
Alchav Jul 12, 2023
a286d7e
Don't remove Nugget Bridge guy after helping Bill
Alchav Jul 14, 2023
d520683
Badge fill state issue and item links fix
Alchav Jul 14, 2023
a5c76bd
Use locations instead of adding player parameter
Alchav Jul 18, 2023
5c5b08c
ensure item.player is in groups before checking it
Alchav Jul 18, 2023
3bd3f38
If they don't persist, they should be generators.
Alchav Jul 18, 2023
b31c652
remove try except breakpoint
Alchav Jul 20, 2023
a21b89d
Do not create stone events with stonesanity on
Alchav Jul 20, 2023
6df8801
Remove try except for get_location calls
Alchav Jul 20, 2023
aaf26db
Create items while locations are created
Alchav Jul 20, 2023
c4b2946
Merge remote-tracking branch 'origin/pokemon_rb_4' into pokemon_rb_4
Alchav Jul 20, 2023
bee70ff
Merge branch 'main' into pokemon_rb_4
Alchav Jul 20, 2023
b991273
Vanilla pokedex bug fix
Alchav Jul 21, 2023
5ce670b
Hidden item logic fix
Alchav Jul 21, 2023
3081a96
Efficiency improvement to full/insanity door shuffle
Alchav Jul 21, 2023
65d10e6
Early items collision with local item fill fix
Alchav Jul 21, 2023
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
29 changes: 29 additions & 0 deletions PokemonClient.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
location_map[type(location.ram_address).__name__][location.ram_address.flag] = location.address
location_bytes_bits[location.address] = {'byte': location.ram_address.byte, 'bit': location.ram_address.bit}

location_name_to_id = {location.name: location.address for location in location_data if location.type == "Item"
and location.address is not None}

SYSTEM_MESSAGE_ID = 0

CONNECTION_TIMING_OUT_STATUS = "Connection timing out. Please restart your emulator, then restart pkmn_rb.lua"
Expand Down Expand Up @@ -72,6 +75,7 @@ def __init__(self, server_address, password):
self.items_handling = 0b001
self.sent_release = False
self.sent_collect = False
self.auto_hints = set()

async def server_auth(self, password_requested: bool = False):
if password_requested and not self.password:
Expand Down Expand Up @@ -153,6 +157,31 @@ async def parse_locations(data: List, ctx: GBContext):
locations.append(loc_id)
elif flags[flag_type][location_bytes_bits[loc_id]['byte']] & 1 << location_bytes_bits[loc_id]['bit']:
locations.append(loc_id)

hints = []
if flags["EventFlag"][280] & 16:
hints.append("Cerulean Bicycle Shop")
if flags["EventFlag"][280] & 32:
hints.append("Route 2 Gate - Oak's Aide")
if flags["EventFlag"][280] & 64:
hints.append("Route 11 Gate 2F - Oak's Aide")
if flags["EventFlag"][280] & 128:
hints.append("Route 15 Gate 2F - Oak's Aide")
if flags["EventFlag"][281] & 1:
hints += ["Celadon Prize Corner - Item Prize 1", "Celadon Prize Corner - Item Prize 2",
"Celadon Prize Corner - Item Prize 3"]
if (location_name_to_id["Fossil - Choice A"] in ctx.checked_locations and location_name_to_id["Fossil - Choice B"]
not in ctx.checked_locations):
hints.append("Fossil - Choice B")
elif (location_name_to_id["Fossil - Choice B"] in ctx.checked_locations and location_name_to_id["Fossil - Choice A"]
not in ctx.checked_locations):
hints.append("Fossil - Choice A")
hints = [location_name_to_id[loc] for loc in hints if loc not in ctx.auto_hints and location_name_to_id[loc] in
ctx.missing_locations and location_name_to_id[loc] not in ctx.locations_checked]
if hints:
await ctx.send_msgs([{"cmd": "LocationScouts", "locations": hints, "create_as_hint": 2}])
ctx.auto_hints.update(hints)

if flags["EventFlag"][280] & 1 and not ctx.finished_game:
await ctx.send_msgs([
{"cmd": "StatusUpdate",
Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@
"Meritous",
"Ocarina of Time",
"Overcooked! 2",
"Pokemon Red and Blue",
"Raft",
"Secret of Evermore",
"Slay the Spire",
Expand Down
2 changes: 1 addition & 1 deletion worlds/pokemon_rb/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022 Alex "Alchav" Avery
Copyright (c) 2022-2023 Alex "Alchav" Avery

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
588 changes: 411 additions & 177 deletions worlds/pokemon_rb/__init__.py

Large diffs are not rendered by default.

Binary file modified worlds/pokemon_rb/basepatch_blue.bsdiff4
Binary file not shown.
Binary file modified worlds/pokemon_rb/basepatch_red.bsdiff4
Binary file not shown.
44 changes: 34 additions & 10 deletions worlds/pokemon_rb/docs/en_Pokemon Red and Blue.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,35 +11,59 @@ Items which the player would normally acquire throughout the game have been move
always able to be completed, but because of the item shuffle the player may need to access certain areas before they
would in the vanilla game.

A great many things besides item placement can be randomized, such as the location of Pokémon, their stats, types, etc., depending on your yaml settings.
A great many things besides item placement can be randomized, such as the location of Pokémon, their stats, types, etc.,
depending on your yaml settings.

Many baseline changes are made to the game, including:

* Bag item space increased to 128 slots (up from 20)
* PC item storage increased to 64 slots (up from 50)
* Bag item space increased to 128 slots (up from 20).
* PC item storage increased to 64 slots (up from 50).
* You can hold B to run (or bike extra fast!).
* You can hold select while talking to a trainer to re-battle them.
* You can return to route 2 from Diglett's Cave without the use of Cut.
* You can select "Pallet Warp" below the "Continue" option to warp to Pallet Towna s you load your save.
* Mew can be encountered at the S.S. Anne dock truck. This can be randomized depending on your settings.
* The S.S. Anne will never depart.
* Seafoam Islands entrances are swapped. This means you need Strength to travel through from Cinnabar Island to Fuchsia
City
City. You also cannot Surf onto the water from the end of Seafoam Islands going backwards if you have not yet dropped
the boulders.
* After obtaining one of the fossil item checks in Mt Moon, the remaining item can be received from the Cinnabar Lab
fossil scientist. This may require reviving a number of fossils, depending on your settings.
* Obedience depends on the total number of badges you have obtained instead of depending on specific badges.
* Pokémon that evolve by trading can also evolve by reaching level 35.
* Evolution stones are reusable.
* Evolution stones are reusable key items.
* Much of the dialogue throughout the game has been removed or shortened.
* If the Old Man is blocking your way through Viridian City, you do not have Oak's Parcel in your inventory, and you've
exhausted your money and Poké Balls, you can get a free Poké Ball from your mom.
* The Pokédex shows which HMs can be learned by any Pokémon registered as seen.
* HM moves can be overwritten if you have the HM for it in your bag.
* The NPC on the left behind the Celadon Game Corner counter will sell 1500 coins at once instead of giving information
about the Prize Corner
about the Prize Corner.
* A woman in Oak's Lab can send you back in time to replay the first rival battle, in case you have no other reachable
and repeatable source of money.
* You can disable and re-enable experience gains by talking to an aide in Oak's Lab.
* You can reset static encounters (Poké Flute encounter, legendaries, and the trap Poké Ball battles in Power Plant)
for any Pokémon you have defeated but not caught, by talking to an aide in Oak's Lab.

## What items and locations get shuffled?

All items that go into your bags given by NPCs or found on the ground, as well as gym badges.
Optionally, hidden items (those located with the Item Finder) can be shuffled as well.
Various options add more items / location checks to the pool, including:
* Randomize Hidden Items.
* Stonesanity: Replace 4 of the 5 Moon Stones in the item pool with the other 4 stones, and remove them from the
Celadon Department Store shop. Will shuffle the hidden item locations that contain Moon Stones in the original game
regardless of the Randomize Hidden Items option.
* Prizesanity: Shuffle the three item prizes from the Celadon Prize Corner.
* Tea: Adds a Tea item to the item pool which is required to pass the Saffron Gate guards instead of vending machine
drinks. Adds a location check to the woman in Celadon Mansion 1F, where the Tea item is found in FireRed and LeafGreen.
* Extra Key Items: Adds key items that will be required to access the Power Plant, Pokémon Mansion, Rocket Hideout,
and Safari Zone. Adds 4 extra item locations to Rock Tunnel B1F
* Split Card Key: Splits the Card Key into 10 different Card Keys, one for each floor of Silph Co that has locked doors.
Adds 9 location checks to friendly NPCs in Silph Co. You can also choose Progressive Card Keys to always obtain the
keys in order from Card Key 2F to Card Key 11F.
* Trainersanity: Adds location checks to 317 trainers. Does not include scripted trainers, most of which disappear
after battling them, but also includes Gym Leaders. You must talk to the trainer after defeating them to receive
your prize. Adds 317 random filler items to the item pool
* Dexsanity: Location checks occur when registering Pokémon as owned in the Pokédex. You can choose a percentage
of Pokémon to have checks added to, chosen randomly. You can identify which Pokémon have location checks by an empty
Poké Ball icon shown in battle or in the Pokédex menu.

## Which items can be in another player's world?

Expand Down
Loading