Difficulty Levels
Moderators: The Artistocrats, Order of Battle Moderators
-
StuccoFresco
- 2nd Lieutenant - Panzer IVF/2

- Posts: 662
- Joined: Sun Feb 10, 2019 11:10 am
Difficulty Levels
Hi all, is it possible to change the Strenght bonus given by difficulty levels?
-
GabeKnight
- Lieutenant-General - Karl-Gerat 040

- Posts: 3710
- Joined: Mon Nov 27, 2017 10:24 pm
Re: Difficulty Levels
I guess not. But you can use the #stimpack cheat to boost individual units.StuccoFresco wrote: ↑Tue Aug 11, 2020 5:54 am Hi all, is it possible to change the Strenght bonus given by difficulty levels?
-
StuccoFresco
- 2nd Lieutenant - Panzer IVF/2

- Posts: 662
- Joined: Sun Feb 10, 2019 11:10 am
Re: Difficulty Levels
Well I was trying to make all units default max strength 20. Changing it in the units.csv does nothing.
Re: Difficulty Levels
I'm also interested in changing max difficulty from +3 enemy strength to +5.
Taking a quick look at the game files and it isn't an easy change it seems but I think I found it in the C# code (Assembly-CSharp.dll):
Getting set int App..cctor():
Taking a quick look at the game files and it isn't an easy change it seems but I think I found it in the C# code (Assembly-CSharp.dll):
Code: Select all
App.unitStrengthMaxFactor : Single[]
Used By
AITasks.KillEnemy..ctor(Double)
AITasks.RefuelAndRepair.EvaluateStateValue(GameState, GameState) : Double
AITasks.StayAlive.Initialise(GameState) : Void
Alliance.GetMaxUnitStrength() : Int32
App..cctor()
CampaignUI.CheckCoreValue() : Void
NewUI.CampaignUI.CheckCoreValue() : Void
Unit.ApplyStrengthDifficultyMod(GameState) : Void
Assigned By
App..cctor()Code: Select all
unitStrengthMaxFactor = new float[] { 0.6f, 0.8f, 1f, 1.15f, 1.3f };Re: Difficulty Levels
So continuing from the above I able to able to change the strength modifiers using a hex editor by searching for the current array initializer above but in hex form:
You'll notice there's 20 values there, four for each difficulty level starting the with the first one. And since I was interesting in editing the last difficulty and making it 1.5x instead of 1.3x, I changed the final four values giving us this:
And now I'm getting pummeled by 15 strength enemy aircraft at Pearl Harbor 
Code: Select all
0x9A, 0x99, 0x19, 0x3F, 0xCD, 0xCC, 0x4C, 0x3F, 0x00, 0x00, 0x80, 0x3F,
0x33, 0x33, 0x93, 0x3F, 0x66, 0x66, 0xA6, 0x3FCode: Select all
0x9A, 0x99, 0x19, 0x3F, 0xCD, 0xCC, 0x4C, 0x3F, 0x00, 0x00, 0x80, 0x3F,
0x33, 0x33, 0x93, 0x3F, 0x00, 0x00, 0xC0, 0x3F- Attachments
-
- 2020-11-16 13_46_16-Greenshot.jpg (71.89 KiB) Viewed 1101 times
-
GabeKnight
- Lieutenant-General - Karl-Gerat 040

- Posts: 3710
- Joined: Mon Nov 27, 2017 10:24 pm
Re: Difficulty Levels
Cool. All this hex-stuff reminds of the things I was doing when I was young...
Okay, it seems to be easy for everybody to de-compile and read the function's source code, but what's the deal with re-compiling? Why use a hex editor?
Interesting, so it's not really "12" HP with difficulty 4?huckc wrote: ↑Mon Nov 16, 2020 4:33 pmCode: Select all
unitStrengthMaxFactor = new float[] { 0.6f, 0.8f, 1f, 1.15f, 1.3f };
Re: Difficulty Levels
Using a hex editor is significantly easier than re-compiling code which I can only assume also has protections/barriers in place to prevent end users from doing so. When compiling, everything needs to be 100% in place and in working order, including the use of private keys and dependency systems that they would only possess.GabeKnight wrote: ↑Mon Nov 16, 2020 10:50 pmCool. All this hex-stuff reminds of the things I was doing when I was young...![]()
Okay, it seems to be easy for everybody to de-compile and read the function's source code, but what's the deal with re-compiling? Why use a hex editor?
-
GabeKnight
- Lieutenant-General - Karl-Gerat 040

- Posts: 3710
- Joined: Mon Nov 27, 2017 10:24 pm
Re: Difficulty Levels
Okay, thanks for the info.
BTW, how does it play against 15HP enemy units? Winnable?
... I'm curious....Please do tell after you've played some of the German scens/campaigns...
BTW, how does it play against 15HP enemy units? Winnable?
... I'm curious....Please do tell after you've played some of the German scens/campaigns...
