-
Notifications
You must be signed in to change notification settings - Fork 722
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
Core: Remove Universally Unique ID Requirements (Per-Game Data Packages) #1933
Conversation
Other things that should probably be part of this PR
|
I know Berserker and I were talking about potentially deleting old seeds. @Berserker66 would probably have a better idea on the feasibility/practicality of upgrading the DB. |
The Noita mod/client now supports this change. It has a cache for the room to link up the slot number for each player with the game they are playing, and uses that as a reference for item/location names. Edit: okay rereading this, this comment isn't super clear. I'm just following the "ideal way" as mentioned above with no real variation. |
WIP process on refactoring `tracker.py` to handle changes and prep for
7a1708c
to
c02dad2
Compare
I don't disagree with the import and string changes in general, but including so many unrelated changes in this already large PR unnecessarily makes it less clear to read. |
This PR is going to be renamed later. Part 1 of tracker clean up goes hand in hand with this PR. Not going to hackily make |
data_version
support from core.World.data_version
.
World.data_version
.World.data_version
.
# Conflicts: # worlds/__init__.py
…ing enough as it is.
Yep it was hints, just had to pass along player info in the node. Seems to work for me now. |
@@ -1,180 +0,0 @@ | |||
<!DOCTYPE html> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this getting deleted in this PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because it snuck back into main somehow. The real tracker was renamed tracker__OcarinaOfTime.html
so this isn't evne used anymore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose it could have been in another PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looked it over, remarked what I noticed and my clients seem to still work.
… that broke tracker functionality.
… tracker functionality. (#3433)
… that broke tracker functionality. (ArchipelagoMW#3433)
… that broke tracker functionality. (ArchipelagoMW#3433)
… that broke tracker functionality. (ArchipelagoMW#3433)
… that broke tracker functionality. (ArchipelagoMW#3433)
… that broke tracker functionality. (ArchipelagoMW#3433)
What is this fixing or adding?
Note: This is a breaking change that may require some clients (and libraries) to handle potential ID conflicts.
The goal of this PR is to remove the requirement that item and location IDs must be unique across all worlds. IDs must still remain unique to their own world, but other worlds may now utilize that ID space for their implementations. This means it's expected for a client to check which game an ID is relevant for, prior to lookup.
This will allow any world developer to use more sensible IDs without need of a base_id_offset`-type addition when building item and location tables, without worry of an ID conflict with another hypothetical world, if so desired.
Data Package Changes / Expectations
Clients that rely on looking up names for location and item IDs will most likely need to change how they perform these lookups to support this paradigm, otherwise, at best, names could be incorrect, and at worst, games will not function. The only changes to the Data Package itself will be the removal of
version
as this update also dropsdata_version
support. If a client or library relies onversion
for data package caching, it will also stop working.For library and client developers, the recommended way to perform name lookup for an ID is to check the relevant player's
NetworkSlot
data for their world, then lookup from within the correspondinggame
's GamePackage.An example lookup scenario:
You connect and authenticate to the Archipelago server and the server responds with a
Connected
packet.You locally cache the
slot_info
data fromConnected
packet for later lookup.Eventually, you need to scout information in a location, so you send out a
LocationScouts
packet for location:100
.Server responds with a
LocationInfo
packet with the following payload:You check player
4
in theslot_info
data you locally cached on connection and find out they're playingBlique
.You can now do your lookup inside the
Blique
game package and get the name for item1
.CommonClient/CommonContext changes
CommonContext.item_names
andCommonContext.location_names
is now a specialized dict (calledNameLookupDict
) for looking up names, separated by game. To make it easier for developers who derive fromCommonContext
, some additional helper methods were created to make getting these names without explicitly finding the game name yourself.It is still possible to lookup names via
{type}_names[id]
, but this should be considered deprecated and may fail to load the correct name if multiple items or locations utilize the same id. Instead, developers should switch to using the above helper methods or defining the game if accessing directly from the dict itself (e.g.,item_names[game][id]
) Eventually, this implicit fallback will be removed.Core Changes
This change also increments the version of Archipelago to
0.5.0
considering the level of breaking change this contains.How was this tested?
Used a modified version of Clique that has ids that match another game and confirmed MultiServer and TextClient worked fine.
Couple unit tests also added for changes to
CommonContext
.I have provided a website for "Clique1933" which shares the same IDs as "Clique" to test the client and server changes, as well as to test your own clients/lib to ensure it doesn't crash when this game interacts. See link for apworld.
Clique1933 Client: http://darkshare.site.nfoservers.com/clique_1933/
Clique1933 APWorld: http://darkshare.site.nfoservers.com/clique_1933/clique_1933.apworld
Please be sure to mark libraries and clients that have updated for this change in #3394.
If this makes graphical changes, please attach screenshots.
N/A