Spaces:
Running
Bundle canonical map assets in-repo (addresses PR #12 map concern)
Browse filesPR #12 (feature/gryffin, @GryffindorafAviator) flagged that the bench
could not resolve base maps without an external OpenRA-RL-Training
checkout. This addresses that concern correctly:
- Bundle the 5 canonical .oramap terrain files the 200 packs actually
use — rush-hour-arena (195 packs) + singles-maginot/twobody/gauntlet
/dilemma — into data/maps/, copied verbatim from the canonical
source (bundled rush-hour-arena map.bin sha == canonical 9567214c).
- loader.py: data/maps is scanned first in _MAP_DIRS so the bench is
self-contained for terrain; the home-dir paths stay as dev fallbacks.
discover_packs uses rglob for nested pack dirs.
NOT taken from PR #12:
- Its bundled maps were placeholder terrain (rush-hour-arena and
scout-maginot shared one generic map.bin that did NOT match
canonical) — replaced with the real maps.
- Its openra_rl_training shim was hand-written stubs diverging from the
real package (DEFAULT_REWARD_WEIGHTS outcome 0.2 vs real 0.5;
ScenarioDefinition schema mismatch) — would silently corrupt scoring;
declined.
- Its numpy<2 pin — the bench is green on numpy 1.26.4 and modern
pandas/pyarrow support numpy 2; the ABI claim is outdated, no pin.
|
Binary file (874 Bytes). View file
|
|
|
|
Binary file (870 Bytes). View file
|
|
|
|
Binary file (872 Bytes). View file
|
|
|
|
Binary file (870 Bytes). View file
|
|
|
|
Binary file (875 Bytes). View file
|
|
|
|
@@ -22,7 +22,11 @@ PACKS_DIR = Path(__file__).parent / "packs"
|
|
| 22 |
# Dirs scanned for `<base_map>.oramap` terrain files. The Rust engine
|
| 23 |
# parses real .oramap terrain (map.bin) when handed an absolute path, so
|
| 24 |
# any map present here is a usable custom map — not a 2-entry allowlist.
|
|
|
|
|
|
|
|
|
|
| 25 |
_MAP_DIRS = [
|
|
|
|
| 26 |
Path.home() / "Projects/OpenRA-RL-Training/scenarios/maps",
|
| 27 |
Path.home() / "Projects/openra-rl/maps",
|
| 28 |
]
|
|
@@ -61,7 +65,7 @@ def discover_packs(directory: str | Path | None = None) -> list[ScenarioPack]:
|
|
| 61 |
"""
|
| 62 |
directory = Path(directory) if directory else PACKS_DIR
|
| 63 |
packs: list[ScenarioPack] = []
|
| 64 |
-
for p in sorted(directory.
|
| 65 |
if p.name.startswith(("_", "TEMPLATE")):
|
| 66 |
continue
|
| 67 |
packs.append(load_pack(p))
|
|
|
|
| 22 |
# Dirs scanned for `<base_map>.oramap` terrain files. The Rust engine
|
| 23 |
# parses real .oramap terrain (map.bin) when handed an absolute path, so
|
| 24 |
# any map present here is a usable custom map — not a 2-entry allowlist.
|
| 25 |
+
# `data/maps` (first) bundles the canonical terrain in-repo so the bench
|
| 26 |
+
# is self-contained — no external OpenRA-RL-Training checkout needed;
|
| 27 |
+
# the home-dir paths remain as fallbacks for dev setups.
|
| 28 |
_MAP_DIRS = [
|
| 29 |
+
Path(__file__).resolve().parents[2] / "data" / "maps",
|
| 30 |
Path.home() / "Projects/OpenRA-RL-Training/scenarios/maps",
|
| 31 |
Path.home() / "Projects/openra-rl/maps",
|
| 32 |
]
|
|
|
|
| 65 |
"""
|
| 66 |
directory = Path(directory) if directory else PACKS_DIR
|
| 67 |
packs: list[ScenarioPack] = []
|
| 68 |
+
for p in sorted(directory.rglob("*.yaml")):
|
| 69 |
if p.name.startswith(("_", "TEMPLATE")):
|
| 70 |
continue
|
| 71 |
packs.append(load_pack(p))
|