For my planning, I thought it would be a good idea to make some flow diagrams of how I roughly want my code to work out.
Published on September 14, 2019 by Amy Elliott
Design & Research Dev Blog College
5 min READ
For my planning, I thought it would be a good idea to make some flow diagrams of how I roughly want my code to work out.
Since I’m using Unreal Engines Blueprints, it would be hard to do Pseudo Code in C++ so, I feel like the approach I’ve taken here is good for planning out what I want to have mechanic-wise.
The first mechanic is Run forward without input, a simple plan on how I would get my movement mechanics working for my endless runner.
From this diagram, you can see that I’m using the Get Forward Vector and Add Movement Input, and I’m then hooking them up to an Event Tick Node, this would activate the moving forward for every tick, which is exactly what I need!
My next mechanic is the Pick up treasure mechanic.
This is very simple, all it does is check what layer the actor is on when the player collides with it, if it’s on the treasure layer, the program will identify it as a treasure so the object will disappear and the Blueprint will interact with the UI and increment the UI treasure value counter.
My next mechanic is Player Increase Speed what this does is checks every frame if the player has collided with the levels checkpoint, and if they have, increment the player speed value by a certain amount every time, making the game more challenging and require faster reflexes to the objects around you, this is similar to the mechanic in the game Thumper, where each level the player gets faster until you only have less then a second to react to the obstacles. Thumper (2016)
My next mechanic is a health system, these are crucial in my game, since there would be no threat if there was an endless runner with no death screen! - The death mechanics would be what keeps the player playing, since it would be very boring with no lose condition.
What I have planned for the health system is each frame, the game is going to check if the player is collided with anything, if they are, similar to the treasure collecting, the game would check if the actor which the player collided with is an obstacle or a collectible, if it’s an obstacle, it would decrease the players health, interacting with the UI to display this, and then, each time the player gets hit it will keep checking if the health is below 1, and if it is, the lose screen will come up.
My next mechanic is Objectives. My plan for this is to check the players statistics every frame.
Some objectives may require the players gold collection, score, checkpoint, etc.
So for whatever objective is active, it will check if the value of the score is what it needs to complete the objective, and if it is equal to the goal, the UI element will be enabled showing that you’ve completed the objective, and then the next objective will be shown for the player to complete. I think this is a really good idea because it makes the player want to play more because they want to complete the goals.
My next mechanic is Level Progression, this will check if the player has got to a check point, and how it does this is invisible blocks will be placed throughout the level, and if they player goes over them, they activate some UI which shows them what checkpoint they’re at, this would be an array of integers which tell the player how far they’ve got in the level, another way I can do this is make a value increase every time the player moves forward, and if they get to a certain value, the UI for the checkpoint would appear.
My next mechanic is keyboard movement this works by allowing the player to move between 3 points on the top of the train, this will work by having the co-ordinates of the 3 points and having the player move between them with a snap animation, I was also considering making the points just blocks which the player moves to, but in the end, I’m not sure if I want this to be the case as it is very restrictive on movement and I think it would be better if the player can move wherever they like left and right without any snapping to co-ordinates.
Here I have done a written plan on how I want to get the collectibles and interactive items to work in my game, this is pretty much a step-by-step plan of what I want to do to make them.
Since I want my game to randomly generate the levels, I instead began a plan for how I’m going to get that working.
I got this research through an Unreal Engine video, the man who made it done this at a talk in Japan, in Japanese, but he was kind enough to do it again in English to show us how he got it working.
I used this video, alongside Unreal Documentation to understand Syntax and how he got the endless tiles spawning as the player moves forward.
This is just the tiles generating, and not the obstacles and pickups.
After the player has passed each tile, there would be a collider which tells the program to put another tile down, and then delete the tile behind them, this ensures that, if the player keeps playing, there isn’t hundreds and hundreds of tiles behind them which can take up space and make the game run slower.
This is my plan for spawning obstacles in the runner, within 3 random points which are set on the floor tiles, these randomly generate an obstacle for each floor tile.