Archived
Forest Runner is a game which I made 2021 for a school project. It is a game similar to Crossy Roads developed with the Unreal Engine 4 and shipped to andriod.
It features:
There are 4 types of floors:
The pathfinding algorithm checks each time a new row gets generated if there exists a path to the last row. If there is no path to take it just generates the last row again and checks again. Ther would have been plenty room for improvement in runtime cost but that exceeded the School project.
The first attempt was a 1d array which stored a struct of int(x;y;value) where x;y are the coordinates
of the tile on the floor and value was the type of floor.
Result:
It was slow as heck and crashed the engine due to exceeding the memory i had installed.
Not even close to runtime compatible!
The second attemt was to split up the array in parts which get used often and parts that weren't used often.
Result:
Failed due to a lack of understanding the problem as that wasn't the original problem.
The third attemt was the first time the code ran during runtime without crashing the engine and the game.
The catch was I had somehow created a loop which accessed non initialized variables if I did not in include a
delay at the right location in the code.
The Code was sililar to the one from V2 but better structured.
Result:
It ran but too slow for my liking.
I got rid of all the struct stuff. I made an signed int32 1D-array where I accessed the elements by
calculating the index with the wonderful formula "index = x+Size.x*y".
Index = position in the array; X = Horizontal location; Size.x = width of one row; y = the height of the element.
Solving this with a 1D array was the only way as unreal engine blueprints dont support 2D arrays :(
Result:
The fith and last version of the pathfinding algorithm took about 0.7 ms to execute. The time of messurement is not accurate as it was
messured on my PC and not on the phone as I don't know how to do it.
PC Specs
Download the game here
For the creation of this game I used: