BF1 Bonuses Research: Elite Training

Started by Dark_Phantom, May 03, 2024, 04:56:46 AM

Previous topic - Next topic
May 03, 2024, 04:56:46 AM Last Edit: May 03, 2024, 01:37:31 PM by Dark_Phantom
Hello there!

One of my big projects recently has been to try to document some of the bonuses in BF1 and get a much clearer idea of what they do and possibly patch one of the cut bonuses, Surplus Supplies.
In my research, I was trying to figure out what Elite Training exactly does.  I don't have a complete answer, but I have a much better one than I did before, and can confirm that it does work.  The reason it is disputed is because it is tuned so low that it may seem negligible.  I posted this in the GT server but here is a more permanent and visible home for it.
The chunk of code I identified is this.  I've not ran the function all the way down to the nitty gritty but here's the gist:
Code (cpp) Select
                    /* Is Elite Training Selected? */
      if (*(char *)(&mActiveBonus + local_cc) < '\0') {
        ...
        CombatUtil::SetAISkill(4,0);
       ...
      }


If Elite Training was selected, it runs the function CombatUtil::SetAISkill(4,0).  Tracing this function down, it does some calculations which boil down to this:

team1difficulty = currentSkillLevel + 4
team2difficulty = currentSkillLevel + 0


CombatUtil::SetAIAimValues() then runs and detects the difficulty levels (set through global variables) and sets a bunch of variables like weapon spread/yaw/damping, whatever all that means other than "their aiming sucks less if the difficulty is higher".  (You can see this behavior in SPTest AI cam, the AI can be looking at you and then practically shoot sideways on lower difficulties)

This is not the only influence on AI behavior, but as far as Elite Training is concerned, this seems to be the impact, although it's quite possible that I've missed more stuff in the AIUtil/CombatUtil functionality.  The way the game calls bonuses is extremely haphazard lol.

As a requested test, I changed the value at 1841e8 in the SWBFSpy exe (which is currently 6A 04 in hex) and modified the 04 to another value.  In this case, I picked 20 in hex (which is actually 32).  The easiest way to select the bonus is to play Birth of the Rebellion and pick any map.  Your AI should perform much better than previously, and in the couple of battles I tried (on Hard!), they won the battle by themselves and it wasn't really close.

My research is mainly conducted using Ghidra.  Let me know what you think.
The BOBclan:  A Rich History


Quote from: Unit 33 on November 29, 2014, 03:44:44 AM
'Please, tell me more about the logistics of the design of laser swords being wielded by space wizards' - Some guy on the internet.

Interesting findings!

I suspected that Elite Training would indeed be related to an increase in difficulty against the player-controlled side, but I think I have never noticed it enough since I started playing SWBF.
AR Clan Discord: https://discord.gg/gmmSm5e | Star Wars: Battlefront - 20th Anniversary (2004-2024)