Show HN: WeeMap – Map Extractor – With KNNs and Tensorflow.js

buildmage.com

1 points by flashgordon 5 hours ago

I used to play WeeWar (browser-based hex strategy game, RIP 2015) way too much, and wanted a way to extract map data from screenshots. So I built a little tool that extracts tile data from hex-based strategy game screenshots (WeeWar, Civilization, etc.) to scratch my own itch. Runs entirely in the browser using TensorFlow.js.

Previously I tried this using p-hashes but those didnt work quite well when units stood on tiles. So this time I tried it with MobileNet for embeddings + KNN for classification. So now doesnt need training and can learn from few examples and runs entirely in the browser.

It's a bit rough around the edges but works well enough that it generalizes to other hex games (tested on some Civilization screenshots too). Lots more that could be done - better UI, model persistence, maybe regression for tile yields - but it was a fun learning project. I also found the best way for me to learn more of the advanced ML concepts was just to build it for something I found fun.

Demo: https://buildmage.com/demos/weemap-scanner/ Source: https://github.com/panyam/weemaps/tree/main/part2-scanner