Conquering Ciros Week 3: Piercing-Elemental Synergy

Published January 28, 2024
Advertisement

This Week's Work:

We're quickly approaching the end of the synergy list, which is good because we need to start getting all hands on deck for polish and improvements instead of new content.

Piercing-Elemental is another on-hit synergy, so the system works the same as the past two weeks. However, this time we have to duplicate a currently active projectile instead of just spawning something new from scratch. The duplicated projectile is also supposed to home in on enemies, even if the original projectile did not. I'll go over the duplication process first, since it was a little easier. We didn't have any strictly homing abilities in the game already, so that process is a little more complicated.

The basic duplication function for elemental-piercing

It's a pretty basic Instantiate call using the GameObject from the projectile that activated the synergy. I added a small Vector3 to the original position just so that the two projectiles are somewhat apart from each other when they're created. Setting the parent to null was a fix I found to stop scaling and rotation issues. The scale and rotation were being set relative to the original projectile because it was instantiated as a child of that projectile, but by setting the parent to null, the new projectile just becomes a child of the scene's root, like the original projectile. Finally, we destroy the OnHit script that every projectile has, because otherwise each duplicated projectile will also spawn a duplicate forever.

The last line adds a new PiercingElemental script, which prevents repeat duplications but also handles the homing.

The PiercingElemental script

We already had a GetNearestEnemy function to make homing easier, fortunately. With that, I calculate a direction vector between the projectile and the closest enemy every frame, and update the MoveTowards script based on that new vector. If we go back and polish more, it would be cool to make the homing feel more limited, like more of a magnetic pull rather than a direct target.

Some Concerns:

Some crystals that would activate this synergy are not projectile-based (Slash being the most obvious one). I'll have to talk more with the designers about what they think is best to handle this. We could just spawn another copy of the blade from Slash, but it looks a little weird when disconnected from the crystal.

I also set the duplicated projectiles to despawn after one collision, even if the original projectile could pierce through enemies. I'm not sure if this is what we should do, but it felt a little overpowered without this limitation. Worst case is we can just remove one line to change it back.

I thought that some crystals would benefit a lot more from this synergy compared to other crystals, but it actually seemed to balance itself out pretty well naturally.

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