Dev Blog: More Upgrades!
Four months later Symbiotic has made imense progress adding new mods, new VFX, new sounds, and more AI! Working on this has been a lot of work but extremely fun and I think we have come out with a product we all are proud of, more updates to follow! However, there will always be more to add and I wanted to take it upon myself to continue building mods for the game. Additionally, I took a lot of inspiration from Risk of Rain 2 by Hopoo Game and took it upon myself to replicate their Shrine of Order to compliment the mods that I added. These will not be going in the game immediatly but will likely be added after the initial steam release as an update.
Upgrade: Berzerker Mode!!!
The first upgrade I made was called Berzerker Mode and does exactly what you think it would do. Once the player reaches certain threshold of low health, they gain a temporary stat increase. This includes increased jump height, increase movement speed, health and damage. This first step can be breaken down into two different steps:
- Saving the original values the player has
- And increasing the values on the player
After that, the values need to be reset on the player after the effect has timed out.
Setting the Local Values
Here we are getting the values for each of the stats and saving it to be referenced later. We need these so that when we overwrite the current values we can set them back to the original state after
Setting the Values on the Player
Next we take the default values that we saved previously and apply a multiplier to them. These new values then get applied to the player until the effect has timed out.
Resetting the Player
Finally the values on the player get set back to there original value.
Making a prototype for paralisys was very simple. I added functionality for the OnStart and OnDestroy functions to be overriden by the blueprint classes. Then on start I stop the enemies movement and wait until the the status effect is destroyed to turn the movement back on. I did not want to mess with the rest of our codebase at the time of making this but it should be improved later by stopping the enemies animations and AI decision making.
My goal for infection was to make a status effect that would spread to new enemies after being applied to the first. the first step was to “hop” to nearby enemies. Originally, I tried doing this by getting the enemies in the scene and doing a distance check. I quickly realized that this was not performant and switched to using a sphere collision overlap to get enemies within a radius. Next I iterate through that list counting the number of enemies that have been infected. Once I have reached the maximum, it stops and resets. Upon resetting, the number of hops remaining reduces by 1 and then goes through the first loop again with the new number of hops. On top of this, it then deals damage to any infected enemies.
Beacon of Order
One of the cool environment interactives in risk of rain are the Shrines of Order. I wanted to try my hand at this and boy was I in for a ride. While I did eventually get it done, it took a lot of bug fixing and resulted in some fun experiences.
The first step in randomizing the players mods is getting the number of mods in each rarity tier. To do this, I loop throught the player’s current array of mods and take a tally of the number of mods in each rarity.
Once I have a tally of how many mods the player has in each rarity, I can then go though and generate the correct umber of mods to give to the player. Because I am using a function on the gun that doesnt account for rarity to get new mods I need to generate a new mod until I have the correct rarity. While this works currently, it may be better to have a way to specify the desired rarity so that you can guarantee only one iteration per new mod. Additionally, this could be improved by making it so that a new mod is not constructed with each iteration, instead using just mod classes.
Next, I can take the list of classes that I generated and construct mods to be added to the gun.
Lastly we need to reset the values on the beacon in case it is used again.
Here is the end result:
I experienced a really fun but game preaking bug while developing this where the player recieved way more mods than intended after multiple uses of the beacon. Here is what it looked like after several uses: