Convert vphys file to a .tri file (a list of vec3 point, each 3 points repersents a triangle)
Reason why I do that is vk3 parser takes lots memory to save the .vphys text (especially for inferno [5.9Gb] )
and .vphys contains lots useless info.
And save the time of converting vphys to vector in ur code
typedef struct Vector3 {
float x, y, z;
};
typedef struct Triangle {
Vector3 p1, p2, p3;
};| # | Map Name | .vphys | .tri | .tri to .vphys | .tri.minz | .tri.minz to .vphys |
|---|---|---|---|---|---|---|
| 1 | inferno | 674MB | 307MB | -54.46% | 25.5MB | -96.23% |
| 2 | overpass | 113MB | 57.1MB | -49.47% | 4.62MB | -95.93% |
| 3 | ancient | 370MB | 22.1MB | -94.03% | 4.76MB | -98.70% |
| 4 | anubis | 256MB | 18.3MB | -92.85% | 3.31MB | -98.67% |
| 5 | dust2 | 175MB | 13.3MB | -92.40% | 2.25MB | -98.70% |
| 6 | vertigo | 129MB | 9.44MB | -92.68% | 1.27MB | -99.02% |
| 7 | nuke | 54.4MB | 8.18MB | -84.96% | 887KB | -98.37% |
| 8 | mirage | 24.8MB | 5.67MB | -77.13% | 522KB | -97.93% |
| 9 | office | 21.4MB | 4.40MB | -79.43% | 451KB | -97.93% |
1. Open the Vphys file decoder webpage
2. Click "Choose File" or drag the .vphys file to the upload area
3. Choose whether to compress the output
4. Click the "Start Decoding" button
5. Wait for the processing to complete, then click the Download button to get the output file
You have to configure the Emscripten toolchain to compile C++ code to WebAssembly
1. Compile C++ code to WebAssembly:
Use Emscripten to compile vphys_parser.cc to generate vphys_parser.js and vphys_parser.wasm
Linux : Use build.sh
Windows : Use build.bat
2. Put the following files in the same directory:
- index.html
- vphys_parser.js
- vphys_parser.wasm
3. Deploy web pages through a web server (direct access to file:// does not work with WebAssembly)
Tips. You can use Python to quickly start a local web server: python -m http.server 8000, then access it in a browser: http://localhost:8000
- CS2 Map Parser https://github.com/AtomicBool/cs2-map-parser
- KV3 Parser https://github.com/joepriit/cpp-kv3-parser
- Memory Lib https://github.com/pain1929/csgo-game-test/blob/main/handle/
- miniz Lib https://github.com/richgel999/miniz