Skip to content

Conversation

Blixibon
Copy link
Member

@Blixibon Blixibon commented Aug 27, 2025

This PR contains assorted overlapping changes under the general categories of more stable and consistent NPC support in HL2DM, the integration of Mapbase's SP features into HL2DM, and general QOL features for HL2DM.

This is built off of and supersedes #459. Recommend reviewing individual commits rather than the entire diff.


What each commit does

This list describes each commit in this PR:

  • Add NPC, clientside activity, and Mapbase param support to HL2MP weapons — Adds NPC support, clientside activity lists, and Mapbase weapon parameters to HL2MP weapons. This was mainly a copy-paste job from their singleplayer HL2 counterparts, and any code that wasn't specific to Mapbase is not gated within #ifdef MAPBASE (e.g. general existing NPC support), while Mapbase-specific code within this PR or within the singleplayer weapons do use the #ifdef.
  • Add support for Mapbase anim state to HL2MP — Replaces HL2MP's anim state with Mapbase's anim state originally designed for singleplayer. Note that the #ifdef preprocessor is still named SP_ANIM_STATE.
  • Add automatic protagonist support to HL2MP player — Adds code to automatically set each player's protagonist based on their model name, as well as optional support for direct protagonist selection via sv_hl2mp_protagonist_select (thus allowing players to select any model defined by the scripts, including characters like Gordon). Assigning each player to a protagonist allows the use of c_arms and other parameters.
  • Allow HL2MP player to use response system for death sound instead of hardcoded soundscripts — Uses a response for the death sound rather than predefined soundscript arrays. This allows more flexibility in death sounds and makes it easier to integrate additional playermodels (such as those provided by direct protagonist selection).
  • Add HL2MP player resource override with NPC net names and idle bots in scoreboard — Adds a HL2MP-specific player resource override. For context, the "player resource" is a global entity that networks important player data for the scoreboard and beyond. MP games are capable of overriding the default player resource to add their own data, but HL2MP does not do this. Its only game-specific change (team colors) is done through an #ifdef in the base player resource (by contrast, TF2 assigns team colors in its own override). This commit adds a HL2MP-specific player resource for both general utility in derived mods as well as for two features:
    • Reflecting players controlled by idle bots, building off of the previous PR for bot possession.
    • Keeping track of and optimizing NPC net names so that every NPC isn't independently networking the same strings. In this case, it effectively doubles as an NPC resource.
  • Add NPC team-based relationships — Automatically assigns HL2 NPCs to teams that correspond to them in HL2MP, and then factors teams into their relationships. This means rebels and Combine forces will attack or support players on their respective teams in Team Deathmatch. Affiliation can be overridden by simply changing each NPC's team number via keyvalue or input.
  • Add HL2MP bullet FX fixes for NPCs and other entities — Fixes bullet FX inconsistencies in HL2MP due to HL2MP doing bullet FX on the client. To do this, bullet FX is done serverside when fired by NPCs (with a new mp_use_server_bulletfx cvar to extend this) and NPCs themselves network blood and limited relationship data.
  • Allow HL2MP gamerules to derive from HL2 gamerules + add basic integrated HL2MP co-op support — Allows HL2MP gamerules to fall back to SP HL2 gamerules functions and use SP ammo type data (which is identical except SP has more ammo types and allows configuration via cvars). Also adds support for integrated co-op mode via the mp_coop cvar, which influences player spawn positions and whether items respawn. The previously unused hl2mp_gamerules proxy is also now connected to hl2_gamerules and controls whether to allow the default suit or weapons (the functionality of this was added in a previous PR).
  • Add support for NPC death notices and target IDs — Adds optional death notices for when NPCs die or when NPCs kill players, controlled by sv_hl2mp_npc_deathnotice_as_victim and sv_hl2mp_npc_deathnotice_as_killer respectively. Enabled by default.
  • Add SP changes to HL2MP gravity gun + clientside +USE prediction — Adds Mapbase params, limited support for ragdoll pickup/mega physcannon, etc. to the gravity gun as well as clientside +USE prediction for player pickup and entities like func_tank.
  • Add npc_citizen MP squad support — Adds support for multiplayer squads to npc_citizen. If player_squad_mp_shared is enabled, then citizen squadmates will be shared between all players. If it is disabled, then each player will have their own commandable squad, with citizens joining the first one that approaches them. The cvar is disabled by default.
  • Add HL2MP player collision avoidance + ally blood decal fix — Adds TF2-style player teammate avoidance (i.e. walking through teammates and being pushed away, rather than just colliding with them) controlled via hl2mp_avoidteammates, and fixes player teammates showing blood decals when attacking them.
  • Fix NPC footstep sounds in HL2MP — Fixes NPCs not emitting footstep sounds in HL2MP.
  • Nextbots sense weapon sounds from traditional NPCs — Allows nextbots to sense NPC weapon firing in the same way they sense it from players.

PR Checklist

  • My PR follows all guidelines in the CONTRIBUTING.md file
  • My PR targets a develop branch OR targets another branch with a specific goal in mind

@Blixibon Blixibon changed the title [HL2MP] [HL2MP] Assorted changes for NPC support, Mapbase features in HL2DM, and new QOL features Aug 27, 2025
@Blixibon Blixibon force-pushed the mapbase/mp-2025/expanded-npc-and-mapbase-support branch from 5a54a04 to 3d5212c Compare August 27, 2025 20:20
@Blixibon Blixibon force-pushed the mapbase/mp-2025/expanded-npc-and-mapbase-support branch from 3d5212c to 06fa2da Compare August 27, 2025 20:47
@Blixibon Blixibon marked this pull request as ready for review August 28, 2025 03:08
@Blixibon Blixibon requested a review from arbabf August 28, 2025 03:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant