HL2.5D

Description

HL2.5D is a demake of Half-Life using a hand-written raycaster engine.

Picking up the HEV suit

LÖVE didn't support 3D back in 2014, so I had to write my own raycaster engine, the same thing Wolfenstein 3D used.

Writing the pixels manually would have been very slow in Lua (even in LuaJIT that LÖVE uses). So instead of doing that, I compute the height of each wall column on screen and draw a single-pixel-wide quad.

Classic Wolfenstein-like raycasters cannot draw floors and ceilings that are not uniformly coloured, but I really wanted to have that feature. Clearly, a cheat was needed :-)

First, I render the tiles of the floor from the perspective of the player onto an offscreen canvas. This only takes translation and rotation into account, because LÖVE doesn't support projective transformations. Then I draw pixel-high quads from the offscreen canvas onto the screen, scaling every single one according to its perspective scale.

This is not the fastest way to render this, but it works fine in LÖVE without custom shaders. (Note: newer LÖVE versions can draw arbitrary meshes, which would have made this part a lot easier, but it was fun anyway).

I didn't work on this one alone, @x_rxi contributed a major part of the gameplay code, tileset and sprites, and @slapmybitsup contributed the scientist sprite.

We didn't finish in time for the MiniLD, apparently making a full FPS game is more work than we anticipated. But I learned a great deal.

I open sourced the engine, you can grab it on my GitHub.

Links