shadorki / genshin-impact-wish-simulator

A React web application to simulate Genshin Impact gacha in the browser
713 stars 162 forks source link

Issue #22, Issue #28, Issue #37, Issue #41, Issue #45, Added a 5-star soft pity #51

Closed elebitzero closed 3 years ago

elebitzero commented 3 years ago

Hey, you have a really cool project that feels a lot like doing pulls in Genshin and the UI looks clean, so I decided to try and fix some of the major issues with the probability so the pulls are more realistic/believable.

I have fixed the issues detailed below. The logic for both past and present banners have been updated. I ran and updated the mocha tests and ran the cypress tests all the tests are passing, except one that I removed because it is no longer applicable. See details below.

After doing some pulls on the app, it looks much closer to what you would expect to get when doing pulls in the game.

elebitzero commented 3 years ago

I added a few more changes, including a separate timer for the 4-star pity, and putting some of the repeated methods into Base-Gacha. The mocha and cypress tests checked out and the pulls still seem reasonable.

shadorki commented 3 years ago

Can you run the build script so I can deploy it? Thanks!

elebitzero commented 3 years ago

I ran the build script but then it had a problem running since I'm on Windows so I manually copied the files to carry out the rest of the command and after that, it looks good. I did a little more cleanup and reran mocha and cypress and both are passing.

elebitzero commented 3 years ago

Issue #37 is now fixed, I also reran the tests, and regenerated the production build. I've been doing lots of test pulls and I seemed to be getting results we can expect from the probabilities listed. Now it should be ready to deploy and merge.

elebitzero commented 3 years ago

BTW, it will be really simple to add new event banners in the future. For example, this is the current event banner adrift-in-the-harbor.js

import BaseGacha from './base-gacha'
import drops from '../data/adrift-in-the-harbor.json'

export default class AdriftInTheHarbor extends BaseGacha {
  constructor() {
    super(drops)
  }
}

Now all the code is generic and is driven off the drop data.

shadorki commented 3 years ago

Jesus christ thats a lot of work lol, have you ran the tests on the rest of the changes?

elebitzero commented 3 years ago

I reran the tests on the rest of the changes, plus I manually did pulls and did some extra clean up after that and now it should be ready. The tests still checked out after those. I'm getting more single 4-star ten pulls, with double 4-stars and triple 4-stars being rarer now.

shadorki commented 3 years ago

@elebitzero Hey dude, is there a reason you are no longer using the app version from the package.json? it's what we use to bust the cache, so you dont force the users to go back to the previous pity system

image

elebitzero commented 3 years ago

The version I added was to version the application state data. I put in logic to read the old version and save it in the new format as version 1 to add backward compatibility so users don't have to see errors for the first time they play with the app again.

shadorki commented 3 years ago

Gotcha @elebitzero sorry for the late response, I just got a new job so I've been all over the place. I really appreciate your help dude.