Eco-Logical

Eco-Logical is a single-player automation game where players program and upgrade teams of drones to craft, farm and clean with the goal of restoring their polluted world. This title is being made by a team of 4 artists and 3 engineers of which I contribute as the programming lead.

Programming Drones

At the core of our game is the player's ability to program the drones that they find in the world, enabling them to perform different tasks. This is done using a visual scripting language with which the player can pass in data such as a 'Target Object' that can be acted upon by an action node like 'Move To' to have the drone move to that object. Only by automating their drones to cooperate with each other will players be able to solve the problems of this polluted world.

I worked on making many of the nodes that are available to players, ranging from instructing drones to gather resources to more advanced math functions, and of course, their ability to bark! I also added a flexible error reporting system to give better feedback when debugging drones, especially for players not as familiar with programming.

By getting getting drones to work together players can incrementally start rehabilitating their environment. Here, a drone is restoring previously polluted trees using seeds crafted by another drone. Crafting those seeds required resources that were harvested by other drones.

Drone Upgrades

Although the drones that players work with are programmed to be autonomous, they are not very efficient when first found. The player can use resource they earn through farming to craft more effective tools for their drones. Schematics for these tools need to be discovered through exploration, often with the more powerful upgrades hidden inside the more heavily polluted parts of the world.

I wrote a small system that populated the reward chests in the level with these recipes, and even programmed the animations shown in the video using control rig. Components have effects ranging from increased harvesting speed to improved storage capacity and can only be equipped to certain slots such as tools being limited to arms. Each component also has a certain memory cost which forces the player to make tradeoffs between their drone's strengths. For instance, a drone may gather extremely fast but have very limited storage capacity.

Customizing drone components is as simple as interacting with them and swapping out their parts. Players even get a small preview window to see how they'll look. Throughout development we added more drone types such as hippo and bull variants that have different intrinsic abilities and can sometimes use unique components.

Inventory (+ Editor Tools)

Given that so much of the game revolves around gathering and processing resources, we needed an inventory system to store and manage the game's items. Each item is defined by a row within an items data table with additional information stored in an associated data asset. I set up the inventory to use a grid of item stacks, each item having their own maximum stack count. Items dropped into the world are also stored as stacks and can combine smaller stacks into larger ones if they're close enough.

Besides storing items, inventories can also transfer items to other inventories. The player can also move, split, drop and compress their loose items into stacks for better inventory management. Some items such as batteries have their own intrinsic state which forces them to only be stored with a stack size of one.

Also featured in the above video is a custom console plugin I made as an alternative to the default Unreal console. In addition to this I worked on many other tools during development to help expedite tasks for both programmers and designers. Just a few of these tools included utility widgets for swapping between actors and their equivalent instanced meshes, and a tool that identified unoptimized meshes that might need an artist's attention.

The World

Players have access to five separate regions, each with their own theme. In order to help the player navigate the world I worked with one of our artists to create a map menu that reflects the current position and state of various objects in the level.

The regions are all separated by bridges that must be repaired before they can be crossed. Repairing them requires resources that can only be obtained through farming and crafting, incentivising players to set up some basic automation before venturing out into the greater world.

Each region has a generator which must be powered to complete the game. The problem for players to solve here is that generators consume fuel items rapidly and require items that can only be produced through farming and crafting. This means that players will have to set up automated chains of drones to gather, transport and craft for each generator simultaneously in order to beat the game.

Smog Simulation

Your greatest adversary in this world is the omnipresent pollution that pervades most areas of the map. Players can only hold their breath for a short window once inside before passing out and being rescued by one of their drones. Instead, players have to rely on their drones to venture inside and gather resources. The smog isn't permanent, though - it's always changing depending on the environment. Piles of junk make areas of the fog stronger while healthy trees that drones can plant will reduce the pollution.

My implementation of the smog went through a few iterations before arriving at what is likely its final design. The current version has an underlying grid of pollution values that it diffuses out over time. When a cell on this grid passes a certain threshold it's marked as polluted or clear. These states are then read to build the procedural mesh that the player sees using Unreal's geometry scripting. A smoothing pass using bezier curves is also applied to the geometry to round out the grid corners.

As the map grew in size the simulation started causing performance problems. A few of the solutions for this were to only update the mesh when required and stagger the updates over multiple frames. By far, the most effective optimization was to move the simulation to its own thread which almost completely nullified most of the smog's impact on performance.

Dynamic Foliage Swapping

In order gather resources, players and drones find and interact with objects like rocks, bushes and junk piles. As our map grew in size and we added more and more resource actors to the world, these additions began to adversely affect the game's performance. To resolve this, I put together a system that allows our level designers to place such objects as instanced foliage in the level which can then be invisibly swapped for their blueprint actors once interacted with (along with some tools to convert already placed actors to abide by the new system). These actors are then converted back into their foliage instances after a period of inactivity.

After our artists did their first set dressing pass on the larger map we encountered new issues with removing grass at runtime. All grass was part of a single foliage actor, resulting in up to 5 second freezes when grass was removed via player tools or farming plots. To address this I created a system that divided up the grass into chunks on begin play. This resulted in fewer instances being affected when altering the grass, removing the freeze entirely.

Save System

Although it's technically possible to complete the game in one sitting, most players are unlikely to do so. This meant we needed some way for players to save and restore their current progress. For some linear games this can be as simple as just starting the player in the last level they visited but for Eco-Logical we needed to be able to save the state of many different types of actors in the level at any given time.

The way I approached this problem was to create a subsystem that would handle the process of saving and loading. Each actor that needs to be restored is given a save component. This component has a delegate that broadcasts prior to saving to let the actor prepare serializable data that can be saved, and a delegate fired post load to use the previously saved data to figure out how to restore the actor's previous transform, inventory, AI state, and so on.

Custom components that require recovery can implement a savable interface that has functions matching the relevant events. Such components can be added to any actor with a save component and the system will handle it automatically.


Eco-Logical is a project that is under active development. If you're interested in following the game's progress or of being notified about the game's release, feel free to message me via the contact form at the bottom of my home page.