The universal racing game
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Nomagno e09b27bb13 Regenerate HTML as ASCII-only 19 hours ago
assets Add full SDL support to HWVi 2 weeks ago
docs Regenerate HTML as ASCII-only 19 hours ago
include/halfworld Reduce operands from three to two 2 days ago
src Reduce operands from three to two 2 days ago
.clang-format The Universal Racing Game Protocol 4 weeks ago
LICENSE The Universal Racing Game Protocol 4 weeks ago
README Little messaging change 2 days ago



Half-World is a stateless protocol for racing games, and with a bit more work any 2D game that needs to be accessible, lightweight, and work under heavy/total packet loss.

It has no implementation requirements whatsoever.

There is a modular no-dependency implementation of a racing game that adheres to Half-World.
'include' folder: Interfaces
'src' folder: Implementations
It has a lot of C utility interfaces, such as:
- HWDOC (Packet/Circuit) generic tokenizer (include/halfworld/hwdoc/hwdoc.h)
- Packet/Circuit data structures and tokenizer (WIP) (include/halfworld/hwdoc/hwnet.h) (include/halfworld/hwdoc/hwt.h)
- Portable VM with custom instruciton set, and assembly language (include/halfworld/hwvm/hwvm.h)
- Portable abstraction over graphics, sound, and input backends (include/halfworld/hwvi.h)
- Arbitrary-viewport ASCII 2D renderer (WIP)
- Portable declarative physics engine (WIP) (include/halfworld/halfive.h)

Back of the envelope calculations suggest that (depending on preprocessor statements used to hided away excessively heavy code),
the memory footprint of the (backend part of the engine) will range from around 256KBs to around 2MBs. It is reasonable to expect
a maximum memory footprint (sound and graphic backends aside, but taking into account the display and network buffers and code) of
4-8MBs, when no memory-reducing preprocessor macros are defined.

Available macros (not setting any of these makes for a headless/nolibc build):
HWVI_GSERV_IMPL_FOO - Enable HWVI graphics server implementation foo
HWVI_AUDIOSERV_IMPL_FOO - Enable HWVI audio server implementation foo
HWVI_STDINPUT_IMPL_FOO - Enable HWVI input server implementation foo

HWASSEMBLY - Enable entry point for assembler
HWVM_OU_HEX - Enable HWVM output register as hexadecimal
HWVM_OU_RAW - Enable printing HWVM output register as raw characters
HWVM_OU_DEBUG - Enable HWVM debug printing
HALFIVE_VM_SIMULATION - Most memory consuming option, enable doing per-player HWVM simulation.

List of specifications and corresponding mime types:
Encoding formats:
Half-World Document (HWDOC)
- text/hwdoc

Domain-specific data formats:
Half-World Network (HWNET)
- text/hwnet
Half-World Track (HWT)
- text/hwt

General-purpose tools:
Half-World Virtual Machine (HWVM)
- text/hwvm
- application/hwbin
- application/hwdrive

If you read all specifications in the docs, you should be able to:
- Use HWNET as a basic communications standard
- Use HWT as a basic format for circuits
- Use HWVM as a basic runtime for user-generated content

To make them extensions easily trackable, I recommend specifying inside them an 8-character alphanumerical name (underscore hyphen 0-9 A-Z a-z, e.g "_My-Ext2").

--- Licensing ---
The whole project is released under the COIL license, as well as all *original* assets/code. Please see each file for individual licensing information, however.