B_defs.c

This module contains all the definitions for the Omicron bot.

Definitions:

Data objects

The defined data objects are:

These aren't seperate data objects, because the entity is the only data structure available in QuakeC. There will only be the entity structure with all the fields defined for all the data objects. In consequence the fields of all data structures must have different names or they are shared.
 
Here are the entity fields and the descriptions for the specific data objects.

+  used for the same purpose as in the original QuakeC code
-   not used for this data object.
 
Original system entity fields
 
definition Quake description bot waypoint botsound
.float modelindex; model index in the precached list + + -
.vector absmin, absmax; origin + mins / maxs + + -
.float ltime; local time for entity - - -
.float movetype; movement type + + -
.float solid; solid type + + -
.vector origin; entity origin + + sound origin
.vector oldorigin; entity origin the previous server frame + + -
.vector velocity; velocity + - -
.vector angles; model angles + - -
.vector avelocity; angle velocity + - -
.vector punchangle; temp angle adjust from damage or recoil + - -
.string classname; spawn function or just the class name + + +
.string model; model name + - -
.float frame; current animation frame + - -
.float skin; current skin of the model + - -
.float effects; special effects + - -
.vector mins, maxs; bounding box extents reletive to origin + + -
.vector size; maxs - mins + + -
.void() touch; function called when entity is touched + + -
.void() use; function called when entity is used - - -
.void() think; function called when '.nextthink < time' + - +
.void() blocked; for doors or plats, called when can't push other - - -
.float nextthink; next time to call the think function + - +
.entity groundentity; entity standing on + - -
.float health; health + - -
.float frags; number of killed opponents + - -
.float weapon; one of the IT_SHOTGUN, etc flags + - -
.string weaponmodel; weapon model name + - -
.float weaponframe; current weapon animation frame + - -
.float currentammo; current ammunition value + - -
.float ammo_shells; number of shells + - -
.float ammo_nails; number of nails + - -
.float ammo_rockets; number of rockets + - -
.float ammo_cells; number of cells + - -
.float items; item bit flags + - -
.float takedamage; damage value for client red fade + - -
.entity chain; next entity in a chain + + -
.float deadflag; flag with value according to the death + - -
.vector view_ofs; add to origin to get eye point + - -
.float button0; fire + - -
.float button1; use + - -
.float button2; jump + - -
.float impulse; weapon changes - - -
.float fixangle; true when view angles should change immediatly - - -
.vector v_angle; view / targeting angle for players + - -
.float idealpitch; calculated pitch angle for lookup up slopes + - -
.string netname; network name for players + - -
.entity enemy; current enemy + - -
.float flags; several flags + - -
.float colormap; color map number used to colorize skin + - -
.float team; team number + - -
.float max_health; players maximum health is stored here + - -
.float teleport_time; time the teleportation takes + - -
.float armortype; save this fraction of incoming damage + - -
.float armorvalue; current amount of armor + - -
.float waterlevel; water level: 0 = not in, 1 = feet, 2 = wast, 3 = eyes + - -
.float watertype; type of water, a contents value + - -
.float ideal_yaw; ideal yaw view angle + - -
.float yaw_speed; speed to change the yaw angle - - -
.entity aiment; entity aiming at - - -
.entity goalentity; a movetarget or an enemy current goal of the bot - player or bot causing the sound
.float spawnflags; flags for spawning the entity - - -
.string target; target classname - - -
.string targetname; name of the target - - -
.float dmg_take;   + - -
.float dmg_save;   + - -
.entity dmg_inflictor;   + - -
.entity owner; owner of the entity (for instance who launched a missile) + - -
.vector movedir; movement direction mostly for doors, but also used for waterjump + - -
.string message; trigger message - - -
.float sounds; either a cd track number or sound number - - -
.string noise; entity noise - - -
.string noise1; " - - -
.string noise2; " - - -
.string noise3; " - - -
 

Non system original entity fields
 
