Topic: The Challenger Research Center Bugsolving
Hi. I'm co-admin of The Challenger server. We spend a lot of time researching methods of making game harder and harder to piss off casual players (and give an orgasm to pro players who loves it). We use ton of various methods, including source diving and stuff. During hardening game, we find a lot of bugs, problems and methods to solve it. Usually we just keep that for us, but we want to help a bit with RTCW COOP development, so we'll share what we found (and what is useful for something else than killing players).
Let's start with map 'end'. Jouhan works on new version of this one and he meet some problems - namely, everyone fights each other, new supersoldiers attacks zombies and Heinrich etc. That sucks. They should kill players, not themselves.
Here's how You solved that problem (one example):
dark1
{
attributes
{
starting_health 500
aim_accuracy 0.6
aggression 1.0
camper 0.0
tactical 0.0
reaction_time 1.0
aim_skill 1.0
}
spawn
{
wait 5
statetype alert
knockback off
// playanim asleep both forever
attack player
}
enemysight
{
gotocast player
attack player
resetscript
}
}
When "problematic" unit notices enemy (like supersoldier notices Heinrich), it's forced to follow player and attack him. It works, that's cool, but why it sucks: "player" in COOP always mean "first player on server" (one with lowest ID). It's awkward and makes map easier. Well, not for first player on server, but You know what I mean.
Reason of problem. Here's part of RTCW code:
typedef enum
{
AITEAM_NAZI,
AITEAM_ALLIES,
AITEAM_MONSTER,
AITEAM_SPARE1,
AITEAM_ENDMAPBOSS, // end.bsp sets "aiteam" "4" for the zombies and bosses (heinrich and friends) at the end of the map
AITEAM_SPARE3,
AITEAM_SPARE4,
AITEAM_NEUTRAL
} AITeam_t;
When You add new axis (or zombie) unit, it's automagically assigned to AITEAM_MONSTER or AITEAM_NAZI, following default value from ai_cast_characters.c:
//AICHAR_SUPERSOLDIER
{
"Super Soldier",
{
170, // running speed
100, // walking speed
90, // crouching speed
90, // Field of View
150, // Yaw Speed
0.0, // leader
0.7, // aim skill
1.0, // aim accuracy
0.9, // attack skill
0.6, // reaction time
0.05, // attack crouch
0.0, // idle crouch
1.0, // aggression
0.0, // tactical
0.0, // camper
16000, // alertness
300, // starting health
1.0, // hearing scale
0.9, // not in pvs hearing scale
512, // relaxed detection radius
2.0, // pain threshold multiplier
},
{
"superSoldierSightPlayer",
"superSoldierAttackPlayer",
"superSoldierOrders",
"superSoldierDeath",
"superSoldierSilentDeath", //----(SA) added
"superSoldierFlameDeath", //----(SA) added
"superSoldierPain",
"superSoldierStay", // stay - you're told to stay put
"superSoldierFollow", // follow - go with ordering player ("i'm with you" rather than "yes sir!")
"superSoldierOrdersDeny", // deny - refuse orders (doing something else)
},
AITEAM_NAZI,
"supersoldier/default",
{WP_VENOM},
BBOX_LARGE, {48,64},
AIFL_NO_RELOAD | AIFL_NO_FLAME_DAMAGE | AIFL_NO_TESLA_DAMAGE,
NULL, NULL, NULL,
NULL,
AISTATE_ALERT
},
So new units will usually have team #0 (axis) or team #2 (monsters / zombies / stuff). But, all units that existed on orginal RTCW 'end' map are assigned to AITEAM_ENDMAPBOSS:
$ strings end.bsp | grep -A6 -B6 aiteam | head -n12
"origin" "576 738 186"
"target" "t608"
"targetname" "killknights"
"classname" "target_relay"
"skin" "dark"
"angle" "270"
"aiteam" "4"
"origin" "544 674 66"
"spawnflags" "1"
"ainame" "dark4"
"targetname" "dark4"
"classname" "ai_warzombie"
$ strings end.bsp | grep '"aiteam" "4"' | wc -l
34
$
Here's .ents key "aiteam" that is not used anywhere in orginal .ents files but was used in .bsp files and is defined in source code. You can use it to assign AIs to one of existing teams. So all You have to do is to add
"aiteam" "4"
to .ents of each AI You add. And remove that 'attack player' stuff. Let them rock!
We also have DoS exploit and some other stuff but we want to share it via PM. To who we should send it?