Map Parser

June 4, 2025 ยท View on GitHub

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

Format of Triangle in .tri

typedef struct Vector3 {
    float x, y, z;
};

typedef struct Triangle {
    Vector3 p1, p2, p3;
};

File size

#Map Name.vphys.tri.tri to .vphys.tri.minz.tri.minz to .vphys
1inferno674MB307MB-54.46%25.5MB-96.23%
2overpass113MB57.1MB-49.47%4.62MB-95.93%
3ancient370MB22.1MB-94.03%4.76MB-98.70%
4anubis256MB18.3MB-92.85%3.31MB-98.67%
5dust2175MB13.3MB-92.40%2.25MB-98.70%
6vertigo129MB9.44MB-92.68%1.27MB-99.02%
7nuke54.4MB8.18MB-84.96%887KB-98.37%
8mirage24.8MB5.67MB-77.13%522KB-97.93%
9office21.4MB4.40MB-79.43%451KB-97.93%

Instructions for end users (using the web tool)

Use


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

Instructions for developers (build and deploy)

Build and Deploy

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

Credits