RTS UI and Unexpected Path Obstructions: Deterrence - Video Devlog 7

The seventh weekly devlog of Deterrence. In this log I finish the units pathfinding with adjusting for player built buildings and implement traditional RTS UI.

A tower defense mixed with real-time strategy where you repel attacking sentient AI robots until they give up.


Adjusting Paths for Unexpected Obstructions

To finish the pathfinding for units, units needed to find their way around buildings. Not just at the moment the path is created, but also during the path's execution to account for buildings created by the player after the path was made. To make buildings work with the pathfinding system, the buildings had to be grid snapped to the pathfinding nodes, and buildings width and length will be measured in whole nodes. For instance, this small bunker is one by one.

The pathfinding system was expanded to include a second buildable layer for units to find paths around. As buildings are built, the pathfinding grid will be updated and vice versa.

Units were then programmed to look for buildings between themselves and their next path node. If their path was in fact being obstructed by a building, the best way around it would be to find a new path which was expensive on the CPU. To limit pathfinding calls, buildings were listed for having already been accounted for and if the unit was in a group, the unit would notify the leader who will find a new path for the whole group.

In the case that an area is completely walled off and the pathfinding fails, a second pathfind will be made ignoring buildings and that path will be truncated where buildings are found. This way, units will still have a path towards the walled off area; solving the issue of islands with an extra pathfind instead of other more CPU intensive methods.

RTS Minimap

I found a really simple tutorial on how to make an RTS minimap in Unity by Alessandro Valcepina. At first glance, I thought that using a second camera for the minimap was a lazy and CPU intensive way to do it. But it turns out with the correct settings, this was a simple and light weight way to build a minimap.

I expanded on the minimap to register clicks and convert the minimap coordinates into game world coordinates by simply using proportions. With this, I was able to make the minimap move the camera anywhere on the map with a simple click.

Latest Jobs


Playa Vista, Los Angeles, CA, USA
Senior Physics Gameplay Engineer - Treyarch

High Moon Studios

Carlsbad, CA, USA
VFX Artist - High Moon Studios

Anne Arundel Community College

Arnold, MD, USA
Instructor/Assistant Professor, Game Art

Treyarch Vancouver

Vancouver, BC, Canada
Producer - Treyarch Vancouver
More Jobs   


Explore the
Subscribe to
Follow us

Game Developer Job Board

Game Developer Newsletter


Explore the

Game Developer Job Board

Browse open positions across the game industry or recruit new talent for your studio

Subscribe to

Game Developer Newsletter

Get daily Game Developer top stories every morning straight into your inbox

Follow us


Follow us @gamedevdotcom to stay up-to-date with the latest news & insider information about events & more