Sandcastle Defense

Hello everyone!

I am and I am learning how to work with blueprints inside UE4. For this I follow classes each week, and I am going to be building a small game from the ground up.

Here is my idea for a game:
You play as a little boy who was peacefully playing in the sandbox, building a sandcastle, until the local bullies decide to show up and ruin your day.
They are trying to destroy your sandcastle. Your hard labor! Surely you won’t just allow this?
You mount a defence and prepare for the oncoming waves of little snotheads coming to ruin your life’s work.
Lucky for you, there are some apple trees in the area. These apples are your main weapon of choice. Hold the bullies back by throwing apples in their faces, until your mom comes back!

So now you might be wondering: , how will this all work?
Well, I’ll tell you. This little project will be like a top-down twin stick shooter, except without all the shooting and gore that usually comes with that type of game.
I felt like making something innocent for a change, so apples to the face it is!
Now, here are the plans I have for this game:

  • Objective: Defend your sandcastle until the timer runs out.
  • You have a limited amount of apples, so you will need to pick up more from nearby apple trees.
  • Standard apples are red. I’m thinking of adding green and/or golden apples that give the player temporary power-ups (increased speed, infinite ammo, health,…)
  • Bullies are standard kamikaze units that run towards your sandcastle.
  • Also thinking of adding different colored enemies that also have ranged attacks.
  • Minimal UI: Just the amount of apples you have, the amount of bullies you scared off, the counting down timer and the health of both you and your sandcastle.

The setting would kind of look like this, but a lot more colorful:

For the art style, I want to keep it simple.
Simple low poly models that don’t use any fancy PBR technology or anything, but are easily identifiable by shape and color.
I made a first test for a character in 3Ds max, inspired by the characters in the animations of YouTube user: pixlpit (bitofalice - YouTube)
Here is a render of my test character:

Clearly I still have a lot to do and a lot of assets to make.
So here’s a list which I’ll try to update as frequently as possible for you guys to follow along:

To do:

  • Player character script. - WIP
  • Enemy scripts.
  • Apple throwing.
  • Pickups.
  • Countdown timer -> leads to you win.
  • Scared bullies counter.
  • UI
    -…

Assets:

  • Player (rigged + animated) - DONE
  • Bullies (rigged + animated - multiple?)
  • Apples (multiple?)
  • Trees - DONE
  • Sandbox + castle - DONE
  • Ground plane / Background - WIP
    (- Sound effects)
    -…

The whole thing is pretty much just an idea right now, all I have is the bare bones.
I will probably add more things or remove some. I’m still considering adding some kind of traps mechanic, but I’m not sure about it.
By all means, let me know what you think and I’ll talk to you real soon.

(Thanks for reading, you beautiful person!)

Update Time!

So, I have been a little busy on the game. I’ve made assets for the player (pink hair) and one enemy (black hair). This enemy will be a “kamikaze” type enemy. By that I mean that this type of enemy will just storm towards your sandcastle, trying to destroy it. I also want to make another enemy type that attacks the player from a distance.
I’ve already made a rig for the player model, which will be shared with the enemy models, however I haven’t gotten around to making any animations yet.
The other assets are the sandcastle that you will have to defend and a basic tree. Right now I’m planning to make the trees the spawn point of additional ammo, since you are throwing apples after all. For the enemy spawn points I was thinking of making something that resembles bushes. I’ll also make a fence which will mark the border of the playing area.

My priority right now is to get a few blueprints working. First of all the player’s control over the character. I got the player character moving, however not quite the way I want to. I’ll look up some tutorials and hopefully manage to make it the way I want it to be. This is probably also a good time to mention that I’ve decided to give the game a 3rd person camera angle rather than a top down one. The reason is that I feel it would just suit the game better and this way there could be some aiming implemented in the future.
The kamikaze enemy script is also something I want to get done asap, aswel as the apple throwing.
I’m not very concerned about making the animations and effects for everything right now, as I just want to get the bare bones working before I start making it more pretty.

Here’s a little screenshot of the test scene I’m working in, containing all the assets I’ve made so far and a little test character controller that I use to test the player’s movement.

That’s it for now, have a good one!

Update

The player movement and kamikaze enemy are both working, all they need when it comes to movement is animations.
Next on my to do list is to start working on the player shooting projectiles and of course the enemies taking damage from them. I also want to try and get the countdown timer working quite soon and to make a basic HUD and menu screen.
Once I get the player’s ‘bullets’ working I’ll start looking into making the enemies attack the sandcastle and it taking damage, since protecting the sandcastle is pretty much your main objective.
After that’s done I’ll get to work on the enemy spawners. I still need to figure out where I’ll hide those so that the enemies don’t just pop up out of nowhere. Maybe let them drop down from the trees? These are things to think about later, right now the shooting mechanic is most important.

Update

I ran into some trouble with the way the player movement worked. Luckily I managed to find a way to fix it. Now the player turns with the camera (which is controlled with the mouse), and the player’s forward direction is determined by which way the camera is pointing. I also added the ability for the kamikaze enemies to do damage to the player once they get close to you, and if you move away they will follow you again. I did this using an enumeration.

The most important update is probably that I got the player’s ‘bullets’ working. By clicking the left mouse button you will throw an apple in front of you. When the apple hits an enemy, that enemy ‘dies’. I’ve currently made it so that you can throw an apple once every 0.5 seconds, but this is subject to change. I’m also unsure whether or not to put in the normal apples as ammo pickups, or if I should just make the player have an unlimited supply of them, and only make the special apples, which are to be added in the future, pickups around the level.

I’ve managed to implement a countdown timer. This timer represents how long you need to hold out and defend your castle in order to win. I’ve set the standard to 60 seconds, since this game is supposed to be kind of a quick 5 minutes of fun. After the 60 seconds the level will end and you’ll go to the next level which will be a bit harder. The way I want to make the levels harder is by adding more enemies, however I might look for something else aswel since just adding more enemies feels kind of cheap.

The last thing I made are enemy spawners. Currently they are not fully functional, since for some reason when the enemies spawn they do not seem to have collision and just fall straight through the floor. It is however possible for me to set down multiple spawn points and give each of them a different timer after which an enemy will spawn. For example one spawner will spawn an enemy every 5 seconds, while another might do so every 8 seconds. Currently I put the tree model on the spawner, just to be able to visualise it a bit better, but the priority right now is to get the spawns to actually stay on the level.

After that’s done I’ll begin work on the HUD, maybe add a scoring system, and the main menu.

Update

I have managed to fix the enemy spawners! Now the enemies pop in and actually stay on the ground and start chasing the player, as was intended.
I’ve also created a quite basic, but effective main menu. The menu currently has the options of ‘Start Game’ and ‘Quit Game’, which work fine. The only issue I have with the menu right now is that the countdown timer is also visible there. This is something I will have to look into. Once I have created more levels for the game, I plan to also add a ‘Level Select’ button which will allow you to do exactly what it says.

Right now I’m working on implementing a sprinting mechanic because I felt like the movement was a bit slow. On the harder levels I hope to make the game a quite a bit chaotic and so the player will have to rush from one side of the level to the other and that’s where having an option to sprint seems like a good idea.
Once I’ve got the sprinting working I will either look into removing the timer from the main menu, or make the menu look a bit better, since right now all it is are 2 simple default buttons. This is only an aesthetic issue however, so I think I will leave that for later.
That is why I will start figuring out how to create the second enemy type which will chase you until they are a certain distance away and will then start attacking you with ranged attacks. I haven’t quite decided yet whether I should make them attack the player or the Sandcastle, but I’m hoping to figure out how to make it so that they attack both. I’m talking about a blueprint that will let them look at the distance between them and the player, and the distance between them and the sandcastle. Whichever is closer to them is the one they will attack.
Alternatively, I might try to randomise their behaviour. By this I mean that when an enemy spawns, the game will randomly tell them to either go attack the player or the objective. I might try both options and see which works best.

