For some reason I came up with the idea of visualising Pong…
I have a small collection of old game consoles from before 1980, many of which are based on the AY-3-8500 chip. The most famous game made possible by this chip is Pong.
Research
Now of course you could make countless games, record them, digitise them and then visualise them, but that would take a long time, especially as you would also need two people, as the old systems do not allow a game against the computer. Therefore, a programmable simulation was needed. I came across the following interesting projects and sites during my research:
-
OdysseyNow - Based on Unity
-
Pong on the Arduino
- 70’s TV game recreation using an Arduino (Atmel ATmega328/168) processor. - Extensive documentation for a faithful recreation
- Pong for Arduino - one of many other examples
-
JavaScript implementation
- Javascript Pong by Jake Gordon - see below
-
Other
Implementation
The image was generated on the basis of typescript-pong
. This project is a fork (or TypeScript port) of javascript-pong
. The documentation for the project is very detailed, but the TypeScript variant is easier to customise. Basically, only infrastructural changes, e.g. a non-interactive mode, were necessary.
This required a simple test based on Playwright. This allows the recording of the games in the browser and the download of the recording to be automated.
Post-processing
A few post-processing steps are necessary to generate the image based on the recordings:
- Add video frames together, inspired by
python-image-averaging
- Separate static and dynamic image parts
- Gamma correction of the dynamic areas to emphasise differences, blur, then colourise
- merge areas again
OpenCV and NumPy are used for the image operations, Matplotlib for the colouring.
Visualisation
In the picture, the static areas are white, as in the game; the coloured areas show how often something happens in which part of the picture.
The distribution follows this scale: On the left (cyan) little activity, on the right (magenta) a lot of activity.
Statistics
The image consists of 1777136 individual images, or 2:42 hours of gameplay, or 333 rounds.
Update 9.9.2024
I’m not the only one who has come up with the idea of using Pong for visualisation: Song Pong.