What?
A genre-mash circuit-building game that combines music with puzzles. Enemies arrive to the beat of a melody and your goal is to play this melody using a bunch of circuitry components.
Gameplay
The core gameplay loop consists of building a circuit that can play a melody. The circuit is built on a grid and consists of components that can be unlocked by progressing through the campaign. Each component has a specific function, and by strategically connecting them, players can create complex circuits that play the required melody and eliminate enemy waves.
Components include:
- Pulser: Generates periodic pulses based on a time signature, serving as the main beat provider.
- Wires: Carry pulses. Single and bidirectional. Jumper wires can cross other wires without connecting.
- Sequencer: Sequentially activates the next output pin for each input pulse.
- Counter: Emits one output pulse after a defined number of input pulses. Useful for creating delays.
Development
I was inspired by games like Infinifactory. The development presented a lot of interesting challenges, including:
- A system for representing circuits in a way that is flexible.
- The logic for how pulses propagate through the circuit.
- A system for enemies to spawn and move according to the beat, along with detecting correct and incorrect notes played.
- A way to communicate the melody to be played visually.
Component interface
I created a common interface to represent components. This included input and output pins, along with common data (like current pulse ID and connected components) and functionality. This provided enough flexibility to allow for a wide variety of component types.
Pulse propagation
To generate the pulses, a global ticker was used to sync time steps across the circuit. Each generated pulse was assigned a unique ID, which was used to track its propagation through the circuit and avoid duplicate triggers. Each component had logic to determine how to handle incoming pulses and when to emit output pulses.
Melody and enemies
I used MIDI files to represent melodies, which were parsed in C++ to extract note and timing information. This allowed for a visual representation of the melody, showing players which notes needed to be played and when. This was crucial for gameplay, as players needed to understand the timing and sequence of notes to build the correct circuits.
This MIDI information was also used to spawn enemy waves:
- Spawn an enemy in the correct note-lane and at the correct distance from the piano.
- Move the enemy forward according to the global ticker.
Sandbox mode
In addition to the campaign, I implemented a sandbox mode. While the original purpose was for testing my designs, it grew into a mode where players can freely experiment with building circuits. In addition, players can import their own MIDI files, and even export their circuits to share with others. These features made use of the file management system and save system of Unreal Engine.