Bez the Bot Whisperer is a master of custom nav-mesh editing.
He knows how to change them to bring out the best in bots and has shared with me some of
his wisdom from having worked with these mythical creatures for hundreds of hours.
I already have a video covering his bot-antics and now he’s back, this time demonstrating
their behaviour on the new Nuke.
So that we’re all on the same page here, bots wouldn’t move on their own were it
not for a nav-mesh, which is a series of squares which cover the entire level, telling them
everything they need to know.
Global Offensive is good because it automatically makes a nav mesh for each map, but if left
at that the results can often be disappointing or even broken, which is why it’s best for
humans to take a look at it before the map is released.
Anyway, this is how the nav mesh works.
If a bot wants to get from A to B, it will look at the squares in between and will make
them go from one to the next until they reach their destination.
It’s understandable but worth mentioning that they prefer simple routes rather than
short ones.
In other words, they’ll take the longer route if it means avoiding complicated areas
full of many small nav squares.
It’s not too much of a problem.
They will still take the difficult path if it’s noticeably shorter, but this will cause
problems with more complicated maps where they’ll likely favour the same simple paths
most rounds.
Now you’d think the nav meshes of official maps would be complete, but they’re not.
Far from it!
Nav mesh areas are connected by blue lines, indicating that bots can move from one to
another.
But there are none connecting those in ramp room to those in bombsite B.
The result is that, instead of using this doorway… the bots will walk around the map
to find another way down.
The same happens in secret.
How would you get down these stairs?
2kliksphilip, demonstrate how for me.
But for a bot it isn’t so simple.
If I tell a bot to go down these stairs… he’ll go all the way around.
The reason?
Valve made a load of small squares on these stairs to act as camping spots- that’s right,
squares can be given roles.
If one’s a camping spot, bots looking to defend an area will run to it, believing that
they’ll be reasonably concealed from view there.
In Nuke’s case, these squares weren’t connected together properly, breaking the
link between the top and the bottom.
Because of this, the bot now thinks that the stairs are an impassable obstacle, much like
some cautious, stupid puppy.
Bez decided to remove these sniper spots and to just let them go up and down the stairs,
which he thought was more important than having a camping spot that they’d hardly ever use
in practice.
Welcome to the world of nav mesh design.
It’s all about compromise!
The entire concept of stringing squares together into paths is very basic and limited, but
if done correctly it can still lead to very playable bots.
In fact, the trick is to keep it as simple as possible.
Don’t think that by adding 100 camping spots to a room that the bots will play it better
than if there were only 5.
They probably won’t.
They are simple creatures and are very easily bogged down by useless information.
Much like puppies.
Simple is better and in this case means making them use stairs for their actual purpose,
rather than as some obscure camping spot.
But camping spots are a thing!
There are 3 grades; red being the worst, green being okay and purple, which is the best.
He believes that sniper bots only really choose purple, whereas normal bots will choose between
going for a near-by green or red, or in Bez’s words, will run across the whole map to get
to a purple one.
Because they’re dicks.
He believes that a lot of places are marked as bad red camping spots because even if the
bots don’t choose to go there themselves, they will check them to see if enemies are
using them.
He showed me ramp room, where there are a load of boxes up here.
Bots themselves won’t be able to get up there but real players can be boosted up and
for his own custom nav mesh for Nuke he added areas up here, which will make bots check
this spot occasionally, plus it helps should a bot be spawned up here for whatever reason.
This is a reason why nav meshes should include spots that the bots will never go to themselves-
it simply makes them more compatible with human players.
Sometimes you have to get creative.
Ladders are a nightmare for us, let alone for bots.
As they approach the ladder they’ll stop running and will begin walking, which if approached
from certain angles, means they will plummet to their deaths.
Take it away, Alfred!
Getting them to stand in the correct position before attempting the ladder will solve this
limitation and is something that Bez has done with his custom navmesh for Nuke.
This ladder’s a nightmare for bots.
Although they’ll seldom use it in practice, it nicely shows how creative you can be when
bypassing bots’ limitations.
At the moment, the ladder is split into two halves for bots.
If they want to get from the ground to the roof, they’ll climb up to the first floor,
get off, then will get back on to climb up the remaining distance.
Bez has split the ladder up into two sides: the left hand side goes all the way up in
one go.
The right hand side stops at the first level.
It’s not perfect, since they won’t be able to get down from the roof to the camping
spot.
But it’s a case of weighing up the pros and cons of each approach and deciding what
would benefit the bots in that area the most.
It’s all about understanding bot behaviour and creating a system that lets them behave
the least…
poorly.
A very useful feature is the NOJUMP command.
Bots have the tendency to jump down stairs or onto platforms, even when it’s possible
to walk over them instead.
This is perhaps the most noticeable limitation with an automatically generated navmesh and
is something we’ve all seen them doing at some point or another.
But it’s easy to fix with this nifty command, which will also minimise falling damage when
they step off ledges.
Want to see how bots navigate a map?
Open the console and type these commands.
For the last one I’ve chosen the N button, but you can use whatever you want.
When you press it, the bot will try to get to where you’re looking at.
nav_edit 1, bot_quota 2, bot_zombie 1, then bind a key to bind n "bot_goto_selected"
The bot_debug 1 command is also interesting.
Spectate them with this option enabled and you’ll be able to see their inner thoughts,
dreams and desires!
It shows how happy they are, how many enemies and friendlies they know are nearby and what
their current status is.
In this mode, you can see them look away from flashes and shake their aim between different
body regions to represent frantic mouse movements if they get alarmed or overwhelmed.
We can also see how they interact with other characters.
If a player makes a noise or is seen, their position is updated with a yellow arrow which
the bot will then use to aim at if they lose sight of the player himself.
In some cases, bots have $10,000 headsets and will be able to hear scopes and silenced
weapons being fired, even at considerable distances!
WEAPON SWITCHING shows the word BANG on the player model, meaning that the game achknowledges
that it should alert players to their location, but doesn’t update the yellow pointer position.
This is probably for the best, since otherwise bots would have super-human senses and we’d
be able to use them as a kind of sniffer-dog to spot hiding enemies.
In conclusion, I walked away from this feeling that, when mixed with considerate map design
and some custom nav meshes, bots can be pretty decent.
At the moment they may get stuck behind doors and stumped by ladders, but with a bit of
help from Bez, they can master these challenges.
And lastly: a parkour challenge.
Will Alfred be able to run all the way around the side of the main building in the default
nuke nav mesh?
Bez pointed out the key problems.
Bots holding heavier weapons aren’t able to jump as far, making this jump impossible.
The nav mesh on the top of this silo is messed up and fragmented into 1000 different bits.
And, if told to go from T spawn to heaven, bots will usually pick another route.
But if the task is split into several smaller parts, this is what they’re capable of.
Isn’t it beautiful to behold.
The AI revolution starts now!
Thanks to Bez for helping me to make this video, and BOT Alfred for being the hero that
we needed.