Skip to content

feat: new generic and unified banner system (poc) - #72

Open
Js41637 wants to merge 1 commit into
juliuskreutz:masterfrom
Js41637:feat/new-banner-system
Open

feat: new generic and unified banner system (poc)#72
Js41637 wants to merge 1 commit into
juliuskreutz:masterfrom
Js41637:feat/new-banner-system

Conversation

@Js41637

@Js41637 Js41637 commented Jun 21, 2025

Copy link
Copy Markdown
Collaborator

Possible idea for a more generic banner config system that can support all games.

This doesn't change any of the existing banner logic or change the current logic in the import code and stuff. That still uses the current tables. If we do want to use this that will need to change but I figure it would be better try and get these changes in first so we can configure all the banners first, and then I can go in and update the existing logic to use the new banner system.

  • Uses a single table to store banner data for games, this removes the need to duplicate the same banner code, queries, tables, and endpoints for each game when they are functionally identicial.
  • Adds additional columns to store more information about the banners such as the gacha type, the banner id, the version, etc.
  • Allows storing the featured 5 stars and 4 stars as an array of ids if multiple options are on a banner
    • In most cases the featured 5 star will only be a single id but having it as array an allow allows us to support cases like Genshin's Chronicled wish which has multiple featured characters on a single banner
    • The 5_star and 4_star naming might not always make sense such as Zenless using the terms S Rank/A Rank, however I think it's just the simplest terminology to use. e.g. in the case of Zenless 5_star would be for S Rank characters.
    • Using an array of ids instead of a single one does mean you can no longer use a foreign key to enforce the character or weapon exists for a certain game however I don't think it's required anyway. If something doesn't exist then it won't affect anything anyway. Also, in some cases it is more limiting. For example, without the characters or weapons needing to exist first, it would let us create the banners in advanced of the patch where the data might not yet be available.

I don't know if those weird sqlx json query cache things are needed, I don't know how to make those.

Overview of columns

  • id: interger, automatically generated id of the banner and the primary key
  • game_id: an id used to tell the games apart (1 = HSR, 2 = ZZZ, 3 = Genshin)
  • gacha_type: the banners gacha type (1 = hsr standard, 11 = hsr lightcone, 1001 = zzz standard, etc.) which can let you easily filter banners of a certain type (per game)
  • banner_id: the unique id of the banner, HSR and Zenless both have distinct banner ids that the hoyo apis return which can be used to easily link pulls to banners. Genshin does not support this.
  • version: the version the banner was added in, not really needed but convenient to have
  • title: The 'official' name of the banner
  • internal_name: a more simple name just for internal use as the official names can be kind of confusing
  • rate_up_5_stars: array of item ids (can be character or weapon)
  • rate_up_4_stars: array of item ids (can be character or weapon)
  • start_time: the start time of the banner (has no timezone)
  • end_time: the start time of the banner (has no timezone)
  • timezone_dependant: whether the start/end times are timezone dependant, if it is then the time should be read as UTC+0, if it isn't, then the time needs to be read in the servers region (asia/eu/us)
  • disabled: way to disable or turn it off if needed, not really needed but convenient to have
  • created_at: when the entry was created, not really needed but convenient to have

@Js41637
Js41637 force-pushed the feat/new-banner-system branch from 49b3cb8 to e0dee15 Compare July 7, 2025 00:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant