Licence MIASHS · Java · pair project
The bot shoots where the ships still fit.
Four targeting strategies, benchmarked over 300 games each. The winner is not the expensive one: a placement-density heatmap beats Monte Carlo simulation while costing a fraction of the computation.
Below is a real recorded game, not a re-enactment. The shots and the grid behind them both come out of the Java run, so what you are watching is the program that produced the numbers further down.
How the heatmap is built
For every ship still afloat, the bot slides that ship across every position on the board and counts the placements that no missed shot rules out. A cell's value is how many surviving placements cover it, so the brightest cell is simply the one the most remaining fleets pass through. Each miss deletes every placement crossing it, which is why whole regions go dark at once.
The parity weighting is the part worth noticing: cells are boosted or halved depending
on (row + column) % shortest_remaining_ship. Because no ship can hide
between two cells of that lattice, checking it first cannot miss anything, and it is
what turns the opening from a scan into a sweep.
Results
Results/tournament_summary.csv.
Results/performance_summary.csv.
Results/tournament_pairwise.csv.
How to read these numbers
-
Tournament.javaplays each pair once and the lower-indexed bot always moves first, so Markov's 52 to 48 edge over Monte Carlo carries an uncorrected first-move advantage. The gap against Uniform is far too large to be explained that way; the gap against Monte Carlo is not. -
performance_summary.csvmeasures self-play, so it reports how fast a bot clears a board, not how it fares against a specific opponent. - The heatmap does not model the rule that ships may not touch, although placement enforces it. The model is therefore slightly wrong on purpose, and still wins.
Same fleet, both bots
The identical ship layout, played by the heatmap bot and by random fire, advancing one shot at a time. This is one game each, not an average.