definition Quake description bot waypoint botsound
.string wad; used wad file - - -
.string map; name of next map - - -
.float worldtype; 0=medieval 1=metal 2=base - - -
.string killtarget; to find entities with target name to kill - - -
.float light_lev; light level, not used by game, but parsed by light util - - -
.float style; light style - - -
.void () th_stand; pointer to standing animation frames - - -
.void () th_walk; pointer to walking animation frames - - -
.void () th_run; pointer to running animation frames - - -
.void () th_missile; pointer to attack animation frames - - -
.void () th_melee; pointer to melee animation frames - - -
.void (entity attacker, float damage) th_pain; pointer to pain animation frames + - -
.void () th_die; pointer to death animation frames + - -
.entity oldenemy; mad at this player before taking damage - - -
.float speed; speed - - -
.float lefty; enemy strafe direction - - -
.float search_time; time to search + - -
.float attack_state; current attack state - - -
.float walkframe; current walk animation frame + - -
.float attack_finished; time attack will be finished + - -
.float pain_finished; time pain will be finished + - -
.float invincible_finished; time invincibility will be finished + - -
.float invisible_finished; time invisibility will be finished + - -
.float super_damage_finished; time super damage will be finished + - -
.float radsuit_finished; time environment suit will ware out + - -
.float invincible_time; time for screen flash when item is running out + - -
.float invincible_sound; sound timing + - -
.float invisible_time; time for screen flash when item is running out + - -
.float invisible_sound; sound timing + - -
.float super_time; time for screen flash when item is running out + - -
.float super_sound; sound timing + - -
.float rad_time; time for screen flash when item is running out + - -
.float fly_sound; sound timing + - -
.float axhitme; TRUE if hit by axe + - -
.float show_hostile; Used to alert monsters that otherwise would let the player go + - -
.float jump_flag; player jump flag + - -
.float swim_flag; player swimming sound flag + - -
.float air_finished; when time > air_finished, start drowning + - -
.float bubble_count; keeps track of the number of bubbles + - -
.string deathtype; keeps track of how the player died + - -
.string mdl; temporary model name - - -
.vector mangle; angle at start - - -
.float t_length; override LENGTH to move sideways - - -
.float t_width; override WIDTH to move back - - -
.vector dest; destination - - -
.vector dest1; " - - -
.vector dest2; " - - -
.float wait; time from firing to restarting - - -
.float delay; time from activation to firing - - -
.entity trigger_field; door's trigger entity - - -
.string noise4; .float pausetime; - - -
.entity movetarget; next target the enemy will move to - - -
.float aflag; amount of ammunition the item contains - - -
.float dmg; damage done by door when hit - - -
.float cnt; misc flag - - type of sound
.void() think1; for temporary think pointer storage - - -
.vector finaldest; final destination at end of move - - -
.vector finalangle; final angle at end of move - - -
.float count; for counting triggers - - -
.float lip; pixel lip remaining at end of move - - -
.float state; state of a door, plat or button - - -
.vector pos1; top position - - -
.vector pos2; bottom position - - -
.float height; height of a plat - - -
.float waitmin; wizard wait - - -
.float waitmax; unused - - -
.float distance; distance - - -
.float volume; volume - - -
 

New entity fields used for bots waypoints and/or botsounds
 
definition bot description waypoint description botsound description
 
