YGOPRODeck icon indicating copy to clipboard operation
YGOPRODeck copied to clipboard

Pack Opening Simulator

Open AlanOC91 opened this issue 6 years ago • 153 comments

The plan is to add a "fun" booster pack opening simulator for Yu-Gi-Oh!

There is already a rather good one over at http://yugiohpacksimulator.com/ but I'd like to make one more akin to the Hearthstone card pack simulators.

When you open a pack, each card is scored and then each scored is added together to receive your "Pack Score". The eventual plan is to then be allowed submit this score to an online leaderboard to compare. This adds the "fun" factor to opening the pack.

Card score is calculated as follows: Score = (Card Database Views * Card Rarity Weighting)/2 Rarity Weightings:

Common = 1
Short Print = 1.5
Rare = 2
Super Rare = 2.5
Ultra Rare = 3
Secret Rare = 4
All Others: 3.5

Current Alpha version screenshots: Start Screen after choosing a booster set: pack-open-start

Once the flip button is pressed: pack-open

AlanOC91 avatar Aug 06 '19 07:08 AlanOC91

Leaderboard is now live for the Alpha version of this: https://db.ygoprodeck.com/pack-leaderboard/

AlanOC91 avatar Aug 07 '19 07:08 AlanOC91

Changes since yesterday: -Fixed Leaderboard. I had it sorting wrongly and limited to displaying 50. When I woke up there was over 300! All data was still captured and will now display correctly. -Added Odds for the Last Card (the potential high rarity card). Y'all were pulling way too many rare cards way too easily! I've now added odds! Now it should be much harder to pull higher rarity cards.

Odds breakdown:

$cardodds = rand(0,99);
    if ($cardodds <5){
        //Secret Rare
    }else if ($cardodds >=5 && $cardodds <= 15){
        //Ultra Rare
    }else if ($cardodds >15 && $cardodds <= 25){
        //Super Rare
    }else if ($cardodds >25 && $cardodds <= 35){
        //Other Rarity
    }else if ($cardodds >35){
        //Common Rarity
    } 

AlanOC91 avatar Aug 07 '19 07:08 AlanOC91

You can now flip each card individually if you wish so.

Next on the TODO list:

  • Enhance retry so it simply opens another pack.
  • Spruce up css.

AlanOC91 avatar Aug 07 '19 12:08 AlanOC91

Added an animated card score counter when all cards are revealed.

  • Fixed an issue where 8 cards may sometimes show instead of 9.
  • Fixed an issue where the reveal card function wasn't disabled when all cards were revealed.
  • Added notice to start screen about card art and set codes.
  • Modified pack score counter css.
  • Fixed an issue with Secret Rare colors on pack leaderboard.

TODO:

  • Better Retry Button
  • Increment score counter on each individual card flip.

AlanOC91 avatar Aug 08 '19 07:08 AlanOC91

  • Fixed an issue where you could accidentally double click to reveal the same card.

  • Score Counter now increments on each card flip.

  • Retry button is now fully ajax compatible and works much better. Giving you a new instance of the same pack you have chosen.

AlanOC91 avatar Aug 08 '19 10:08 AlanOC91

  • Cleaned up a lot of the back-end code to make it much easier to quickly add card sets.
  • Added 6 new card sets.
  • Add a "Choose Set" button to easily allow you to pick a set again.

AlanOC91 avatar Aug 08 '19 11:08 AlanOC91

Features:

  • Added multiple new sets including new ones.
  • New sets use different formula for pulling cards as per: https://yugioh.fandom.com/wiki/Booster_Pack
  • Old sets: 7 commons, 1 Rare and either 1 Common or Rarity higher than Rare.
  • New sets: 7 commons, 1 Rare and at least a Super Rare.
  • Added date stamp to the leaderboard.
  • Slightly increase name length for leaderboard.

Bugs:

  • Fixed a bug where you can hit the Retry button before score is fully calculated.
  • Fixed a bug where you can hit the Flip button before the cards have fully loaded in.
  • Fixed a bug where the score was re-calculated for that card if you clicked it again after it was flipped.

TODO:

  • Limit leaderboard entry input to 20 characters.
  • Short Print should appear in replacement of a common card, need to code in that functionality.

AlanOC91 avatar Aug 09 '19 07:08 AlanOC91

Features:

  • Updated code to accommodate Speed Duel booster packs.
  • Added 3 Speed Duel booster packs.
  • Added "All Time Leaderboard" and changed the original leaderboard to a "Weekly Leaderboard".
  • Weekly Leaderboard will be automatically archived once a week into the All Time leaderboard.
  • Re-organized the list of boosters. This will receive another re-organization towards the end of completion.

