Specialization

A bit of gameplay and AI

Five weeks at 50%

INSPIRATION

pikmin.gif

After spending the last two projects at The Game Assembly not doing much gameplay programming I finally had the opportunity to do something more fun, visual and interactive.

Another thing I had wanted to do for some time was to get more experience using a "professional" engine so for my project I used Unreal Engine.

I had recently started playing the game Pikmin for Nintendo Switch and had a lot of fun with it so I decided to do something inspired by that game on a smaller scale.

A player character and some followers doing one or two tasks.

So I played a bit more and decided on three follower features that I wanted to implement mostly inspired from the game, not directly copied.

 

FOLLOWERS

The three features I settled on were:​

  • Following the player

  • Letting the player bounce on them

  • Protecting the player

 

Luckily we had some enemies in our current game project A Familiar Tale which were perfect to use as followers. After asking nicely an animator did some tweaks to his animations so the little fellows could be used in Unreal Engine.

followClose.gif

FOLLOWERS FOLLOW

With using Unreal Engine you get a lot of advantages but there is also much to learn. During my five weeks at 50% I felt that it was easy to learn new things and I really enjoyed using an engine that was a little more developed than our own that we only had a couple of months to develop.

One of the features I used was the behavior tree that exists in Unreal. A very powerful feature that really helped me keep different behaviors separated but also transitioning well between each other. 

The first behavior I implemented was simply following the player around. 

The first attempts had the mushrooms running into the heels of the player creating a stuttering behavior. With Unreal I simply exposed the values of the speed and acceleration of both the player and the mushrooms to the editor and tweaked them until it felt right.

 

There was also a matter of finding the right amount of followers for my project in particular. Going from too few to far too many in the end I settled on ten little followers. 

GETTING JUMPED ON

goAwayNice.gif

Something I felt was missing from Pikmin was interaction between the player character and the followers. Of course you can throw your little followers but that is about it. I felt that with the shape of my followers one thing was obvious, I had to be able to jump on them.

Now a living follower will not just stand there and get jumped on.

So in the follow behavior I check the dot product between the mushrooms up-vector and a vector from mushroom to player, if it is above a certain value the mushrooms change behavior to fleeing from the player instead. 

But you can order the mushrooms to stand in a certain spot and then jump on them. 

When the collision happens the player checks if the mushrooms are below their feet with a dot-product. If they are then I set the players jump force a bit higher then normal and trigger a jump. When the player lands the jump force is reset. Of course both the normal jump force and the extra force were exposed for fast and easy tweaking. 

PROTECTION

To get the mushrooms to protect the player I started with drawing spots ahead of the player with debug spheres. This gave me a first chance to tweak distances and variables. 

When the positions felt okay I made the mushrooms go to these positions through the behavior tree. So every mushroom had a spot to go to when its behavior tree told it to go into protect mode and the player updated these spots every timed it moved.

REFLECTIONS

During my planning I sometimes felt that my scope was far too low but realized later that it was quite accurate. Time disappears quickly when you have a website to make, a resume to update and suddenly your computer at school crashes. 

I managed to make the features I set out to make, of course I could tweak them even more to get them even nicer but I am pleased with how they turned out.

Meanwhile I also learnt a bit about working in a professional engine which I have wanted to do for some time. Unreal Engine and I assume other engine like Unity really are great to use and I look forward to using something similar in the future. 

I had a lot of fun during this project.
Here are some more pictures and gifs from the development.
Thanks for reading!