Skip to content

weliveinhell/source-engine

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Emscripten port for the source engine (only portal tested)

hosted on yikes.pw

discord: https://discord.gg/2kgxEREY6g

list of broken stuff

  • sound
  • saving/loading (works, TODO: save to browser storage)
  • sometimes render breaks (something related to lightmaps?)
  • fullscreen html button (works through game settings)

building

use docker, something like this, there might be some missing libs idk:

docker run --rm -it -v.:/source-engine debian

apt update
apt install git curl wget python3 xz-utils llvm binutils -y

# activate emsdk
cd /
git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
git checkout 2d480a1b7c7a34a354188d93f3e89190a44a1d21
./emsdk install latest
./emsdk activate latest
source ./emsdk_env.sh

cd /source-engine

# patch and rebuild sdl2
embuilder --pic build sdl2 sdl2-mt
sed -Ei 's/freq = EM_ASM_INT/freq = MAIN_THREAD_EM_ASM_INT/' /emsdk/upstream/emscripten/cache/ports/sdl2/SDL-release-2.32.0/src/audio/emscripten/SDL_emscriptenaudio.c
embuilder --force --pic build sdl2 sdl2-mt

# patch glMapBufferRange to allow some "unsupported" parameters
patch /emsdk/upstream/emscripten/src/lib/libwebgl.js emscripten/libwebgl.patch

emmake ./build_emscripten.sh

then download packed game data (yikes.pw/portal/chunks/mapName.data for each map) and put it to ./build/install/chunks/

packing game data

first of all, you'll need to build engine from https://github.com/nillerusr/source-engine for your native arch add that printf to ./filesystem/basefilesystem.cpp

FileHandle_t CBaseFileSystem::OpenForRead( const char *pFileNameT, const char *pOptions, unsigned flags, const char *pathID, char **ppszResolvedFilename )
{
	printf("OpenForRead %s %s\n", pFileNameT, pathID);
	VPROF( "CBaseFileSystem::OpenForRead" );

and lauch it via emscripten/get_logs.sh script, make sure to edit map list

after that, use emscripten/repackage.js script to make .data chunks

edit knownMaps and baseGamePath variables, make sure to unpack all .vpks

About

Modified source engine (2017) developed by valve and leaked in 2020. Not for commercial purporses

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 79.5%
  • C 17.6%
  • SWIG 1.5%
  • C# 0.4%
  • Perl 0.3%
  • Python 0.3%
  • Other 0.4%