Why embark in this messy bunch of work? I've asked myself the same thing a few times. But *drum rolls* The time has come, and the benefits of coding NPCs in have piled up with each day of development, and so did inspiration.
The goal is to make AI-controlled entities different from the bots that we already have, that can be interfaced with script files and/or the map editor.
Sounds far-fetched? Maybe, but as always I'll start with small steps. A simple mission or two, on the same wavelength of the tomb tutorial map. Think Sauerbraten, they have some fun singleplayer missions to play alongside multiplayer.
-Cooperation / Zombie mode
This is an even more important reason. Using dumbed-down bots as zombies is both limiting and wasteful.
-The reasons why bots aren't suitable
1) The bot AI is built with one purpose in mind: emulating a player as well as they can - the default OA bots manage that well enough. That means considerable thinking depth and independence, working in teams, following the goal of every game mode -- which can imply many things other than blowing someone to smithereens. The bot AI is very complex.
All while the singleplayer/Coop AI would need (for the moment) pretty much two things: Following a script (such as patrolling waypoints) and fighting the player(s) and/or other NPCs. That is true for anything from the final boss to the lowliest cannon fodder.
Merging these two things would probably do more harm than good.
2) Even outside of their AI, bots are coded in every respect like players. Again, the core server code that handles clients (players and bots) is pretty arcane and better just left alone. What to send to whom, etc.
Also, even the game mechanics (not the core, the .vm) would need extensive modifications to accomodate that. Just scratching on the surface, the respawn mechanics.
I did experiment a bit on the bots before moving on to understand this.
3) NPCs should be spawned in relatively large numbers, at the beginning, via map layout, or via scripts, and just be removed at the end of a level or when they die. The clients need, again, some complicated pathways for that to happen.
=== Progress ===
Surprisingly, getting them to spawn without crashing was relatively painless.
Models are still behind however:
Using the armor shard as a placeholder. You see a NPC relentlessly firing an invisible gun, complete with invisible infinite, magic-reloaded ammo.
Yeah. That used to be me. Now they can target you and hit you with surprising (read: too much) accuracy. However, as of now (7 nov) they can't move, except for falling. They're much like turrets.
Movement, AI, and graphics are the next steps.
(9 nov) Adding movement proved disastrous. Despite having "Fatal errors" in the AI, the Angry Armor Shard o' Doom was teleporting around the map mowing me down with its unlimited ammo, impossible to hit and sometimes to see.
(11 nov) Movement somewhat fixed, but still far from done.
(11 nov, 2) Basic movement (A to B) works
(13 nov) Moving on to weapon usage
(14 nov) NPCs now have a target detection algorithm that considers field of view, target distance, target speed and how much in front of them the target is.
(16 nov) NPCs will now pick a weapon taking into account enemy distance, ammo left and preference (similar, but not exactly like bot weights). Strangely head aim is a bit disappointing now. It will stay off for the moment.
(19 nov) Aiming issues fixed, now giving them a model.
(20 nov) Models are working (the headlessness will be addressed soon)
(20 nov, 2) Hitboxes work. Wow, it's been quick.
(26 nov) They can now hear sounds. On to map scripting (already partially done).
(30 jul) huge break in the news, but it's still going (albeit a bit slowly).
Now the game will load an additional file alongside the map .bsp (e.g. q3dm1.npcdef) that will contain info about any NPCs used in the map - e.g. hit points, model, speed, acceleration, how you'll interact if you use your action key on them, etc. so that in different maps you can have drastically different enemies - currently up to 8 types, but it'd be really trivial to raise that limit should the need arise.
The rest is done via map editor - their weapon, what to do when spawned, waypoints to follow, etc.
What needs to be done is deaths of NPCs "firing their targets", that is, activating something like a button activates a door. So when you've defeated that boss, the exit door will conveniently open by force of plot.
Additional mapping features (keys, multiple switches to open one door, skill level-based events such as more enemies spawning, ...) are a bit lacking and are on their way in. Already made keys in the classic doom style (blue yellow and red).
The keys could also be used in MP team mode, since the two teams could be made to carry the respectively color-coded key by default...