Player Inventory #32

Open
opened 2025-05-26 08:08:22 -07:00 by VD15 · 0 comments
Collaborator

This details an overhaul and formalization of the cards a PLAYER has in their inventory. Currently a PLAYER is thought to 'own' a CARD if there is a PULL in the PULL table that corresponds to both their ID and the CARD's ID.

This represents a problem if we want to transfer ownership of CARDs between PLAYERs: just because a PLAYER ROLLed a card some time in the past, doesn't mean that they currently own it. We'll want a more robust mechanism if we want to add more features.

Database Representation

The pulls table should be split into two tables, rolls and pulls:

rolls:

Column Data Type Description
id INTEGER Uniquely identifies a ROLL.
timestamp DATETIME When this ROLL happened.
player INTEGER (FK) What PLAYER did this ROLL.

pulls:

Column Data Type Description
id INTEGER Uniquely identifies a PULL. Public Facing; PLAYERs will use this to identify their PULLs.
owner INTEGER (FK) What PLAYER owns this PULL.
roll_id INTEGER (FK) What ROLL this PULL was obtained in.
card_id INTEGER (FK) What CARD was obtained in this PULL.

This approach also allows for a many-to-one relationship between PULLs and ROLLs, allowing us to be more flexible in our implementation of ROLLs. For example, we could add a 10-ROLL feature, common in many gacha games, where PLAYERs may ROLL for 10 PULLs at once.

This details an overhaul and formalization of the cards a PLAYER has in their inventory. Currently a PLAYER is thought to 'own' a CARD if there is a PULL in the PULL table that corresponds to both their ID and the CARD's ID. This represents a problem if we want to transfer ownership of CARDs between PLAYERs: just because a PLAYER ROLLed a card some time in the past, doesn't mean that they currently own it. We'll want a more robust mechanism if we want to add more features. ### Database Representation The `pulls` table should be split into two tables, `rolls` and `pulls`: #### `rolls`: | Column | Data Type | Description | | -------- | -------- | -------- | | id | INTEGER | Uniquely identifies a ROLL. | | timestamp | DATETIME | When this ROLL happened. | | player | INTEGER (FK) | What PLAYER did this ROLL. | #### `pulls`: | Column | Data Type | Description | | -------- | -------- | -------- | | id | INTEGER | Uniquely identifies a PULL. Public Facing; PLAYERs will use this to identify their PULLs. | | owner | INTEGER (FK) | What PLAYER owns this PULL. | | roll_id | INTEGER (FK) | What ROLL this PULL was obtained in. | | card_id | INTEGER (FK) | What CARD was obtained in this PULL. | This approach also allows for a many-to-one relationship between PULLs and ROLLs, allowing us to be more flexible in our implementation of ROLLs. For example, we could add a 10-ROLL feature, common in many gacha games, where PLAYERs may ROLL for 10 PULLs at once.
VD15 added the
Feature
Feedback Wanted
labels 2025-05-26 08:08:22 -07:00
VD15 added this to the v2.0 project 2025-05-26 08:08:22 -07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: waifu/kemoverse#32
No description provided.