Recent posts

#1
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.
#2
SWBF1 Modding / Re: Sniper range
Last post by Zelenium - April 22, 2024, 01:51:25 PM
All right, I have done it.
It was really hard. The specific number (59) is nowhere to be found, it uses very strange formulas (that don't make sense, I checked).

All bots can now calmly fire at the maximum weapon firing distance. Eventually I'll create a topic where I'll collect my findings on the executable, so that everyone can choose what they need.
Current Instruction:
1. Using HexEditor, navigate to address "141D80"
2. Сhange the code from "D9 44 24 1C" to "D9 E8 90 90"
3. Enjoy snipers killing you through the entire map
#3
SWBF1 Modding / Re: Mission.lvl side import he...
Last post by Led - April 22, 2024, 01:42:29 AM
Thanks for the follow-up!
#4
SWBF1 Modding / Re: Mission.lvl side import he...
Last post by VulkanMU - April 21, 2024, 08:03:49 PM
I figured out what I needed. There are conflicts if you try to read any items that have the same side name and same side prefix. Example rep_inf_macewindu. Calling this class twice from two separate rep.lvl files will cause the second one to have certain graphics overwritten by the first or just not work at all. I've learn quite a bit about side.lvl and mission.lvl files over the past week. I'm thinking of putting together a tutorial on how to create a new side and add it into a shipped map as a 4th local side.
#5
Requests / Re: Dead links all over the si...
Last post by RevanSithLord - April 21, 2024, 06:30:52 PM
https://www.swbfgamers.com/index.php?action=downloads;sa=view;down=1138

Hello. This link seems to be broken. Some reason I cannot open .hta files to use BFBuilder for *ANY* reason on this computer, no matter what I do and if anyone has the .exe versions provided in this download, that'd be greatly appreciated. HTA files are incompatible with my OS and no matter what I searched, there were no legitimate ways to circumvent my problems with the regular HTA files. Just thought I'd let people know the link was broken. I would love to mod BF1, but I simply *cannot* at this point.  :( BF2 is great and all, but I want to mod BF1.
#6
SWBF1 Modding / Re: Mission.lvl side import he...
Last post by Led - April 21, 2024, 08:41:45 AM
Hard to know if it is a limit, but it is easy to find out with a stock map or just try stock sides with the map.

#7
SWBF1 Modding / Re: Mission.lvl side import he...
Last post by VulkanMU - April 20, 2024, 02:20:41 PM
Can you read from two separate side files that have the same name? Or is that an engine limit?
#8
SWBF1 Modding / Re: Mission.lvl side import he...
Last post by Led - April 20, 2024, 01:52:02 PM
That is often a mis-named or mis-located file name for your map or your side.  You should check them.  You are reading in two rep.lvl files.
#9
SWBF1 Modding / Mission.lvl side import help
Last post by VulkanMU - April 20, 2024, 11:15:49 AM
Not sure exactly what I am doing wrong here. After inspecting geo3's Mission.lvl file from Execution at Geonosis mod in a hex editor, I made a similar looking command in my mods Mission.lvl. However it crashes a soon as I try to play the map. The map works if I remove the dc: rep side call. Any ideas what I am doing wrong? Obviously I am not doing something the engine is expecting.

--start header
function ScriptInit()
local CIS = 2
local REP = 1
local ATT = 1
local DEF = 2
--end header
--start objectives
AddMissionObjective(REP,"red", "level.GeoM1.objectives.1");
AddMissionObjective(REP,"orange", "level.GeoM1.objectives.2");
AddMissionObjective(REP,"orange", "level.GeoM1.objectives.3");
AddMissionObjective(CIS,"red", "level.GeoM1.objectives.1");
AddMissionObjective(CIS,"orange", "level.GeoM1.objectives.2");
AddMissionObjective(CIS,"orange","level.GeoM1.objectives.3");
--end objectives
--start soundlvl
ReadDataFile("sound\\geo.lvl;geo1cw");
--end soundlvl

-- Start sidelvls
ReadDataFile("SIDE\\cis.lvl",
"cis_inf_basic",
"cis_inf_countdooku",
"cis_inf_droideka");
ReadDataFile("SIDE\\rep.lvl",
"rep_bldg_forwardcenter",
"rep_fly_assault_dome",
"rep_fly_gunship",
"rep_fly_gunship_dome",
"rep_fly_jedifighter_dome",
"rep_inf_basic",
"rep_inf_jet_trooper",
"rep_inf_macewindu",
"rep_walk_atte")
ReadDataFile("dc:..\\..\\..\\geo2\\Data\\_LVL_PC\\Side\\rep.lvl",
"rep_inf_jedimale",                                                             
"rep_inf_jedimaleb",                                                           
"rep_inf_jedimaley")
--end sidelvls
--start loadouts
SetTeamName(CIS, "CIS")
SetTeamIcon(CIS, "cis_icon")
AddUnitClass(CIS, "cis_inf_battledroid",10)
AddUnitClass(CIS, "cis_inf_assault",1)
AddUnitClass(CIS, "cis_inf_pilotdroid",2)
AddUnitClass(CIS, "cis_inf_assassindroid",2)
AddUnitClass(CIS, "cis_inf_droideka",1)
SetHeroClass(CIS, "cis_inf_countdooku")
SetTeamName(REP, "Republic")
SetTeamIcon(REP, "rep_icon")
AddUnitClass(REP, "rep_inf_clone_trooper",10)
AddUnitClass(REP, "rep_inf_arc_trooper",1)
AddUnitClass(REP, "rep_inf_clone_pilot",2)
AddUnitClass(REP, "rep_inf_clone_sharpshooter",2)
AddUnitClass(REP, "rep_inf_jet_trooper",1)
SetHeroClass(REP, "rep_inf_macewindu")
--end loadouts
--start teamstats
SetUnitCount(ATT, 16)
SetReinforcementCount(ATT, 200)
SetUnitCount(DEF, 16)
SetReinforcementCount(DEF, 200)
--end teamstats
--start alliances
SetTeamAsFriend(ATT, 1)
SetTeamAsEnemy(ATT, 2)
SetTeamAsFriend(DEF, 2)
SetTeamAsEnemy(DEF, 1)
SetAttackingTeam(ATT);

SetTeamName(4, "locals")
    AddUnitClass(4, "rep_inf_jedimale",2)
    AddUnitClass(4, "rep_inf_jedimaleb",2)
    AddUnitClass(4, "rep_inf_jedimaley",2)
    SetUnitCount(4, 6)
    SetTeamAsFriend(4, ATT)
--end alliances

--start memorypools
ClearWalkers()
AddWalkerType(0, 4)-- special -> droidekas
AddWalkerType(1, 4)-- 1x2 (1 pair of legs)
AddWalkerType(2, 0)-- 2x2 (2 pairs of legs)
AddWalkerType(3, 0)-- 3x2 (3 pairs of legs)
SetMemoryPoolSize("PowerupItem", 60)
SetMemoryPoolSize("EntityMine", 40)
--end memorypools
--start worldlvl
ReadDataFile("dc:GeoM1\\GeoM1.lvl")
--end worldlvl
--start spawndelay
SetSpawnDelay(10.0, 0.25)
--end spawndelay
--start flyheight
--end flyheight
--start ainotify
--end ainotify
--start stayinturrets
--end stayinturrets
--start denseenvironment
SetDenseEnvironment("true")
--end denseenvironment
--start birdsandfish
--end birdsandfish
--start deathregions
--end deathregions

--start soundconfig
OpenAudioStream("sound\\tat.lvl","tatcw_music");
OpenAudioStream("sound\\tat.lvl","tat1");
OpenAudioStream("sound\\tat.lvl","tat1");
OpenAudioStream("sound\\cw.lvl","cw_vo");
OpenAudioStream("sound\\cw.lvl","cw_tac_vo");
OpenAudioStream("sound\\tat.lvl","tat1_emt");
SetBleedingVoiceOver(CIS,CIS,"cis_off_com_report_us_overwhelmed",1);
SetBleedingVoiceOver(CIS,REP,"cis_off_com_report_enemy_losing",1);
SetBleedingVoiceOver(REP,CIS,"rep_off_com_report_enemy_losing",1);
SetBleedingVoiceOver(REP,REP,"rep_off_com_report_us_overwhelmed",1);
SetLowReinforcementsVoiceOver(CIS, CIS, "cis_off_defeat_im", .1,1);
SetLowReinforcementsVoiceOver(CIS, REP, "cis_off_victory_im", .1,1);
SetLowReinforcementsVoiceOver(REP, REP, "rep_off_defeat_im", .1,1);
SetLowReinforcementsVoiceOver(REP, CIS, "rep_off_victory_im", .1,1);
SetOutOfBoundsVoiceOver(2,"Allleaving");
SetOutOfBoundsVoiceOver(1,"Impleaving");
SetAmbientMusic(CIS,1.0,"cis_tat_amb_start",0,1);
SetAmbientMusic(CIS,0.99,"cis_tat_amb_middle",1,1);
SetAmbientMusic(CIS,0.1,"cis_tat_amb_end",2,1);
SetAmbientMusic(REP,1.0,"rep_tat_amb_start",0,1);
SetAmbientMusic(REP,0.99,"rep_tat_amb_middle",1,1);
SetAmbientMusic(REP,0.1,"rep_tat_amb_end",2,1);
SetVictoryMusic(CIS,"cis_tat_amb_victory");
SetDefeatMusic (CIS,"cis_tat_amb_defeat");
SetVictoryMusic(REP,"rep_tat_amb_victory");
SetDefeatMusic (REP,"rep_tat_amb_defeat");
SetSoundEffect("ScopeDisplayZoomIn","binocularzoomin");
SetSoundEffect("ScopeDisplayZoomOut","binocularzoomout");
SetSoundEffect("SpawnDisplayUnitChange","shell_select_unit");
SetSoundEffect("SpawnDisplayUnitAccept","shell_menu_enter");
SetSoundEffect("SpawnDisplaySpawnPointChange","shell_select_change");
SetSoundEffect("SpawnDisplaySpawnPointAccept","shell_menu_enter");
SetSoundEffect("SpawnDisplayBack","shell_menu_exit");
SetPlanetaryBonusVoiceOver(REP,REP,0,"rep_bonus_rep_medical");
SetPlanetaryBonusVoiceOver(REP,CIS,0,"rep_bonus_cis_medical");
SetPlanetaryBonusVoiceOver(REP,REP,1,"");
SetPlanetaryBonusVoiceOver(REP,CIS,1,"");
SetPlanetaryBonusVoiceOver(REP,REP,2,"rep_bonus_rep_sensors");
SetPlanetaryBonusVoiceOver(REP,CIS,2,"rep_bonus_cis_sensors");
SetPlanetaryBonusVoiceOver(REP,REP,3,"rep_bonus_rep_hero");
SetPlanetaryBonusVoiceOver(REP,CIS,3,"rep_bonus_cis_hero");
SetPlanetaryBonusVoiceOver(REP,REP,4,"rep_bonus_rep_reserves");
SetPlanetaryBonusVoiceOver(REP,CIS,4,"rep_bonus_cis_reserves");
SetPlanetaryBonusVoiceOver(REP,REP,5,"rep_bonus_rep_sabotage");--sabotage
SetPlanetaryBonusVoiceOver(REP,CIS,5,"rep_bonus_cis_sabotage");
SetPlanetaryBonusVoiceOver(REP,REP,6,"");
SetPlanetaryBonusVoiceOver(REP,CIS,6,"");
SetPlanetaryBonusVoiceOver(REP,REP,7,"rep_bonus_rep_training");--advanced training
SetPlanetaryBonusVoiceOver(REP,CIS,7,"rep_bonus_cis_training");--advanced training
SetPlanetaryBonusVoiceOver(CIS,CIS,0,"cis_bonus_cis_medical");
SetPlanetaryBonusVoiceOver(CIS,REP,0,"cis_bonus_rep_medical");
SetPlanetaryBonusVoiceOver(CIS,CIS,1,"");
SetPlanetaryBonusVoiceOver(CIS,REP,1,"");
SetPlanetaryBonusVoiceOver(CIS,CIS,2,"cis_bonus_cis_sensors");
SetPlanetaryBonusVoiceOver(CIS,REP,2,"cis_bonus_rep_sensors");
SetPlanetaryBonusVoiceOver(CIS,CIS,3,"cis_bonus_cis_hero");
SetPlanetaryBonusVoiceOver(CIS,REP,3,"cis_bonus_rep_hero");
SetPlanetaryBonusVoiceOver(CIS,CIS,4,"cis_bonus_cis_reserves");
SetPlanetaryBonusVoiceOver(CIS,REP,4,"cis_bonus_rep_reserves");
SetPlanetaryBonusVoiceOver(CIS,CIS,5,"cis_bonus_cis_sabotage");--sabotage
SetPlanetaryBonusVoiceOver(CIS,REP,5,"cis_bonus_rep_sabotage");
SetPlanetaryBonusVoiceOver(CIS,CIS,6,"");
SetPlanetaryBonusVoiceOver(CIS,REP,6,"");
SetPlanetaryBonusVoiceOver(CIS,CIS,7,"cis_bonus_cis_training");--advanced training
SetPlanetaryBonusVoiceOver(CIS,REP,7,"cis_bonus_rep_training");--advanced training
--end soundconfig

--start activebonus
--end activebonus

--start camerashots
AddCameraShot(-0.404895, 0.000992, -0.914360, -0.002240, -85.539894, 20.536297, 141.699493);
AddCameraShot(0.040922, 0.004049, -0.994299, 0.098381, -139.729523, 17.546598, -34.360893);
AddCameraShot(-0.312360, 0.016223, -0.948547, -0.049263, -217.381485, 20.150953, 54.514324);
--end camerashots

--start footer
end
--end footer



#10
Forum News and Forum Rules / Re: Celebrate with us!
Last post by Anyder - April 18, 2024, 02:02:43 PM
Hey folks! :)

Here's an update in case you missed it.

SWBF1 Server Rotation:
  • Core - Bespin: CC
  • Core - Rhen Var: Citadel
  • Core - Tatooine: Mos Eisley
  • ModMap - Giftheck's Scarif: Beach
  • ModMap - Sereja's Umbara: Shadow Forest
  • ModMap -  Sereja's Coronet Luxury Spaceliner
  • ModMap - Red04's Mustafar Refinery (SWBF2 Conversion)
  • ModMap -  Red04's Kamino (SWBF2 Conversion)
Download mappack here --> http://tiny.cc/cantinablast // SWBF1-Mappack.rar

SWBF2 Server Rotation:
  • Core - Mustafar
  • Core - Mos Eisley
  • Core - Corus
  • Core - Death Star
  • ModMap - Eddie's Italia
  • ModMap - Saleucami
Download mappack here --> http://tiny.cc/cantinablast // SWBF2-Mappack.rar

Special thanks to Giftheck, Sereja & Red04 for their modmaps.

Remember, you can join us in the community discord here: SWBFGamers Discord Server