News | Forum | People | FAQ | Links | Search | Register | Log in
New Level Compilers From Uncle Mike
P2ST is a set of level compilers written by Uncle Mike (Xash3D coder) in 2017-2019.

P2ST was written on top of the classic QBSP compiler from HLSDK to avoid generational layering of bugs of ZHLT compiler supplemented with low performance and hard to read macros formatting of VHLT and half-baked solutions of both.

The priorities of writing P2ST compilers were:
1. Being faster than VHLT
2. Creating effective BSP tree (recursion depth, overall speed)
3. Clean lightmaps without artifacts (noise, seams, etc.)
4. Storing additional info for Paranoia 2
5. Compiling Quake maps that VHLT's CSG can't handle due to some specific errors in those maps
6. Unlimited number of planes while staying compatible

By default P2ST produce maps in BSP30 format supported by many source ports of Quake. P2ST can correctly handle Quake-style light sources with limited light radius. The compiler can handle some pretty heavy load, it was tested on maps from Arcane Dimensions including The Forgotten Sepulcher. Uncle Mike claim it to be nearly 50% more effective at saving various mapping limits than TyrUtils.

Although not all features of the compiler can be utilized by Quake engines (custom face extents, custom lightmap scale, world space luxels supported by Xash3D) there are still cross-engine features:

- Reads maps in Quake 1 2 3 format

- Bezier Curves from Quake 3(Uncle Mike uses Quark which got a Bezier tool). At compile time Beziers turn into regular polygons. Example ".map"

- dirtmapping from TyrUtils

- misc_external_map from TyrUtils

- misc_model: same as above but recursive. A certain ".map" can be referenced on another map as misc_model prefab and at compile time the prefab itself, its child prefabs, their child prefabs etc. will compile and will be put into your map. You can edit one external prefab and then it will update on all your maps after you compile them. Prefab maps can contain func_detail, misc_model, env_static, Beziers. World brushes and other entities will be ignored.

