Friday, August 14, 2015

The Difficulties of Rendering a Lovely Hedge Maze and...Spikes.

After getting the maze to properly function in the previous post, I figured something a little more visually comfortable would work well with the actual maze construction, rather than stone blocks. I had scoured online for foliage meshes for hedges, but the one available to suit my needs was unfortunately VERY expensive for the GPU to render properly. Actually, at this point, my laptop can barely render anything in Unreal Engine 4, which is why I hope to use a more powerful system when I actually start more serious development. As a result, I managed a hedge texture bumped outward by way of a normal map on the regular cube, but only by a slight bit. Still, it looks a bit more lovely than a bunch of bricks.

As for the spike, I mainly put together the framework for a repetitive spike in place that overlaps with all objects to make it look as if it was peeking out of the actual hedge itself. The UENUM structure actually worked out better than expected, allowing me to actually use the enum in blueprints as well. I used an enumeration for the behavior of the spike, allowing it to switch between its resting periods along with extension and retraction.

By using an interpolation method (VInterpTo) that starts out strong and eases out over a set time, I was able to get a natural looking movement of the spike with random ranges on things such as resting time to keep the spikes from being too uniform.

I also tried to figure out how to get it to move in a direction based on rotation, instead of cutting the spike movement to basic directions; the mesh initially started in an upright position, so getting the up vector of the rotation helped for setting a movement direction that would change as the mesh was rotated.



Next up? Getting it to kill the player and populating the maze with spawns of the actor.

No comments:

Post a Comment