A(I)steroids is an Asteroids clone developed in the Love2D framework. The classic Asteroids game mechanics are used as a metaphor for the volatile and fragmented nature of AI technology and markets.
Larger asteroids splitting into smaller ones mimics how AI technologies branch into specialised applications. The player's struggle to navigate/defend through chaos reflects our attempt to make sense of rapid AI delopments and the lack of consistent or planned-ahead regulation.
The shooting/splitting is based on the original Asteroids game. In this version, the size of the asteroid relates to the stock trading volume for that day. The shooting/splitting represents both the effort required to break down large volumes of trades and the fragmentation of AI technologies into specialised applications.
Using stock prices to generate asteroids characteristics also creates an interactive data visualition. Game mechanics are used to explore market volatility through:
- asteroid size based on the stock's trading volume for the day
- asteroid colour reflects price change (last - open): green for gains, darker red for larger losses
- asteroid segments scale with the stock's last price
- asteroid line width matches daily price range (high - low)
- asteroid rotation speed tied to price change magnitude: clockwise for gains, counter-clockwise for losses
- asteroid speed correlates to daily stock volatility
- the player's score reflects the stock's market value (last trading price), with collisions against asteroids resulting in score penalties proportional to the asteroid's size
To download the game, go to the releases page and download the appropriate package for your platform.
Warning
The Mac version is not signed, you may need to ignore the security warning to be able to run it.
The stock data was downloaded from the Nasdaq website,
using the historical data from the past month, covering the period between
2025-02-07 and 2025-03-06. The data was combined into a single CSV file, and then
converted into a lua table using the data/csv_to_lua.py
script. The stocks
included are:
- Amazon (AMZN)
- AMD (AMD)
- Apple (AAPL)
- Broadcom (AVGO)
- Google (GOOG)
- Meta (META)
- Microsoft (MSFT)
- NVIDIA (NVDA)
- Taiwan Semiconductor Manufacturing Company Ltd(TSM)
The conversion script requires the Python pandas library.
The game music was created through Data Sonification, using Sonic Pi. The same variables used to generate the asteroids are used to generate the music. Notes are derived from the stock volume, and synth effects are derived from the stock prices.
The script used to generate the music is assets/music/csv_to_audio.rb
. The
script needs to be run inside Sonic Pi.
To run the game, you need to have Love2D installed, and a copy of this repository.
git clone https://github.com/kingsdigitallab/aisteroids.git
cd aisteroids
love .
src/
: Source codedata/
: Data filesentities/
: Entity components, e.g. player, asteroid, bulletsystems/
: Systems components, e.g. collision detectionutils/
: Utility components, e.g. coloursstates/
: Game state components, e.g. game state, game over
assets/
: Assets, e.g. audio, fonts, imagesconf.lua
: Configurationmain.lua
: Entry point and game loopREADME.md
: This file
assets/sounds/laser.ogg
was converted to OGG format from the original by bubaproducer -- License: Attribution 4.0assets/sounds/thrusters.ogg
was converted to OGG format from the original by DJT4NN3R -- License: Creative Commons 0assets/sounds/explosion.ogg
was converted to OGG format from the original by Artninja -- License: Attribution 4.0assets/sounds/asteroid_hit.ogg
was converted to OGG format from the original by runningmind -- License: Creative Commons 0
- LOVE
- Sheepolution - How to LÖVE - Table of Contents
- GitHub - Keyslam/LOVE-VSCode-Starter-Template: A minimalistically configured VSCode template for LOVE
- Data sonification - Wikipedia
- Sonification
- Telling data stories with music
- The Sound of Data (a gentle introduction to sonification for historians)
- Sonic Pi: Basics