- misc_model in ASE format. Specifying a model in HL format turns misc_model into env_static.
Supported env_static parameters:
spawnflags 4 (don't cast shadow)
spawnflags 8 (no vertex lighting)
zhlt_selfshadow 0/1 (for vertex lighting)
zhlt_nosmooth (for broken normals or artistic reason)
zhlt_backfrac (fix light leaks if needed)

- zhlt_nocsg 0/1 (global or for a particular func_group or other entity) disables CSG like in Quake 3. Brushes don't cut each other and void-facing polygons stay.
More func_group parameters:
_dirt to allow/deny dirtmapping on particular face
_shadow to be TyrUtils compatible

- zhlt_precisionclip 0/1 (global or per entity) enables Quake-style creation of collision mesh. Can be useful if you stuck in some complex geometry like caves. Exhaust clipnode limits 4 times faster.

- skybox does not illuminate if there's no other lights

- func_detail_wall, func_detail_fence, func_detail_illusionary, SKIP on solids turns into NULL - from TyrUtils

More entity parameters:

- zhlt_vertexlight 0/1 for any entity

- zhlt_lightflags 2 (brush entities cast shadows)

- zhlt_invisible, zhlt_noclip

- zhlt_detaillevel (func_detail priority level, at 0 it becomes func_group)

- zhlt_usestyle (directly assign lightstyle in some controversial cases)

Command line parameters:

-quake (adjust gamma, dscale, sky for Quake-styled lighting)

-gamma (0.3...1)

-merge 0/1/2 (how to merge adjacent faces of the same plane: default 1, advanced 2)

-balance to mimic VHLT-styled lighting instead of QBSP/ZHLT

Best results can be achieved when compilers are put in root directory of the game, i.e. "Quake" to see all the resources below.

(P2ST - Paranoia 2: Savior Tools)

P2ST ver. 0.98
patch for VIS
it was tested on maps from Arcane Dimensions including The Forgotten Sepulcher. Uncle Mike claim it to be nearly 50% more effective at saving various mapping limits than TyrUtils.

Can you go into some more detail here? This sounds kinda interesting to say the least.

P2ST can correctly handle Quake-style light sources with limited light radius.

Not sure what you mean by this. What light attenuation formulae are supported, and how large is this "limited light radius"? 
On Quake lighting he just wrote
"added full support for Quake lights and their specifics" and mentioned all these delay, wait, cone, cone2, etc.
and in different place "introduced -quake key, sets gamma 1.0, -dscale 0.5, -sky 0.0, and enables -lightbalance. Basically this is a preset to make lighting purely Quake-like".

On limit exhaustion:

You probably know that now I can't sit tight because of Ericw's compilers for Quake called TyrUtils. Can't say that they're better than mine in all aspects, more like the opposite. But they do possess certain features I don't have. Therefore - these should be added. Meanwhile I compare them for effectiveness and speed.

My coplilers
Object names Objects/Maxobjs Memory / Maxmem Fullness
------------ --------------- --------------- --------
entities [variable] 205865/2097152 ( 9.8)
planes 4968/524288 99360/10485760 ( 0.9)
textures [variable] 8852/33554432 ( 0.0)
vertexes 23696/393216 284352/4718592 ( 6.0)
nodes 9839/262144 432916/11534336 ( 3.8)
texinfo 1212/262144 48480/10485760 ( 0.5)
surfaces 17951/262144 502628/7340032 ( 6.8)
clipnodes 16821/262144 201852/3145728 ( 6.4)
leafs 6289/262144 276716/11534336 ( 2.4)
markfaces 21909/327680 87636/1310720 ( 6.7)
edges 42399/1048576 339192/8388608 ( 4.0)
surfedges 83552/2097152 334208/8388608 ( 4.0)
models 215/4096 13760/262144 ( 5.2)
=== Total BSP file data space used: 2.70 Mb ===
World size ( 2560 2304 3968 ) units
original name: maps/ad_metmon.bsp
internal name: Arcane Monstrosity

Object names Objects/Maxobjs Memory / Maxmem Fullness
------------ --------------- --------------- --------
entities [variable] 204240/2097152 ( 9.7)
planes 4855/524288 97100/10485760 ( 0.9)
textures [variable] 854214/33554432 ( 2.5)
vertexes 30612/393216 367344/4718592 ( 7.8)
nodes 16485/262144 725340/11534336 ( 6.3)
texinfo 1359/262144 54360/10485760 ( 0.5)
surfaces 25385/262144 710780/7340032 ( 9.7)
clipnodes 25845/262144 310140/3145728 ( 9.9)
leafs 10496/262144 461824/11534336 ( 4.0)
markfaces 29568/327680 118272/1310720 ( 9.0)
edges 65668/1048576 525344/8388608 ( 6.3)
surfedges 100675/2097152 402700/8388608 ( 4.8)
models 215/4096 13760/262144 ( 5.2)
=== Total BSP file data space used: 4.62 Mb ===
World size ( 2688 2432 4608 ) units
original name: maps/ad_metmon.bsp
internal name: Arcane Monstrosity

Performing time of my compilers:
4 sec csg + 12 sec bsp
Memory consumption: csg 39.64 Mb, bsp 30.36 Mb (memory not summed up)
11.000 seconds elapsed (qbsp)
Peak memory usage: 163320980 (155.8M)

What is intresting:
1. In terms on limit exhaustion my compilers are definitely more optimal than TyrUtils. Nearly 1.5 times more effective. It's unclear why planes are being exhausted faster though. I mean it doesn't matter, they're 32-bit-limited, but anyway.
2. Memory. I was in doubt but nearly 100% sure now, compilers were split to save memory indeed. This is the most simple way besides screwing with correct memory freeing. And the effect is quite noticeable, too, as you can see. We win 2 to 4 times more memory.
3. TyrUtils work in a single thread (qbsp) without any special optimizations and they're still faster. I've got a couple guesses: either SSE optimization of modern IDEs give an effect here, or this is an effect of VHLT's chinese accelerator of BSP tree building, for small trees lagging more than original code but accelerating greatly with increasing polycount. Can't say for sure yet.

And there is another post with statistics on the same page.
Keep in mind that this was early on and he kept working on P2ST throught the next year. 
You must be logged in to post in this thread.
Website copyright © 2002-2024 John Fitzgibbons. All posts are copyright their respective authors.