.float (entity ear, entity snd) f_sndweight; - - sound weight function
.void (entity bot) f_ai; current bot ai function - -
.void (entity bot) f_lastai; last bot ai function - -
.float tmpskin; to temporary store the skin - -
.float clmodelindex; modelindex for client - -
.float botflags; some bot flags besides .float flags - -
.vector old_velocity; the velocity during the previous frame - -
.vector old_origin; the origin during the previous frame - -
.float old_flags; the flags during the previous frame - -
.float old_botflags; the botflags during the previous frame - -
.entity touchedwaypoint; last touched waypoint - -
.float botskill; the skill of the bot - -
.entity attackedby; entity attacking the bot - -
.float item_weight; weight of item bot goes for during seek - -
.entity longtermgoal; the long term goal of the bot - -
.entity longtermgoal_wp; current waypoint to go for the long term goal - -
.float longtermgoal_dist; current distance towards the long term goal - -
.float roam_count; counter for the number of roam goals used - -
.float attackmove_dist; > 0 if the enemy is running during attack - -
.float attackstrafe_time; time strafing during attack - -
.float chase_time; time the bot gets for chasing - -
.float retreat_time; time the bot gets for a retreat - -
.float check_time; for periodic checks - -
.float enemyvisible_time; last time the enemy was visible - -
.float rocketjump_time; last time the bot rocket jumped - -
.string teamname; the team name of the bot or player - -
.float teamnumber; the number of the team the entity is in - -
.float clientnumber; number of the client - -
.float botnumber; number of the bot - -
.float shirtpantscolor; shirt and pants color - -
.float ideal_pitch; ideal pitch angle - -
.entity move_goal; - -
.string messagestr1; part 1 of the current message of the bot - -
.string messagestr2; part 2 of the current message of the bot - -
.string messagestr3; part 3 of the current message of the bot - -
.float messagenr; number of the message - -
.entity lastkilled; last entity killed by this bot - -
.entity lastdeathcause; last entity causing the death of this bot - -
.void() think2; temporary think - -
.float nextthink2; temporary nextthink - -
.float lastphysicstime; last time the physics were run - -
.vector prephysicsorigin; origin before Quake physics were run - -
.vector prephysicsvelocity; velocity before Quake physics were run - -
.vector touchorigin; origin when the bot touched something - -
.vector steporigin; origin up the step - -
.entity next; next in bot list next in wp list next in sound list
.entity prev; previous in bot list previous in wp list previous in sound list
.float waypointnumber; - number of the waypoint -
.float waypointtype; - type of waypoint -
.string waypointitem; - item classname at wp location -
.float wp0; - path link wp number -
.float wp1; - " -
.float wp2; - " -
.float wp3; - " -
.float wp4; - " -
.float wp5; - " -
.float wp6; - " -
.float wp7; - " -
.entity path0; - reversed reachability links -
.entity path1; - " -
.entity path2; - " -
.entity path3; - " -
.entity path4; - " -
.entity path5; - " -
.entity path6; - " -
.entity path7; - " -
.float dist0; - link distance -
.float dist1; - " -
.float dist2; - " -
.float dist3; - " -
.float dist4; - " -
.float dist5; - " -
.float dist6; - " -
.float dist7; - " -
.entity cache0_ent; - cached entity -
.entity cache1_ent; - " -
.entity cache2_ent; - " -
.entity cache3_ent; - " -
.entity cache4_ent; - " -
.entity cache5_ent; - " -
.entity cache6_ent; - " -
.entity cache7_ent; - " -
.float cache0_dist; - cached entity distance -
.float cache1_dist; - " -
.float cache2_dist; - " -
.float cache3_dist; - " -
.float cache4_dist; - " -
.float cache5_dist; - " -
.float cache6_dist; - " -
.float cache7_dist; - " -
.entity wpnext; - waypoint cache update field -
.entity wpprev; - " -
.float tmpdist; - " -
.float wpinlist; - " -
 

New entity fields for real clients only
 
definition description
.float camflags; camera flags
.entity camera; the camera entity in observer mode
.vector camangle; camera angles
.vector clientorigin; the origin of the client before eye or chase cam
.vector clientv_angle; the view angles of the client before eye or chase cam
.float angletime; time between two observer angle updates
.vector chasecamoffset; offset of the chasecam
.float admin; administrator password and menu counter
 

New fields for entities which are possible goals of the bot
 
definition description
.entity lastgoal_bot; last bot that went for this goal
.float lastgoal_time; last time a bot went for this goal
.entity lastlongtermgoal_bot; last bot with this long term goal
.float lastlongtermgoal_time; last time a bot had this long term goal
.float (entity wp, float dist, entity ent) f_updatecache; entity function to update the waypoint cache
.float (entity bot, entity e) f_goalweight; entity function which returns the goal wieght of the entity
.float (entity bot, entity e) f_walkaboutweight; entity function which returns the walkabout wieght of the entity
 

Constants

Several constants are defined which can be used in all the other modules.
 

Global variables

Several global variables are defined which can be used in all modules.
 

Client specific 'built-in' functions

The client specific 'built-in' functions are disabled for bots.  Quake crashes if they are called for bots because they are fake clients.