Ethosoft
A Gymnasium environment wrapping 331uw13/3D-Game — a raylib/C first-person shooter with procedural voxel terrain — as a headless, steppable RL environment.
The game runs off-screen (no visible window), driven one fixed timestep
(1/60s) at a time by actions from Python, via a small native library
(game3denv.dll) built from the game's own C source plus a thin env API
(see src/env/ in the main repo). No game-logic files were modified to make
this possible — see src/env/env_shim.c for how input is injected instead.
import gymnasium as gym
import ethosoft # registers "Game3D-v0"
env = gym.make("Game3D-v0")
obs, info = env.reset()
for _ in range(1000):
action = env.action_space.sample()
obs, reward, terminated, truncated, info = env.step(action)
if terminated or truncated:
obs, info = env.reset()
env.close()
Spaces
- Action (
Dict):move(MultiBinary(4): forward/back/left/right),run,jump,shoot,aim(Discrete(2)),look(Box(-1, 1, (2,))mouse-look delta, scaled bylook_scale). - Observation (
Dict):rgb(Box(0, 255, (H, W, 3), uint8)off-screen render, resolution fromgame.cfg),vector(Box(-inf, inf, (12,)): health fraction, armor fraction, xp, total kills, position xyz, yaw, pitch, onground, nearest enemy distance in the current chunk, nearest enemy alive). - Reward:
Δhealth * 0.1 + Δkills * 10 + 0.01per step,-50on death. terminatedwhen the player dies;truncatedaftermax_episode_steps(default 2000, set viaGame3DEnv(max_episode_steps=...)).
Scope (v0.1)
- Same procedurally generated world persists across episodes in a process;
reset()respawns the player, it does not regenerate terrain. - Inventory, NPC dialogue, and item crafting are not part of the action/ observation space yet.
- Only one
Game3DEnvmay be alive per process (the native library holds a single global game state) — use separate processes to parallelize. - Prebuilt binary ships for Windows x64 only. On Linux/macOS, build
game3denv.soyourself from the main repo (mingw32-make envlibon Windows or the equivalent GCC/Make invocation using the Makefile'senvlibtarget on Linux/macOS with raylib installed) and drop it intoethosoft/native/alongsideres/,weapons_cfg/, andgame.cfg.
License
GPL-3.0-or-later, same as the upstream game (raylib itself is zlib-licensed).
Metadata
Release files for ethosoft 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ethosoft-0.1.0.tar.gz | 6.7 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ethosoft-0.1.0-py3-none-win_amd64.whl | Python 3 | none | Windows x86-64 | Details |
Total release size: 13.4 MB
Release files / ethosoft-0.1.0.tar.gz
| Download URL | ethosoft-0.1.0.tar.gz |
|---|---|
| Size | 6.7 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
988c2db3958bf06bc42fe579589010d8e5948cda10af99d1671774ab576e7bb9
|
|
BLAKE2b-256 checksum How to use checksums |
38105fb884b51162604bda96bfd14f4d7f47afaa69a214ff1418b78a5567ed2a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.10
|
Release files / ethosoft-0.1.0-py3-none-win_amd64.whl
| Download URL | ethosoft-0.1.0-py3-none-win_amd64.whl |
|---|---|
| Size | 6.7 MB |
| Tags | Python 3 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
e1900029b11a63f9d2faf4c6f7e2664d7f6f2d7a08a8e020d7d4157af74f598b
|
|
BLAKE2b-256 checksum How to use checksums |
ceeec218efd5406cfb27c8235d0364c7d0e4bc387f8cec85037e8656f2b0366f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.10
|