Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Japro update #188

Merged
merged 6 commits into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion codemp/cgame/cg_effects.c
Original file line number Diff line number Diff line change
Expand Up @@ -1051,7 +1051,7 @@ void CG_SpotIcon( int client, vec3_t org ) {
static vec3_t lastPos;

// only visualize for the client that scored
if (client != cg.predictedPlayerState.clientNum || cg_scorePlums.integer == 0) {
if (client != cg.predictedPlayerState.clientNum || cg_spotIconPlums.integer == 0) {
return;
}

Expand Down
2 changes: 1 addition & 1 deletion codemp/cgame/cg_snapshot.c
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ void CG_StrafeTrailLine( vec3_t start, vec3_t end, int time, int clientNum, int

cg.drawingStrafeTrails |= (1 << clientNum);

if (cg_scorePlums.integer && (number > 0) && (number % SVFPS == 0)) {//oh this is stupid, assume sv_fps is 30 on servers that create it i guess.
if (cg_strafeTrailPlums.integer && (number > 0) && (number % SVFPS == 0)) {//oh this is stupid, assume sv_fps is 30 on servers that create it i guess.
localEntity_t *le;
refEntity_t *re;
vec3_t angles;
Expand Down
4 changes: 3 additions & 1 deletion codemp/cgame/cg_xcvar.h
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,8 @@ XCVAR_DEF( cg_strafeTrailRacersOnly, "0", NULL, CVAR_ARCHIVE )
XCVAR_DEF( cg_strafeTrailRadius, "2", NULL, CVAR_ARCHIVE )
XCVAR_DEF( cg_strafeTrailFPS, "40", NULL, 0 )
XCVAR_DEF( cg_strafeTrailGhost, "1", NULL, CVAR_ARCHIVE )
XCVAR_DEF( cg_strafeTrailPlums, "0", NULL, CVAR_ARCHIVE )
XCVAR_DEF( cg_spotIconPlums, "0", NULL, CVAR_ARCHIVE )

XCVAR_DEF( cg_drainFX, "1", NULL, CVAR_NONE )
//Make maxpackets userinfo maybe idk
Expand Down Expand Up @@ -331,7 +333,7 @@ XCVAR_DEF( cg_shaderSaberGlow, "0.625", NULL, CVAR_NONE )//1.25?
XCVAR_DEF( cg_saberTeamColors, "1", NULL, CVAR_ARCHIVE )
XCVAR_DEF( cg_noRGBSabers, "0", NULL, CVAR_ARCHIVE )
XCVAR_DEF( disco, "0", NULL, CVAR_INTERNAL ) //xD
XCVAR_DEF( cg_scorePlums, "0", NULL, CVAR_ARCHIVE )
XCVAR_DEF( cg_scorePlums, "1", NULL, CVAR_ARCHIVE )
XCVAR_DEF( cg_stereoSeparation, "0.4", NULL, CVAR_ARCHIVE )
XCVAR_DEF( cg_shadows, "1", NULL, CVAR_ARCHIVE )
XCVAR_DEF( cg_simpleItems, "0", NULL, CVAR_ARCHIVE )
Expand Down
3 changes: 2 additions & 1 deletion codemp/game/bg_pmove.c
Original file line number Diff line number Diff line change
Expand Up @@ -5754,7 +5754,8 @@ static void PM_GroundTrace( void ) {
}

// check if getting thrown off the ground
if ( pm->ps->velocity[2] > 0 && DotProduct( pm->ps->velocity, trace.plane.normal ) > 10 ) {
//Don't do this for vehicles
if ( (!pm_entSelf || pm_entSelf->s.NPC_class != CLASS_VEHICLE) && (pm->ps->velocity[2] > 0 && DotProduct( pm->ps->velocity, trace.plane.normal ) > 10 )) {
if ( pm->debugLevel ) {
Com_Printf("%i:kickoff\n", c_pmove);
}
Expand Down
9 changes: 9 additions & 0 deletions codemp/game/bg_slidemove.c
Original file line number Diff line number Diff line change
Expand Up @@ -837,6 +837,15 @@ qboolean PM_SlideMove( qboolean gravity ) {
PM_ClipVelocity(pm->ps->velocity, planes[i], clipVelocity, OVERCLIP);
// slide along the plane
PM_ClipVelocity (endVelocity, planes[i], endClipVelocity, OVERCLIP );
#if 1
if (pm->ps->stats[STAT_MOVEMENTSTYLE] == MV_TRIBES &&
(((pml.groundTrace.surfaceFlags & MATERIAL_MASK) >= MATERIAL_SHORTGRASS && (pml.groundTrace.surfaceFlags & MATERIAL_MASK) <= MATERIAL_GRAVEL) || ((pml.groundTrace.surfaceFlags & MATERIAL_MASK) == MATERIAL_MUD) || ((pml.groundTrace.surfaceFlags & MATERIAL_MASK) == MATERIAL_ROCK)) &&
(planes[i][2] == 0 || planes[i][2] == 1)) {//Vertical or horizontal brush collision in tribes mode
//For some reason I have to use pml.groundtrace results instead of trace results because trace results dont see the surfaceflags or contents (???). Need to add more material types for terrain detection. Or make use of surfaceparm terrain instead in the future.
pm->ps->pm_time = 250;
//Com_Printf("^3Deadstop detection! Mitigating! Contents is %i %i %i %i\n", trace.surfaceFlags & MATERIAL_MASK, pml.groundTrace.surfaceFlags & MATERIAL_MASK, trace.contents & CONTENTS_INSIDE, pml.groundTrace.contents & CONTENTS_INSIDE);
}
#endif

#if _GAME
//Always in coop? what if somehow there is no playerstate? crash?
Expand Down
4 changes: 2 additions & 2 deletions codemp/game/g_local.h
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,8 @@ extern int dueltypes[MAX_CLIENTS];//JAPRO - Serverside - Fullforce Duels y is th
#define FT_NORAGEFIRERATE (1<<18)
#define FT_BUFFMINDTRICK (1<<19)
#define FT_BUFFMELEE (1<<20) //not really a forcetweak but no room in weapon tweaks!
#define FT_DRAINDMGNERF (1<<21)
#define FT_FIXGRIPPEDREGEN (1<<22) //not really a forcetweak but no room in weapon tweaks!
#define FT_DRAINDMGNERF (1<<21) //drain takes 3 instead of 4fp from enemy
#define FT_FIXGRIPPEDREGEN (1<<22) //lets you regen during a jump if you are caught and not holding jump (?)


//Saber tweaks
Expand Down
20 changes: 16 additions & 4 deletions codemp/game/w_force.c
Original file line number Diff line number Diff line change
Expand Up @@ -2116,23 +2116,30 @@ void ForceDrainDamage( gentity_t *self, gentity_t *traceEnt, vec3_t dir, vec3_t
int modPowerLevel = -1;
int dmg = 0; //Q_irand( 1, 3 );
int dmg2 = 0;
int healthoverride = 0;

if (self->client->ps.fd.forcePowerLevel[FP_DRAIN] == FORCE_LEVEL_1)
{
dmg = 2; //because it's one-shot
}
else if (self->client->ps.fd.forcePowerLevel[FP_DRAIN] == FORCE_LEVEL_2)
{
dmg = 3;
if (self->client->sess.raceMode)
dmg = -4;
else
dmg = 3;
}
else if (self->client->ps.fd.forcePowerLevel[FP_DRAIN] == FORCE_LEVEL_3)
{
#if _draintest
dmg = g_forceDrainDamage.integer;//4
#else
dmg = 4;
if (g_tweakForce.integer & FT_DRAINDMGNERF) {
healthoverride = 4;
dmg = 3;
}
else
dmg = 4;
#endif
}

Expand Down Expand Up @@ -2185,7 +2192,10 @@ void ForceDrainDamage( gentity_t *self, gentity_t *traceEnt, vec3_t dir, vec3_t
if (self->client->ps.stats[STAT_HEALTH] < self->client->ps.stats[STAT_MAX_HEALTH] &&
self->health > 0 && self->client->ps.stats[STAT_HEALTH] > 0)
{
self->health += dmg;
if (healthoverride)
self->health += healthoverride;
else
self->health += dmg;
if (self->health > self->client->ps.stats[STAT_MAX_HEALTH])
{
self->health = self->client->ps.stats[STAT_MAX_HEALTH];
Expand Down Expand Up @@ -5969,7 +5979,9 @@ void WP_ForcePowersUpdate( gentity_t *self, usercmd_t *ucmd )
if ( !(self->client->ps.fd.forcePowersActive & (1<<FP_LIGHTNING)) )
self->client->force.lightningDebounce = level.time;

if ( (!self->client->ps.fd.forcePowersActive || self->client->ps.fd.forcePowersActive == (1 << FP_DRAIN)) && //whats up with fp_drain being mentioned here
//Com_Printf("Forcepowers active %i for %s\n", self->client->ps.fd.forcePowersActive, self->client->pers.netname);

if ( (!self->client->ps.fd.forcePowersActive || self->client->ps.fd.forcePowersActive == (1 << FP_DRAIN) || (self->client->ps.fd.forceGripBeingGripped && g_tweakForce.integer & FT_FIXGRIPPEDREGEN && self->client->ps.fd.forcePowersActive == (1 << FP_LEVITATION) && self->client->pers.cmd.upmove <= 0)) && //whats up with fp_drain being mentioned here
((self->client->sess.movementStyle != MV_TRIBES) || !(self->client->ps.eFlags & EF_JETPACK_ACTIVE)) &&
((self->client->sess.movementStyle != MV_TRIBES) || ((self->client->jetPackDebReduce + 250) < level.time)) && //Extra time here?
!self->client->ps.saberInFlight && (self->client->ps.stats[STAT_MOVEMENTSTYLE] != MV_SPEED) && (self->client->ps.weapon != WP_SABER || !BG_SaberInSpecial(self->client->ps.saberMove)) )
Expand Down
71 changes: 71 additions & 0 deletions docs/Defrag Mapping Guide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
**JKA Defrag Map Maker guide:**

This guide will focus on making defrag maps for jaPRO mod. I don't know of any other JKA MP mod that does defrag timers except for CTF fast-caps (timers based on ctf flag capture).

**Base concept:**
A defrag course has a start and a finish. Players spawn before the start line and their timer is started by crossing the start line. Their timer is stopped when they hit the finish line and their time is recorded if it is a personal best. Leaderboards exist to see how they compare to other players. You can have many courses in one map.

**Movement styles:**
Currently there are 19 different movement styles in jaPRO defrag. A movement style is simply a different set of movement physics the player can choose to use. Leaderboards are specific to a movement style. The styles are:

1. **siege**
This is the style used in siege mode of JKA. There is no air acceleration. Players typically use rolling, ramps, and wall-strafe to increase speed.
2. **jka**
Default JKA style.
3. **qw**
Inspired by quakeworld but with JKA force jump. Players can make tighter turns while maintaining their speed. It also has ramp jumps.
4. **cpm**
Inspired by CPM from q3 defrag. No forcejumps, faster basespeed (320), high air control, rampjumps, and double jumps.
5. **q3**
Inspired by vanilla mode from q3 defrag. Like CPM but without increased air control.
6. **pjk**
Like CPM but with force jump, and regular JKA basespeed.
7. **wsw**
Inspired by Warsow. Like CPM but with a dash move and a walljump move, which lets you redirect your speed to any angle without speed loss. Its version of ramp jump also does not reduce your horizontal speed at all.
8. **rjq3**
Q3 with rocket launcher. Players propel them selves with rocket knockback.
9. **rjcpm**
RJQ3 with air control.
10. **swoop**
Riding a swoop bike. It's modified to give you a grav boost option which lowers your gravity for a few seconds.
11. **jetpack**
Jetpack but with different jetpack physics and spiderman style grapple hook that lets you properly swing. It also has detpacks for self knockback boost.
12. **speed**
JKA but with faster base speed (same as forcespeed). It only gives you 50force which does not regen.
13. **sp**
SP inspired physics (higher air accelerate and your speed is halved when you land unless the landing point is lower than your takeoff point).
14. **slick**
All ground friction is removed and has super fast acceleration while on ground. No forcejump.
15. **botcpm**
Same as CPM but it has a button that makes your strafe angles perfect.
16. **coop**
2 player mode. JKA physics with weaopns that let you boost eachother.
17. **ocpm**
Version of CPM which tries to be mroe accurate to Q3 defrags version of CPM. Specifically 125fps physics and velocity snapping.
18. **tribes**
Tries to mimic the skiing and jetpack style of movement from the tribes franchise. Has a gun that you can self boost with, and a thrust pack that you can trade forcepoints for speed with.
19. **surf**
Inspired by CS 1.6 physics. Can be used for surf maps or bhop maps.

Seaons:
Furthermore, leaderboards can be broken down per season. The current seasons typically lasts 1 year, for example season 5 was 2023. A global leaderboard still exists which ignores seasons.

**Mapping tips:**
There are a few things to take into account when making a defrag map. First is the start area. You don't want players to be able to build up a huge amount of speed before hitting the start trigger, as this is typically seen as boring gameplay called "loop starting". Areas before the start brush are typically very small and have a patchmesh infront of the start trigger so players cant re-trigger the start once they go past it. There are other options (trigger_newpush) that let you dynamically cap a players speed in certain directions (to prevent "loop starting") while in the start.
Checkpoint triggers are popular to scatter throughout the course so players can gauge their speed throughout the run.
Try to make use of noise, message, etc fields on the triggers. If you have multiple courses, the message field on the finish trigger is mandatory and acts as the courses name.

**New/modified entities:**
See here https://github.com/videoP/jaPRO/blob/master/scripts/japro_entities.def

**Examples:**
Challenge style map: https://www.youtube.com/watch?v=NqDdeNQkCjI

Race map on built on an existing map: https://www.youtube.com/watch?v=m7W-88DdPKk

Climb style map: https://www.youtube.com/watch?v=crhV1V4IndM

Torture style map: https://www.youtube.com/watch?v=WlgNCN6MbtQ

Montage: https://www.youtube.com/watch?v=sy3HdYTx0yE

File renamed without changes.