2017-07-20 23:11 EDT


View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0002788FSSCPAIpublic2013-02-10 04:36
ReporterWoolie Wool 
Assigned ToThe_E 
PriorityimmediateSeveritymajorReproducibilityalways
StatusresolvedResolutionfixed 
PlatformAMD Phenom IIOSWindowsOS VersionVista
Product Version3.6.16 
Target VersionFixed in Version 
Summary0002788: Difficulty level appears locked on Insane
DescriptionThe difficulty level for the game appears stuck on Insane, at least in regards to weapon fire rates and damage scaling. No matter how low you set the difficulty, enemy weapons will always do full damage.
Steps To ReproduceSet the difficulty to Very Easy. Load an FSPort mission with no shields (for instance, Small Deadly Space from the original FS1 campaign, The Fifth Column from the Twist of Fate Demo). Allow enemies to shoot you.

Vasudan Light Lasers will do 2-4% damage depending on whether one or both bolts hit.

Terran Turrets will do around 18% damage.

Being near (<150 m) an exploding Ma'at in Small Deadly Space will do catastrophic damage, perhaps killing you outright.

On older builds (the one I cross-tested on was dated 12/28/11), damage done by these weapons on Very Easy is one fourth this amount, as intended.
TagsNo tags attached.
Attached Files
  • ? file icon WeaponDamageTest.fs2 (5,260 bytes) 2013-02-07 19:00
  • patch file icon 2788.patch (4,750 bytes) 2013-02-09 18:32 -
    Index: shiphit.cpp
    ===================================================================
    --- shiphit.cpp	(revision 9527)
    +++ shiphit.cpp	(working copy)
    @@ -1930,8 +1930,7 @@
     	int other_obj_is_asteroid;
     	int other_obj_is_debris;
     	int other_obj_is_ship;
    -	float shp_diff_dmg_scale = 1.0f;	// Nuke: we will multiply difficulty related damage factors against this, so they can be passed to armor type GetDamage calls.
    -	float sub_diff_dmg_scale = 1.0f;	// Nuke
    +	float difficulty_scale_factor = 1.0f;
     
     	Assert(ship_obj);	// Goober5000
     	Assert(hitpos);		// Goober5000
    @@ -1989,8 +1988,7 @@
     			// Do a little "skill" balancing for the player in single player and coop multiplayer
     			if (ship_obj->flags & OF_PLAYER_SHIP)	{
     				// Nuke - store it in a couple factor and we will apply it where needed
    -				shp_diff_dmg_scale *= The_mission.ai_profile->player_damage_scale[Game_skill_level];
    -				sub_diff_dmg_scale *= The_mission.ai_profile->player_damage_scale[Game_skill_level];
    +				difficulty_scale_factor *= The_mission.ai_profile->player_damage_scale[Game_skill_level];
     			}		
     		}
     	}
    @@ -2011,7 +2009,7 @@
     			Assert((beam_get_weapon_info_index(other_obj) >= 0) && (beam_get_weapon_info_index(other_obj) < Num_weapon_types));
     			if (((Weapon_info[beam_get_weapon_info_index(other_obj)].subtype != WP_LASER) || special_check) && (Player_obj != NULL) && (ship_obj == Player_obj))
     			{
    -				ship_hit_pain(damage * shp_diff_dmg_scale);
    +				ship_hit_pain(damage * difficulty_scale_factor);
     			}	
     		}
     		if (other_obj->type == OBJ_WEAPON)
    @@ -2019,7 +2017,7 @@
     			Assert((Weapons[other_obj->instance].weapon_info_index > -1) && (Weapons[other_obj->instance].weapon_info_index < Num_weapon_types));
     			if (((Weapon_info[Weapons[other_obj->instance].weapon_info_index].subtype != WP_LASER) || special_check) && (Player_obj != NULL) && (ship_obj == Player_obj))
     			{
    -				ship_hit_pain(damage * shp_diff_dmg_scale);
    +				ship_hit_pain(damage * difficulty_scale_factor);
     			}
     		}
     	}	// read violation sanity check
    @@ -2032,7 +2030,7 @@
     
     	//	if ship is already dying, shorten deathroll.
     	if (shipp->flags & SF_DYING) {
    -		shiphit_hit_after_death(ship_obj, (damage * shp_diff_dmg_scale));
    +		shiphit_hit_after_death(ship_obj, (damage * difficulty_scale_factor));
     		return;
     	}
     	
    @@ -2079,21 +2077,21 @@
     			}
     			
     			float pre_shield = damage; // Nuke: dont use the difficulty scaling in here, since its also appled in Armor_type.GetDamage. dont want it to apply twice
    -			float pre_shield_ss = (subsystem_damage * sub_diff_dmg_scale); // Nuke - same here
    +			float pre_shield_ss = subsystem_damage; // Nuke - same here
     
     			if (piercing_pct > 0.0f) {
     				damage = pre_shield * (1.0f - piercing_pct);
     			}
     
     			// Nuke: apply pre_shield difficulty scaling here, since it was meant to be applied through damage
    -			pre_shield *= shp_diff_dmg_scale;
    +			pre_shield *= difficulty_scale_factor;
     
     			if(shipp->shield_armor_type_idx != -1)
     			{
     				// Nuke: this call will decide when to use the damage factor, but it will get used, unless the modder is dumb (like setting +Difficulty Scale Type: to 'manual' and not manually applying it in their calculations)
    -				damage = Armor_types[shipp->shield_armor_type_idx].GetDamage(damage, dmg_type_idx, shp_diff_dmg_scale);
    +				damage = Armor_types[shipp->shield_armor_type_idx].GetDamage(damage, dmg_type_idx, difficulty_scale_factor);
     			} else { // Nuke: if that didn't get called, difficulty would not be applied to damage so apply it here
    -				damage *= shp_diff_dmg_scale;
    +				damage *= difficulty_scale_factor;
     			}
     
     			damage = apply_damage_to_shield(ship_obj, quadrant, damage);
    @@ -2122,7 +2120,7 @@
     	if ( (damage > 0.0f) || (subsystem_damage > 0.0f) )	{
     		int	weapon_info_index;
     		int armor_flags = 0;		
    -		float pre_subsys = (subsystem_damage * sub_diff_dmg_scale); // Nuke: should be the last time we need to do this in this function
    +		float pre_subsys = subsystem_damage; // Nuke: should be the last time we need to do this in this function
     		bool apply_hull_armor = true;
     		bool apply_diff_scale = true;
     
    @@ -2159,13 +2157,13 @@
     			
     			if(shipp->armor_type_idx != -1)
     			{
    -				damage = Armor_types[shipp->armor_type_idx].GetDamage(damage, dmg_type_idx, shp_diff_dmg_scale);
    +				damage = Armor_types[shipp->armor_type_idx].GetDamage(damage, dmg_type_idx, difficulty_scale_factor);
     				apply_diff_scale = false;
     			}
     		}
     		// Nuke: this is done incase difficulty scaling is not applied into damage by getDamage() above
     		if (apply_diff_scale) {
    -			damage *= shp_diff_dmg_scale; // Nuke: we can finally stop doing this now
    +			damage *= difficulty_scale_factor; // Nuke: we can finally stop doing this now
     		}
     
     		// continue with damage?
    
    patch file icon 2788.patch (4,750 bytes) 2013-02-09 18:32 +

-Relationships
+Relationships

-Notes

~0014686

Woolie Wool (reporter)

3.6.14 RC8 is not affected by this bug so it must have crept in during the 3.6.15 cycle.

~0014687

niffiwan (developer)

Last edited: 2013-02-07 05:47

View 2 revisions

I have reproduced this with a little debug code to output the amount of damage taken by ships. I think it was introduced in r8629.

Tested in Easy (2/5), no mods active

r8628 I'm taking 6.75 hull damage from Subach's
r8629 I'm taking 13.5 hull damage from Subach's

I'll attach my test mission (which is just a hacked up version of an Axem test mission :nervous:)

~0014688

Yarn (developer)

I can confirm that the bug was indeed introduced in r8629.

I have uploaded another test mission that should test this bug more reliably.

~0014689

Zacam (administrator)

Last edited: 2013-02-08 22:05

View 2 revisions

Has anyone thought to check the damage scaling (pre and post) based on ALL the difficulty levels?

And yes. Woolie was kind enough to do exactly that over IRC with me.
Hull integrity damage reduction on an unshielded Apollo from a Terran Turret using the FS2 default AI profile, from Very Easy to Insane: 5, 9, 12, 15, 18

Is the results from a build pre-revision and the test build (which is current trunk with the revision backed out, but that has other side effects)

Build with the revision in question: the damage is 18, always on all difficulties.

~0014691

niffiwan (developer)

Last edited: 2013-02-08 22:11

View 3 revisions

Aww... I just did that as well with Yarn's mission - well, not to let the results go to waste :)

No Mod active - Shivan Mega Laser firing at an Ursa

