Jump to content

Cellprocesses

Members
  • Posts

    14
  • Joined

  • Last visited

Posts posted by Cellprocesses

  1. So Im playing with adding new player/NPC stats to the game

    I started with adding new variables to the PlayerStateBase class defined in q_shared.h. I set default values in that definition, then set new values depending on the NPC class in the NPC_Begin function located in NPC_Spawn, ie:

     

    if ( ent->client->NPC_class == CLASS_KYLE)
    {
    	ent->client->ps.wisdom = 12;
    	ent->client->ps.charisma = 20;
    	ent->client->ps.dexterity = 17;
    }


    I can then access this variable elsewhere in functions in say, wp_saber.cpp, using:

     

    attacker->client->ps.wisdom;


    So I now have added custom attributes to all NPCs and the player, and can access them in functions, but I cant seem to set specific values for the player, when I did

     

    if ( ent->client->NPC_class == CLASS_PLAYER)
    {
    	ent->client->ps.wisdom = 10;
    	ent->client->ps.charisma = 9;
    	ent->client->ps.dexterity = 11;
    }


    the default values never update, because NPC_Begin(...) only initializes NPCs, and the player isnt an NPC. Ive done some digging trying to find where the player gets initialized, but cant find it. SP_NPC_Player(...) in NPC_Spawn.cpp looked like it, but adding the lines to set custom attributes at the end of that function did nothing.

    Where is the player entity initialized in OpenJK?

  2. Okay, so some exciting news, I have the first new force power working, force body is now a thing in jedi academy:

     

    if ( self->client->ps.forcePowerLevel[FP_BODY] == FORCE_LEVEL_1)
    	{	if(self->health >= 70)
    		{
    			self->health -= 20;
    			int currentForcePoints = self->client->ps.forcePower;
    			self->client->ps.forcePower = increaseToAMax(currentForcePoints, 40, 100);
    			return;
    		}
    	}
    	else if ( self->client->ps.forcePowerLevel[FP_BODY] == FORCE_LEVEL_2)
    	{
    		if(self->health >= 60)
    		{
    			self->health -= 10;
    			int currentForcePoints = self->client->ps.forcePower;
    			self->client->ps.forcePower = increaseToAMax(currentForcePoints, 50, 100);
    			return;
    		}
    	}
    	else if ( self->client->ps.forcePowerLevel[FP_BODY] == FORCE_LEVEL_3)
    	{
    		if(self->health >= 55)
    		{
    			self->health -= 5;
    			int currentForcePoints = self->client->ps.forcePower;
    			self->client->ps.forcePower = increaseToAMax(currentForcePoints, 60, 100);
    			return;
    		}
    	}


    The most obvious use is to chain with spamming force lightning blasts on level 3 since you can just stand there and overwhelm a jedi opponent by repeatedly hitting them with a never ending stream of lightning.

    Still has a few minor bugs, cant figure out how to keybind it, it doesnt show up in the menu for assigning force powers to keys, and the icon doesnt have a string associated with it when you select it from the force powers carousel.

  3. Okay some further ideas so far...

    Want to add to the base class for all NPCs and player base attributes on the model used in Knights of the Old Republic. @mrwonko, is there any map of the base classes for npcs and entities in jedi academy? Ie I think theres a base class for entities so medpacs and npcs can both be force pulled, all npcs inherit from a common parent class?

    So in this base class for npcs that all other Npcs inherit from Ill include

    npc.strength (could affect probability of winning saber locks, isnt there already an attribute for this somewhere?)
    npc.dexterity (affect blasters and saber deflection?)
    npc.constitution (kinda pointless since hitpoints are already defined in the npc configuration files)
    npc.intelligence
    npc.wisdom
    npc.charisma (WIS/CHARISMA is used in KOTOR to decide if certain force powers will work on a target, I cant remember if there are some similar checks to decide if certain force powers will work on a target in Jedi Academy?)
    npc.vitality
     

  4. On 8/19/2024 at 9:32 PM, mrwonko said:

    If you're on Windows using Visual Studio, there's a dropdown to select the type of build to perform, I think typically in the top bar. If you're on Linux/Mac using make, I don't know.

    Did some digging, it appears to work if I run cmake as

     

    cmake -DCMAKE_C_FLAGS=-DNDEBUG -DCMAKE_INSTALL_PREFIX=/home/user/app/openjk ..

     

  5. 2 hours ago, mrwonko said:

    There are a lot of assertions that you can run into when running a debug build. If it's a new one caused by something you added, it's worth understanding why, but don't worry too much about the ones that already trigger. Just do a release build and they'll be ignored, that's how Raven "solved" the issue, too.

    How do you do a release build? Is it some flag I havent set right in make?

  6. Im attaching the little bit of changes Ive got so far if anyone wants to try building their own copy of my tuned build of jedi academy:
     

    Changelog, repeated from the post:

     

    -Redefined all weapons damage, muzzle velocity, shots per blast for shotgun, etc. Strongly reccomend Ultimate Weapons mod with this for best experience
    -Defined scale factors in wp_saber.h for scaling up or down force push range, how hard force push knocks back, force choke range, force choke damage, force protect duration, force absorb duration, force see duration. Mostly just housekeeping the code there so force powers can be tuned easily with new builds.
    -Force push now has a sliding scale of how hard it pushes back opponents. Level 1 is the basic knock them on their ass  youre used to, level 3 literally hurls them across the room like The Force Unleashed.

     

    int forceKnockbackByPushLevel(int pushLevel)
    {
    	switch(pushLevel)
    	{
    		case 0:
    			return 0;
    		case 1:
    			return forceKnockbackBase;
    			// base value is 200
    		case 2:
    			return multiplyAndRoundInteger(1.5, forceKnockbackBase);
    		case 3:
    			return multiplyAndRoundInteger(2.5, forceKnockbackBase);
    		case 4:
    			return multiplyAndRoundInteger(3.5, forceKnockbackBase);
    		// quadding up to 800 knockback  was a bit insane, just force pull
    		// on a group of stormtroopers was literally sending them 200 m
    		// off a cliff behind the player			
    	}
    }

    -Force push blocking isnt 100% effective in duels. Added a probability function for dice rolls, jedi opponents have to pass a weighted dice roll to not be pushed back by force push.
    -If youve ever been annoyed by how jedi\reborn opponents can stand there all day and shrug at you while you fire the sniper rifle at them, today is your lucky day! Added a probability check for the sniper rifle dodge move so it only happens some of the time. Obviously not weighted correctly right now at 50/50.

    Part of the logic of probability checks is to make the saber wielding opponents seem more human, it doesnt make any sense how the player usually gets dissolved 3-4 times a game by a well timed sniper blast but the same weapon in the hands of the player is useless against jedi opponents. Same idea for force push, etc, etc.

  7. On 7/22/2024 at 4:09 PM, mrwonko said:

    There's a limited bsp editor in the files section, though I think the version on GitHub is newer. It cannot change the level geometry, but you should be able to edit the enemy placements.

    I believe you cannot increase the number of selectable levels per tier without coding, but it's probably possible to insert additional levels in the multi-level sequences in-between (Hoth/Vjun/Taspir). You can also replace existing levels entirely.

    Look for a target_levelchange using the bsp editor, that should define which level to load next, or if the game should go back to the level selection.

    Thank you for that reference, I dont have a windows machine handy, but I will definitely try it when I have one available

    Im pretty sure youd have to be careful which NPCs you delete and add, as certain NPCs in the game are needed to be or not be for the cutscenes to work right, off the top of my head, if you dont kill the stormtroopers in the smelting room on taspir, npc kyles cutscene will get stuck reacting to the enemies and not play right, in the last taspir cutscene where alora taunts you before encountering rosh theres a reborn standing next to her that jumps down to fight you at the end of the cutscene, if you kill the reborn before the cutscene starts, it gets stuck etc.

    How are the scripted motions for things like that assigned to npcs, when you compile the map in radiant you have to link it?

    On 7/22/2024 at 4:09 PM, mrwonko said:

    There's a limited bsp editor in the files section, though I think the version on GitHub is newer. It cannot change the level geometry, but you should be able to edit the enemy placements.

    I believe you cannot increase the number of selectable levels per tier without coding, but it's probably possible to insert additional levels in the multi-level sequences in-between (Hoth/Vjun/Taspir). You can also replace existing levels entirely.

    Look for a target_levelchange using the bsp editor, that should define which level to load next, or if the game should go back to the level selection.

    Also also, for the level selection screen, isnt that stored in a lua or whatever compiled script type the sdk uses? Has anyone tried creating a template for that so that the between levels menu could be modified? Also could allow for options like selecting points in the core force abilities like push/pull/lightsaber defense/jump, etc.

  8. Sorry for the very slow response on this.

    One unfortunate note, you can change the blaster bolt velocities and damage in the source, but it causes stability issues, the one error that constantly causes crashes is the assertion in the qmath random number generator:

     

    // Returns an integer min <= x <= max (ie inclusive)
    int irand( int min, int max )
    {
    	int	result;
    	
    	assert((max - min) < 8*QRAND_MAX);
    
    	max++;
    	holdrand = (holdrand * 214013L) + 2531011L;
    	result = holdrand >> 17;
    	result = ((result * (max - min)) >> 15) + min;
    
    	return result;
    }


    I believe theres a min/max restriction of something like 32768 for the limits of the int datatype? and for some reason upping blaster bolt speed constantly causes random number requests that exceed that limit?

    Oddly enough, my kludge above seems to solve most of the issues, is it possible that the original code was thinking of the data limits under 32 bit which was the norm in 2003, and now 64 bit machines have a much larger range for the int datatype so it doesnt exceed the data limits of int in a 64 bit environment?

    The assertion error also sometimes crashes for other odd things like tavions ground slam attack so it could be inherent in the code, or maybe the changes do affect stability

  9. For fun, the changes I made this time around in weapons.h

     

    /*
    ===========================================================================
    Copyright (C) 1999 - 2005, Id Software, Inc.
    Copyright (C) 2000 - 2013, Raven Software, Inc.
    Copyright (C) 2001 - 2013, Activision, Inc.
    Copyright (C) 2013 - 2015, OpenJK contributors
    
    This file is part of the OpenJK source code.
    
    OpenJK is free software; you can redistribute it and/or modify it
    under the terms of the GNU General Public License version 2 as
    published by the Free Software Foundation.
    
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
    
    You should have received a copy of the GNU General Public License
    along with this program; if not, see <http://www.gnu.org/licenses/>.
    ===========================================================================
    */
    
    // Filename:-	weapons.h
    //
    // Note that this is now included from both server and game modules, so don't include any other header files
    //	within this one that might break stuff...
    
    #ifndef __WEAPONS_H__
    #define __WEAPONS_H__
    
    #include "../qcommon/q_shared.h"
    
    typedef enum //# weapon_e
    {
    	WP_NONE,
    
    	// Player weapons
    	WP_SABER,			// player and NPC weapon
    	WP_BLASTER_PISTOL,	// player and NPC weapon
    	WP_BLASTER,			// player and NPC weapon
    	WP_DISRUPTOR,		// player and NPC weapon
    	WP_BOWCASTER,		// NPC weapon - player can pick this up, but never starts with them
    	WP_REPEATER,		// NPC weapon - player can pick this up, but never starts with them
    	WP_DEMP2,			// NPC weapon - player can pick this up, but never starts with them
    	WP_FLECHETTE,		// NPC weapon - player can pick this up, but never starts with them
    	WP_ROCKET_LAUNCHER,	// NPC weapon - player can pick this up, but never starts with them
    	WP_THERMAL,			// player and NPC weapon
    	WP_TRIP_MINE,		// NPC weapon - player can pick this up, but never starts with them
    	WP_DET_PACK,		// NPC weapon - player can pick this up, but never starts with them
    	WP_CONCUSSION,		// NPC weapon - player can pick this up, but never starts with them
    
    	//extras
    	WP_MELEE,			// player and NPC weapon - Any ol' melee attack
    
    	//when in atst
    	WP_ATST_MAIN,
    	WP_ATST_SIDE,
    
    	// These can never be gotten directly by the player
    	WP_STUN_BATON,		// stupid weapon, should remove
    
    	//NPC weapons
    	WP_BRYAR_PISTOL,	// NPC weapon - player can pick this up, but never starts with them
    
    	WP_EMPLACED_GUN,
    
    	WP_BOT_LASER,		// Probe droid	- Laser blast
    
    	WP_TURRET,			// turret guns
    
    	WP_TIE_FIGHTER,
    
    	WP_RAPID_FIRE_CONC,
    
    	WP_JAWA,
    	WP_TUSKEN_RIFLE,
    	WP_TUSKEN_STAFF,
    	WP_SCEPTER,
    	WP_NOGHRI_STICK,
    
    	//# #eol
    	WP_NUM_WEAPONS
    } weapon_t;
    
    #define FIRST_WEAPON		WP_SABER		// this is the first weapon for next and prev weapon switching
    #define MAX_PLAYER_WEAPONS	WP_STUN_BATON	// this is the max you can switch to and get with the give all. - FIXME: it's actually this one *minus* one... why?
    
    // AMMO_NONE must be first and AMMO_MAX must be last, cause weapon load validates based off of these vals
    typedef enum //# ammo_e
    {
    	AMMO_NONE,
    	AMMO_FORCE,		// AMMO_PHASER
    	AMMO_BLASTER,	// AMMO_STARFLEET,
    	AMMO_POWERCELL,	// AMMO_ALIEN,
    	AMMO_METAL_BOLTS,
    	AMMO_ROCKETS,
    	AMMO_EMPLACED,
    	AMMO_THERMAL,
    	AMMO_TRIPMINE,
    	AMMO_DETPACK,
    	AMMO_MAX
    } ammo_t;
    
    
    typedef struct weaponData_s
    {
    	char	classname[32];		// Spawning name
    	char	weaponMdl[64];		// Weapon Model
    	char	firingSnd[64];		// Sound made when fired
    	char	altFiringSnd[64];	// Sound made when alt-fired
    //	char	flashSnd[64];		// Sound made by flash
    //	char	altFlashSnd[64];	// Sound made by an alt-flash
    	char	stopSnd[64];		// Sound made when weapon stops firing
    	char	chargeSnd[64];		// sound to start when the weapon initiates the charging sequence
    	char	altChargeSnd[64];	// alt sound to start when the weapon initiates the charging sequence
    	char	selectSnd[64];		// the sound to play when this weapon gets selected
    
    	int		ammoIndex;			// Index to proper ammo slot
    	int		ammoLow;			// Count when ammo is low
    
    	int		energyPerShot;		// Amount of energy used per shot
    	int		fireTime;			// Amount of time between firings
    	int		range;				// Range of weapon
    
    	int		altEnergyPerShot;	// Amount of energy used for alt-fire
    	int		altFireTime;		// Amount of time between alt-firings
    	int		altRange;			// Range of alt-fire
    
    	char	weaponIcon[64];		// Name of weapon icon file
    	int		numBarrels;			// how many barrels should we expect for this weapon?
    
    	char	missileMdl[64];		// Missile Model
    	char	missileSound[64];	// Missile flight sound
    	float  	missileDlight;		// what is says
    	vec3_t 	missileDlightColor;	// ditto
    
    	char	alt_missileMdl[64];		// Missile Model
    	char	alt_missileSound[64];	// Missile sound
    	float  	alt_missileDlight;		// what is says
    	vec3_t 	alt_missileDlightColor;	// ditto
    
    	char	missileHitSound[64];	// Missile impact sound
    	char	altmissileHitSound[64];	// alt Missile impact sound
    	void	*func;
    	void	*altfunc;
    
    	char	mMuzzleEffect[64];
    	int		mMuzzleEffectID;
    	char	mAltMuzzleEffect[64];
    	int		mAltMuzzleEffectID;
    
    	int		damage;
    	int		altDamage;
    	int		splashDamage;
    	int		altSplashDamage;
    	float	splashRadius;
    	float	altSplashRadius;
    
    } weaponData_t;
    
    
    typedef struct ammoData_s
    {
    	char	icon[64];	// Name of ammo icon file
    	int		max;		// Max amount player can hold of ammo
    } ammoData_t;
    
    // Bryar Pistol
    //--------
    #define BRYAR_PISTOL_VEL			8800	// much faster to properly match what the movies look like
    											// the player shouldnt be able to sidestep incoming stormtrooper fire
    											// at a distance of say across a large room
    #define BRYAR_PISTOL_DAMAGE			55		
    #define BRYAR_CHARGE_UNIT			400.0f	// bryar charging gives us one more unit every 200ms--if you change this, you'll have to do the same in bg_pmove
    
    // E11 Blaster
    //---------
    #define BLASTER_MAIN_SPREAD			1.4f
    #define BLASTER_ALT_SPREAD			3.8f	// my fun theory for this goes like, on the death star in ANH, all of
    											// teh stormtroopers had their blasters on full auto spraying at Luke & co
    											// as fast as possible but their groupings were like
    											// the size of a garage door, while Luke & co used the primary single
    											// shot with half decent accuracy to actually hit something
    											
    											// and maybe now that the remnant is poor they have to conserve ammo by
    											// sticking to single fire mode. 
    #define BLASTER_NPC_SPREAD			1.4f
    #define BLASTER_VELOCITY			8800
    #define BLASTER_NPC_VEL_CUT			1.0f
    #define BLASTER_NPC_HARD_VEL_CUT	1.0f
    #define BLASTER_DAMAGE				55
    #define	BLASTER_NPC_DAMAGE_EASY		55		// damage is much higher than the paltry 6/12/16 of the original game
    #define	BLASTER_NPC_DAMAGE_NORMAL	55 		// the idea here which sort of matches the shows & films is 1 shot will
    #define	BLASTER_NPC_DAMAGE_HARD		55 		// badly wound an unarmoured person, 2 will kill him, and 3 will kill
    											// an armoured one
    											
    											// I think I tried higher damage values for this and it made stormtroopers
    											// a bit too lethal
    
    // Tenloss Disruptor
    //----------
    #define DISRUPTOR_MAIN_DAMAGE			24
    #define DISRUPTOR_NPC_MAIN_DAMAGE_EASY	24
    #define DISRUPTOR_NPC_MAIN_DAMAGE_MEDIUM	24
    #define DISRUPTOR_NPC_MAIN_DAMAGE_HARD	24
    
    #define DISRUPTOR_ALT_DAMAGE			99
    #define DISRUPTOR_NPC_ALT_DAMAGE_EASY	99
    #define DISRUPTOR_NPC_ALT_DAMAGE_MEDIUM	99
    #define DISRUPTOR_NPC_ALT_DAMAGE_HARD	99
    #define DISRUPTOR_ALT_TRACES			3		// can go through a max of 3 entities
    #define DISRUPTOR_CHARGE_UNIT			150.0f	// distruptor charging gives us one more unit every 150ms--if you change this, you'll have to do the same in bg_pmove
    
    // Wookie Bowcaster
    //----------
    #define	BOWCASTER_DAMAGE			67			// dunno what really to do with this one, it packs more punch than
    #define	BOWCASTER_VELOCITY			6600		// blasters, but a bit slower
    #define	BOWCASTER_NPC_DAMAGE_EASY	67
    #define	BOWCASTER_NPC_DAMAGE_NORMAL	67
    #define	BOWCASTER_NPC_DAMAGE_HARD	67
    #define BOWCASTER_SPLASH_DAMAGE		0
    #define BOWCASTER_SPLASH_RADIUS		0
    #define BOWCASTER_SIZE				2
    
    #define BOWCASTER_ALT_SPREAD		5.0f
    #define BOWCASTER_VEL_RANGE			0.3f
    #define BOWCASTER_CHARGE_UNIT		200.0f	// bowcaster charging gives us one more unit every 200ms--if you change this, you'll have to do the same in bg_pmove
    
    // Heavy Repeater
    //----------
    #define REPEATER_SPREAD				1.3f
    #define REPEATER_NPC_SPREAD			1.3f
    #define	REPEATER_DAMAGE				22		// my personal headcanon for this is the DC-15 was chosen specifically
    #define	REPEATER_VELOCITY			8800	// to kill separatist battle droids which are made of tinfoil and good
    #define	REPEATER_NPC_DAMAGE_EASY	22		// intentions. So the deece has a high rate of fire, minimal damage
    #define	REPEATER_NPC_DAMAGE_NORMAL	22		// but good accuracy
    #define	REPEATER_NPC_DAMAGE_HARD	22
    
    #define REPEATER_ALT_SIZE				3	// half of bbox size
    #define	REPEATER_ALT_DAMAGE				105
    #define REPEATER_ALT_SPLASH_DAMAGE		50
    #define REPEATER_ALT_SPLASH_RADIUS		228
    #define	REPEATER_ALT_VELOCITY			1100
    #define	REPEATER_ALT_NPC_DAMAGE_EASY	105
    #define	REPEATER_ALT_NPC_DAMAGE_NORMAL	105
    #define	REPEATER_ALT_NPC_DAMAGE_HARD	105
    
    // DEMP2
    //----------
    #define	DEMP2_DAMAGE				35
    #define	DEMP2_VELOCITY				5800
    #define	DEMP2_NPC_DAMAGE_EASY		35
    #define	DEMP2_NPC_DAMAGE_NORMAL		35
    #define	DEMP2_NPC_DAMAGE_HARD		35
    #define	DEMP2_SIZE					2		// half of bbox size
    
    #define DEMP2_ALT_DAMAGE			45
    #define DEMP2_CHARGE_UNIT			500.0f	// demp2 charging gives us one more unit every 500ms--if you change this, you'll have to do the same in bg_pmove
    #define DEMP2_ALT_RANGE				4096
    #define DEMP2_ALT_SPLASHRADIUS		286
    
    // Golan Arms Flechette
    //---------
    #define FLECHETTE_SHOTS				9		// After some tests I found that having 12 particles per shot was too much for my system, as soon as 
    											// a full room of shotguns opens up the game slows to a crawl and often crashes
    											
    											// I cant say for sure but there may be an engine limit on blaster bolts active at one time
    #define FLECHETTE_SPREAD			4.0f
    #define FLECHETTE_DAMAGE			12
    #define FLECHETTE_VEL				5500
    #define FLECHETTE_SIZE				1
    
    #define FLECHETTE_ALT_DAMAGE		40
    #define FLECHETTE_ALT_SPLASH_DAM	20
    #define FLECHETTE_ALT_SPLASH_RAD	168
    
    // NOT CURRENTLY USED
    #define FLECHETTE_MINE_RADIUS_CHECK		200
    #define FLECHETTE_MINE_VEL				1000
    #define FLECHETTE_MINE_DAMAGE			100
    #define FLECHETTE_MINE_SPLASH_DAMAGE	200
    #define FLECHETTE_MINE_SPLASH_RADIUS	200
    
    // Personal Rocket Launcher
    //---------
    #define	ROCKET_VELOCITY				650		// actually much slower than vanilla, we will see, but I felt rockets
    #define	ROCKET_DAMAGE				130		// were too fast to easily force push back in vanilla
    #define	ROCKET_SPLASH_DAMAGE		80		// a general theme with my changes here, I felt like splash damage for 
    #define	ROCKET_SPLASH_RADIUS		260		// explodey weapons was too low in vanilla, so its been turned up for
    #define ROCKET_NPC_DAMAGE_EASY		130		// this, TDs, concussion, etc.
    #define ROCKET_NPC_DAMAGE_NORMAL	130
    #define ROCKET_NPC_DAMAGE_HARD		130
    #define ROCKET_SIZE					3
    
    #define	ROCKET_ALT_VELOCITY			(ROCKET_VELOCITY*0.5)
    #define ROCKET_ALT_THINK_TIME		100
    
    // Concussion Rifle
    //---------
    //primary
    #define	CONC_VELOCITY				9000
    #define	CONC_DAMAGE					120
    #define CONC_NPC_SPREAD				1.0f
    #define	CONC_NPC_DAMAGE_EASY		120
    #define	CONC_NPC_DAMAGE_NORMAL		120
    #define	CONC_NPC_DAMAGE_HARD		120
    #define	CONC_SPLASH_DAMAGE			50
    #define	CONC_SPLASH_RADIUS			250
    //alt
    #define CONC_ALT_DAMAGE				90//100
    #define CONC_ALT_NPC_DAMAGE_EASY	90
    #define CONC_ALT_NPC_DAMAGE_MEDIUM	90
    #define CONC_ALT_NPC_DAMAGE_HARD	90
    
    // Emplaced Gun
    //--------------
    #define EMPLACED_VEL				8000	// very fast
    #define EMPLACED_DAMAGE				150		// and very damaging
    #define EMPLACED_SIZE				5		// make it easier to hit things
    
    // ATST Main Gun
    //--------------
    #define ATST_MAIN_VEL				7000	//
    #define ATST_MAIN_DAMAGE			125		//
    #define ATST_MAIN_SIZE				3		// make it easier to hit things
    
    // ATST Side Gun
    //---------------
    #define ATST_SIDE_MAIN_DAMAGE				75
    #define ATST_SIDE_MAIN_VELOCITY				6300
    #define ATST_SIDE_MAIN_NPC_DAMAGE_EASY		75
    #define ATST_SIDE_MAIN_NPC_DAMAGE_NORMAL	75
    #define ATST_SIDE_MAIN_NPC_DAMAGE_HARD		75
    #define ATST_SIDE_MAIN_SIZE					4
    #define ATST_SIDE_MAIN_SPLASH_DAMAGE		10	// yeah, pretty small, either zero out or make it worth having?
    #define ATST_SIDE_MAIN_SPLASH_RADIUS		16	// yeah, pretty small, either zero out or make it worth having?
    
    #define ATST_SIDE_ALT_VELOCITY				1100
    #define ATST_SIDE_ALT_NPC_VELOCITY			600
    #define ATST_SIDE_ALT_DAMAGE				130
    
    #define ATST_SIDE_ROCKET_NPC_DAMAGE_EASY	30
    #define ATST_SIDE_ROCKET_NPC_DAMAGE_NORMAL	50
    #define ATST_SIDE_ROCKET_NPC_DAMAGE_HARD	90
    
    #define	ATST_SIDE_ALT_SPLASH_DAMAGE			130
    #define	ATST_SIDE_ALT_SPLASH_RADIUS			200
    #define ATST_SIDE_ALT_ROCKET_SIZE			5
    #define ATST_SIDE_ALT_ROCKET_SPLASH_SCALE	0.5f	// scales splash for NPC's
    
    // Stun Baton
    //--------------
    #define STUN_BATON_DAMAGE			22
    #define STUN_BATON_ALT_DAMAGE		22
    #define STUN_BATON_RANGE			25
    
    // Laser Trip Mine
    //--------------
    #define LT_DAMAGE			150
    #define LT_SPLASH_RAD		256.0f
    #define LT_SPLASH_DAM		90
    
    #define LT_VELOCITY			250.0f
    #define LT_ALT_VELOCITY		1000.0f
    
    #define PROX_MINE_RADIUS_CHECK		190
    
    #define LT_SIZE				3.0f
    #define LT_ALT_TIME			2000
    #define	LT_ACTIVATION_DELAY	1000
    #define	LT_DELAY_TIME		50
    
    // Thermal Detonator
    //--------------
    #define TD_DAMAGE			105		// in universe, getting hit with a TD blast without wearing armour is instant kill
    #define TD_NPC_DAMAGE_CUT	1.0f	
    #define TD_SPLASH_RAD		188
    #define TD_SPLASH_DAM		72
    #define TD_VELOCITY			900
    #define TD_MIN_CHARGE		0.15f
    #define TD_TIME				6500	// increased to make this a bit more interesting. Might actually be able to force push them away like this
    #define TD_THINK_TIME		300		// don't think too often?
    #define TD_TEST_RAD			(TD_SPLASH_RAD * 0.8f) // no sense in auto-blowing up if exactly on the radius edge--it would hardly do any damage
    #define TD_ALT_TIME			3000
    
    #define TD_ALT_DAMAGE		105		// exact same stats as regular, just it blows up on contact instead
    #define TD_ALT_SPLASH_RAD	188
    #define TD_ALT_SPLASH_DAM	72
    #define TD_ALT_VELOCITY		600
    #define TD_ALT_MIN_CHARGE	0.15f
    #define TD_ALT_TIME			3000
    
    // Tusken Rifle Shot
    //--------------
    #define TUSKEN_RIFLE_VEL			6900	
    #define TUSKEN_RIFLE_DAMAGE_EASY	70		// damaging
    #define TUSKEN_RIFLE_DAMAGE_MEDIUM	70		// very damaging
    #define TUSKEN_RIFLE_DAMAGE_HARD	70		// extremely damaging
    
    
    #endif//#ifndef __WEAPONS_H__

     

  10. So my first love with Jedi Academy was always the single player campaign. :shrug:

    A few years back I made some basic quality of life improvements, editing the NPC config files under ext_data. Most changes were just  common sense QOL stuff, like normalizing enemies health to 100 like the player, giving various enemies new force abilities (think the low level disciples you encounter in pairs where one has grip or lightning and the other has lightsaber), or weapons, etc. I called it NPC++ and left it.

    If you want to try it you can download it here.

    I also made some modifications to the blaster fire speed and damage as discussed in this thread on jkhub. Needless to say the experience is a lot better, basic stormtroopers are somewhat dangerous in groups, the weapons below the concussion rifle are actually useful; since concentrated weapons fire from say 6-7 stormtroopers at once will gradually overwhelm a level 1 player, dashing in pouring fire with blasters from cover before using the lightsaber actually makes sense now. The original game as shipped was way too lightsaber heavy, with tweaks it finally feels like Dark Forces 2, where you frequently change weapons based on situation.

    Anyways, Im looking for some thoughts on how feasible various ways of further improving the base game may be.

    For things that can be done without modifying the source (priority as this can be shipped as a mod that anyone can use easily without having to recompile):

    The base game still feels a bit empty to me. The number of enemies per level could have been higher, but was probably limited by the hardware capabilities of 2003. IIRC the placement and number of enemies is probably defined in the map BSP files which arent a realistic candidate for recompiling since we dont have the sources to open in the editor? If we did have the sources (I think the editor has the Korriban #1 map available?) we could recompile with more enemies and overwrite some of the map bsp files in assets0.pk3.

    Is there any way there could be say a script hook that triggers every time the game creates say a stormtrooper, so instead of creating that single stormtrooper we create an entire squad? Or a hazardtrooper comes with a support squad of stormtroopers, etc, etc,

    How exactly does the game trigger the end of 1 level returning to the map selection screen or point the game to load the next map between hoth parts 1, 2, korriban parts 1, 2. Is it possible to insert additional levels in between? I seem to recall some talk of a mod adding the feature of walking around the jedi temple for fun in between missions a few years ago?

  11. Did some research into this, was able to find the location for the weapons configuration is in /code/game/weapons.h. Most weapons values are defined in there as numeric constants.

    I believe the breakdown goes like this:

    defined in weapons.dat in a PK3 under ext_data folder:
    -weapon model, icon, which class it ties to, the functions used for effects, etc, etc.
    -what type of ammo it fires
    -how much ammo each shot uses
    -shot range (not sure what exactly this indicates as I cant ever remember a scenario where range mattered in openjk (it just winks out of existence after so many metres?)
    -I believe firetime indicates the cooldown between shots in milliseconds possibly?

    defined in weapons.h in the source:

    -how much damage a blast does

    -how fast the blaster bolt travels
    -the weapons spread, ie how accurate it is, how tight of a grouping you can make shooting at a target at a range
    -how fast some of the altfire modes for the pistol, bowcaster, sniper rifle, etc. take to charge, although this has to be edited in multiple files of the source code to work right
    -detonation timer for things like the thermal detonator
    -how much damage and splash distance various explodey weapons do


     

    A question for the OpenJK team, could it be/is it already implemented that the constants defined in weapons.h could be electively loaded from weapons.dat or some other file? Things like weapons speed and damage could load from config file without completely breaking compatibility with the original binaries. (it would just mean making some mods that are openjk compatible but not with the original game.)

    My suspicion is the only reason it wasnt done that way when the game released back in 2003 was time pressure on release, otherwise it makes perfect sense to have all weapons values load from weapons.dat for tweaking the game while playtesting.

  12. Hey all.

    A few years ago I played around with making Jedi Academy SP a bit better by adjusting some of the wonky aspects of the base games values for NPC health (made NPCs 100 health same as the player), weapon bolt speed (I sped up the speed for things like the E-11 fire as I find it comically slow and not in line with the movies, weapon fire damage, and the spread of weapons fire (ie making the E-11 have a very inaccurate fire when in full auto secondary fire, etc. As I recall the final experience was a lot better, it actually made playing parts of the game on blasters a necessity just like Dark Forces, instead of just using the lightsaber everywhere.

    Anyways I seem to recall I originally modified those speed and damage values by directly editing some file in the source code and recompiling, but Ive long since forgotten which parts of the source to change to get that effect. I vaguely recall somebody on JKHub telling me back then I could accomplish the same thing by putting the right config file in an apk, but I dont know what folder structure and/or content for the file I will need.

    If anybody can point me to the correct part of the source to play with these values again it would also be greatly appreciated.

×
×
  • Create New...