• Stars
    star
    120
  • Rank 295,983 (Top 6 %)
  • Language
    Rust
  • Created over 4 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Göld: Löve for Goldsrc

Göld - Löve but for Goldsrc

This is designed to be a game engine for hacking together 3D games using old tech. It's based on the simple mental model of PyGame or Löve, but for Goldsrc/Quake-era tech. My ultimate goal is to have a simple engine which can do basically everything that many simplistic 3D games will need, without making an attempt at being too general. I can currently load Quake 2 maps (although not Quake/Goldsrc maps yet), render them with proper BSP culling and frustrum culling, and load and render HL1 models. Many Quake 2 maps look better in Göld than in the original game, since Göld renders in HDR and applies the filmic ACES tonemapping algorithm, extended with crosstalk (desaturating bright colours) and bloom implemented with Kawase blur. Eventually I'll write a post up explaining why HDR and tonemapping is important, and comparing XYZ tonemapping to tonemapping componentwise in RGB (which is how many HDR renderers handle it, requiring an additional colour-correction step). In an ideal world I'd do tonemapping using OpenColorIO so that I can, for example, use Filmic Blender tonemapping instead of hardcoding ACES, but it's not particularly pressing.

Renderer settings can be tweaked by pressing backtick to access the debug menu.

Screenshot 1

Screenshot 2

Screenshot 3

Screenshot 4

Roadmap/future features

The next feature I want to implement is animation. It's partially completed, but I can't load the animations from the .mdl file yet. My next task will be extending my BSP loader to support loading Half-Life 1 maps. In an ideal world I'd also be able to load Quake 1 and Quake 3 maps too, and even other forms of BSP, but that's much more of a stretch goal than anything else since Half-Life 1 is the game that I want to steal assets from the most. After that my next task is integrating a scripting layer and adding some simple collision and other game-specific elements. As a part of implementing scripting and collision I want to convert this to use an ECS. I'm considering rewriting this to use Bevy, which would make integrating scripting easier, but I'm not yet sure whether that would work well as I've written a Quake 3 map renderer on Amethyst which was a horrible experience, as the asset loading system and renderer were almost unusable. Admittedly since this is a standalone project and not a library I would be completely able to throw out the Bevy renderer (and I would probably have to considering I've written my own that's tailored perfectly for what I need to render), but if the asset loader isn't usable that's more of an issue. It's something I'll have to tackle once animation is implemented. Finally, I want to have some kind of scriptable UI system, and I don't want it to be custom. Dear ImGui is one solution but I'm also considering using Ultralight (which, for some reason, has Rust bindings on PsychonautWiki's GitHub account). Since one possible future goal is to get this running on the web, having a web-native UI framework might be pretty nice.

My ultimate goal is to make a simple racing game or platformer using this engine - if I have the time, both. I don't really intend to release a full game using this, but I think it'd be good to try to make two quite-different games as a test for how easy it is to make something different. I might try to reimplement simple versions of some classic Quake mods like Q3Rally or FreeCS, or even allow using QuakeC as the scripting language directly, except with a superset of the functions available (similar to how FTEQuake works). The first language I want to use is Lua though, so if I do implement QuakeC scripting it'll be possible to seamlessly use Lua and QuakeC scripts in the same project.

I do not intend for this to be a full Quake series source port like Darkplaces or FTEQuake, but instead to be a Quake-like game engine that implements features in a Quake-compatible way where convenient. However, I am considering how possible it would be for me to compile the Half-Life or Xash client/server source code to WebAssembly and run it, as Half-Life separates the game (which is a .dll) from the engine (which is a .exe). Whether this is worth the significant effort that would be required is up for debate. It would be cool to get Goldsrc games working on this though, since I think They Hunger especially would be great to see rendered in a modern engine with modern conveniences.

How to use

