If your project already contains the visual studio project, follow the below steps to quickly setup the ComboMeter functionality in your project. The New ComboMeter contains two main components
The ComboMeterComponent - This component added to the PlayerController isi responsible for keeping score among other things on how well the player is playing.
ComboMeterWidget - This widget is responsible for showing the combos the player has achieved. The ComboMeter has added funcationlities to visualize music for extra "coolness".
Please go through the below steps to set them both up in your project.
If your project already contains the visual studio project files you can directly add the ComboMeterComponent on the PlayerController you have for your game.
Initialize the ComboMeterComponent on the PlayerController by providing the list of ComboLevels and the ComboDecayCurve to it. The ComboMeter Component uses the ComboLevelDetails to determine the number of ComboLevels your character can achieve and the ComboDecayCurve to determine how fast the Combo fill percent should be decayed.
The ComboLevelDetail classes are already created in the plugin as an example. Youcan create more if you as appropriate for your game. In the example provided the ComboLevel classes are created for '0', 'D', 'C', 'B', 'A', 'S', 'SS' and 'SSS' ranks.
The Music Visualizer ComboMeter part of the 5.5 update, handles a lot of the work that the previous BP version of the ComboMeterWidget did. So, to get started create a child class of the 'MusicVizComboMeterBP' provided with the plugin as an example and add it to the main canvas or and HUD UI widget you have created for your game. Don't forget to select the MusicComboMeterDrawStrategy from the Menu if not already selected. We will get to this in the next section.
The new ComboMeter uses a 'DrawStrategy' to actaully renders the different layers in the ComboMeter. Again, there is already a DrawStrategy class provided in the plugin. You can create a child class of this 'MusicComboMeterDrawStrategyBP' and add the new Child class to the 'DrawStrategy' field of the ComboMeter Widget BP you created above.
Now that you have both the ComboMeter Component and the Widget set up, you can put the ComboMeter to test by invoking its methods from a PlayerCharacter blueprint. An example PlayerCharacterBP is provided in the plugin content folder. It simulates an action game by adding points to the combometer on press of number keys on your keyboard where each of the number 1-8 are treated as different combos. In an actual game you can use different moves you execute to invoke the 'AddComboPoints' method providing the id of the move to add points to the ComboMeter. But how do you calculate points? The ComboMeterComponent provides a Default 'CalculatePoints' method to do this. This method takes an Id of the move and the weight of the attack, which can range from anthing greater than zero, to calculate points similar to how points are calculated in Devil May Cry games. If you want different behaviour than what is provided in the plugin for calculating the points, you can just write your own method for calculating points appropriate for your game and the add the result to your ComboMeter.
The final part of the process is to enable Music visualization.
This feature is dependent on the 'Audio Synesthesia' plugin of Unreal engine which itself is in the Beta stage as of now. Hence, to not force users to enable beta plugins if they don't want to if they don't want the music visualization feature, the MusicVisualization code is provided in a paid DLC... just kidding, as a free extenstion to the CA_ComboMeter plugin. This is one of the plugins you initialized in the first steps of this tutorial.
Now to actually enable the visualization, you need to provide the MusicComboMeterDrawStrategyBP you create earlier with a Visualizer class. There is an example Visualizer class Configured with the CA_MusicVisualizer plugin you can select from the drop down to give it a quick test. The visualizer class needs a map of the Music and the corresponding NRT analysis files to get the pitch data from the audio. The frequencies you want the Visualizer class to pass on the the materials need to be specified in the 'Frequencies to Visualize' array. In the example, two frequencies are selected by their index in the NRT analysis, 33 and 28 for Sonata music, and the keys for these indexes, 'Pitch_1' and 'Pitch_2' are what the Visuailzer class passes to the MaterialInstances. See the second video below for details.
The way the Music Visualization works is by fetching the ConstantQ data from the audio being played and passing the frequencies that you have specified in the Visualizer class to the Material instances in the DrawStrategy. To add other frequencies to the visualization you need to specify those frequencies in the 'Frequecies to Visualize' array and reference those values by the parameters of the same name.
DON'T FORGET TO CREATE A CHILD CLASS OF THE VISUALIZER CLASS INHERITING FROM THE 'MusicVisualizerBP' provided in the plugin, so that if any updates are provided in the future your changes not overwritten. The same goes for the DrawStrategy as well.
With the new ComboMeter 5.5 update, for the new ComboMeter widget we have seen earlier, all the customizations are avaiable in one convinient place - the DrawStrategy. You can specify alternate textures, materials here which will instantiated by the Widget and used accordingly.
To make any modifications to the DrawStrategy, make sure to create a child class in your game content folder from the default DrawStrategy provided, so that any updates do not overwrite your changes in the plugin folder.
Here is quick overview of how you can implement scoring for a player.
(This is applicable for a Devil May Cry style one active mission at a time - games. If you need something more complex tailored to your game, you can contact me on Discord for a contract/paid support for implementing more advanced scoring functionalities for your game.)
StartScoring - Scoring player begins after invoking the StartScoring method on the ComboMeterComponent. This is usually done at the beginning of the mission.
PauseScoring - Let's say you have different areas where the Player may fight waves of enemies and you have to travel between these areas. You wouldn't want to score player, let's say when there is a cutscene or the player is not in combat(eg, while still travelling to the designated combat area). So, you can pause scoring once the player is not in combat. You can invoke the 'ClearAchievedComboRank' to clear the current rank before pausing so that when the scoring is resumed, the rank starts with 0 combo rank.
ResumeScoring - Let's say the player enters a specific combat designated area and the combat begins, you can invoke the 'ResumeScoring' method to previously paused ComboMeter.
EndScoring - Once you have finished a mission, you can invoke 'EndScoring' to, well, end scoring the player. Don't forget to invoke the 'CalculateRatingAverge' method on the ComboMeter to compute the average rank the player has achieved during the mission. This method returns a float indicating the average.
ApplyDamage - Whenever the player takes damage, you can invoke the 'ApplyDamage' method on the ComboMeter to do the same to the ComboMeter. You can provide a DamageWeight value to indicate how big the damage was.
With that you should be now able to have somewhat end to end functionality of scoring a particular mission. There are other functionalities that come with the ComboMeter plugin, such as Mission end screen, Save functionality. But unfortunately, some of the videos were accidentally deleted. I'll be reuploading the videos along with many improvements to the plugin. Thank you for your patience.
For any techincal support for the plugin, you can verify your account on the Fab marketplace by leaving your Discord user name in the QnA section and I'll add you the official channel.
Let's make greate games!
Please refer ComboMeter - Ranking Screen to find documentation on how to rank the player.