I will provide another screenshot of the game once I have this new enemy type working.

Update

So what news do I have? Well for one, the main menu is just about done. (see screenshot)


Currently the level select is empty, since I only have the testing level right now, but I plan to make 3 different levels. Kind of like giving the player a choice between easy, medium and hard mode.
I’ve also made an enemy who rushes to attack the sandcastle. I had to drop the idea of a ranged enemy as I was advised against it. Apparently building it up from scratch is quite a bit of work. Right now the enemy just attacks the castle once, but I want to get him to attack it continuously while he is within a certain radius of the sandcastle. Getting that to work is my priority right now.
Another thing I added is a golden apple power up! Picking up the golden apple will double your fire rate for 5 seconds. I’m still unsure whether to place these throughout the level and let the player decide when best to use them, or to let them drop randomly from enemies.

Also not unimportant is that the player can now die! You’re given 100 health and each time an enemy’s attack on you is successful, you lose 5 points of health. A UI which shows how much health you have is currently a WIP. I’m using the debug strings for now to check if everything is working (it is). When you reach 0, the game is over. The same will apply to the sandcastle, once I can make the castle attackers work. After that it is time to make the game feel more like a game. That means creating some animations.

That’s it for now. The exam where I will have to present my project is on the 21st of June, so the game should be finished by then.
If not, then R.I.P me.

Update

I managed to fix the castle attacking enemy and also made it so that the castle can actually be destroyed, and when that happens you lose the game.
I updated the UI so that in the bottom corners you can see the player’s health and that of the sandcastle.
Some fences and some shrubbery have also been added around the playing area so that you don’t have the feeling you could fall into the abyss at any moment.
The first sounds have been implemented, so now when you hit an enemy with an apple you’ll hear a splat sound. I’m still looking for some fitting background and menu music.

All that is left now is polishing the game up. This mainly means putting in all the animations and making sure that everything works 100%. Maybe tweak some values that have to do with attack range, movement speed and jump height. I’m hoping to get some feedback on that when I let some friends test the game for me. I will also be putting some more time into the design of the menus, mainly making custom buttons and fonts. Either before or after that, I’ll also construct 2 more levels, as I’ve said in the previous update the goal is to have an easy one, a medium one and a hard one. The way I’ll achieve these different difficulties will be through the level design, the amount of enemy spawners and how fast the enemies will spawn after each other. I’ve already played around with this a bit and trust me, it can get quite hectic.

Thank you all for reading this progress thread, the next update will probably be right before the exam when the game is finished, so I hope I’ll be able to show you something nice by then.

Final Update

Hey everyone! So the game is done, just in time for the exam tomorrow. Boy, it’s been a long, hard road, but we finally did it.
So first things first, you want to know what changed since the last update.
Well to start off, I added animations to the game. So now all of the characters move and attack and all that good stuff. Secondly, I redid most of the menus. I changed the buttons, changed the fonts and made 2 new menu screens for when you win and when you lose the game. Next I added more sound, mainly background music. I tried adding a footsteps sound but it ended up being hard to sync with the character’s footsteps, which I managed to do after a while but then I just found the sound to be annoying after a while so I decided to leave it out. In order to differentiate the enemies that attack you from the ones that go after the castle I went ahead and recoloured the castle rushers. I also added some more player feedback for when you hit an enemy. I already had a splat sound, but now I’ve also added some red particles that explode when you hit a bully with an apple.
Other than that I made the 3 separate levels as I said I would and they are increasing in difficulty quite well. I also gave each level different music so that you can feel the pressure a bit more.

So that’s it then. Everything works fine within the Unreal editor, however building the project breaks a few things for some reason so I’ll be trying to resolve those as best I can before the morning.
Other than that, here are some screenshots of the menus, and one of how the game typically plays (you surrounded by enemies).