Half-Life 2

Half-Life 2

Better Combat AI
66 Comments
Monki 9 Jul @ 7:36am 
@Tyler Alyx doesn't follow you because you have the dynamic fire mod

This mod makes all NPCs that accompany you not follow you unless you have the flashlight on
Tyler 5 Jul @ 9:38pm 
This mod completely breaks Alyx, She's calling for help wanting me to turn on my flashlight so she can follow me.
Hds46  [author] 1 Jul @ 12:02pm 
@PAPAZULU_
Code is inside .cfg file which is inside "cfg" folder. I'm using Notepad++ for it.
robotgamer2 1 Jul @ 11:42am 
dude ive been looking everywhere for a mod like this TY FOR MAKING THIS
PAPAZULU_ 23 Jun @ 8:46am 
Hey @Hds46, sorry to bother you, but could you tell me which tool you used to create or view the code for the scripts?

Since the code doesn’t appear in the console, I assume it must be in Hammer, right? If so, could you give me a quick explanation on how to open it and view these variables? I’d really appreciate it — I want to experiment with the AI as well =D
kuba_jeden 18 Jun @ 12:26pm 
can yall fix the ally npc's? alyx in the episodes keeps getting worried when i dont have my flashlight on , sheckley and griggs are basicly USELESS in the antlion defence section in episode 2
John S. Stapler 11 Jun @ 11:15pm 
chain mail in MY 2025 more likely than you think
_-Echo-117-_ 11 Jun @ 10:25am 
below me is a person warning others persons that there is a honest to god "scary chain email" in 2025
hexagonopus 6 Jun @ 8:49pm 
below me is an honest to god "scary chain email" in 2025
WARNING! Carry on reading! Or you will die, even if you only looked at the word warning! Once there was a little girl called Clarissa, she was ten-years-old and she lived in a mental hospital, because she killed her mom and her dad. She got so bad she went to kill all the staff in the hospital so the More- government decided that best idea was to get rid of her so they set up a special room to kill her, as humane as possible but it went wrong the machine they were using went wrong. And she sat there in agony for hours until she died. Now every week on the day of her death she returns to the person that reads this letter, on a monday night at 12:00a.m. She creeps into your room and kills you slowly, by cutting you and watching you bleed to death. Now send this to ten other profiles on this one site, and she will haunt someone else who doesn't. This isn't fake. apparently, if u copy and paste this to ten comments in the next ten minutes u will have the best of your life
SJTHEGAMER 5 Jun @ 6:24am 
barney doesn't follow when i dont have the flashlight on
Uncle Qrow <3 1 Jun @ 4:30pm 
Hm Im conflicted.I always though combines were dumb, unlike HECU marines, and this should be just what I need. However, there's that video on youtube showing their nice tactical skills in flanking the player, which are great and fun!... despite the fact that I have never noticed them in game
PAPAZULU_ 31 May @ 10:01am 
@Quirrel
You can make it work in Entropy: Zero 2 by installing manually. Here's how:

Open Crowbar.

Go to: workshop\content\220\3472975079

Decompile the _dir.vpk file to a folder of your choice.

A file named 84.cfg will be created. It contains AI behavior code.

Move it to: steamapps\common\EntropyZero2\entropyzero2\cfg

If it doesn't exist, create autoexec.cfg in the same folder.

Open autoexec.cfg and add: exec 84.cfg, then save.

Launch the game, open the console, and type: exec autoexec

If successful, a message will confirm it.

I can confirm it works. Without this mod, unarmed rebels run, stop, turn around, then continue. With it, they flee continuously, sometimes out of sight. I may have seen one take cover, but I’m not sure.

This way it can be used in any Half-Life 2 single-player mod.
Leepik28 29 May @ 8:50am 
yo small problem with this mod i belive it makes the combine at the point where you meet aleks for first time they take cover and dont want to beat you even with you being absolutley harmless
Nikão 21 May @ 5:31pm 
nice
gael the soldier 21 May @ 1:25pm 
"this mod just makes them pussies" They have a chance to get domed inbetween the eyes now, they're using the cover for good.
Quirrel 19 May @ 10:24am 
this is amazing. Can you do a version for black mesa and entropy zero 2 as well?
Salty 14 May @ 4:38am 
Nice
Boneworks 8 May @ 12:50am 
this mod just makes them pussies
kitcat 7 May @ 3:03pm 
the mode is nice its neat to see them take cover and move smartly to sometime i feel like they don't shoot as much as they should also the mounted machin gun doesn't work anymore
Hds46  [author] 7 May @ 12:44pm 
@awchris11
It will work but keep in mind that Valve's squad system major flaw is that only 2 NPCs in the same squad are able to attack at the same time.
awchris11 7 May @ 12:24pm 
@Hds46
What about this mod with the global combine squads then?
Hds46  [author] 7 May @ 10:04am 
@awchris11
Aggressive Combine Soldiers and Better Combat AI are not compatible with each other as they contradict each other. Global Combine Squads is not working good with Combine Patrol mod for some reasons.
awchris11 6 May @ 10:57pm 
@Hds46
Are all four of your combine mods compatible with each other, or is it best to only have one active at a time?
Hds46  [author] 6 May @ 10:13pm 
It shouldn't but I'm not sure though. That addon also changes AI behavior because of enabled Episode One logic.
GLoriG][UnV:C17-14] 6 May @ 10:07pm 
Wow, Idk that. Thanks for the Info, does that will conflicted with this mod?
Hds46  [author] 6 May @ 2:03pm 
@TEX
I'll tweak it to make them shoot more. Though Idk if it will work in close quarters but there's an option for it yes.
TEX 6 May @ 11:40am 
I noticed that when using this mod, Rebels shoot much more rarely (if at all) when in close quarters, where I would've hoped that they shoot faster if anything. Unfortunately a deal breaker for me...

