How 3kh0/portal-2 works
This is an archival mirror of the Portal 2 / Source engine development tree, not a single standalone utility. The README describes gameplay code divided across client, server and shared layers, alongside engine rendering, networking, audio, particles and scripting. The graph sketches those product areas and key internal interfaces; it is not a verified runtime call sequence. Source excerpts are partial, and many central modules were only indexed, so undocumented connections are omitted.
Main entry points: client Client Gameplay · cdll_engine_int.cpp Engine Client API · enginetrace.cpp Collision Tracing · gl_model_private.h Rendering
Components 26
Gameplay
- Client Gameplay
game/client - Shared Gameplay
game/shared - Server Gameplay
game/server
Engine Runtime
- Engine Client API
engine/cdll_engine_int.cpp - Engine Server
engine/server.h - Collision Tracing
engine/enginetrace.cpp - Client Class Registry
public/client_class.h - Networking
common/netmessages.cpp - Scripting Interfaces
common/lua.h - Collision Models
engine/cmodel_engine.h - Physics Interface
public/vphysics_interface.h
Media Systems
- Rendering
engine/gl_model_private.h - Post Effects
materialsystem/stdshaders/engine_post_dx9.cpp - Audio System
engine/audio/public/sound.h - Voice Audio
engine/audio/private/voice_sound_engine_interface.cpp - Particle Systems
blobulator/common/blobrender.cpp
Shared Foundation
- Math Library
public/mathlib/mathlib.h - Platform Types
public/tier0/platform.h - Threading
public/tier0/threadtools.h - Profiling
public/tier0/vprof.h - Profiling Telemetry
public/tier0/vprof_telemetry.h - Console Variables
public/tier1/convar.h - Memory Debug Hooks
public/tier0/memdbgon.h - Base Types
public/tier0/basetypes.h - Debug Utilities
public/tier0/dbg.h
Other components
- Player
Connections 18
- Player → Client Gameplay: plays
- Client Gameplay → Engine Client API: uses engine API
- Client Gameplay → Shared Gameplay: shares gameplay
- Server Gameplay → Shared Gameplay: shares gameplay
- Engine Client API → Collision Models: queries models
engine/cdll_engine_int.cpp - Engine Client API → Audio System: exposes sound
engine/cdll_engine_int.cpp - Engine Client API → Collision Tracing: traces world
engine/enginetrace.cpp - Engine Server → Server Gameplay: hosts gameplay
- Client Class Registry → Client Gameplay: registers classes
public/client_class.h - Collision Tracing → Collision Models: queries collision
engine/enginetrace.cpp - Rendering → Post Effects: uses shader
- Audio System → Voice Audio: supports voice
- Client Gameplay → Networking: exchanges data
- Rendering → Particle Systems: renders effects
- Physics Interface → Collision Tracing: provides physics
engine/enginetrace.cpp - Platform Types → Base Types: defines platform types
engine/audio/private/audio_pch.h - Profiling → Threading: uses thread support
public/tier0/vprof.h - Profiling → Profiling Telemetry: includes telemetry
public/tier0/vprof.h