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 next message
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.
Re: Sandro's STOMP: Change "travel time reduction" to "travel speed increase" internally.[message #359769 is a reply to message #359768] Sun, 26 April 2020 20:10 Go to previous messageGo to next message
silversurfer

 
Messages:2760
Registered:May 2009
There is no need to rename anything. The description doesn't match the functionality. The idea was to reduce travel time and the description should reflect that, so we need to fix the description.

What worries me more are the background values, because they don't even work properly. The (incorrect) description in Backgrounds.xml says:
<!-- +-% travel speed modifiers, -20 to 20-->
<travel_foot>0</travel_foot>
<travel_car>0</travel_car>
<travel_air>0</travel_air>

and then the variables in the code:
ustravelbackground_foot = max(ustravelbackground_foot, pSoldier->GetBackgroundValue(BG_TRAVEL_FOOT));
ustravelbackground_car  = max(ustravelbackground_car,  pSoldier->GetBackgroundValue(BG_TRAVEL_CAR));
ustravelbackground_air  = max(ustravelbackground_air,  pSoldier->GetBackgroundValue(BG_TRAVEL_AIR));

All of the above variables are unsigned int, so how can they ever be negative, especially considering that the minimum value is initialized at 0.

Stacking several survivalists doesn't make sense to me anyway. If anything, they would probably slow the team down because they are constantly debating which path the team should choose. big grin
I would limit it to one survivalist bonus only, but anyone can do that already by setting MAX_STACKABLE_LESS_TRAVEL_TIME_BONUSES to 1.

It's good that background bonuses don't stack. I wouldn't even allow them to apply a bonus to the whole team. They are personal benefits, not a tour guide ability.
I won't change that however, but the background calculation needs to be fixed to allow negative values. At least that makes sense, because if you have someone in your team that loves to smell the roses, he/she should slow you down.



Wildfire Maps Mod 6.07 on SVN: https://ja2svn.mooo.com/source/ja2/branches/Wanne/JA2%201.13%20Wildfire%206.06%20-%20Maps%20MOD

