Details

Overview

Terrene was one of the many projects I worked on for an assessment during my first year of study at AIE which focused on AI decision making and path finding.
The project consists of a binary decision tree, A* path finding and procedural world generation utilizing Perlin noise.


Game Features

A small generated using various layers of perlin noise; one for each aspect of the world. ( ground, water, trees )
Generated World

Sheep units can be placed in the world.
Sheep

Left clicking a unit will bring up their current stats and objective.
Unit UI

Wolf units can be introduced to hunt sheep. They have a larger range of sight and are very simple; always choosing to hunt even if starving and food is already available. It’s an unfortunate loose end not resolved due to time constraints.
Sheep & Wolves

A debug overlay can be enabled [H] to view every unit’s closest water source, food source, current path and sight range.
Debug Overlay


Retrospective

If a tree falls in a forest…

A bunch of time was spent setting up the generation of the world; which was super fun to implement but overkill and served no purpose other than to make the game look far better than what the passing marks required.
What sucks is that the world is generated using preprocessor directive values ( e.g #define SEED 1234 ) instead of loading a config file or generating a new seed each time the game starts. No-one outside the programming class believed it was procedurally generated until I showed them by recompiling the source code with a new seed.
The biggest injustice here is that I still haven’t updated it; it serves as a reminder to make features accessible and user friendly. Also I’m lazy.

Some may call this junk. Me? I call it my git repo

The project runs amd doesn’t have any issues besides AI occasionally turning into tornados, but the code definitely needed more work; especially the classes for the decision tree and handling asset management.
At the time I jumped it thinking “it’s more or less a doubly linked list with two children - it’ll be a breeze”. That was shortly after learning about state machines using switch statements…
It works but a little more research could’ve gone a long way.