Look At Those Curves!

Dev log for Elementary from 10/16/18 to 10/30/18

What have I been working on so far?

My primary focus so far has been the attacking functionality, more specifically the way the orbiting particles react. (I tried to get a .gif of the attack animation but it didn’t work. It pretty much matches my sketch from last week though.) So the way it functions is with a combination of a spline around the player and a dynamically created Bezier curve for the boomerang attack. The spline is kind of unnecessary as I could just lerp the particle’s position on a sine wave but a spline allows me easier and more precise control of setting the particle’s position be percentage around the player. I created a simple function for this that looks as such:

At its core, this function is just a slight modification to the built-in GetPositionOnSplineAtDistance node. To run the idle animation, I simply add to this distance on Tick.

So the attack animation isn’t 100% done as of writing. Right now, the particle teleports to the right side of the character, does the boomerang animation, and snaps back to the far side of the character. The function that creates the Bezier curve looks like this:

This first part uses the given points to create the handles for them.

This second part uses 5 local Vector3 variables and lerps them in groups to get the destination point for the particle.

At a high level, what this does is takes in the start and end points (usually the point closest to the camera and the point furthest respectively) and dynamically creates the two handles for the curve based on a desired reach. This function is then run on a timeline and once it’s finished the particle is returned to moving along the spline.

Technically this is totally functional and I would just need to instantiate a hitbox at a certain point in the boomerang animation; however, the current issues with it are that it only aims to the right and the snapping at the start of the animation needs smoothed out. As I mentioned in the previous post, you will be able to aim in full 360 degrees of freedom like in Metroid: Samus Returns.

That is unfortunately the only major progress I’ve made thus far. I expected the distractions to cool down after last week but they actually got worse. The next week or two should be mostly clear so I hope to make some more progress then.

What obstacles have I encountered?

The biggest obstacle here was figuring out how exactly to create the attacking from a backend perspective. I originally planned on using just splines to accomplish this but I ran into an issue when trying to move one of the spline anchors during runtime. Moving it out for the attack animation worked fine, but whenever I moved the point back the particle would be snapped further along the spline as the total distance of the spline path shrinks. I could have created a work around for this but I don’t think I would ever have been able to get it seamless. On the recommendation of a colleague, I did some research into Bezier curves. This ended up being exactly what I needed as it gives me more options in how the curve functions without actually modifying the spline.

What's next?

First thing is to finish up the main attack fixing the issues I mentioned above. Once that’s done, I will move onto the charge attack which is already about 1/3 of the way done. After that I will probably start prototyping the elements and their effects. I am unfortunately anticipating a pretty big delay next month but I will talk about that more next time.

Until next time, thanks for reading!