The Physical Build Project based on the game Keep Talking And Nobody Explodes
Dev blog | Project aims and goals | Project to-do | Youtube playlist | KTANE IRL Discord server |
I’m currently making short update videos on progress on my Youtube playlist. It’s certainly much quicker to film/narrate what’s new than type up a new blog post! Check there for more up-to-date info, meanwhile a more detailed write-up will appear here going into much more detail.
Prev post: Communications (part 2): BLE | Next post: OOP revamp, CAN shake-up and the debugger |
This is another catch-up update covering about August 2020 to January 2021.
Not exactly a module, as there is no puzzle to defuse, the Timer is one of the common components in any bomb. There will always be the need for timer display! Because of its requirement in very game, it became the obvious choice to bear the game logic and be the comms hub.
The Timer holds a variable to describe the game state:
On the physical side, there are three components:
It was planned for the Timer module to be self-contained, so allowing the module to be positioned anywhere in the bomb chassis. For the Timer to generate and control the serial number e-ink display, there would have to be another specialised bus wired in between all module slots and widget slots. This seemed very impractical, and so the serial number control was broken out into a new ESP32.
The Timer (top), Keypad (right) and Widget (bottom) modules.
This controller, assisting the Timer with common game tasks, is designed to sit permanently in the case to interface with the widget slots in the chassis.
Currently, there is no functionality to show indicators, ports or batteries (these are currently intended to be changed manually), but this Widget controller has two main tasks:
Syber from the Discord server came up with the brilliant idea of using an e-ink display to emulate the serial number sticker on the bomb case. These can be a little sluggish to update, but this only needs to happen once before the game starts, and they can look quite convincing as a passive paper sheet! This also removes a time consuming manual intervention to get the game ready. I’m using the 2.9” three colour Waveshare e-ink display which can conveniently emulate the white, black and red colours of the sticker.
Syber also did a great job of copying the fonts into the u8g2 library. This library is pretty big, and understandably so having the ability to draw to a huge number of displays in a variety of fonts and drawing functions - which was another driving factor to break the serial number controller out from the Timer.
The Timer generates a serial number for a new game, passes this to the Widget ESP32 via CAN, then the Widget ESP can update the e-ink display.
Although possible to put a speaker in the Timer (and I may still do this as an addition), it felt sensible to also move this function to the Widget controller. As this will be permanently seated in the case, so too can some good-sized speakers. And since this ESP32 will only have the serial number display to update, it will have a lot of free time (and memory) to play sound cues. Currently, the sound cues are some common game sounds (ticking, strike warnings and an explosion) but expanding this to cover other game sound effects will be trivial.
The audio amp is the PAM8403, driving an old laptop speaker for the moment. The sound library was created by XTronical which is very powerful, being able to play multiple sounds at once from hex-encoded .wav files.
The Widget controller listens on the CAN bus for cues from the Timer, then plays sound files with little overall delay according to a specific audio trigger (tick sound when the timer ticks over a second) or other game triggers (strike sound when a strike message is broadcast). As the Widget controller doesn’t have to send a message, it is given a blank (all-zeros) CAN ID and mask.
Prev post: Communications (part 2): BLE | Next post: OOP revamp, CAN shake-up and the debugger |