Skip to content

Commit 203961e

Browse files
committed
craftax: reorg to top-level config + shared resources dir
- config/ocean/craftax.ini -> config/craftax.ini - config/ocean/craftax_classic.ini -> config/craftax_classic.ini - ocean/craftax/textures.bin -> resources/craftax/textures.bin - scripts/craftax_convergence_bench.py -> tests/craftax_convergence_bench.py - drop empty scripts/ directory - pack_textures.py: write to resources/craftax/textures.bin - craftax.h / craftax_classic.h: fopen textures from resources/craftax/
1 parent 30fbea8 commit 203961e

6 files changed

Lines changed: 11 additions & 11 deletions

File tree

ocean/craftax/craftax.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -752,17 +752,17 @@ static bool craftax_textures_loaded = false;
752752
static void craftax_load_textures(void) {
753753
if (craftax_textures_loaded) return;
754754
const char* candidates[] = {
755-
"ocean/craftax/textures.bin",
756-
"../ocean/craftax/textures.bin",
757-
"../../ocean/craftax/textures.bin",
755+
"resources/craftax/textures.bin",
756+
"../resources/craftax/textures.bin",
757+
"../../resources/craftax/textures.bin",
758758
};
759759
FILE* f = NULL;
760760
for (size_t i = 0; i < sizeof(candidates)/sizeof(candidates[0]); i++) {
761761
f = fopen(candidates[i], "rb");
762762
if (f) break;
763763
}
764764
if (!f) {
765-
fprintf(stderr, "craftax: textures.bin not found run ocean/craftax/pack_textures.py\n");
765+
fprintf(stderr, "craftax: textures.bin not found in resources/craftax -- run ocean/craftax/pack_textures.py\n");
766766
exit(1);
767767
}
768768
const size_t tile_bytes = CRAFTAX_TEX_TILE_PX * CRAFTAX_TEX_TILE_PX * 4;

ocean/craftax/pack_textures.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
ASSETS = Path(__file__).resolve().parents[2] / (
2222
".venv/lib/python3.12/site-packages/craftax/craftax/assets"
2323
)
24-
OUT_BIN = Path(__file__).parent / "textures.bin"
24+
OUT_BIN = Path(__file__).resolve().parents[2] / "resources" / "craftax" / "textures.bin"
2525

2626
TILE = 16
2727

ocean/craftax_classic/craftax_classic.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1008,17 +1008,17 @@ static bool cc_textures_loaded = false;
10081008
static void cc_load_textures(void) {
10091009
if (cc_textures_loaded) return;
10101010
const char* candidates[] = {
1011-
"ocean/craftax/textures.bin",
1012-
"../ocean/craftax/textures.bin",
1013-
"../../ocean/craftax/textures.bin",
1011+
"resources/craftax/textures.bin",
1012+
"../resources/craftax/textures.bin",
1013+
"../../resources/craftax/textures.bin",
10141014
};
10151015
FILE* f = NULL;
10161016
for (size_t i = 0; i < sizeof(candidates)/sizeof(candidates[0]); i++) {
10171017
f = fopen(candidates[i], "rb");
10181018
if (f) break;
10191019
}
10201020
if (!f) {
1021-
fprintf(stderr, "craftax_classic: textures.bin not found run ocean/craftax/pack_textures.py\n");
1021+
fprintf(stderr, "craftax_classic: textures.bin not found in resources/craftax -- run ocean/craftax/pack_textures.py\n");
10221022
exit(1);
10231023
}
10241024
const size_t tile_bytes = CC_TEX_TILE_PX * CC_TEX_TILE_PX * 4;
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
isn't rewarded twice for reaching the same tier.
1212
1313
Usage:
14-
uv run python scripts/craftax_convergence_bench.py --timesteps 10_000_000
15-
uv run python scripts/craftax_convergence_bench.py --skip-train --plot-only
14+
uv run python tests/craftax_convergence_bench.py --timesteps 10_000_000
15+
uv run python tests/craftax_convergence_bench.py --skip-train --plot-only
1616
"""
1717
import argparse
1818
import json

0 commit comments

Comments
 (0)