Inside3D tutorials.
Created By: | Andrew Walbert |
eMail: | awalbert@epix.net |
Difficulty Scale: | Easy |
Purpose
Alright, so the BIP name isn't original. It stands for Bot Improvement
Protocal. Unlike the Reaper Improvement Protocal (RIP), BIP will work
with ANY bot. In the appendix of the BIP are instructions on making some
of the more complex AI functions work with specific bots such as the Reaper
or Zeus bots.
Contents
1.0 - Bot Vision
1.5 - Darkness 'Camping' AI
2.0 - Bot Rankings
Bot Vision
This section will show you how to add code to a bot that gives it realistic
vision. Realistic vision means that the bot will have a lessor chance of
seeing another bot or player that is hiding in a dark area of a level. This
is probably the first time that anything like this has been accomplished.
There isn't much to it, but you need to follow the steps exactly.
Step 1 ------ Open up the file that your bot uses for it's fighting AI and locate its check attack subroutine. Directly ABOVE the check attack subroutine, add this bit of code: void () botSetNearLight = { local entity e; local entity targ; targ = self.enemy; e = findradius (targ.origin,200); if (e.classname == "light") nearlight = TRUE; }; Then, edit the check attack subroutine to include these lines: botSetNearLight(); if (!(nearlight) && (random() < 0.7)) return; That should be placed directly after any locals or defines (ex. targ = self.enemy) Save and close the file. Step 2 ------ Next, open up defs.qc or whatever file your bot uses for defs. At the top of the file, insert this line: float nearlight; Save and close the file. Step 3 ------ Open up misc.qc and find the light subroutine. Add this line to it near the beginning: self.classname = "light"; Now add that line to the beginning of each of the following subroutines: light_fluoro light_fluorospark light_globe FireAmbient light_torch_small_walltorch light_flame_large_yellow light_flame_small_yellow light_flame_small_whiteSave and close the file.
Conclusion
That was a fairly simple addition to your bot. I wanted to start out with
something original, yet simple to do. The next section will show you how
to add special AI subroutines to have your bot attempt to hide in darker
areas.
Bot Improvement Protocal (1 of 15)
Andrew Walbert
Copyright (c) 1997, All Rights Reserved.
BY USING ANY PORTION OF THE BOT IMPROVEMENT PROTOCAL, YOU AGREE TO THE FOLLOWING TERMS AND CONDITIONS:
ANDREW WALBERT CANNOT BE HELD LIABLE FOR ANY DAMAGES CAUSED TO YOU, YOUR COMPUTER, OR SOFTWARE ON THE COMPUTER SYSTEM. ANY BOT OR QUAKE MODIFICATION RELEASED THAT USES ANY PORTION OF THE BOT IMPROVEMENT PROTOCAL MUST INCLUDE THE FOLLOWING STATEMENT UNALTERED IN THE TEXT FILE ACCOMPANYING THE RELEASE PACKAGE.
This (BOT/Quake Mod) uses code from the Bot Improvement Protocal created by Andrew Walbert (awalbert@epix.net).