Home » MODDING HQ 1.13 » v1.13 Feature Requests » Sandro's STOMP: Change "travel time reduction" to "travel speed increase" internally. (It's about the Survival trait and additional background bonuses.,)
Sandro's STOMP: Change "travel time reduction" to "travel speed increase" internally.[message #359768] Sun, 26 April 2020 18:28 Go to previous message
LootFragg is currently offline LootFragg

 
Messages:349
Registered:August 2009
Location: Berlin, Germany
Oi.

Sandro's traits are still some of the nicer things in life and I wouldn't want to miss 'em. One pet peeve of mine is changing values towards zero though. Always leads to quirks and feels unintuitive because maths.

I identified the relevant code (I hope) and changed a few characters. Thing is, I'm having trouble getting Visual Studio Community 2019 installed, so I haven't been able to compile the changes I made. It would be nice if someone could do this, see if it works as intended.

The problem is travel time reduction as opposed to travel speed increase. The SURVIVAL trait gives it, the value can be changed in Skills_Settings.ini.
[Survival]
GROUP_TIME_SPENT_FOR_TRAVELLING_BY_FOOT_REDUCTION = 30
GROUP_TIME_SPENT_FOR_TRAVELLING_IN_VEHICLE_REDUCTION = 15
MAX_STACKABLE_LESS_TRAVEL_TIME_BONUSES = 2

In the game, this gets displayed in the tooltip as "+30% group traveling speed between sectors if traveling by foot". Internally, it's not a speed increase but a time reduction, which leads to potential awkwardness as two default survivalists increase group speed to 250%, which can be mildly increased through backgrounds.

I want to change travel time being not Normal*(1-Mod) but Normal/(1+Mod). So instead of erasing time (+100% speed meaning you teleport instantly), I want travel time to be based on speed, giving diminishing returns the more survivalists you stack. I love diminishing returns.

------

I looked at source revision 8785.

Items to change:

GameSettings.h (only Variable Name)
GameSettings.cpp (Variable Name and INI Variable Name)
Laptop/personnel.cpp (only Variable Name)
Strategic/Strategic Movement.cpp (Variable Name and operators in calculation)

Data-1.13/Skills_Settings.ini (only INI Variable Name, Description already mentions speed)

First off, changing variable names to avoid confusion.
In GameSettings.h, GameSettings.cpp, personnel.cpp and StrategicMovement.cpp, change
gSkillTraitValues.ubSVGroupTimeSpentForTravellingFoot
to
gSkillTraitValues.ubSVGroupTravelSpeedIncreaseOnFoot
and
gSkillTraitValues.ubSVGroupTimeSpentForTravellingVehicle
to
gSkillTraitValues.ubSVGroupTravelSpeedIncreaseInVehicle

INI Variable name as well, as found in GameSettings.cpp and Skills_Settings.ini. Change
GROUP_TIME_SPENT_FOR_TRAVELLING_BY_FOOT_REDUCTION
to
GROUP_TRAVEL_SPEED_INCREASE_ON_FOOT
and
GROUP_TIME_SPENT_FOR_TRAVELLING_IN_VEHICLE_REDUCTION
to
GROUP_TRAVEL_SPEED_INCREASE_IN_VEHICLE
as well as
MAX_STACKABLE_LESS_TRAVEL_TIME_BONUSES
to
MAX_STACKABLE_TRAVEL_SPEED_BONUSES
(Funny enough, gSkillTraitValues.ubSVMaxBonusesToTravelSpeed is already correct)

------

In StrategicMovement.cpp, lines 3584 ff. (given revision 8785):

