A fully playable AND mappable rhythm game made entirely* in patcher!!!
*most of it is in patcher, but some of it is in the mixer because of limitations within patcher...
This one took way longer than the last one, so here's how it works:
Footage:
Explanation: (Skip to the bottom for the download!)
Gameplay
Player Input
- An instance of Fruity Keyboard Controller is used to take in Midi information from the user, and is limited to C5 through F5, (Q/W/E/R respectively when using Keyboard To Piano mode.)
- A single instance of ZGameEditor Visualizer is used to handle all of the visuals.
- Unlike the last Patcher Game, this one functions entirely without the need for visual indicators, all the logic is handled independently of the visuals, so theoretically it is possible to play with 0 GPU usage! (Though it might be a bit hard to play.)
- The Bullet "spawn" logic is handled exclusively with Automation clips triggered by Pattern Clips on the playlist. This unorthodox approach was inspired by the desire to make more complicated games without having to rely solely on the RGB output values of ZGameEditor like the last game did. Not only does this make the game easier to set up, it also makes it easy to modify, allowing even newcomers to FL Studio to quickly map their own songs to the game!
- The position, (Position Y,) and the opacity, (Layer Alpha,) of the bullets is synced between two automation clips being triggered by notes on the Channel Rack. An empty layer is also present to give the user a visual indicator of when the bullet will hit the line in-game.
Abbreviations:
FFC (Fruity Formula Controller)
FEC (Fruity Envelope Controller)
MO (Midi Out)
PC (Peak Controller)
Hit Detection
- The player's input is captured by a set of FFCs labeled "Input" A through D. The Fruity Keyboard controller outputs a value depending on what note is played, and then resets back to 0 whenever the note stops playing. Inside of the Input FFC, I used a formula that makes it so that if A has the same value as B, the FFC will output a 1, and otherwise it will output a 0. The player's input is linked to A, and the exact value of the respective key is set to B, this way we can track whether or not the player has hit the key. This is done three more times for the remaining keys.
- Another automation clip is used to give the player a window of time where hits are allowed to be registered, working like a gate. This automation clip is linked to parameter A of FFCs labeled as "Accuracy" 1 through 4 respectively for each of the inputs.
- The Accuracy FFCs use "AND" gates, meaning that the FFCs will only output a 1 if both the A and B parameters are set to 1 at the same time. Next, we assign the "Input" FFCs to the B parameters of the "Accuracy" FFCs. And just like that, this gives us a way to check that the player has hit the button exactly when a bullet is on the line!
As far as I know, there's no way to add up values inside of FL Studio 21. This may be subject to change in the future, so if you know of a way to accomplish this, please let me know! Below is a workaround to this limitation:
- Score is handled by using a text object inside of ZGameEditor that can be automated to count upwards or downwards depending on the input signal. We can make use of this by using the LFO inside of a PC in the master mixer channel, and setting it to the slowest possible speed. With this setup, we can make the signal rise a few units every couple of seconds, and have that act as our score. We will call this "ScoreController.
- Next, we use another instance of PC labeled as "Input" to enable / disable the mixer slot corresponding to our "ScoreController." We can trigger the "Input" PC by using a noise generator inside of Patcher that only lets signal come through whenever the "Accuracy" FFC outputs a 1, meaning that the score will only go up whenever a note is hit, and will remain the same otherwise.
- The noise generator is actually just an instance of 3xOscillator set to white noise. A note is constantly being held by using an instance of MO connected to an active button inside of Patcher's control surface.
- By repeating all of these steps three more times, we can make it seem like the "score" increases whenever any bullet is hit by the player on the line.
- Using a similar setup to the Noise Generator, an instance of FPC to play a sound whenever a note is successful hit. We utilize an MO to make the sound trigger, and then we use an instance of VFX Key Mapper to make sure it only triggers the exact pad inside of FPC that we want.
- The MO is triggered using the same "Input" PCs that activate the "ScoreController" PC.
- Lastly, bullets "pop" whenever the player successfully hits them at the right time. This is done by changing the "Height" parameter inside of ZGameEditor.
- Another set of FFCs labeled "AdditionalUtil" is used to invert the signal of the "Accuracy" FFCs, and is then used to trigger yet another set of MOs, that then trigger a set of FECs to smooth the animation of the pop.
Bug Fixing:
Game doesn't take input:
Check that you have Typing Keyboard to Piano Keyboard enabled at the top of the screen.
Remember to select the green "Game" instance of Patcher before you close all windows.
Score doesn't go up:
Make sure that the "ScoreStart" button is enabled inside of patcher, its located at the top of the window, under the "Game Start" tab.
Game is laggy:
This is because of the visuals, sadly there's no easy fix for this besides disabling all of the effects within ZGameEditor, but that takes a tiny bit of knowhow. Give it a try!
Final comments:
Honestly this was one heck of an undertaking, but it just goes to show how amazing of a program FL Studio really is. The more I use this app, the more I realize that I'm barely scratching the surface of what can be done, and I am extremely excited to keep pushing the boundaries of what is possible. Thanks for reading, and thanks for playing!
- Henyx
P.S.
Image-Line! If any of you are reading this, please let me make a preset pack for FLEX! I've been dying to see what's under the hood of that synth, so if you like my work with Patcher, rest assured that I will deliver the same quality if not better!
Download!