Saguaro
Revision as of 18:02, 18 March 2026 by CrazyBassoonist (talk | contribs) (Saguaro is my strongest bot ever =))
Background Information
- Bot Name
- Saguaro
- Author
- CrazyBassoonist
- Extends
- AdvancedRobot
- What's special about it?
- It's a competitive megabot that takes a somewhat different approach than other top bots.
- Great, I want to try it. Where can I download it?
- The source code is available on github.
- How competitive is it?
- Currently #5 in the roborumble.
Strategy
- What is its basic strategy?
- Saguaro is a multimode bot with three distinct modes (and more planned for the future). It has a main mode as well as a BulletShielding mode and a mode designed to get very high scores against bots with very predictable movements (currently just used against mirror bots). It has a nice method of exploring modes by tracking the score during different modes and creating a confidence interval for the mode's true mean score; this means that if one mode is substantially worse than another the bad mode can be ruled out after just a few rounds, but if two modes are very close in performance it will spend a lot of time testing to find which one is truly better.
- How does its main mode work?
- Saguaro uses the same KNN/kd-tree approach for predicting opponent behavior that many bots do, but it takes a somewhat different approach to how it uses that data.
- First, it finds the observations most similar to the current game state. It then treats each of those observations as a Gaussian kernel, constructing continuous probability distributions that describe both where the opponent's shots might be and where the opponent might move to.
- Next, it randomly generates a number of candidate plans: combinations of a movement path, targeting angle, and bullet power. For each plan, it estimates the probability of taking damage and damaging the opponent by integrating those distributions over the plan's predicted bot-width intersections with the waves.
- Finally, it calculates the plan's expected score for both us and the opponent by building a game tree over a fixed time horizon, branching on every possible combination of shots hitting or missing. For branches that don't end in a robot death, it estimates the expected value of end-of-round bonuses using the simulated energy difference and our previous score against that opponent. Between ticks, it saves the best plans from the previous tick and evaluates mutated versions of those alongside newly generated random plans.
- There are very few heuristics involved in how Saguaro behaves while in this mode. Most of them have to do with how it generates candidate plans: there are a few hardcoded movement options, and it only considers targeting angles aimed at the peak of the opponent's movement distribution or angles that provide a bullet shadow for the movement path. Everything else comes from trying to maximize expected score, which produces all kinds of cool emergent behavior. For example, Saguaro plays very safe when it has a high score but will even do things like opportunistic ramming against bots it is losing to.
- How does its BulletShielding work?
- The BulletShielding geometry and opponent gun modeling are based very closely on how BeepBoop and EnergyDome do them, but it does have one unique feature in this mode. Saguaro tries to calculate how much time it has before it will next need to intercept the opponent's bullet, and if it has enough time it will fire a shot aimed to hit the opponent first. This avoids wasting all of the extra gun heat that you typically do while bullet shielding, and having more raw score from bullet hits does a lot to dilute the damage from those times when the opponent does manage to hit you.
- How does its last mode work?
- Currently Saguaro's final mode is only enabled against bots that copy its movement, but in theory it works against any opponent whose behavior is very predictably based on how Saguaro moves. In this mode Saguaro generates movement paths in advance and commits to them no matter what, then aims at the opponent by simulating their movement forward in time until the shot would land. Watch it in action against a bot like PolishedRuby and you will see how effective this method is. This mode was written with the idea of being strong against rambots, but it turns out that having more time to think about your movement options tends to be much more important against those than having perfect accuracy.
- Is this robot melee-capable?
- No.
- What does it save between rounds and matches?
- A lot. The main things that it saves between matches are data from mode exploration and the knn weights (no observations are saved). It does come preloaded with opponent data files, but the bot explores modes and learns opponent embeddings itself instead of having that data hardcoded into it. So its behavior against existing bots is just the behavior you would see after running it a few times against each one.
Additional Information
- Where did you get the name?
- Its a riff on my first megabot, PricklyPear.
- Can I use your code?
- RWPCL
- What's next for your robot?
- I have a lot of ideas for how to improve this bot further. If you take a look at its scores you will see that it has a lot of ground to gain against strong bots (currently it only has extremely static predictors for opponent behavior); improving those scores will be the next step.
- Does it have any White Whales?
- I don't know if BeepBoop can ever be defeated (seriously what is Kev feeding that thing?), but it would be a dream to eventually pass DrussGT as that was the strongest bot for most of time I was previously active.
- What bots is it based on?
- It uses Rednaxela's kd-tree implementation and a FastMath class based on his FastTrig classes.
- The BulletShielding mode is based on how BeepBoop and EnergyDome do bullet shielding.
- In general I spent a lot of time learning from the source code of BeepBoop, DrussGT, and Diamond while making this bot, so big thanks to those Kev, Skilgannon, and Voidious for making those bots open source. The general idea of trying to maximize expected score was inspired by how BeepBoop does bullet power selection, and it also uses lessons from BeepBoop in a few other ways like for how it calculates 50%-weighted bullet shadows and how it estimates precise MEAs.
Version History
0.1
- First release - ScoreMax, BulletShielding, and PrecisePrediction modes