Wave Game

Rob Steiner 2017-10-15
Wave Game

Slowly, but certainly here comes another Unreal Engine game! First game of Pinball was great with getting my feet wet, so how about a Wave Game?! More opportunities to take my learnings a bit further with this project. Implementing a basic AI, complex game mechanics, animations, and some cool material manipulation. I won’t talk about some of the other stuff I covered with the Pinball game. Plan to keep this fresh with new learnings for this project only. Without further ado, the Wave Game!



Level Design

Interestingly, the design of the level had a good amount of effort put into it… Weird because the player barely sees it while playing. Only till the player either wins or dies does the player get a view of the level. When the camera ascends from over the player’s head to a position in the sky pointing downwards at the level. Pretty much a necessary effect to make sure the player appreciates the effort!

Something I learned while designing the level was how different a rock can look just by being slightly rotated… Not kidding, I only used one rock model for the whole level! I either shrunk it, made it bigger, or rotated it on the XYZ. Pretty crazy. Learning how to tile a floor together was a pain. Pixels matter. Positioning is everything. Had to tell myself not to stress to much about certain things not aligning perfectly… After all that, I found myself thinking this was some high-tech Minecraft experience.

I guess this would also be a solid place to mention the awesome game logic for handling enemy waves. It actually isn’t incredibly difficult, but worth mentioning. Making all enemy a child of the same parent class, populating an array with the parent class, and finally cycling through the array after wave completion spawning the classes. This was an excellent approach and allowed for quick additional waves.

Material

I was pretty pumped about some of the ways I used materials for this project. From learning about landscape painting with varieties of grass, ferns, and other plants, to utilizing parent materials that take parameters for quick child materials. But! The coolest things, distance material blending!

<video class=”img-responsive” style=”padding-bottom: 10px;”controls>

Your browser does not support this video.

Check that out, that beautiful blending between two types of materials as I zoom the camera in and out. I felt so cool once I implemented the functionality. This allows for the camera to zoom out and have the material not look like it is tiling. Same applies to when the camera is closer to the ground too. Luckily, implementation wasn’t too bad… Regardless of how big the Blueprint looks.

Another sweet implementation for this project was tessellation of the gravel and grass materials. As the camera approaches a material, the tessellation is applied. Meaning only parts of the material are being tessellated at a time. Nice memory saver. After some math to calculate the height on the rocks and grass, voila!

Animation

This is the first time jumping into animation with Unreal Engine. It was pretty intuitive once I figured out where everything was and what meant what. Dabbling with locomotion states, animation blends, and blend spaces!

With the nature of the game, the controls are pretty straight forward, thus the locomotion is also easy stuff! Other than the movement state, jumping produced three more states. Needing one for liftoff, mid-air, and landing.

With the locomotion defined, I utilized two layers for blending animations together. A Base pose layer with an Upper Body pose. This allowed for the attacking animation to blend with the running animation, letting our character’s legs continue to run while the upper body performed the sword strike. An interesting concept I had no idea existed till this project!

For a little variety in the running animation, I decided to add a little lean in the character depending on velocity. Capturing the velocity in the X Y direction because we only care about running, not jumping and feeding it into a blend space.

With the velocity captured, the blend space would use it to determine which animation to play. If between two points on the graph it would blend them. Crazy! The higher velocity forward even had two points, giving the character an even slighter lean if running forward at full speed.

A.I.

Luckily, I have some good experience with Blue Prints, but this was a first at applying some logic to enemies for some basic combat A.I. Some would say the logic is basic, and a little buggy, but hold on… Basic? Look at the freaking Blue Print!

Or this one?!?!

Seriously though, that’s a pretty basic buggy A.I. and the Blue Print was massive. Still makes me nervous looking at it. In those Blue Prints the logic for chasing and attacking players, collecting health if damaged, and simple patrolling. Depending on types of enemy, the A.I. would perform different attacks at different ranges… Slick. Also, depending on the enemy type they had cool different hair colors! That was the easy Blue Print…

Well that covers about everything I wanted to talk about for this project! I’m currently story boarding an idea out and designing some cool game mechanics for hopefully a big exclusive video game! Stay tuned till next time! Might be a cool developer blog on progress…

Cya,
Rob