Difficulty Levels

Moderators: The Artistocrats, Order of Battle Moderators

Post Reply
StuccoFresco
2nd Lieutenant - Panzer IVF/2
2nd Lieutenant - Panzer IVF/2
Posts: 662
Joined: Sun Feb 10, 2019 11:10 am

Difficulty Levels

Post by StuccoFresco »

Hi all, is it possible to change the Strenght bonus given by difficulty levels?
GabeKnight
Lieutenant-General - Karl-Gerat 040
Lieutenant-General - Karl-Gerat 040
Posts: 3710
Joined: Mon Nov 27, 2017 10:24 pm

Re: Difficulty Levels

Post by GabeKnight »

StuccoFresco wrote: Tue Aug 11, 2020 5:54 am Hi all, is it possible to change the Strenght bonus given by difficulty levels?
I guess not. But you can use the #stimpack cheat to boost individual units.
StuccoFresco
2nd Lieutenant - Panzer IVF/2
2nd Lieutenant - Panzer IVF/2
Posts: 662
Joined: Sun Feb 10, 2019 11:10 am

Re: Difficulty Levels

Post by StuccoFresco »

Well I was trying to make all units default max strength 20. Changing it in the units.csv does nothing.
huckc
Master Sergeant - U-boat
Master Sergeant - U-boat
Posts: 533
Joined: Mon Apr 24, 2017 1:38 pm
Location: USA

Re: Difficulty Levels

Post by huckc »

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):

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()
Getting set int App..cctor():

Code: Select all

unitStrengthMaxFactor = new float[] { 0.6f, 0.8f, 1f, 1.15f, 1.3f };
huckc
Master Sergeant - U-boat
Master Sergeant - U-boat
Posts: 533
Joined: Mon Apr 24, 2017 1:38 pm
Location: USA

Re: Difficulty Levels

Post by huckc »

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:

Code: Select all

	0x9A, 0x99, 0x19, 0x3F, 0xCD, 0xCC, 0x4C, 0x3F, 0x00, 0x00, 0x80, 0x3F,
	0x33, 0x33, 0x93, 0x3F, 0x66, 0x66, 0xA6, 0x3F
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:

Code: Select all

	0x9A, 0x99, 0x19, 0x3F, 0xCD, 0xCC, 0x4C, 0x3F, 0x00, 0x00, 0x80, 0x3F,
	0x33, 0x33, 0x93, 0x3F, 0x00, 0x00, 0xC0, 0x3F
And now I'm getting pummeled by 15 strength enemy aircraft at Pearl Harbor :D
Attachments
2020-11-16 13_46_16-Greenshot.jpg
2020-11-16 13_46_16-Greenshot.jpg (71.89 KiB) Viewed 1101 times
GabeKnight
Lieutenant-General - Karl-Gerat 040
Lieutenant-General - Karl-Gerat 040
Posts: 3710
Joined: Mon Nov 27, 2017 10:24 pm

Re: Difficulty Levels

Post by GabeKnight »

huckc wrote: Mon Nov 16, 2020 7:41 pm And now I'm getting pummeled by 15 strength enemy aircraft at Pearl Harbor :D
Cool. All this hex-stuff reminds of the things I was doing when I was young... :lol:

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?
huckc wrote: Mon Nov 16, 2020 4:33 pm

Code: Select all

unitStrengthMaxFactor = new float[] { 0.6f, 0.8f, 1f, 1.15f, 1.3f };
Interesting, so it's not really "12" HP with difficulty 4? :shock:
huckc
Master Sergeant - U-boat
Master Sergeant - U-boat
Posts: 533
Joined: Mon Apr 24, 2017 1:38 pm
Location: USA

Re: Difficulty Levels

Post by huckc »

GabeKnight wrote: Mon Nov 16, 2020 10:50 pm
huckc wrote: Mon Nov 16, 2020 7:41 pm And now I'm getting pummeled by 15 strength enemy aircraft at Pearl Harbor :D
Cool. All this hex-stuff reminds of the things I was doing when I was young... :lol:

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?
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
Lieutenant-General - Karl-Gerat 040
Lieutenant-General - Karl-Gerat 040
Posts: 3710
Joined: Mon Nov 27, 2017 10:24 pm

Re: Difficulty Levels

Post by GabeKnight »

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... :mrgreen:
Post Reply

Return to “Order of Battle : World War II - Scenario Design”