Is this something that's solvable in the limits of this scripting? Maybe make it to where Rebels can shoot at enemies at full-auto when close enough?
Hds46  [author] 6 May @ 8:15am 
@GLoriG][UnV:C17-14]
This addon of mine - Dynamic Fire Glow makes combine soldiers more accurate with AR2(Pulse Rifle) in non-episodic Half-Life 2 campaign. This is unintentional change added by episodic behavior required for this addon. In Episodes combine soldiers are more accurate with AR2 than in original HL2.
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=3475221974&tscn=1746544266
GLoriG][UnV:C17-14] 6 May @ 8:01am 
Aw shame :(

But Good work tho, Appreciate it
Hds46  [author] 6 May @ 7:58am 
@GLoriG][UnV:C17-14]
It doesn't unfortunately. There's no way to do it via scripting. It's hardcoded in the engine.
GLoriG][UnV:C17-14] 6 May @ 7:54am 
Does this also change their accuracy? Soldier and Metrocop aim is bugging me off, or make Rebels shoots innacurate too?
норм
George Floyd 5 May @ 4:44pm 
Hell yeah hds dominating hl2 workshop
Xx_HeadshotGamer_xX 5 May @ 3:19pm 
dont abbreviate civil protection
Roger 5 May @ 12:28pm 
very nnice
chloe2k 5 May @ 11:35am 
dont abbreviate civil protection
Dr. Walter λ 4 May @ 3:37pm 
finally a mod to make npcs less dumb
Gavrilov 4 May @ 1:47am 
dont abbreviate civil protection
ghost of turkmenistan 3 May @ 12:02pm 
dont abbreviate civil protection
HeaL^Me 2 May @ 6:01pm 
looks promising enemy ai improving combat mod. unfortunately cp equipped with stun batons often run away from me and only to awkwardly return and attack in a loop, cp dismounts his mounted gun then just stands there doing nothing. hope theres improvement in the future
Mackenna 2 May @ 3:18pm 
Una joya de juego, a pesar de que ya es muy antaño, continúa siendo súper entretenido y muy buenas gráficas!!:headcrab::steamthumbsup:
PAPAZULU_ 2 May @ 8:06am 
I've been waiting for something like this—definitely trying it out now! :D

I was going to ask about the two-NPC firing limit per squad, but I see that's already been addressed. What I’d like to know is: is it possible to remove the squad system entirely and make each NPC act independently? I believe F.E.A.R. does this—the Replicas don’t recognize each other as squadmates, but voice lines create the illusion of teamwork.

That 2-per-squad firing limit has always felt really restrictive.

If not, there's a mod called Gameplay Rebalance AI+ where the creator removed that limitation and added behaviors like full-auto fire and suppression . In the base game, they often stop firing and just rush. The source code is public

Mod: https://www.moddb.com/games/half-life-2/downloads/gameplay-rebalance-ai
SRC: https://github.com/DKmaster16/HL2_GRAI/tree/master

Just sharing in case it help with future updates. thanks for this awesome mod! HL2 with smarter AI feels incredible.
Hds46  [author] 1 May @ 6:12pm 
@andreakutzke0207
This is from "Serverside Ragdolls", you need to disable the mod on sandtraps level because ingame script is not compatible with it. You can reenable it right after killing antlion guard and passing through the door. There shouldn't be another issue after this moment.
andreakutzke0207 1 May @ 5:53pm 
When I kill the Antlion guard in the chapter Sandtraps, the Vortigaunt approaches me and just stays there doing nothing. Does anyone know what mod does this? If so, it will be greatly appreciated!
BezPixelu 1 May @ 5:25pm 
Nice👍🏼
Hds46  [author] 1 May @ 2:54pm 
@VλλK CSGOSKINS
This is open source already and is just cfg file. You can find it in steam/steamapps/workshop/220/3472975079/cfg/custom_scripts
Hds46  [author] 1 May @ 2:52pm 
@FirstComing
Unfortunately no because Half-life 2 doesn't have scripting language such as VScript, Lua or Angelscript. I'm using a very basic and limitrd cfg scripting and map logic.
FirstComing 1 May @ 2:10pm 
Just wondering, could it be possible to remove the 2-npc squad firing limitation and make hunters much more likely to run and shoot at the same time for a future update to this addon? I'm sure it'll make the AI a lot more dangerous.

Awesome addon btw :D
realmente melhorou a AI do jogo