Jump to content


Photo

Is there a way to remove the unit health modifiers given by the difficulty setting for the Campaign in DC or SS?


4 replies to this topic

#1 Daemonjax

Daemonjax
  • Members
  • 8 posts

Posted 14 March 2021 - 06:49 AM

According to the wiki for Dark Crusade (https://dow.fandom.c...rusade/Campaign):

 

Easy:
    Player units have 250% health
    Enemy units have 25% health
Normal:
    Player units have 200% health
    Enemy units have 100% health
Hard:
    Player units have 100% health
    Enemy units have 150% health
 
I want to set Hard's enemy health modifier to 100% instead of 150%.  The reason is: I'm playing Dark Crusade with the backported Skirmish AI 3.20 mod (and I modified that so that the mapdb feature is enabled for the campaign), and it's just too hard.  I can beat the campaign on hard with the 2.60 version, but the 3.20 version is just too good when they have 150% health.
 
I looked for the code myself by grepping all the DC extracted files.  Closest thing I found was in difficultylevel.scar and wxpdifficultylevel.scar (by updating the entity list to include tau and necron units & buildings), but that must be from the base game and winter assault because the entity lists in those files haven't been updated with the new races in DC, so they can't work.  
 
I suspect it's hardcoded, but I figured I'd ask here.  
 
If this has never been done before (because it is hardcoded), I suppose I could fix the functions in difficultylevel.scar and wxpdifficultylevel.scar and use them to undo the hardcoded modifiers (by multiplying all enemy unit health by 2/3).  But I'd rather be wrong about it being hardcoded and I'm just missing something.

Edited by Daemonjax, 14 March 2021 - 07:28 AM.


#2 jONES1979

jONES1979

    eL-jONESON

  • Members
  • 1,720 posts
  • Location:Еду в Саратов стрелять в пиратов!

Posted 21 March 2021 - 03:41 AM

It is coded somewhere in attributes or in company settings, as far as I remember


Edited by jONES1979, 21 March 2021 - 03:41 AM.


#3 Moreartillery

Moreartillery
  • Members
  • 247 posts
  • Projects:Cinematic Battles

Posted 23 March 2021 - 11:17 PM

In corsix open attrib>tables>tuning and look in metamap_difficulty_modifiers.

Don't modify wxpdifficultylevel.scar, doing that caused a crash for me in soulstorm.


Developer of the Cinematic Battles mod.

https://www.moddb.co...nematic-battles


#4 Oh_Horizon_x

Oh_Horizon_x
  • New Members
  • 1 posts

Posted 25 March 2023 - 09:57 AM

Sorry for the necroposting, but this is apparently the ONLY place on the internet that even addresses this topic, may as well keep it going.

I have a year of Corsix experience, mostly for DC. I am trying to change the values similar to OP up there. I can tell you confidently that editing difficultylevel.scar and/or the modifiers under the tuning file have ZERO effect on the health of units in-game. I've even completely deleted sections of SCAR coding and it didn't even so much as show up in the warnings.log. Because I am a novice, I can only speculate as to why. It appears to me that the files I am editing in this case are benign for some reason, but that doesn't make much sense. I have a general understanding of how Vanilla > WA > DC > SS are related to each other in terms of files and folders, but modding via Corsix for multiplayer and skirmish is very direct, whereas this has me scratching my head.

Can anyone help me?



#5 Daemonjax

Daemonjax
  • Members
  • 8 posts

Posted 14 January 2025 - 04:18 PM

I'll take a look at it soon, because it was something I planned on doing for myself -- setting units to 100%/100% health for... some setting, probably normal. 

 

What I'd really _like_ to do is shift _all_ the difficulty setting "to the left", basically replacing easy with the current normal settings, etc. in order to open up a difficulty setting higher than hard but not sure if its worth spending the time to do the testing for that. 

 

But I'll probably just make normal 100%/100% instead of 200%/100%... leaving easy and hard the way it is now -- it'll make testing simple, too because i just need to test ONE thing. 

 

 

Update:

 

My testing confims this works:

 

data/attrib/tables/tuning.rgd

... such that the record for: player_metamap_difficulty_modifiers->normal->modifier_01->value = 1 (instead of 2, so it just multiplies player health by 1)

 

Note1: modifying the same value in data/attrib/tuning/player_metamap_difficulty_modifiers.rgd has no effect ingame.  Not sure why, didn't investigate further.

Note2: Comparing the original (from for Dark Crusade 1.2 cd version) to the modified tuning.rgd in a hex editor...

 

total offset (decimal) = 78236

original  : 00 00 00 40 (little endian single float32 =  2)

modified: 00 00 80 3F (little endian single float32 = 1)

 

Those are the only 4 bytes that need to be modified for this simple change.  Corsix's Mod Studio does also modify 4 bytes within the the file header as well, but that has nothing to do with this modification -- I can't make heads or tails of it.  I'm a little curious, but I'm unlikely to find an answer without digging through the code for the mod studio... and I'm not about to do that.  My best guess is that it's an artifact from how it actually exports the rgb after editing -- it probably converts it to lua first, and then back to rgd before saving. 

 

If someone could point me to header format info for .RGD files, that would be nice.

 

Anyways, if you're using a mod that includes a modified tuning.rgd for some reason you should be able to just hexedit in that one float32 change and it should still work as expected.

 

--------------------------------------------------------------------------------------------

 

Here's an archive that contains 3 files for Dark Crusade 1.2 (cd version):

 

1) the original (as extracted using corsix's mod studio)

2) a modified version (as modified and exported using corsix's mod studio)

3) another modified version (made by hexediting the original from #1)

 

#2 and #3 work ingame exactly the same (player health on normal is set to 100%).

 

Testing includes: starting new compaign on normal, choosing space marines, checking health on commander screen, and attacking some territory and then checking the commander's health in the battlescape.  So, not exactly exhaustive, but it should be fine for all maps and all commanders

 

 

https://drive.google...iew?usp=sharing


Edited by Daemonjax, 14 January 2025 - 06:28 PM.




Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users