Awakened PoE trade, AI complexity
I am playing the game Path of Exile again and continue to be amazed at the complexity of the third party tools gamers have created for it. The game doesn’t really support addons or anything, it’s all hacked on. A few years ago I looked at how PoB Item Tester worked; this time around it’s Awakened PoE Trade (APoET).
There’s a feature where APoET will take a screenshot of the screen, OCR the text on the caption of an item, then tell you whether it is valuable. It’s a little flaky but when it works it’s a huge convenience over alt-tabbing out and doing a web lookup.
The tech it uses is remarkably complex. APoET itself is an Electron app written in 8500 lines of TypeScript and 6800 lines of Vue. It’s a strange UI, built to run as popups on hotkeys while playing the game; not at all like a typical Electron windowed app.
The OCR code is just 326 lines of TypeScript. To use it you install a binary blob. In that is Tesseract, a nearly 40 year old OCR library that has gotten a bunch of updates over time. The modern version is based on OpenCV (itself 20 years old) and some machine learning model boiled down into 4MB of weights. The code for these libraries are a further 5.5MB of WASM binaries. It’s called “tesseract-core-simd”; news to me that WASM could take advantage of SIMD instructions, I guess that’s a few years old.
Anyway it’s a tower of complex software building what is ultimately a pretty simple and kludgey product. I love that this is all possible and accessible even to folks hacking a tool for a game they play.
(while I’m here, the real standout tool for PoE is Path of Building, a complete theorycrafting game simulator. With 50,000 lines of hand-written Lua and another 2M lines of game data as Lua code.)