An online Cyberpunk 2077 breach protocol minigame solver using camera + OCR
Try it here: https://govizlora.github.io/optical-breacher
Optical breacher is a Progressive Web App which means it can be "installed" to your home screen like a native app, and used offline. It will be automatically updated whenever there is an update on the website.
- Open the website in Safari, and click the
Share
button at the bottom. - Choose
Add to Home Screen
, and confirm by clickingAdd
.
- Open the website in Chrome. For the first time visit, there should be a prompt to add it to the home screen. If you don't see the prompt, follow below.
- Click the three dot icon on the top right corner of the browser.
- Choose
Add to Home screen
, and confirm by clickingAdd
.
- Open the website in your browser (Using Chrome as example, Edge should be the same).
- Click the three dot icon on the top right corner of the browser.
- Choose
Install Optical Breacher Mk.1...
, and confirm by clickingInstall
.
The puzzle solving algorithm is basically bruteforce, with a simple pruning at sequence lenth of 6 (See govizlora#23 for details)
The target sequences are weighted from top to bottom as this: 1
, 1.1
, 1.2
, ... So it will focus on more hit first, and when even, the lower sequences will have higher priority.
The OCR part took the most time. I initailly used the default English OCR provided by tesseract, but it fails randomly (like recognizing "55" into "5") and the success rate is below 50%. Eventually I trained the model by myself, using tesstrain. Instead of recognizing single English characters, I let the program treat the byte as a whole, so the computer actually think "55" or "1C" as a single character in a mysterious language. The self-trained model worked better, but still not perfect. TBH I think maybe tesseract is not the best option, but since it's the only popular choice in JavaScript and I'm not famailiar with WASM, this will be the way to go for now.
- Make sure you have
node
andyarn
installed - Clone this repo, and run
yarn
to install the dependencies - Run
yarn start
. A browser window will open automatically with the app running. You can also accees the app using your phone, as long as they are under the same network.
You can also run the app locally with docker using this Dockerfile (thanks @ddimick). In this case, you don't need to install node
or clone this repo.
- https://github.com/kyle-rader/breach for test data
- https://github.com/naptha/tesseract.js which made this web app possible
- https://github.com/tesseract-ocr/tesseract and https://github.com/tesseract-ocr/tesstrain tesstrain made training the model a lot easier
- My wife for providing machine learning advices
Thanks goes to these wonderful people (emoji key):
Peter Polgar 🎨 |
Steve-luo 🎨 |
Doug Dimick 🚇 |
This project follows the all-contributors specification. Contributions of any kind welcome!