Re: Sandro's STOMP: Change "travel time reduction" to "travel speed increase" internally.[message #359771 is a reply to message #359768] Sun, 26 April 2020 20:56 Go to previous messageGo to next message
edmortimer

 
Messages:1354
Registered:January 2015
Location: Home Free
Quote:
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 like the idea of increasing speed as opposed to reducing travel time. I also like the idea of diminishing returns, with stacking adding only very little - 2 heads are better than 1 (and 2 who know what to do are better than 1 who does and 1 who doesn't), and we're only talking very manageable-size groups of people.

[Updated on: Sun, 26 April 2020 20:58]







Re: Sandro's STOMP: Change "travel time reduction" to "travel speed increase" internally.[message #359772 is a reply to message #359771] Sun, 26 April 2020 21:29 Go to previous messageGo to next message
sevenfm

 
Messages:2323
Registered:December 2012
Location: Russian Federation
I like the idea, except the changing options names part.



7609+AI (r1719) | Experimental project | Unofficial Modpack | Youtube | Trunk (r8910) | 1.13 Starter Docs | 1.13 How to get

Кто в Москве не бывал, красоты не видал.


Re: Sandro's STOMP: Change "travel time reduction" to "travel speed increase" internally.[message #359777 is a reply to message #359772] Sun, 26 April 2020 22:27 Go to previous messageGo to next message
silversurfer

 
Messages:2760
Registered:May 2009
Instead of a hard cap or on top of it we could simply use this formula to set the "ubSurvivalistHere" value:
ubSurvivalistHere = (2*ubSurvivalistHere)/(1+ubSurvivalistHere)
This provides a nice curve with diminishing returns. If you had 10 survivalists you'd get the max value of 1.82. So from 1 survivalist to 10 you'd have a range of 30% to 55% reduction of travel time (with GROUP_TIME_SPENT_FOR_TRAVELLING_BY_FOOT_REDUCTION = 30). I think that is somewhat reasonable.



Wildfire Maps Mod 6.07 on SVN: https://ja2svn.mooo.com/source/ja2/branches/Wanne/JA2%201.13%20Wildfire%206.06%20-%20Maps%20MOD

Re: Sandro's STOMP: Change "travel time reduction" to "travel speed increase" internally.[message #359779 is a reply to message #359777] Mon, 27 April 2020 00:18 Go to previous messageGo to next message
edmortimer

 
Messages:1354
Registered:January 2015
Location: Home Free
Quote:

Instead of a hard cap or on top of it we could simply use this formula to set the "ubSurvivalistHere" value:

ubSurvivalistHere = (2*ubSurvivalistHere)/(1+ubSurvivalistHere)

This provides a nice curve with diminishing returns. If you had 10 survivalists you'd get the max value of 1.82. So from 1 survivalist to 10 you'd have a range of 30% to 55% reduction of travel time (with GROUP_TIME_SPENT_FOR_TRAVELLING_BY_FOOT_REDUCTION = 30). I think that is somewhat reasonable.

Sounds good. I'd even make the max value of 10 survivalists even less, maybe around 1.5 - but I'm not quibbling over 0.35. happy






Re: Sandro's STOMP: Change "travel time reduction" to "travel speed increase" internally.[message #359798 is a reply to message #359779] Mon, 27 April 2020 23:57 Go to previous messageGo to next message
silversurfer

 
Messages:2760
Registered:May 2009
Ok folks, things have changed in r8794.

Fixes:
  • Survivalist trait descriptions have been corrected for most languages (I don't speak Russian or Chinese).
  • Survivalist trait bonus was applied to air travel though it shouldn't.
  • Backgrounds <travel_air> modifier wasn't used before by the game. Now it is.
  • Backgrounds <travel_x> speed modifiers can now use negative values.

Changes:
  • Survivalist travel speed bonus stacks for multiple survivalists but with very diminishing returns. Formula is:
    (2.5 * num survivalists) / (1 + 1.5 * num survivalists)
    That means your travel time reduction goes from 30% (default value of "GROUP_TIME_SPENT_FOR_TRAVELLING_BY_FOOT_REDUCTION") to 46,875% with 10 survivalists in the team. MAX_STACKABLE_LESS_TRAVEL_TIME_BONUSES still applies, so if you set this to 2 for example, you'll only get the bonus for two survivalists even if you have ten in the team!
  • Background <travel_foot> modifier - a slow soldier in your team will slow the whole team down. Yes, this sucks and it is intended. Get rid of him, but do it quietly...
    One fast soldier will not increase the speed of the whole team anymore. He is no survivalist, he can just march faster.
  • Background <travel_car> modifier - the game automatically picks the highest bonus, because naturally this merc will pose as the driver (in strategic view there is no driver).
  • Background <travel_air> modifier - the game automatically picks the highest bonus, because naturally this merc will pose as the co-pilot. If you only have mercs with negative modifiers in your team they will slow down the flight, because they will distract the pilot.



Wildfire Maps Mod 6.07 on SVN: https://ja2svn.mooo.com/source/ja2/branches/Wanne/JA2%201.13%20Wildfire%206.06%20-%20Maps%20MOD

Re: Sandro's STOMP: Change "travel time reduction" to "travel speed increase" internally.[message #359814 is a reply to message #359798] Tue, 28 April 2020 16:30 Go to previous messageGo to next message
LootFragg

 
Messages:349
Registered:August 2009
Location: Berlin, Germany
Hey, thanks. This does remove the "stacking survivalists" issue.

Question: Does this mean the lowest travel time reduction / highest travel time increase will be used for the group?

Discussion: The backgrounds should then probably be adjusted. Dr. Stella Trammel, for instance, is an old lady with near zero AGI but she has a travel speed increase / travel time reduction background.

Discussion: I had always seen backgrounds as more of a "how does a character act within a group" thing. Soldier/leader types would push travel speed not through their own physical prowess but by pushing everyone else. It felt weird to me that Dr. Trammel, being old and slow in the field, would elevate group speed in spite of her being a relentless pusher. AGI should get factored in but that's another topic.

Discussion: Might be good to have the default Survivalist travel time reduction reduced to ~20 as well, since the benefit of a 42% group speed increase still feels very strong for a single trait point and seemingly mandatory. Players can customize, of course, but I am in favor of sensible defaults. I feel that not having at least one IMP with the trait on default settings is a waste. Until you're at the point of using Skyrider and vehicles for every move, the trait multiplies squad performance beyond what I'd expect.

Discussion: Is there an easy way to change its effect based on terrain? As in giving less bonus on roads but max bonus in dense jungle. So far, it simply takes already calculated travel time and reduces it, meaning you're 42% faster in forests, in deserts, on mountains and on paved roads. Feels unintuitive that Bear Grylls would have the group travel at jogging speed and still reduce the amount of exhaustion and need for sleep when taking a well-beaten path without obstacles. But I guess changing that would mean hooking into the strategic pathfinding which I have no clue about, as it would ultimately lead to different paths for different squads going from the same place to the same destination. Grunty would walk down the road, Shadow would move through the underbrush.
Re: Sandro's STOMP: Change "travel time reduction" to "travel speed increase" internally.[message #359816 is a reply to message #359814] Tue, 28 April 2020 18:13 Go to previous messageGo to next message
silversurfer

 
Messages:2760
Registered:May 2009
LootFragg wrote on Tue, 28 April 2020 15:30

Question: Does this mean the lowest travel time reduction / highest travel time increase will be used for the group?
The chosen modifier depends on the travel type (foot=lowest,air=highest,vehicle=highest).

LootFragg wrote on Tue, 28 April 2020 15:30

Discussion: The backgrounds should then probably be adjusted. Dr. Stella Trammel, for instance, is an old lady with near zero AGI but she has a travel speed increase / travel time reduction background.
She may be very tall and have long legs that allow her to walk faster without being agile. Walk speed is not a matter of agility. In a team her small bonus won't help her anyway, because the lowest modifier is used for foot travel.



Wildfire Maps Mod 6.07 on SVN: https://ja2svn.mooo.com/source/ja2/branches/Wanne/JA2%201.13%20Wildfire%206.06%20-%20Maps%20MOD

Re: Sandro's STOMP: Change "travel time reduction" to "travel speed increase" internally.[message #359818 is a reply to message #359816] Tue, 28 April 2020 20:30 Go to previous messageGo to next message
edmortimer

 
Messages:1354
Registered:January 2015
Location: Home Free
Quote:
Discussion: The backgrounds should then probably be adjusted. Dr. Stella Trammel, for instance, is an old lady with near zero AGI but she has a travel speed increase / travel time reduction background.

She may be very tall and have long legs that allow her to walk faster without being agile. Walk speed is not a matter of agility. In a team her small bonus won't help her anyway, because the lowest modifier is used for foot travel.

As Silver Surfer said, also maybe many other things and perhaps a little of all of them, like experience on long marches, sheer determination to keep moving, a personal affinity to hiking, whatever the mind can think up for reasons that Stella isn't just a cardboard cut-out of her Agility score . . . she has other dimensions that a normal civ with her Agility score wouldn't have . . . and maybe that's why she is doing what she's doing.






Re: Sandro's STOMP: Change "travel time reduction" to "travel speed increase" internally.[message #359983 is a reply to message #359818] Sun, 10 May 2020 02:03 Go to previous messageGo to next message
LootFragg

 
Messages:349
Registered:August 2009
Location: Berlin, Germany
Then I misunderstood the post.

silversurfer
One fast soldier will not increase the speed of the whole team anymore. He is no survivalist, he can just march faster.
I thought it meant there is no travel time reduction for backgrounds anymore. I don't know what it means then.
Re: Sandro's STOMP: Change "travel time reduction" to "travel speed increase" internally.[message #359985 is a reply to message #359983] Sun, 10 May 2020 11:49 Go to previous message
silversurfer

 
Messages:2760
Registered:May 2009
It means that the slowest merc will define your team speed on foot. If you have one merc, who can march especially fast ( travel_foot > 0 ) and the rest of the team can not, he will not profit from his background. He can't just drag the rest by the hairs. If he is alone or with other fast mercs, he will profit from his background.
This also means that one slow merc ( travel_foot < 0 ) will slow the whole team down even if you have a survivalist, because their normal speed is already lower than that of a team without negative travel_foot modifiers.



Wildfire Maps Mod 6.07 on SVN: https://ja2svn.mooo.com/source/ja2/branches/Wanne/JA2%201.13%20Wildfire%206.06%20-%20Maps%20MOD

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


Current Time: Wed Oct 28 17:01:57 EET 2020

Total time taken to generate the page: 0.01105 seconds