Ammo Balancing in Half-Life : Alyx


A major part of the core tension of Half-Life: Alyx comes from the player's limited resources. Your ammo is constantly running low, and every missed shot or poorly used weapon, matters. This all comes from spot on ammo balancing. There's no "magic bullet" to achieve this perfectly every time, but Half-Life: Alyx does include several dynamic systems that try to remove any outliers, and keep players in the perfect levels of danger. These two systems are Ammo Removal and Ammo Drain.
Ammo Removal
Ammo Removal is a system that will remove items from the world if the player has too many of it. It can be enabled with this setting on most items.
Consider this a lot like the "max ammo" in most other games. The systems strives to keep the player's inventory within certain numbers.
These numbers can be found in the Skill.cfg (normal difficulty values below).
hlvr_player_ammobal_removeat_pistol "60" ... hlvr_player_ammobal_removeat_shotgun "12" ... hlvr_player_ammobal_removeat_rapidfire "150"
The game checks the player's inventory (including ammo in a weapon) against these values when an item is loaded in.
This can be when the item enters the Potential Visibility Set or is spawned via a Point_template.
If the player has more then these values, the item is removed.
Keep in mind, this includes items such as grenades; if the player has this item in their inventory, a new one will not be spawned.

However, there is more nuances to this system, as never finding an item for long periods of time can be frustrating.
There exists an invisible counter. After seven items have been removed, the eighth one will not be.
After that , the counter starts again.
There is some additional logic when it comes to health syringes:
- If you have full health and no syringe in a pocket, there is a random chance of the item spawning
- If you have less than full health and no syringe in a pocket, the item will always spawn
- If you have a syringe in a pocket, the item will not spawn (respecting the above counter)
Ammo Drain
hlvr_player_ammobal_min_pistol "20" hlvr_player_ammobal_max_pistol "60" ... hlvr_player_ammobal_min_shotgun "8" hlvr_player_ammobal_max_shotgun "12" ... hlvr_player_ammobal_min_rapidfire "90" hlvr_player_ammobal_max_rapidfire "150"
hlvr_player_ammobal_drain_pistol "4" ... hlvr_player_ammobal_drain_shotgun "6" ... hlvr_player_ammobal_drain_rapidfire "4"
sk_zombie_max_additional_ammo_shots "18" sk_headcrab_max_additional_ammo_shots "4" sk_barnacle_max_additional_ammo_shots "8" sk_combine_max_additional_ammo_shots "16"
Best Practices
My Output | Target Entity | Target Input | Parameter | Delay |
---|---|---|---|---|
Ouput_OnHackSuccess | [locker_template] | ForceSpawn | 0.00 |
(temporary text) These additional "safety nets" all point to one fact: this system is not meant to prevent the player's inventory from "snowballing" just slow it down.
It encourages the player's inventory to stay in a certain area, but it does not prevent it from exceeding that. Thorough players can still find an advantage.
This won't solve poor designer choices.