Skip to content
Brent Yorgey edited this page Jun 6, 2024 · 11 revisions

Ready to prove you're the fastest robot swarm wrangler in the west? Try Swarm speedrunning! (If you want to prove you're the cleverest rather than the fastest, try Code golf!)

Uploading/hosting

We recommend recording and hosting speedruns via asciinema, though note there is a limit (25MB?) on asciicast upload size. Speedruns longer than 10 minutes or so may need to just be recorded as a normal video.

Categories

Swarm speedruns come in several distinct flavors. The first distinction has to do with what is being measured:

  • Best time: The elapsed wall-clock time is measured from the start of the scenario to achieving the objective.
    • Note: speedruns in this category should not adjust the game speed, since that would privilege runners with beefier computers that can simulate more game ticks per second. The speed must remain at the default 16 ticks/second for the entire run.
  • Best ticks: The elapsed game ticks are measured from the start of the scenario to achieving the objective.
    • Adjusting the game speed is allowed. Speed it up to save time (or slow it down so you can type a lot without wasting ticks!).

Swarm automatically uses both the above metrics and keeps track of your personal best for a given scenario.

For scenarios that take place in a procedurally generated world, there are also two categories to do with how the seed is chosen:

  • Random seed: start from a new, random seed every time.
    • Using a predefined library of general-purpose definitions is allowed (it would be too tedious/boring to retype definitions every time). Sharing your definitions publicly is encouraged but not required.
    • This type of speedrun emphasizes developing a good library of general-purpose tools and then reacting to the given world quickly and effectively.
  • Set seed: start from a specific, chosen seed, perhaps one that has many resources close to the base etc.
    • Presumably, this category is about crafting a specific program which carries out all the steps automatically, and making that program as efficient as possible.

The categories described above are orthogonal, giving four main categories in total, e.g. best time/random seed, or best ticks/set seed, etc.

Tips

  • To load a specific scenario without going through the menu, use the --scenario (-i) flag.
  • To run a specific program immediately when loading a scenario (such as a file containing custom definitions), use the --run flag with a file containing Swarm code.
  • To use a specific seed value (for set seed runs), use the --seed (-s) flag.

For example, to run the code in curry.sw on the curry challenge with seed 100, use

swarm -i Speedruns/curry -s 100 --run curry.sw

To record a run with asciinema you could, for example, do something like

asciinema rec -c 'swarm -i Speedruns/curry -s 100 --run curry.sw' --overwrite curry.cast

If you have a good run, you can then upload it with asciinema upload curry.cast.

Scenarios

Some default speedrun scenarios can be found in the New Game menu, under Speedruns. Post recordings of your best times here! Also, feel free to propose new scenarios, either by describing them here or via a pull request (see the scenario authoring guide for help on creating your own speedrun scenario).

Curry

  • best time/random seed in 1:15 by Brent Yorgey

    asciicast

Forester

Mithril

  • best time/random seed in 21:02 by Brent Yorgey (sadly the asciicast was too large to upload)

    mithril-speedrun-proof