Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Day 2: Sensors!

Got a couple of good hours of work in today, although there’s not a ton of visual stuff to show off for my efforts quite yet! As planned, I started working on the cop’s new AI, and the first step in that process was to determine whether or not I wanted to work with Micosmo’s Sensor Toolkit, which I decided to move forward with. It’s a really straight forward system to work with, and it’s got some great FOV visualizers, which I’m a sucker for.

The toolkit also has some navigation functionality, although I wasn’t quite as impressed with that. I’m sure it’s probably user error on my side, but given how quick it is to work with Unity’s native navigation tools, I really don’t see much reason to use a different system. 

At the end of the day, all I ended up doing really just amounted to this:


Which of course looks incredibly basic, but that represents properly setting up sensors, colliders, figuring out physics layers, and so on. But now all the futzing around with a new system is over, so I can just focus on writing a state machine for our foe in blue. Here’s a flow chart I worked out for their behaviors:


I was also going through some old notes and was reminded of the fact that in addition to police, there’s also on site security present in the corporate office (which is why the flowchart is listed as both guard and police). At the start of the game you’ll only encounter security guards, who will be randomly distributed throughout the building. They’re much slower than police and have a smaller FOV, meaning it’s much easier to get around them during your destructive rampage. However, after a certain property damage value is hit, the cops are called in, and they’re serious business. They’ll be much faster (only running, versus security which also has a walk) and have a huge FOV (as seen above), so they’ll be harder to avoid. I’ll probably just extend the police class for security, but we’ll see how things go tomorrow when I have more time to work. 

I’ve set aside plenty of time tomorrow to really dig in, so I’m hoping that by the devlog check in I’ll have completed the cop’s AI. At the very least, I’ll be much further along the way!

Completed today:

  • Evaluated Sensor Toolkit
  • Integrated Sensor Toolkit into new cop AI script

Tomorrow TODO:

  • Continuing work on the cop AI