It would be great if someone did that for the CTF logic, AceOfThumbs, but I'm not a Nexuiz developer. This patch is just something I had fun messing with. I'm not planning on investing much more time time with Nexuiz code right now. If someone else wants to mess with it check out my "Why bots aren't better at CTF" topic for my thoughts. Consider messing with the roles and goals. Coming up with some way assuring that bots never stand still, perhaps some sort of Brownian motion random walk if nothing else, would help significantly.
I did make one last enhancement to my patch - bots both pick their enemy and decide to fire their weapon based on testing line of sight from their vantage point to a single point within their enemy's bounding box. That point may either be their enemy's origin or the center of the bounding box, which is close to the same thing.
The problem is that if you are partially obscured, such as when you are on a platform looking down at the bot, the bot may not fire since your origin may be obscured. In such cases you can fire down at the bot with impunity.
With my latest patch if there is not a line of sight to its enemy's origin the bot will then test line of sight to all eight corners that make up its enemy's bounding box. It will shoot at whichever corner is exposed. With the latest patch at skill 100 if the bot has a nex it will almost always shoot you before you can even see him.
There was some talk in this thread about this patch being accepted into Nexuiz. That's fine with me, but as I mentioned I consider this patch to just be a fun hack. For a real fix ideally more work should be done to make what I did seamlessly integrated into the skill system rather than having a skill of 100 be a magic value. It seems like increasing the skill from its minimum value (currently 0) to its maximum value (currently 10) should result in gradual increases in skill.
As to the bigger picture - this may seem like flame bait, but there are issues with the Quake C code that ideally would be cleaned up.
There is a lot of commented out code. For example, look at all the commented out code in bots.qc. It's not a big deal, but it's something people have to sort through. It would be nice if most of it was deleted. It's all in some version control system anyway, right?
An even bigger issue is that Quake C either has limitations that compelled the authors of some of the code in Nexuiz to do some odd things. For example, this pushes something onto a stack:
void(entity e) navigation_pushroute =
{
self.goalstack31 = self.goalstack30;
self.goalstack30 = self.goalstack29;
self.goalstack29 = self.goalstack28;
self.goalstack28 = self.goalstack27;
...
self.goalstack02 = self.goalstack01;
self.goalstack01 = self.goalcurrent;
self.goalcurrent = e;
}
Yes, all 32 slots within the stack are hard coded. It's repeated again for the pop and again to clear all the slots. This has to do with limitations in Quake C:
http://en.wikipedia.org/wiki/QuakeC
So I understand that enhancing something like Quake C is hard and that everyone involved probably behaved reasonably given the constraints they had. But at the same time I just want to point out that there are these limitations and that there is a significant cost in terms of how cumbersome the code is.