The part that looks like:
			// on foot, the bonus should be higher
			if( fFoot )
			{
				// however, we cannot be quicker than the helicopter
				iBestTraverseTime = max( 10, (iBestTraverseTime * (100 - (ubSurvivalistHere * gSkillTraitValues.ubSVGroupTimeSpentForTravellingFoot)) / 100) );

				iBestTraverseTime = max( 10, (iBestTraverseTime * (100 - ustravelbackground_foot) / 100));
			}
			// all other types (except air)
			else if ( fAir )
			{
				// however, we cannot be quicker than the helicopter
				iBestTraverseTime = max( 10, (iBestTraverseTime * (100 - (ubSurvivalistHere * gSkillTraitValues.ubSVGroupTimeSpentForTravellingVehicle)) / 100) );

				// yes, this background allows us to fly faster :-)
				iBestTraverseTime = max( 9,  (iBestTraverseTime * (100 - ustravelbackground_air) / 100));
			}
			else
			{
				// however, we cannot be quicker than the helicopter
				iBestTraverseTime = max( 10, (iBestTraverseTime * (100 - (ubSurvivalistHere * gSkillTraitValues.ubSVGroupTimeSpentForTravellingVehicle)) / 100) );

				iBestTraverseTime = max( 10, (iBestTraverseTime * (100 - ustravelbackground_car) / 100));
			}
Change to look like:
			if( fFoot )
			{
				// however, we cannot be quicker than the helicopter
				iBestTraverseTime = max( 10, (iBestTraverseTime / (100 + (ubSurvivalistHere * gSkillTraitValues.ubSVGroupTimeSpentForTravellingFoot)) * 100) );

				iBestTraverseTime = max( 10, (iBestTraverseTime / (100 + ustravelbackground_foot) * 100));
			}
			// all other types (except air)
			else if ( fAir )
			{
				// however, we cannot be quicker than the helicopter
				iBestTraverseTime = max( 10, (iBestTraverseTime / (100 + (ubSurvivalistHere * gSkillTraitValues.ubSVGroupTravelSpeedIncreaseInVehicle)) * 100) );

				// yes, this background allows us to fly faster :-)
				iBestTraverseTime = max( 9,  (iBestTraverseTime / (100 + ustravelbackground_air) * 100));
			}
			else
			{
				// however, we cannot be quicker than the helicopter
				iBestTraverseTime = max( 10, (iBestTraverseTime / (100 + (ubSurvivalistHere * gSkillTraitValues.ubSVGroupTravelSpeedIncreaseInVehicle)) * 100) );

				iBestTraverseTime = max( 10, (iBestTraverseTime / (100 + ustravelbackground_car) * 100));
			}
This changes the formula into one that goes away from zero instead of approaching it, giving the trait and backgrounds the actual speed increase characteristic promised in the tooltip. +50% speed means taking 33% less travel time. +100% speed means going twice as fast and taking half the time instead of teleporting to Meduna and back in the blink of an eye.

The variable name changes are supposed to reflect exactly that, keeping consistency between descriptions, tooltips, variable names and internal calculations. Hope I didn't leave anything out.

I did not look at energy cost reduction because that kinda makes sense intuitively. Spend X% less energy than others for the action. Ehh. Could be better but pff. I don't care.

-----

Would be great if you could change that. Numerical issues like that bug me in general but it's only after playing with Igor for a while and having his squad arrive >40% faster that I felt I had to address this, especially as a Survivalist IMP running with Igor and Wink can triple the entire squad's speed which almost puts Hamous and Skyrider to shame. Suparu sanic supeedo!

Opinion
I noticed background travel speed bonuses only take the highest one into account. I feel they could be stackable as well, adding all the bonuses together as with the changed formula, this only provides diminishing returns. So +5%, +6%, +3%, +5% and +4% would only be +23% speed multiplicative with the Survivalist bonus, a mere 18.7% travel time reduction. I'm thinking they should probably be added on the same level as the survivalist trait bonus instead of being multiplicative, but even as a multiplier, adding all bonuses together makes intuitive sense and doesn't break the game. Like, 10 athletic military people with +5% speed only lead to a 33% reduction in travel time. Makes sense. Would love your opinion on whether backgrounds should stack.

Report message to a moderator

Master Sergeant
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: JA 2 1.13 Wiki/Website Update
Next Topic: Visible equipment on character sprites?
Goto Forum:
  


Current Time: Sat Jun 28 16:09:10 GMT+3 2025

Total time taken to generate the page: 0.00521 seconds