Forest Runner

Archived

  • What is the game
  • The idea
  • The pathfinding algorithm
  • Download
  • Programms used
  • What is it?

    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:

  • Several Biomes
  • Crocodiles in rivers which can kill you
  • A highscore system (local)
  • The main character (a slime)
  • A cell based labyrinth algorithm which fixes bad generated landscapes
  • Basic Idea:

    There are 4 types of floors:

  • Floor (The walkable area)
  • Wall (An area which blocks the characters movement)
  • Water (An area where enemies could spawn and which would block character movement)
  • Bridges (A navigatable water tile)
  • Crocodiles which could spawn on water tiles can kill the player as soon as the player gets touched
    by the crocodile. The player has a confined space of about 13 tiles in width and an infinite space
    upwards.
    Movement: The player can only move 1 tile right, left or up. Not back! (simplifies the pathfinding algorithm by 1 direction)

    The pathfinding algorithm

    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.


    V1

    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!


    V2

    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.


    V3

    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.


    V4

    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:

    V5

    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

    Download the game here

    Programms used:

    For the creation of this game I used:

  • Blender 2.83
  • Audacity 2.3.3
  • GIMP 2.10.18
  • HitFilm4Express
  • Unreal Engine 4.26.2

  • Contact: Impressum

    Back to main page

    Copyright: Konstantin Passig 2022