Lightning Fix and Supercharging

Published February 05, 2024
Advertisement

This week my Ciros tasks were to fix our Lightning ability, to implement the crystal Supercharge system, and to replace the ability’s sprites with the finalized art.

The sprite task, I decided was best to be delayed into next week as not all of the crystal’s have only one sprite even though there are multiple systems that were written with one sprite in mind. This will be discussed to decide the best way forward.

Lightning was a rather quick fix, though an interesting one. I wrote and tested the ability originally in October or November. It was working, got merged into our main branch, and somehow was broken. What would happen is the ability would work insanely quickly, striking enemies multiple times a second.

The intention of the ability was to find an enemy, strike them, then cooldown. If a chance value is hit, the lightning would strike again quickly rather than waiting for a full cooldown. Intuition would say that the problem was either with the cooldown or the extra strike chance. I first looked at the ability’s scriptable object framework. Here laid the first issue, “Cooldown” was set in the framework while the code was looking for “cooldown.” The problem was still happening, which is where I and a couple others started looking through the code line by line. Our guess was that it had to do with my slightly convoluted boolean system for determining when a strike was allowed or when to cooldown. It turned out that I was setting the boolean for _charged at the wrong time, enabling a strike almost every frame.

The ability is now in working order. If the extra strike chance is hit over a specified limit, the ability will be forced to do a full cooldown. I also tested and reviewed the values for the ability’s damage and cooldown to make it feel much nicer.

Supercharging is implemented in a very simple way currently but I decided more needed to be discussed before I spent the time implementing the system. Currently, there is a Player attribute nilvorClass that is assigned an enum value on the start of the game. Depending on this value, the supercharged crystal will receive a buff of Damage, Range, or Cooldown.

This would happen if a crystal is dragged to another crystal of the same type OR if a threshold of crystals are discarded. What needs to be finalized is what should happen when the threshold is reached, how I want to implement that system, and how good of a buff needs to be applied.

Previous Entry Crystal Swapping End
0 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement