Behind the Scenes of Beetle Uprising: The Navmesh

Beetle Uprising

Collect, raise and breed an army of beetles to rise up and lay claim to the abandoned lot! The game features a complex genetics simulation and real-time tactics missions with a full campaign.

Continuing our short look at some of the behind-the-scenes goings on with Beetle Uprising, this time we're talking about the navmesh. Below is a screenshot of the Unity navmesh editor. It shows one of our earlier levels with the navmesh highlighted. We use terrain steepness to limit walkability, and have a few invisible "fence" objects (you can see some straight blocks that cut the nav mesh) we use to keep players and enemies from wandering outside the play area. [url={STEAM_CLAN_IMAGE}/30237079/ac2b12d041e136047b2a5a516d1e7bdf12cc032a.jpg][img]{STEAM_CLAN_IMAGE}/30237079/ac2b12d041e136047b2a5a516d1e7bdf12cc032a.jpg[/img][/url] We needed to keep players from clicking on navmesh that is auto-generated but is outside the play area, so we wrote code that determines if a click is pathable from a few "starting locations" that are inside the play area. We needed more than one of those objects to deal with situations where doors open and change the play area. If you run your mouse over a map, you can see the cursor change to indicate that you are inside or outside the legal area. We would sometimes have bugs where enemy spawners would not push beetles into the play area, because we like them coming out of holes and other difficult bits of terrain. They might fall through the floor, or pile up inside a cave. So tweaking the spawner location was always fun. Something else about spawners: they have a starting location, but also an implicit move-to is given to each enemy with an optional remote location. This makes it seem like the bugs rush out when triggered, then gather in a staging area, waiting until their Perception area overlaps with one of your beetles. Then the fight is on!