Doom on the Tildagon badge.
Install it from the app store, or copy this
repository's files to /apps/doomagon/ on the badge.
When you first install Doomagon from the store, and then run it, it will look like it is frozen. It's extracting itself. Then when you run Doomagon it will complain about not having enough RAM.
Reboop the badge, then run Doomagon.
Time to time the framerate dips to 1-4 fps. You can press 'enter' on the keeb expansion to toggle framerate, or do so from the menu in Doomagon. The dips are either because of sdcard reads, or other badge behaviour. Generally its almost 30fps.
No game data ships with this app, because none of it is redistributable. The app finds what is on the hexpansion SDcard or on the badge's own storage, and offers to download Freedoom if it cannot find anything. A microSD hexpansion is recommended but not required: the shareware and Freedoom WADs should fit in internal flash, while the commercial ones do not. Doom 2 also works, any wad files larger than 11MB will begin to affect functionality and features.
Pressing 'C' at the menu, or pressing 'enter' on the keebdexpansion will start the game. If you've enabled 'net' for network play, it will host or try to join a game.
You should be able to select a 'skill' (difficulty) an 'episode', and 'map'.
B and E on the badge changes options, or left/right or a/d on the keebdexpansion.
F on the badge brings up the menu and quits/minimises.
You can use:
-
Spaceagon, the joystick nub moves you forward, backward, turns left and right. B and E strafe you left and right. C fires. The ring of LEDs will flash whenever a weapon is fired, or if you have a powerup. This can be disabled with "Gun Flash".
-
Keebdexpansion, near full support as though you're playing Doom on a keyboard. You can use the number keys to switch weapons. wasd is forward/back and strafe. Cursor / arrow keys are forward/back and turn. Ctrl fires. If enabled in the menu, you can hold 'g' to use the gyro to turn. Which axis is determined by what you have set in the menu.
-
Touch ring on the spaceagon, this isn't implemented. I tried it, but until we have i2c interrupts the polling of the touch buttons isnt worth the performance cost or the delay.
The badge has no audio hardware. Doomagon sends the sound somewhere else:
- Network -- the badge serves a page, and a device on the same network as the badge becomes the sound card. Effects and music, because the browser synthesises the OPL2 music itself. When this is enabled, you're given an IP address, open this in a web browser and press the button. You also get volume control.
- I2S -- a DAC on any of the six hexpansion ports. Effects only. This is because music requires synthesis, until we get a midi player for the badge. It would have been possible to do i2s sfx and network music, but then getting that working with multiplayer at the same time would have had sacrifices.
Badge to badge, over ESP-NOW or WiFi. Deathmatch and co-op. This is changed via the 'NET LINK' option.
Changing the NET option switches between:
- OFF, no multiplayer
- HOST DM, host deathmatch and you will want to change some other options.
- HOST CO-OP, host co-operative where you play together through the levels
- JOIN, join a game. Make sure you have the same wad loaded as host.
ESP-NOW hasn't been tested, I only have one badge. Co-Op hasn't been tested, only deathmatch and only a simulated server against a bot. One badge has to be the 'host', both badges need the same wad loaded. You'll be shown the IP address of the badge, but the badge may try to discover someone to join on the same network. You're notified when someone has joined, it uses the 'name' of the badge as the player name. Then you can start the game. Timelimit and frag count are configurable (I think?) and you can turn off monsters.
There's diagnostics and framerate toggle options. Only enable them if you're interested, but otherwise it may tank performance.
There's a couple of easter eggs if you know what to type.
The following github repositories were referred to and used for reference while developing this app and may use code or code inspired from them, or has been tested with code from them during development:
- https://github.com/DanNixon/microsd-hexpansion
- https://github.com/davedarko/KeebDeckHexpansion/
- https://github.com/emfcamp/badge-2024-documentation
- https://github.com/id-software/doom
- https://github.com/fragglet/miniwad
- https://github.com/fragglet/squashware
- https://github.com/GorGylka/Smallest-Doom
- https://github.com/next-hack/nRF52840Doom
- https://github.com/ArcaneNibble/hexpansion-headphones
- https://github.com/andreacampanella/AudioHexpansion
The code and repository has been maintained with the assistance of anthropic's claude code.
GPL-2.0-or-later. Doomagon embeds a build of doomgeneric, which descends from Chocolate Doom and from id Software's Doom source release, all of which are GPL-2.0-or-later.
doomgeneric.mpy in this repository is a compiled binary of that engine, with
this project's modifications. Its complete corresponding source is in
native/ in this repository, on the same branch and in the same release --
including the changes made to the engine, the MicroPython module glue and the
build files. native/ carries an export-ignore attribute so that it is not
downloaded onto badges; it is in every clone and in every source archive.
native/src/tinflate.c is by Andrew Church and is public domain.
The badge's own APIs are used, not included. Freedoom, if you download it, is separately licensed and is not distributed here.