Voxels in HL2

Channel:
Subscribers:
671
Published on ● Video Link: https://www.youtube.com/watch?v=geT_zmYxI5U



Duration: 0:19
241 views
14


Using Source's I/O system for some terrible things...

The idea was to teleport a spherical trigger_multiple which breaks surrounding voxels. But this isn't as easy as it may seem, when constrained to the I/O system:

- A logic_relay can't get "the entity that called it", so each voxel needs some duplicated code (change its targetname, for later reference).- Execution order is all over the place, so I gotta do things across multiple frames, which somehow works out in this case.
- point_teleport is pretty broken in HL2 and can not be used here.- Can't teleport a trigger entity using trigger_teleport, so I teleport an invisible prop_physics instead, with the trigger parented to it.- Can't detect collision with func_breakable, so I use a func_physbox and enable its physics simulation for a single frame to detect collision.

Furthermore, Source has a limit of 1024 brush entities it seems. So the voxel grid could neither be finer, nor much bigger, without reaching some limitations. Besides, it seems like the engine is already struggling to do collision detection of this many entities at once...

TL;DR: Write some C++ instead of doing it via I/O, or better yet, use another game engine for this.