# Smaug (2026)
An auction bot in Python that fought live against the agents of my whole class at the University of Agder
Smaug is the auction agent I built for the Artificial Intelligence Architecture course (IKT110) during my exchange semester at the University of Agder. The brief: write a Python bot for an auction game run by the teacher, then let it fight live against the agents of the whole class, in two games of 1000 rounds. The grade depends on the final ranking.
In the game, a dragon auctions about thirty chests of points every second. The highest bid wins and pays in full, the others get half of their bid back; every player earns a salary in gold, can save at a bank that pays interest, and only points count at the end. My agent plays like a prudent investor: it keeps its savings at the bank up to the interest limit, ignores auctions worth too little, bids the recent market price per point plus a margin on the best ones, sells a few points back to the bank when it overpays, and spends its savings over the last hundred rounds, before the final rush.
Every setting was chosen by measuring rather than guessing. I built a simulator on the teacher's game engine that plays a full game in about ten seconds with the exact code of my agent, then ran a tournament of about 2,300 games, changing one setting at a time. The battle also showed me the limit of the exercise: a simulation is only as good as its opponents, and my classmates bid much harder than the example agents I had trained against.
Since a crashed agent misses rounds, and the teacher had warned that the server would sometimes send broken data on purpose, the agent never trusts what it receives: every field is checked, a broken round is skipped, and every bid goes through an "airbag" that makes it valid. I tested it against 10,000 broken messages, network cuts and a killed process. Next to it, a terminal monitor built with Textual shows its signals live (win rate, gold lost, market price) and lets me adjust the margin or switch features off during a game, through a small instruction file that the agent bounds before using it.
On the technical side: Python 3.12 and numpy for the agent, Textual for the monitor, pytest for 163 tests and GitHub Actions to run them before every merge.
On the day, the games ran at one round per second in front of the whole class, with no second try: a stressful exercise where every decision had to be taken under pressure, without overreacting. In the first game the class was much more aggressive than my simulations, and I raised the margin step by step. For the second, I started higher and switched point selling off: the agent won 87% of its bids and finished 5th out of 20, with a B.
I set out to build the best bot I could, and it went well. It was also a real challenge: a very big project in Python, split between the agent, the monitor and the simulator, built in just over two weeks across 22 pull requests.