Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fork of Quake GPL Source Release with modern CMake build pipeline and WASM + WebSocket multiplayer support

Notifications You must be signed in to change notification settings

initialed85/Quake

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

15 Commits

Repository files navigation

Quake

This repo contains my attempt to modernise the Quake 1 source code.

If it's working (mileage varies) you can play it right now at quake.initialed85.cc; I'm running a few dedicated servers, but you can also run your own to play against others right from your (standard old school Quake listen server style).

Goals

  • Aim to keep the experience primarily vanilla with a few tasteful improvements
  • Get the code building as a CMake project
  • Use SDL2 as the system platform abstraction
  • Provide build tooling for macOS, Linux and WASM (sorry about it Windows)
  • Fix the NAT-related issues in the original UDP net code
  • Implement WebSocket multiplayer for the WASM build (via a proxy / gateway server)

Tasks

  • [DONE] Get the code building as a CMake project
    • [DONE] Get a skeleton CMake project working w/ sys_null.c etc
      • [DONE] Fix various variable name clashes etc when throwing everything into a single LibQuakeLib
        • [TODO] Figure out if this is okay- the original build tooling clearly made it all work somehow
  • [DONE] Use SDL2 as the system platform abstraction
    • [DONE] Work out idiomatic way to include SDL2
    • [DONE] Implement video w/ SDL2
    • [DONE] Implement keyboard w/ SDL2
    • [DONE] Implement mouse w/ SDL2
    • [DONE] Implement audio w/ SDL2
  • [DONE] Provide build tooling for macOS, Linux and WASM (sorry about it Windows)
    • [DONE] Make Bash scripts for native (macOS / Linux) builds
    • [DONE] Make Bash scripts for WASM builds
      • [DONE] Various fixes to get WASM builds working
    • [DONE] Make Bash scripts for Docker (Linux) builds
  • [DONE] Fix various bugs stumbled across
    • [DONE] Fix pointer math segfault loading maps in common.c::COM_FileBase
    • [DONE] Fix pointer math segfault loading maps in pr_exec.c::PR_ExecuteProgram::OP_EQ_S
    • [DONE] Fix null pointer caused (I think) by late init of SDL2 audio under WASM in snd_mix.c::Snd_WriteLinearBlastStereo16
    • [DONE] Fix null pointer to do with server setup in sv_main.c::SV_ModelIndex
    • [DONE] Fix pointer math segfault to do with warping and odd screen sizes caused by r_shared.h::MAXHEIGHT and r_shared.h::MAXWIDTH
    • [DONE] Fix whatever the pointer hell was going on with pr_strings
  • [DONE] Fix the NAT-related issues in the original UDP net code
    • You can control the port your client will use with the -port flag; e.g. if you wanted to run a server and 2 clients all on the same machine:
      • ./Quake -port 26000 +map start
      • ./Quake -port 26001 +connect 127.0.0.1:26000
      • ./Quake -port 26002 +connect 127.0.0.1:26000
  • [DONE] Implement WebSocket multiplayer for the WASM build (via a proxy / gateway server)
  • [TODO] Fix crash encountered with -width 2560 -height 1440 -fullscreen and maybe higher resolutions
  • [TODO] Fix server search screen not finding all servers
  • [TODO] Fix FrikBot going into some state where it won't attack (probably relates to my workaround hack for runaway loop error)
  • [TODO] Make it so the server can specify some FrikBots to join from the commandline

Usage

There are similar build scripts for 3 different build variants:

  • Native
    • Build for whatever your platform is (as long as it's macOS or Linux)
    • Build output is at WinQuake/build-native
  • WASM
    • Build for running in a browser
    • Build output is at WinQuake/build-wasm
  • Docker
    • Build for Linux, using Docker
    • Build output is at WinQuake/build-docker

NOTE: You'll need to place your demo / purchased Quake resources at WinQuake/id1 to be able to run Quake.

Native

# build once
./build-native.sh
# build any time code changes
./watch-build-native.sh
# run in a 1280x800 window (i.e. cd WinQuake && ./build-native/WinQuake -width 1280 -height 800)
./run-native.sh

WASM

# build once
./build-wasm.sh
# build any time code changes
./watch-build-wasm.sh
# run at https://localhost:8443 (play using a browser)
./run-wasm.sh

Docker

# build once
./build-docker.sh
# build any time code changes
./watch-build-docker.sh
# run in a Docker container (i.e. cd WinQuake && ./build-native/WinQuake -dedicated 16, in a Docker container)
./run-docker.sh

Original documentation

See original README and original LICENCE

Dev scratch notes

# for deploying Docker-built Linux Quake server to Kubernetes
ARCH=amd64 ./build-docker.sh && IMAGE=initialed85/quake:latest PUSH=1 ./package-docker.sh
# for deploying native-built WASM Quake server to Kubernetes
ARCH=amd64 ./build-wasm.sh && IMAGE_1=initialed85/quake-wasm-nginx:latest IMAGE_2=initialed85/quake-ws-server:latest PUSH=1 ./package-wasm.sh

About

Fork of Quake GPL Source Release with modern CMake build pipeline and WASM + WebSocket multiplayer support

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 70.4%
  • QuakeC 15.6%
  • Assembly 9.7%
  • Makefile 3.6%
  • Shell 0.4%
  • CMake 0.1%
  • Other 0.2%

AltStyle によって変換されたページ (->オリジナル) /