from https://github.com/ArnCarveris/OpenSource.
fixed by ZRY.

Ivan Avdeev 564841de1e add mipmaps %!s(int64=7) %!d(string=hai) anos
3p 564841de1e add mipmaps %!s(int64=7) %!d(string=hai) anos
src 002291e49b add basic c vbsp parser and support stuff %!s(int64=7) %!d(string=hai) anos
.gitignore 3d5eba2d36 osx: restored, added nyans %!s(int64=11) %!d(string=hai) anos
.gitmodules 002291e49b add basic c vbsp parser and support stuff %!s(int64=7) %!d(string=hai) anos
.ycm_extra_conf.py ad0bd5eafa clarify standards usage %!s(int64=7) %!d(string=hai) anos
COPYING.WTFPL 57387726fe Create COPYING.WTFPL %!s(int64=11) %!d(string=hai) anos
OpenSource.c 37e14f2125 make base0 dxt1 textures mostly work %!s(int64=7) %!d(string=hai) anos
README.md 5bc3c46922 Update README.md %!s(int64=11) %!d(string=hai) anos
TODO aad29b1b37 add collections as a precursor for asset loading %!s(int64=7) %!d(string=hai) anos
ahash.h d58b010a46 test per-face draw-calls: too expensive %!s(int64=7) %!d(string=hai) anos
atlas.c 002291e49b add basic c vbsp parser and support stuff %!s(int64=7) %!d(string=hai) anos
atlas.h 002291e49b add basic c vbsp parser and support stuff %!s(int64=7) %!d(string=hai) anos
bsp.c 564841de1e add mipmaps %!s(int64=7) %!d(string=hai) anos
bsp.h 00dca06da1 add broken textures %!s(int64=7) %!d(string=hai) anos
cache.c d58b010a46 test per-face draw-calls: too expensive %!s(int64=7) %!d(string=hai) anos
cache.h 645a0db1a7 remove all remaining allocator uses %!s(int64=7) %!d(string=hai) anos
collection.c 01314e79a0 add material and texture loading into memory %!s(int64=7) %!d(string=hai) anos
collection.h 7627c63761 make filesystem collection case insensitive %!s(int64=7) %!d(string=hai) anos
common.h 645a0db1a7 remove all remaining allocator uses %!s(int64=7) %!d(string=hai) anos
compile.sh 01314e79a0 add material and texture loading into memory %!s(int64=7) %!d(string=hai) anos
dxt.c 37e14f2125 make base0 dxt1 textures mostly work %!s(int64=7) %!d(string=hai) anos
dxt.h 01314e79a0 add material and texture loading into memory %!s(int64=7) %!d(string=hai) anos
filemap.c aad29b1b37 add collections as a precursor for asset loading %!s(int64=7) %!d(string=hai) anos
filemap.h aad29b1b37 add collections as a precursor for asset loading %!s(int64=7) %!d(string=hai) anos
libc.h 01314e79a0 add material and texture loading into memory %!s(int64=7) %!d(string=hai) anos
material.c 37e14f2125 make base0 dxt1 textures mostly work %!s(int64=7) %!d(string=hai) anos
material.h 37e14f2125 make base0 dxt1 textures mostly work %!s(int64=7) %!d(string=hai) anos
mempools.h 645a0db1a7 remove all remaining allocator uses %!s(int64=7) %!d(string=hai) anos
texture.c 564841de1e add mipmaps %!s(int64=7) %!d(string=hai) anos
texture.h 645a0db1a7 remove all remaining allocator uses %!s(int64=7) %!d(string=hai) anos
vbsp.h 00254c406b get displacement lightmaps to work almost correctly %!s(int64=7) %!d(string=hai) anos
vtf.h 01314e79a0 add material and texture loading into memory %!s(int64=7) %!d(string=hai) anos

README.md

OpenSource

This all began more than ten years ago when I was playing Half-Life for the first time and noticed that some maps should really overlap if they were connected the way they were at the loading location. (e.g. there's this huge area, then a shallow path, right turn, load, right turn again and then another huge area).

I've been wondering since, what would the map of entire Half-Life look like if you merge all the maps together...

...

Then, after all these years, I suddenly realized that it's actually not that hard.

So, here you go, this utility does exactly that -- it loads a valve bsp file, then finds all the connections and loads them next.

Video of a fly around the entire Half-Life world: http://www.youtube.com/watch?v=-SaRdQdW-Ik

Half-Life 1:

Half-Life 2:

What it loads

  • all the bsp brushed geometry, including some weird detached stuff
  • lightmaps

What it does not load

  • models
  • material textures (they take fuckload of videomem and look like shit anyway)
  • bsp visibility info, as there's obviously no point in doing that

Supported platforms

  • Linux
  • Mac OS X
  • Windows
  • Raspberry Pi

Supported games

Everything with VBSP version 19 should work. Tested on Half-Life: Source and Half-Life 2.

Half-Life 2 has some issues:

  • no displacements
  • incorrect parsing of lightmap format for ver20 vbsp

How to

  1. Get an appropriate binary from bin/, or compile one if you're on linux or raspberry (see below)
  2. Get a Half-Life: Source (not the vanilla one) gcf file and extract it somewhere
  3. win32/osx: drag-n-drop c0a0.bsp onto application; linux/rpi: see below
  4. Wait 10-30 seconds (I was too lazy to code a loader screen)
  5. ?????
  6. Have fun

How to compile (linux/raspberry)

Prerequisites:

  • common:
    • gcc
    • make
  • Linux:
    • libSDL
  • Raspberry:
    • broadcom sdk in /opt/vc (pre-installed on raspbian)
    • no libSDL, no X11 required!
    • /dev/input/event0 and 1 are expected to be a mouse and a keyboard respectively
  1. git clone https://github.com/w23/OpenSource.git
  2. cd OpenSource
  3. git submodule init
  4. git submodule update
  5. make -C 3p/kapusha -j5
    • raspberry: make -C 3p/kapusha RPI=1
  6. make -j5
    • raspberry: make RPI=1
  7. ./OpenSource /path/to/gcf/root/hl1/ c0a0
    • raspberry: ./OpenSource /path/to/gcf/root/hl1/ c0a0 32

Other platforms (win32/osx): there are nice project files!

ISSUES

  • The code is bad and I should feel bad.

Next stop: the huge world of Portal 2