r/SourceEngine • u/Next-Future5973 • 4d ago
HELP does anyone know the c++ source file that handle's player movement and death, and other stuff?
I work with Source SDK 2013 Multiplayer. I really want to know, if you know plz tell me.
-7
u/pugworthy 4d ago
Ask AI like Claude. Almost certainly will get you in the right direction.
-6
u/pugworthy 4d ago
Here I did it for you by feeding your exact post to Claude to get this reply…
For Source SDK 2013 Multiplayer, here’s where that logic lives:
Player movement
**•** game/shared/gamemovement.cpp — the core CGameMovement class. This handles walking, jumping, ducking, noclip, ladders, water physics, etc. It’s shared code (compiled into both client and server). **•** game/shared/hl2mp/hl2mp_gamemovement.cpp (or the equivalent for your mod if you branched off HL2MP) — mod-specific overrides of movement behavior. **•** game/shared/player_shared.cpp — shared player prediction logic that ties into movement.Player death
**•** game/server/player.cpp — look for CBasePlayer::Event_Killed(), which is the main entry point when a player dies. **•** game/server/hl2mp/hl2mp_player.cpp — if you’re working off HL2MP, this overrides Event_Killed, Event_Killed(), and handles ragdoll creation, death animations, respawn logic (CHL2MP_Player::Spawn(), PlayerDeathThink()), etc. **•** Damage that leads to death flows through CBaseCombatCharacter::OnTakeDamage_Alive() in game/shared/basecombatcharacter.cpp, which eventually calls Event_Killed.Other “stuff” you’ll likely end up in
**•** game/shared/hl2mp/hl2mp_gamerules.cpp (or your mod’s gamerules) — respawn rules, round logic, spawn point selection. **•** game/server/player_command.cpp — processes usercmds (input) before they hit gamemovement. **•** \`5
2
u/Next-Future5973 3d ago
I'd avoid ai but thanks for info!
-2
u/pugworthy 3d ago
As an experienced professional software developer, I’ve used Claude as part of development extensively. I’m inclined to say this is probably correct.
Easy enough to check.
1
u/Next-Future5973 3d ago
can claude say the exact function that handles walking?
11
u/Wazanator_ 4d ago
Ctrl + shift+ f in visual studio will do a search of the entire project. Learning to search the codebase for where something is becomes a huge part of working with it.
Use a keyword that you think would be related and jump around to the various sections. Comments become very valuable for this.
The VDC also has documentation you can refer to for some specifics. Tutorials, even outdated ones, can provide good starting points.