Skip to content

Commit

Permalink
Plethora of fixes and enhancements
Browse files Browse the repository at this point in the history
 - Long-standing bot spawn/telefrag issue fixed
   * Fixed KillBox logic via 'fixflaws'
 - Fix for half-in-wall Flag: SV_PushEntity()
   * On narrow ledges flag could get stuck in vertical solid
 - CVar 'weaponswap' - auto switch weapon
   * Auto switch on upgraded weapon pickup
 - CVar for extra HUD detail
   * 'set combathud' in server.cfg CVAR_NOSET
 - CVar 'killerflag'
   * Flag draws health from subdued flagholder
   * Player stays in combat to avoid penalty
 - Some HUD rearrangement and colorization
 - Broadcast score summary to console at level intermission
 - Made a little more gibby
  • Loading branch information
DirtBagXon committed Jun 16, 2020
1 parent 7cf8927 commit fdab8ea
Show file tree
Hide file tree
Showing 28 changed files with 616 additions and 147 deletions.
1 change: 0 additions & 1 deletion 3zb2/game.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ set zigkiller 1

// Player identification
set playerid 1
set playerid_alt 0

//set the spectator mode on/off (default off = 0,on = 1) fire button-catch and release & [ or ] button-select target
set spectator 0
Expand Down
7 changes: 5 additions & 2 deletions 3zb2/zig.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,16 @@ set zigkiller 1
set respawn_protection 1
set ctf 0
set aimfix 1
set combathud 1
set fixflaws 1
set playerid 1
set playerid_alt 0
set killerflag 1
set weaponswap 1
set spawnbotfar 1
set botlist default
set vwep 1

set fraglimit 30
set fraglimit 0
set timelimit 10

set maplist q2dmx
Expand Down
6 changes: 4 additions & 2 deletions CONFIG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,14 @@ zigkiller ZigFlag holder kill gives bonus frag (default on = 1, off = 0)
botlist Set the botlist section name (default = "default")
ctf CTF mode on/off (default off = 0, on = 1)
aimfix Enable more accurate aiming (default on = 1, off = 0)
combathud Display extra information in HUD (default on = 1, off = 0)
respawn_protection Enable brief immunity on respawn (default off = 0, on = 1)
spawnbotfar Spawn bots on farthest spawn points (default off = 0, on = 1)
killerflag Flag takes health from a subdued holder (default on = 1, off = 0)
basepath Specify mod basedir path to 'quake2' directory (default = ".")
fixflaws Fix some noted Quake 2 gameplay flaws (opentdm) (default on = 1, off = 0)
fixflaws Fix some noted Quake 2 gameplay flaws (default on = 1, off = 0)
playerid Indentify player in the crosshair (default off = 0, on = 1)
playerid_alt Additional cvar for alternate positioning of the player_id label.
weaponswap Auto switch to upgraded weapon on pickup (default off = 0, on = 1)

2. Modification of this values will activate during the game is running

Expand Down
68 changes: 54 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
This is a custom port of the 3rd Zigock Bot II to Quake II - Yamagi Quake II is recommended. \
All warnings (up to GCC9) and unused variables have been addressed in the original source. \
The code also has handpicked backport fixes, enhancements and features applied from various \
sources: `TSmod`, `yquake2`, `OpenTDM` and custom.
sources: `tastyspleen`, `yquake2`, `OpenTDM`, `OpenFFA` and custom.

This was modified for my own use and driven by nostalgia for the Quake II servers of the 90's. \
There are many heavily modified versions of the Quake II engine, this mod tries to keep the look and feel of \
Expand All @@ -25,14 +25,18 @@ The original `zigmode` was released belated, buggy and only half implemented, I
more refined, just for fun. I was trying to keep the look and feel of the original deathmatch, but with a few bells and whistles.

* Simple HUD enhancements.
* Autospawn bots at level start.
* Visual/Audio notifications to Flagholder.
* Flagholder dogtag displayed on scoreboard.
* Optional Flag respawn feature.
* Optional Flagholder frag bonus.
* Optional Flag sucks health from subdued holder.
* Optional auto weapon switching on upgrade.
* Optional identified generic gameplay fixes.
* Optional respawn protection.
* Spawn bots at a distance.
* Autospawn bots at level start.
* Visual/audio notifications to Flagholder.
* HUD Identification of player in the crosshair.
* Flagholder dogtag displayed on scoreboard.
* Optional spawn bots at distance.
* Optional HUD playerid.
* Optional enhanced HUD.

..and many bugfixes was the final outcome of playing around with the code.

Expand All @@ -41,7 +45,7 @@ The mod also supports skin and model teams with appropriate bonuses and penaltie
The changes subtly alter the game dynamics and improve on the original zigmode game element, IMHO. \
The original gameplay, with bugfixes, can still be enabled by disabling the new elements via cvars.

`Capture and Hold` plays best on smaller level maps with a couple of bots throw in.
`Capture and Hold` plays best on smaller level maps with a timelimit, no fraglimit and a couple of bots.

### Pak file (Flag model) and Route Chaining files

Expand All @@ -57,9 +61,12 @@ set zigspawn 1
set zigkiller 1
set ctf 0
set aimfix 1
set combathud 1
set spawnbotfar 1
set killerflag 1
set fixflaws 1
set playerid 1
set playerid_alt 0
set weaponswap 1
set botlist default
set autospawn 3
set vwep 1
Expand Down Expand Up @@ -199,18 +206,50 @@ Fix noted Quake 2 gameplay flaws (opentdm), enable `1` (default) or disable `0`

fixflaws 1

Identify player in the crosshair, enable `1` or disable `0` (default) \
Additional cvar for alternate positioning of the player_id label: `playerid_alt`:
Flag takes health from a subdued holder, anti-camping, enable `1` (default) or disable `0`:

killerflag 1

**Stay-in-the-fray** to avoid penalty.

Identify player in the crosshair, enable `1` or disable `0` (default)

playerid 1
playerid_alt 1

Display extra (rank, timer) information in HUD:

combathud 1

Auto switch to upgraded weapon on pickup, enable `1` or disable `0` (default):

weaponswap 1

`Capture and Hold (ZigFlag)` mode for Deathmatch/Team games:

zigmode 1
zigspawn 1
zigkiller 1

Broadcast the summary of the top six players, in console, at level intermission:

----------------
| q2dm1 | ~ 02 |
------------------------------------------------------
| X | Player | S | P | T | F | A |
------------------------------------------------------
| * | [BOT]Batty | 30 | 0 | 8 | +8 | +0 |
| | [BOT]Chews | 26 | 0 | 8 | +0 | +2 |
| F | [BOT]Lupin | 21 | 0 | 8 | +3 | +2 |
| | _GONZO_ | 6 | 19 | 8 | +6 | +0 |
------------------------------------------------------

**S** - *Score* \
**P** - *Ping* \
**T** - *Time* \
**F** - *Flag Possession bonuses* \
**A** - *Assassinations of Flagholder* \
**~** - *Flag bounce occurrences*

## Errata

Specify a `basedir` to inform the mod of the system `baseq2` directory location. \
Expand All @@ -224,8 +263,8 @@ Use on the following errors:
3ZB CFG: file not found: ./3zb2/3zbconfig.cfg
Chaining: file 3zb2/chdtm/q2dm1.chn not found.

The mod has a random issues in `SV_RunThink()`, resulting in a segfault, during bot tracing \
when the *lightweight* `gamemap` command is used for level change. Use the `map` command which \
The mod has a random issues using `gamemap`, resulting in a lockup or segfault. Bot tracing in \
`SV_RunThink()` seems to be the related area, but I have yet to track down. Use the `map` command which \
causes a full level reset to overcome the issue. Note: **Q2Pro** attempts to enforce the use of \
`gamemap`, use `sv_allow_map 1` in Q2Pro to overcome this:

Expand All @@ -234,4 +273,5 @@ causes a full level reset to overcome the issue. Note: **Q2Pro** attempts to enf

##

![captureandhold](https://raw.githubusercontent.com/DirtBagXon/3zb2/master/screenshot.png)
![captureandhold](https://raw.githubusercontent.com/DirtBagXon/3zb2/master/screenshot/screenshot.png)
![captureandhold](https://raw.githubusercontent.com/DirtBagXon/3zb2/master/screenshot/screenshot2.png)
Binary file removed screenshot.png
Binary file not shown.
Binary file added screenshot/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshot/screenshot2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 10 additions & 2 deletions src/bot/func.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ qboolean Get_YenPos(char *Buff,int *curr)
void Load_BotInfo()
{
char MessageSection[50];
char MessageHighlight[MAX_STRING_CHARS];
char Buff[1024];
int i,j,k,l;

Expand Down Expand Up @@ -109,7 +110,8 @@ void Load_BotInfo()
if(Buff[0] == '.' || Buff[0] == '[' || Buff[0] == '#') break;
k = strlen(Buff);
if((strlen(Buff) + strlen(ClientMessage)) > MAX_STRING_CHARS - 1) break;
strcat(ClientMessage,Buff);
HighlightStr(MessageHighlight, Buff, MAX_STRING_CHARS);
strcat(ClientMessage, MessageHighlight);
}
MESS_NOTFOUND:
//if(botlist->string == NULL) strcpy(MessageSection,BOTLIST_SECTION_DM);
Expand Down Expand Up @@ -576,11 +578,17 @@ void PutBotInServer (edict_t *ent)
client->zc.ctfstate = CTFS_OFFENCER;
}

// we must link before killbox since it uses absmin/absmax
if(fixflaws->value)
gi.linkentity (ent);

if (!KillBox(ent))
{ //Couldn't spawn in?
}

gi.linkentity (ent);
if(!fixflaws->value)
gi.linkentity (ent);

G_TouchTriggers (ent);
}

Expand Down
7 changes: 3 additions & 4 deletions src/g_chase.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ void ChaseNext(edict_t *ent)
break;
} while (e != ent->client->chase_target);

