Gource Engine - Go game engine for Source Engine games
October 16, 2018
As my earlier projects may have made apparent, I’ve been working on a game engine in Golang. There aren’t may of these available, so besides a few examples, and some CGO bindings for windowing libraries I am more or less on my own here.
The purpose of this project is absolutely not to produce any generic game engine that can be used for any game. The purpose was to create a drop-in replacement for source engine client binaries, ideally for single player, although providing an interface for networking isn’t beyond the realm of possibility.
All source engine games are different. They share a massively similar core codebase (unsuprisingly), but have all the game logic creeping across the common codebase. Not to mention that Valve’s games are all closed source. I want to create a common open source base for source games, that clients could build on top of, or in as many cases as possible, just be dropped in as a replacement for existing binaries. This project would provide common entity definitions, and a mechanism to define game-specific entities and their behaviour.
Naturally this is a massive task. I’m painfully aware of the aspects of source that need replicating for this: file format loading, scene management and rendering, AI, physics, potentially networking and the event/entity I/O manager.
So where am I at right now? Right now, the project can be pointed at any source game directory, load any bsp within it, as well as any content path/vpk’s listed in the games gameinfo.txt. From that information, it can load and display vmt and vtf material/textures. Fully visibility data/culling is supported (and as of last night, working correctly it appears) Displacements can be loaded, but is incomplete Props can be partially loaded but again this is incomplete Only $basetexture is supported by the shaders right now, but all properties are available from the parsed vmts, so implementation of other parameters shouldn’t necessarily be hugely complicated.
Next steps (at time of writing)
- Finish prop loading
- Implement bullet physics library (attempting to replicate VPhysics is nigh impossible, although there is a gmod-vphysics project that could be cgo’d in. Need to investigate)
- Begin entity definitions and entity I/O manager
Naturally this is open source and available here: https://github.com/galaco/Gource-Engine