Helper Bots v1-01-2000 Release 1 © RTCM W0rm
Many people seem to want to be able to create helper bots for duke3d.
What the heck is a helper bot?
A helper bot is a computer controlled player in duke3d intended to help duke. This means that it will have to point at and shoot other monsters, and be able to follow duke around wherever he goes.
Why is it so tough to create a helper bot?
Unfortunately, duke was not created to have helper bots. There are no commands to have any actors (AI) face/attack monsters. There are also no commands for these actors to know if there is a monster near, only when duke is near. Another huge problem is that the way for an actor to detect an obstacle such as a wall or stairs to get up is "ifawayfromwall" which barely works. Not only does this command not know which are 'stairs' and which are walls (so it can't tell walls from sector splits), but even if it is beside the wall or staircase (facing away or along it) it will still think that it is facing the wall/staircase. You can probably tell this is not the best means of creating helper AI.
Is there any way to make it look like it is a helper bot?
Yes! You can simply 'fake' a helper bot. As I said just before, you can have the actors
see what duke is doing, so we can use this to our advantage. See what I mean below! Note
that I simply wrote this up without testing, it may have errors.
What are the main problems not completely worked out?
Would have to be having the bot shoot at other monsters. If you've tried to make a helper bot you've probably realized that the "shoot" command automatically shoots weapons towards duke. This can be surprisingly easily overcome. Creating a new actor using the rpg tiles as an example, you can give it an ai to fire straight ahead of the helper bot who would shoot it. So it would basically spawn the missile which would use a "move" to fly straight, when it hits a monster or wall, "ifnotmoving" could be used to set it off. Why did I mention this as a problem? Because there is still no way to know where a monster is located to shoot at him! I still haven't figured that out either, but now you have a cure to the "shoot" command if you didn't before.
Let's set up the different AI functions...
Later in the code of the actor:
I will continue the code another time.