That's an AI in excess of Quake and most other commercial games because of the co-operative nature of your AI, unit co-ordination or 'strategy' is perhaps the hardest aspect of AI coding and fails all too often in commercial games. Infact it's the key reason why I don't play commercial RTS games anymore simply because in commercial games the AI has been sacrificed for graphics.
I'm sorry to say I can't just turn around and give you source code, you are going to have to do this yourself. The strategic aspect of your AI will be the single most complex part of your program - if it isn't then it probably has very limited strategic value and not worth coding. There's some conceptual papers on the link I gave you earlier.
However you don't want to flaff around with all of that complicated stuff when there is a simpler way...
You can perform a few simple tricks to simulate co-ordinated movement such as having a 2nd bot follow in anothers footsteps (by constantly giving it a destination waypoint of it's partner), so that they appear to be a team - and when they engage in combat (if playerFired()) they break off individually to seak their own cover etc.
You could add a test that if a bot 'wingman' is in cover and another is not - then he fires wildy to keep your head down whilst the other moves.
I'll leave the rest to your imagination and game design.
The second most complex part of a game is probably route finding, and for that I recommend looking up examples of A* as it seems ideal for use with BSP. - here's a link to a DB coded one:
http://www.realgametools.net/forums/index.php?board=8;action=display;threadid=15264.
Choosing the weapon on range is so simple I wont insult you with a theoretical answer, i'll just give you a few range calculation functions...
null=make vector 1
`Range Finding
function range(ax#,bx#)
result#=abs(ax#-bx#)
endfunction result#
function range2D(ax#,az#,bx#,bz#)
dx#=abs(ax#-bx#)
dz#=abs(az#-bz#)
result#=sqrt((dx#*dx#)+(dz#*dz#))
endfunction result#
function fastRange2D(ax#,az#,bx#,bz#)
result#=abs(ax#-bx#)+abs(az#-bz#)
endfunction result#
function range3D(ax#,ay#,az#,bx#,by#,bz#)
set vector3 1,ax#-bx#,ay#-by#,az#-bz#
result#=length vector3(1)
endfunction result#
Hope that gets you started.
AI IS the flesh of the game, everything you've done until now was just the peticoat.
Pneumatic Dryll
