creator cover maximqad
maximqad

maximqad 

just a dev who ports fps to Dreamcast

4subscribers

4posts

goals1
$76.92 of $456 raised
BBA

About

Hi, my name is Max. 
I'm from Russia. Just hobbying with programming and now my goal is to get Dreamcast more online games.

How Half-Life’s Renderer Was Rebuilt for Dreamcast (part 2)

The PC GoldSrc studio renderer was designed around late-1990s OpenGL. It assumes a reasonably capable CPU, abundant system memory, and an OpenGL driver that can absorb thousands of small immediate-mode calls.
That model does not fit the Dreamcast.
The Dreamcast port keeps GoldSrc’s animation system, bones, body groups, skins, chrome effects, render modes, and triangle-command format, but replaces the final half of the pipeline with something much more deliberate. The renderer is built around SH-4 matrix instructions, indexed batching, preprocessed geometry, PVR-native textures, and a special multi-matrix extension hidden inside the Dreamcast Direct3D driver.

How Half-Life’s BSP Renderer Was Reworked for the Dreamcast

At a glance, the Dreamcast port of Half-Life still renders the world the same way as the PC build: determine the current BSP leaf, decompress its PVS, walk the visible BSP nodes, reject geometry outside the frustum, collect visible surfaces, and draw them grouped by texture.
Underneath that familiar structure, however, the Dreamcast renderer is substantially different. The port trades the PC renderer’s generous memory layouts and OpenGL immediate-mode drawing for compact structures, shared data, explicit batching, native texture formats, and carefully managed rendering passes.
The result is not a new renderer so much as a Dreamcast-specific interpretation of GoldSrc’s renderer.

The BSP algorithm survived; its data did not

The high-level world-rendering sequence remains recognizable:
  1. Mod_PointInLeaf finds the leaf containing the camera.
  2. R_MarkLeaves obtains that leaf’s potentially visible set.
  3. Visible leaves mark their parent nodes.
  4. R_RecursiveWorldNode walks only the marked part of the BSP.
  5. Node bounds are tested against the view frustum.
  6. Visible surfaces are linked into texture chains.
  7. The texture chains are submitted in batches.
  8. Decals and lightmaps are rendered as later passes.
The PC build follows almost the same logical sequence. The major difference is that the Dreamcast port aggressively changes the runtime representation of the BSP.
The original PC structures use full-width integers for values such as contents and visframe. On Dreamcast, these become signed bytes. Surface frame markers, dynamic-light frame markers, lightmap coordinates, surface edge counts, style indices, and several flags are packed into byte or short fields.
The Dreamcast node and leaf layouts are also deliberately arranged so their common header occupies the same offsets. A leaf can therefore be traversed as an mnode_t while walking back through its parents without conversion or an extra abstraction layer.
This matters on a machine with 16 MB of main RAM. BSP data is touched constantly by visibility, collision, lighting, entity linking, and rendering. Reducing its working set improves more than the amount of free memory: it also reduces the pressure placed on the SH-4 cache and memory bus.

The plane-normal table

One of the most distinctive Dreamcast changes is the global plane-normal table.
In the PC build, every runtime BSP plane is an mplane_t containing:
  • A three-float normal vector.
  • A float distance.
  • Plane type and sign bits.
  • Padding.
That is 20 bytes per plane. The PC loader even reserves space for twice the BSP plane count.
 
 

Half-Life Dreamcast is back online!!

The engine's net_ws transport layer — the code that owns the UDP sockets and moves packets in and out — was replaced with stubs. They compile, they get called, they return cleanly, and they do nothing. Look at the executable's import table and there is no winsock at all: the binary has no way to open a socket even in principle.
The gutting goes past the transport. Chunks of the client that only matter when other players exist were trimmed or narrowed on the assumption that nobody would ever be online. The multiplayer menu leads nowhere.
And the disc's copy of Windows CE was built without a networking component either, so even a fully repaired game would have nothing underneath it.
Subscription levels0
No subscription levels
Go up