r8628
    very easy: 7.500000
    easy: 15.000000
    medium: 19.500000
    hard: 25.500000
    insane: 30.000000

r8629
    very easy: 30.000000
    easy: 30.000000
    medium: 30.000000
    hard: 30.000004
    insane: 30.000000

(also removed my test mission from the ticket)

Also note: the firing speed of the Basilisk did change, with hard & insane being noticeably faster than very easy / easy / medium

~0014692

Woolie Wool (reporter)

Last edited: 2013-02-08 22:53

View 5 revisions

Confirmed that this actually isn't related to insane difficulty, but simply ignoring all damage scaling by difficulty.

I created a new AI profile called "LOL U R DED" with the damage factor on Insane set to 50000. Turrets still did 18% damage to the Apollo with newer builds.

In older builds, after correcting a stupid typo, a single ML-16 shot could kill the player in this profile on Insane in older builds. So it indeed has nothing to do with Insane but rather the complete absence of damage scaling.

Profile is:

$Profile name: LOL U R DED
$Player Damage Factor: 0.25, 0.5, 1, 1.5, 50000
#End

~0014693

Yarn (developer)

Woolie Wool, I think I know why that's happening: you entered 0.5 as 0,5, which the game interprets as two values instead of one. See what happens if you correct that.

~0014694

Woolie Wool (reporter)

Corrected, see note edit above. Everything ran as expected, instant overkill in older builds, 18% damage in newer builds.

~0014695

Zacam (administrator)

So, it's not that it cares about the difficulty level scaling, it's that it is getting some arbitrary value and using that regardless of the difficulty scaling.

That -should- make it easier to track down.

~0014696

Woolie Wool (reporter)

The +Difficulty Scale Type: parameter in armor.tbl is also broken and does nothing.

~0014697

The_E (administrator)

Attached a patch that may fix this. Please test.

~0014698

niffiwan (developer)

Patch appears to fix the damage scaling. Tested with Yarn's mission:

Very Easy -> Insane:
7.500000
15.000000
19.500000
25.500000
30.000000

~0014699

The_E (administrator)

Patch committed to trunk in 9529. The issues with +Difficulty Scale Type: will be dealt with in Mantis 2793.
+Notes

-Issue History
Date Modified Username Field Change
2013-02-07 00:03 Woolie Wool New Issue
2013-02-07 00:07 Woolie Wool Note Added: 0014686
2013-02-07 05:45 niffiwan Note Added: 0014687
2013-02-07 05:45 niffiwan Assigned To => niffiwan
2013-02-07 05:45 niffiwan Status new => confirmed
2013-02-07 05:46 niffiwan File Added: hurtme.fs2
2013-02-07 05:47 niffiwan Note Edited: 0014687 View Revisions
2013-02-07 05:47 niffiwan Assigned To niffiwan =>
2013-02-07 19:00 Yarn File Added: WeaponDamageTest.fs2
2013-02-07 19:00 Yarn Note Added: 0014688
2013-02-08 19:00 Zacam Note Added: 0014689
2013-02-08 22:05 Zacam Note Edited: 0014689 View Revisions
2013-02-08 22:08 niffiwan Note Added: 0014691
2013-02-08 22:08 niffiwan File Deleted: hurtme.fs2
2013-02-08 22:09 niffiwan Note Edited: 0014691 View Revisions
2013-02-08 22:11 niffiwan Note Edited: 0014691 View Revisions
2013-02-08 22:18 Woolie Wool Note Added: 0014692
2013-02-08 22:19 Woolie Wool Note Edited: 0014692 View Revisions
2013-02-08 22:27 Woolie Wool Note Edited: 0014692 View Revisions
2013-02-08 22:44 Yarn Note Added: 0014693
2013-02-08 22:48 Woolie Wool Note Edited: 0014692 View Revisions
2013-02-08 22:52 Woolie Wool Note Added: 0014694
2013-02-08 22:53 Woolie Wool Note Edited: 0014692 View Revisions
2013-02-08 23:01 Zacam Note Added: 0014695
2013-02-08 23:27 Woolie Wool Note Added: 0014696
2013-02-09 18:32 The_E File Added: 2788.patch
2013-02-09 18:33 The_E Note Added: 0014697
2013-02-09 22:37 niffiwan Note Added: 0014698
2013-02-10 04:36 The_E Note Added: 0014699
2013-02-10 04:36 The_E Status confirmed => resolved
2013-02-10 04:36 The_E Resolution open => fixed
2013-02-10 04:36 The_E Assigned To => The_E
+Issue History