Extract Quake 2's .pak files into a folder called data in the working directory that you'll be executing the program in (so probably the project root, if you're executing with cargo run). You can do this with a tool like pakextract. I don't parse .wal textures, so you'll have to bulk-convert any textures stored as .wal to .tga, .png, .gif or suchlike. I'm just using the image library for my image parsing, since Goldsrc uses .png and .tga textures anyway and the game that I have in mind as an "end goal" for this project primarily reuses Goldsrc assets. To convert .wal to .tga, I would like to recommend Wally since everyone else online does, but I've found that it consistently crashes when batch processing images under Wine, and so the best way I've found to do the conversion is by a simple Python script using the Pillow library:

from PIL import WalImageFile

for vals in os.walk("."):
    root, dirs, files = vals
    for file in files:
        pre, ext = os.path.splitext(file)
        try:
            WalImageFile.open(root + "/" + file).save(root + "/" + pre + ".png")
        except:
            pass

If you don't do this, you'll see something which I'm sure will be familiar to many modders and tinkerers of this era of games:

Missing texture

More Repositories

1

const-concat

Heinous hackery to concatenate constant strings.
Rust
112
star
2

crunchy

Crunchy unroller - deterministically unroll constant loops
Rust
30
star
3

zig-kak

Kakoune syntax highlighting for Zig
14
star
4

pollock

An ergonomic and performant processing-like library for generative art and simple games in Rust
Rust
10
star
5

runwasm

Run emscripten-compiled wasm files using `wasmi` and dark magic
Rust
9
star
6

rustfest-perf-workshop

Example code for the Rustfest Fastware workshop
Rust
7
star
7

octahack-rs

A fast, efficient, modular music creation toolkit, designed for live performance
Rust
6
star
8

sexpress

Extremely fast s-expression parser for lisp implementations. It's pretty unwieldy to use right now.
NewLisp
6
star
9

asmquery

An extremely-WIP low-level retargetable instruction selection subsystem for Lightbeam, designed for optimisation and simplicity
Rust
4
star
10

troubles.md

Source to http://troubles.md/
HTML
3
star
11

octahack-zig

VCV/Max-style modular plug-anything-to-anything system, designed to be embedded free-standing in an Octatrack-style physical instrument
Zig
3
star
12

autoproto

Replacement derive macros for `prost::Message`, and supporting traits and types to make implementing this trait easier
Rust
3
star
13

nan-preserving-float

Rust
3
star
14

skottie-rs

Lottie animation player using Skia
Rust
2
star
15

GoldsRS

An uncoordinated mess of goldsrc-era file format parsers (BSP, MDL, etc.)
Rust
2
star
16

cowvec

Faster version of `Cow<[T]>` and `Cow<str>`
Rust
2
star
17

quadratic-decomposition

Vector stroke renderer by decomposing shapes into simple fills and quadratic bezier curves.
Rust
2
star
18

stateful-lua

A DSL for writing finite state machines in Lua (aimed towards game development). Based on UnrealScript's state construct. Allows single inheritance with the enter and exit functions being called the minimum number of times.
Lua
2
star
19

flow-field-pathfinding

Simple implementation of flow field pathfinding built on top of petgraph
Rust
1
star
20

astcenc-sys

Low-level bindings for astc-encoder, the ARM library to create ASTC files.
Rust
1
star
21

madvise-rs

Rustic safe wrapper around madvise
Rust
1
star
22

llvm-euler

Project euler problems in raw, artisinal LLVM IR (copied from my old account)
LLVM
1
star
23

stupid-alloc

A simple, serialisable external allocator designed to reuse space in long-lived mutable files.
Rust
1
star
24

assimp-sys

Forked from Eljay, but that user seems to have deleted all their projects
Rust
1
star
25

serializable-tlsf

Implementation of two-level segregated fit for memory allocation in long-lived files.
Rust
1
star
26

quake-shooter

Quake-like shooter based on amethyst
Rust
1
star
27

astcenc-rs

Idiomatic Rust bindings to the official ASTC encoder library from ARM
Rust
1
star
28

somr

Single-owner, multiple-reader pointer (like `Rc` without the refcounting)
Rust
1
star
29

rustfest-game

Simple multiplayer asteroids game for rustfest
Rust
1
star
30

waveform

Really hacky audio visualiser/player put together for fun/testing
Rust
1
star
31

mdfmt

Simple, extremely opinionated markdown "prettifier". Will probably eat your laundry.
Rust
1
star
32

chat-lua

Proof-of-concept chat eDSL in Lua using coroutines
Lua
1
star
33

ranger-kak

Replacement Ranger integration after it was removed from Kakoune's default bundle
1
star