TL;DR: I found console commands that let you do things similar to what you can do in Left 4 Dead and CSS regarding bots. Was wondering if any of you give a rat’s ass about them. Also found a bot that can be added thru console that runs on these grid things that Left 4 Dead uses. Watch video below.
Now, I’d like to make it clear that I have no verification of this from Garry or anyone else working on the game. For all I know, this could have just been something they were playing around with and forgot to take out before sending out the patch. All I know is that as of the most recent update there are bots in Garry’s Mod that use navigation meshes to move about the map.
Don’t know what a navigation mesh is? You can find some info here:
Anyway, I got around to generating the nav mesh for gm_construct the same way you would generate a nav mesh for Left 4 Dead. I opened the map, then typed nav_generate into the console. I then waited for about 5 minutes as my computer made buzzing noises akin to a swarm of bees. Then it reloaded the map, and there you have it: a fully generated nav mesh in Garry’s Mod.
If you didn’t know this already, all source games besides Left 4 Dead and CSS used nodes to allow their AI to navigate the environment. These are placed in the map before it’s compiled, and are layed out by the mapper. In many ways this is in-superior to a nav mesh. The game won’t do it for you, you can’t mark the nodes with anything too complex (such as PLAYER SPAWN or OBSCURED), and the nodes need to be placed before compiling, meaning that if you didn’t make the map, you can’t edit where the nodes are placed (at least to my knowledge). You can find more info on nodes here:
Knowing this, I was astonished when I hadn’t seen anyone else talking about the inclusion of the nav mesh functionality. I searched everywhere, I couldn’t find a single thread on the matter. It was about this point that I realized either I’m crazy or I’m the only one who understands the significance of this. I naturally settled on the second option, and began to wonder if there were any entities coded into Gmod that used the navigation mesh. I started browsing through the console looking for something suspicious that I hadn’t seen there before, and after quite a bit of searching I found it. The command is:
It is, as the name implies, a simple bot. It assumes the T pose and wanders around, with the model of a female citizen. The cool thing about her is that I can spawn a large number of them at a time with negligible impact. So far I’ve only been daring enough to try 100, and got 30 fps (which is my average framerate), but I wouldn’t doubt being able to get up to 200 bots before experiencing any noticeable lag.
I urge you all to experiment with this new functionality, and perhaps even provide some more information on the simple_bot’s behavior.