Bugs:

  • Fixed a bug where the card opening area height was too large when opening a Speed Duel booster pack.

AlanOC91 avatar Aug 09 '19 10:08 AlanOC91

  • Added multitudes of new packs.
  • Rearranged buttons on pack opening screen.
  • Added Lazy Loading when choosing a card set. This should massively reduce page size/load, especially on mobile devices.
  • Added link to the Leaderboards.

TODO:

  • Finish off sets.
  • Show card prices.
  • TCG player purchase links.

AlanOC91 avatar Aug 12 '19 11:08 AlanOC91

  • Added back-end support for Battle Packs.
  • Added 3 Battle Pack boosters.

AlanOC91 avatar Aug 13 '19 11:08 AlanOC91

  • Added the remaining core TCG sets.
  • Fixed an issue with the Leaderboard Cron Job where it wasn't moving the weekly table into the archived table.

AlanOC91 avatar Sep 16 '19 10:09 AlanOC91

  • Added some code that auto-scrolls the users up to the cards when it begins. This is especially useful on mobile devices so you don't have to manually scroll back up to start flipping cards.

AlanOC91 avatar Oct 02 '19 14:10 AlanOC91

  • A bunch of Packs Added.
  • Added Pack Number selector for Sealed Draft Mode.

AlanOC91 avatar Dec 18 '19 08:12 AlanOC91

Currently seems to be a bug with the "Tournament Pack" packs where you can occasionally get 2 cards instead of 3.

AlanOC91 avatar Feb 05 '20 12:02 AlanOC91

Start work on adding Mega Packs to pack sim.

AlanOC91 avatar Mar 22 '20 18:03 AlanOC91

Mega Packs:

2014-2019:

  • 16 cards per pack
  • 1 Prismatic Secret Rare
  • 1 Ultra Rare
  • 1 Super Rare
  • 1 Rare
  • 12 Commons

AlanOC91 avatar Mar 22 '20 18:03 AlanOC91

  • Mega Packs 2014 - 2019 are now added.

AlanOC91 avatar Mar 23 '20 11:03 AlanOC91

  • Duel Overload added.

AlanOC91 avatar Mar 23 '20 11:03 AlanOC91

  • Fixed an issue where adding a mega pack to the leader board didn't add every card you opened.

AlanOC91 avatar Mar 23 '20 22:03 AlanOC91

  • Fixed an issue where you couldn't manually reveal all mega pack cards.

AlanOC91 avatar Mar 29 '20 12:03 AlanOC91

  • Added Secret Slayers

AlanOC91 avatar Apr 04 '20 13:04 AlanOC91

  • Show greyed-out (unusable) version of future packs.

AlanOC91 avatar Apr 06 '20 14:04 AlanOC91

[suggestion] there are alot of other packs that have released over the years, including but not limited to the kaiba mega pack, the gold series, and dark beginnings/dark revelation series, and the star packs.

AexDEye9 avatar May 06 '20 10:05 AexDEye9

  • Star Packs added.

Looked into adding Dark Beginnings 1/2 but they are difficult to implement. According to the wiki:

Dark Beginning (and all other Reprint Packs) always contain 6 Monster Cards, 3 Trap Cards, 3 Spell Cards, 1 Tip Card and 1 or even 2 rares.

This will be difficult to implement at the moment. Will look into adding other packs first.

AlanOC91 avatar May 06 '20 11:05 AlanOC91

  • Ra Yellow Mega Pack added.

AlanOC91 avatar May 06 '20 11:05 AlanOC91

  • Legendary Collection 2: The Duel Academy Years Mega Pack added.

AlanOC91 avatar May 06 '20 11:05 AlanOC91

  • Updated mobile CSS and revised mobile layout for pack select screen and card reveal screen.
  • Offset CSS and JS to separate files for optimizaiton.

AlanOC91 avatar May 06 '20 12:05 AlanOC91

  • Legendary Collection Kaiba Mega Pack added.

AlanOC91 avatar May 07 '20 07:05 AlanOC91

  • Slightly optimized all card set images.

AlanOC91 avatar May 07 '20 07:05 AlanOC91

Next on the agenda.

TODO: Dark Beginning 1 + Dark Beginning 2 followed by Dark Revelations 1,2,3 and 4.

AlanOC91 avatar May 27 '20 08:05 AlanOC91