Robot Factory - Devlog 002
Hi there,
In this second update to the prototype, I’ve added two major new features: Fog of War and World Navigation. Both are deeply connected and should help shape the core gameplay loop.
After introducing buildings in the previous update, I began exploring different building types and their potential functions. The first building was the Connector, which links other structures to the HQ and powers them. I also introduced Towers, which could be either on or off based on connectivity. At first, they didn’t have much of a purpose aside from testing the power connectivity. To indicate whether a Tower is powered or not, they were assigned a floating marker at their top. The look reminded me of Sauron’s floating eye, which sparked an idea: what if towers acted as beacons that expand the visible world?
That idea led directly to my implementation of the Fog of War. Unlike traditional RTS fog systems that dynamically update based on unit movement, my version represents the visible range of influence of the robotic hivemind the player controls. Units can't move beyond this range, and visibility can only be expanded by activating towers near the fog’s edge. These towers "scan" and reveal new terrain, slowly pushing back the unknown.
Creating this system was its own challenge. I wanted to build it from scratch rather than rely on a third-party package. My first attempt involved using individual GameObjects as grid squares, which I assumed wasn't very performative, but would serve as a learning experience. Even with optimizations like disabling colliders and batching quads, the performance hit was severe with tens of thousands of tiles (2D grids scale quickly!). Eventually, I pivoted to a much more reasonable approach: a single scalable texture used as a visibility map, where each physical pixel represents a tile. This solution made a lot more sense and required learning some new texture manipulation techniques. Syncing it with the building grid's snapping system took a bit of trial-and-error with the math, but nothing too complicated. The result is a system that tracks visibility through a 2D array and contains methods to either turn fog pixels on and off based on world position. Implementing visibility checks for towers, building placement, and resource spawning was rather straightforward after that.
Once I had this mechanic of gradually revealing the world, I realized it no longer made sense to keep the player locked to the HQ. To support exploration while preserving the general theme of robotic entities, I introduced a flying drone that serves as the new camera. Players can now move it freely with a right-click, and still orbit around it as before. The drone can't move through fog-covered areas, which maintains the importance of towers for exploration and expansion.
That’s it for this update. As always, I’d love to hear your thoughts and feedback.
— Zach
Leave a comment
Log in with itch.io to leave a comment.