gi.centerprintf(ent, "Chase Cam on %s..\n", e->client->pers.netname);
ent->client->chase_target = e;
ent->client->update_chase = true;
}
Expand All @@ -132,7 +131,6 @@ void ChasePrev(edict_t *ent)
break;
} while (e != ent->client->chase_target);

gi.centerprintf(ent, "Chase Cam on %s..\n", e->client->pers.netname);
ent->client->chase_target = e;
ent->client->update_chase = true;
}
Expand All @@ -141,16 +139,17 @@ void GetChaseTarget(edict_t *ent)
{
int i;
edict_t *other;
char nomore[MAX_TEXT];

for (i = 1; i <= maxclients->value; i++) {
other = g_edicts + i;
if (other->inuse && !other->client->resp.spectator) {
ent->client->chase_target = other;
ent->client->update_chase = true;
UpdateChaseCam(ent);
gi.centerprintf(ent, "Chase Cam on %s..\n", other->client->pers.netname);
return;
}
}
gi.centerprintf(ent, "No other players to chase.");
HighlightStr(nomore, "No other players to chase", MAX_TEXT);
gi.centerprintf(ent, nomore);
}
36 changes: 36 additions & 0 deletions src/g_combat.c
Original file line number Diff line number Diff line change
Expand Up @@ -553,3 +553,39 @@ void T_RadiusDamage (edict_t *inflictor, edict_t *attacker, float damage, edict_
}
}
}

qboolean KillerFlagCheck(edict_t *ent)
{
edict_t *flagholder;
flagholder = ent;

if(!(flagholder->flags & FL_GODMODE))
{
if(flagholder->health > FLAG_HEALTH + 1)
{
flagholder->penalty += 1;
flagholder->health -= FLAG_HEALTH * flagholder->penalty;
}
else
flagholder->health -= 1;
}

if(flagholder->health <= 0)
{
meansOfDeath = MOD_FLAG;
player_die (flagholder, NULL, NULL, FLAG_HEALTH, vec3_origin);
return true;
}

flagholder->client->damage_blood = 1 * flagholder->penalty;
flagholder->client->damage_alpha = 0.1 * flagholder->penalty;
flagholder->client->damage_knockback = 10 ;
flagholder->pain_debounce_time = level.time + 1;;

if(IsFemale(flagholder))
gi.sound(ent, CHAN_VOICE, gi.soundindex("chick/Chkpain1.wav"), 1, ATTN_NORM, 0);
else
gi.sound(ent, CHAN_VOICE, gi.soundindex("mutant/step2.wav"), 1, ATTN_NORM, 0);

return false;
}
7 changes: 6 additions & 1 deletion src/g_ctf.c
Original file line number Diff line number Diff line change
Expand Up @@ -2931,12 +2931,17 @@ static void old_teleporter_touch (edict_t *self, edict_t *other, cplane_t *plane
AngleVectors (other->client->v_angle, forward, NULL, NULL);
VectorScale(forward, 200, other->velocity);

// we must link before killbox since it uses absmin/absmax
if(fixflaws->value)
gi.linkentity (other);

// kill anything at the destination
if (!KillBox (other))
{
}

gi.linkentity (other);
if(!fixflaws->value)
gi.linkentity (other);
}

/*QUAKED trigger_teleport (0.5 0.5 0.5) ?
Expand Down
6 changes: 6 additions & 0 deletions src/g_func.c
Original file line number Diff line number Diff line change
Expand Up @@ -2198,7 +2198,13 @@ Kills everything inside when fired, irrespective of protection.
*/
void use_killbox (edict_t *self, edict_t *other, edict_t *activator)
{
if(fixflaws->value)
gi.linkentity (self);

KillBox (self);

if(fixflaws->value)
gi.unlinkentity (self);
}

void SP_func_killbox (edict_t *ent)
Expand Down
5 changes: 5 additions & 0 deletions src/g_items.c
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,9 @@ qboolean Pickup_Ammo (edict_t *ent, edict_t *other)

if (!(ent->spawnflags & (DROPPED_ITEM | DROPPED_PLAYER_ITEM)) && (deathmatch->value))
SetRespawn (ent, 30);

other->last_action_time = level.time;

return true;
}

Expand Down Expand Up @@ -914,6 +917,8 @@ qboolean Pickup_Armor (edict_t *ent, edict_t *other)
}
}

other->last_action_time = level.time;

if (!(ent->spawnflags & DROPPED_ITEM) && (deathmatch->value))
SetRespawn (ent, 20);

Expand Down
Loading

0 comments on commit fdab8ea

Please sign in to comment.