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
|
|
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
|
|
|
|
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 
|
|
silversurfer |
  |
Messages:2791
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. 
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%20MODReport message to a moderator
|
|
|
|
|
|
|
|
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 
|
|
silversurfer |
  |
Messages:2791
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%20MODReport message to a moderator
|
|
|
|
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 
|
|
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.
Report message to a moderator
|
|
|
|
|
|
|
|
Goto Forum:
Current Time: Mon Mar 24 18:52:06 GMT+2 2025
Total time taken to generate the page: 0.00841 seconds
|