This project implements an external AutoWall system for Counter‑Strike 2. It extracts up‑to‑date collision geometry and material data from Source 2
.vpk
files, builds a BVH for fast ray‑tracing, and computes bullet penetration damage using real material modifiers.
Warning:
- Not a polished release—some maps exhibit malformed geometry and inverted triangles.
- Development was time‑consuming and is currently paused. Use this as a reference or starting point.
- Physics Extraction:
‑ Parses.vphys
/.phys
viavmdll
to pull vertex, triangle, and material indices. - Parser Module:
‑ Readsm_collisionAttributes
,m_meshes
, andm_hulls
blocks.
‑ Converts hex blobs intostd::vector<TriangleCombined>
. - BVH Acceleration:
‑ Builds or loads a cached.bvh
file.
‑ Splits along the longest AABB axis until ≤ 4 triangles per node. - Ray‑Triangle Intersection:
‑ Möller–Trumbore algorithm with BVH speed‑up. - Bullet Penetration Logic:
‑ Computes damage reduction per material segment and distance falloff. - Python Binding:
‑ Exposeshandle_bullet_penetration()
via pybind11. - Material Parser:
‑ Readssurfaceproperties.txt
andsurfaceproperties_game.txt
for penetration modifiers.
- Visual Studio 2022 (x64, Release)
- Python 3.10.6 with
pybind11
Configure project properties:
-
C/C++ → General → Additional Include Directories
C:\Users\USERNAME\AppData\Local\Programs\Python\PythonXX\include C:\Users\USERNAME\AppData\Local\Programs\Python\PythonXX\Lib\site-packages\pybind11\include
-
Linker → General → Additional Library Directories
C:\Users\USERNAME\AppData\Local\Programs\Python\PythonXX\libs
-
Linker → Input → Additional Dependencies
pythonXX.lib
Build configuration:
Release x64
⚠️ ReplaceUSERNAME
andPythonXX
with your actual Windows username and Python version.
For example:Python310
,USERNAME = John
.
see example
This project is licensed under the MIT License.
See the LICENSE file for details.