harddaysengine 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- harddaysengine-0.1.0/.gitattributes +6 -0
- harddaysengine-0.1.0/.github/workflows/ci.yml +32 -0
- harddaysengine-0.1.0/.gitignore +29 -0
- harddaysengine-0.1.0/.importlinter +82 -0
- harddaysengine-0.1.0/.python-version +1 -0
- harddaysengine-0.1.0/AGENTS.md +107 -0
- harddaysengine-0.1.0/DEAD_ENDS.md +24 -0
- harddaysengine-0.1.0/GEMINI.md +10 -0
- harddaysengine-0.1.0/LICENSE +25 -0
- harddaysengine-0.1.0/PKG-INFO +157 -0
- harddaysengine-0.1.0/README.md +140 -0
- harddaysengine-0.1.0/config.example.toml +7 -0
- harddaysengine-0.1.0/docs/ARCHITECTURE.md +5573 -0
- harddaysengine-0.1.0/docs/DECISIONS.md +1063 -0
- harddaysengine-0.1.0/docs/IMPLEMENTATION_PLAN.md +455 -0
- harddaysengine-0.1.0/docs/PLAYABILITY_AUDIT.md +307 -0
- harddaysengine-0.1.0/docs/PROGRESS.md +244 -0
- harddaysengine-0.1.0/pyproject.toml +139 -0
- harddaysengine-0.1.0/scripts/audit_shots.py +138 -0
- harddaysengine-0.1.0/scripts/quality_gate.py +95 -0
- harddaysengine-0.1.0/scripts/verify_campaign.py +56 -0
- harddaysengine-0.1.0/src/harddaysengine/__init__.py +7 -0
- harddaysengine-0.1.0/src/harddaysengine/__main__.py +5 -0
- harddaysengine-0.1.0/src/harddaysengine/app/__init__.py +39 -0
- harddaysengine-0.1.0/src/harddaysengine/app/audio.py +214 -0
- harddaysengine-0.1.0/src/harddaysengine/app/audio_stream.py +81 -0
- harddaysengine-0.1.0/src/harddaysengine/app/audit.py +1062 -0
- harddaysengine-0.1.0/src/harddaysengine/app/campaign_audit.py +259 -0
- harddaysengine-0.1.0/src/harddaysengine/app/config.py +331 -0
- harddaysengine-0.1.0/src/harddaysengine/app/dice_screen.py +113 -0
- harddaysengine-0.1.0/src/harddaysengine/app/ending_audit.py +82 -0
- harddaysengine-0.1.0/src/harddaysengine/app/ending_screen.py +163 -0
- harddaysengine-0.1.0/src/harddaysengine/app/fight_audit.py +671 -0
- harddaysengine-0.1.0/src/harddaysengine/app/fight_runtime.py +688 -0
- harddaysengine-0.1.0/src/harddaysengine/app/fight_scene.py +50 -0
- harddaysengine-0.1.0/src/harddaysengine/app/game.py +2616 -0
- harddaysengine-0.1.0/src/harddaysengine/app/input.py +450 -0
- harddaysengine-0.1.0/src/harddaysengine/app/inspector.py +489 -0
- harddaysengine-0.1.0/src/harddaysengine/app/intro_player.py +446 -0
- harddaysengine-0.1.0/src/harddaysengine/app/loop.py +141 -0
- harddaysengine-0.1.0/src/harddaysengine/app/map_runtime.py +76 -0
- harddaysengine-0.1.0/src/harddaysengine/app/map_scene.py +142 -0
- harddaysengine-0.1.0/src/harddaysengine/app/meeting_audit.py +150 -0
- harddaysengine-0.1.0/src/harddaysengine/app/meeting_screen.py +57 -0
- harddaysengine-0.1.0/src/harddaysengine/app/module_player.py +207 -0
- harddaysengine-0.1.0/src/harddaysengine/app/paula.py +290 -0
- harddaysengine-0.1.0/src/harddaysengine/app/scene_assets.py +377 -0
- harddaysengine-0.1.0/src/harddaysengine/app/service_screen.py +105 -0
- harddaysengine-0.1.0/src/harddaysengine/app/sheet_screen.py +94 -0
- harddaysengine-0.1.0/src/harddaysengine/app/sound_front.py +73 -0
- harddaysengine-0.1.0/src/harddaysengine/app/stonehenge_screen.py +139 -0
- harddaysengine-0.1.0/src/harddaysengine/app/synth.py +595 -0
- harddaysengine-0.1.0/src/harddaysengine/app/town_screen.py +89 -0
- harddaysengine-0.1.0/src/harddaysengine/app/valley_audit.py +102 -0
- harddaysengine-0.1.0/src/harddaysengine/app/valley_screen.py +67 -0
- harddaysengine-0.1.0/src/harddaysengine/app/village_audit.py +56 -0
- harddaysengine-0.1.0/src/harddaysengine/app/window.py +285 -0
- harddaysengine-0.1.0/src/harddaysengine/app/wizard_audit.py +103 -0
- harddaysengine-0.1.0/src/harddaysengine/app/wizard_screen.py +153 -0
- harddaysengine-0.1.0/src/harddaysengine/assets/__init__.py +223 -0
- harddaysengine-0.1.0/src/harddaysengine/assets/adf.py +276 -0
- harddaysengine-0.1.0/src/harddaysengine/assets/ai_map_rules.py +51 -0
- harddaysengine-0.1.0/src/harddaysengine/assets/arena.py +205 -0
- harddaysengine-0.1.0/src/harddaysengine/assets/audio.py +189 -0
- harddaysengine-0.1.0/src/harddaysengine/assets/bank_data.py +177 -0
- harddaysengine-0.1.0/src/harddaysengine/assets/caster_rules.py +151 -0
- harddaysengine-0.1.0/src/harddaysengine/assets/cel.py +201 -0
- harddaysengine-0.1.0/src/harddaysengine/assets/computer_knight_rules.py +98 -0
- harddaysengine-0.1.0/src/harddaysengine/assets/creature_rules.py +175 -0
- harddaysengine-0.1.0/src/harddaysengine/assets/dice_house_data.py +361 -0
- harddaysengine-0.1.0/src/harddaysengine/assets/dragon_rules.py +164 -0
- harddaysengine-0.1.0/src/harddaysengine/assets/drake_rules.py +124 -0
- harddaysengine-0.1.0/src/harddaysengine/assets/ending_data.py +701 -0
- harddaysengine-0.1.0/src/harddaysengine/assets/ending_runtime_data.py +298 -0
- harddaysengine-0.1.0/src/harddaysengine/assets/extract.py +406 -0
- harddaysengine-0.1.0/src/harddaysengine/assets/fight_defs.py +957 -0
- harddaysengine-0.1.0/src/harddaysengine/assets/fight_palette.py +251 -0
- harddaysengine-0.1.0/src/harddaysengine/assets/fight_program.py +234 -0
- harddaysengine-0.1.0/src/harddaysengine/assets/fight_setup.py +72 -0
- harddaysengine-0.1.0/src/harddaysengine/assets/fighter_rules.py +293 -0
- harddaysengine-0.1.0/src/harddaysengine/assets/flyer_rules.py +98 -0
- harddaysengine-0.1.0/src/harddaysengine/assets/guardian_rules.py +122 -0
- harddaysengine-0.1.0/src/harddaysengine/assets/hit.py +190 -0
- harddaysengine-0.1.0/src/harddaysengine/assets/hunk.py +200 -0
- harddaysengine-0.1.0/src/harddaysengine/assets/intro_data.py +800 -0
- harddaysengine-0.1.0/src/harddaysengine/assets/lzss.py +110 -0
- harddaysengine-0.1.0/src/harddaysengine/assets/manifest.py +159 -0
- harddaysengine-0.1.0/src/harddaysengine/assets/map_rules.py +148 -0
- harddaysengine-0.1.0/src/harddaysengine/assets/meeting_data.py +113 -0
- harddaysengine-0.1.0/src/harddaysengine/assets/mog_code.py +367 -0
- harddaysengine-0.1.0/src/harddaysengine/assets/music_data.py +34 -0
- harddaysengine-0.1.0/src/harddaysengine/assets/palette.py +97 -0
- harddaysengine-0.1.0/src/harddaysengine/assets/picture.py +166 -0
- harddaysengine-0.1.0/src/harddaysengine/assets/program_code.py +79 -0
- harddaysengine-0.1.0/src/harddaysengine/assets/rnc.py +156 -0
- harddaysengine-0.1.0/src/harddaysengine/assets/scene_sound_data.py +68 -0
- harddaysengine-0.1.0/src/harddaysengine/assets/screen_fx.py +35 -0
- harddaysengine-0.1.0/src/harddaysengine/assets/service_data.py +99 -0
- harddaysengine-0.1.0/src/harddaysengine/assets/service_screen_data.py +499 -0
- harddaysengine-0.1.0/src/harddaysengine/assets/sheet_data.py +122 -0
- harddaysengine-0.1.0/src/harddaysengine/assets/shop_data.py +136 -0
- harddaysengine-0.1.0/src/harddaysengine/assets/snatcher_rules.py +96 -0
- harddaysengine-0.1.0/src/harddaysengine/assets/sound_rules.py +482 -0
- harddaysengine-0.1.0/src/harddaysengine/assets/stalker_rules.py +109 -0
- harddaysengine-0.1.0/src/harddaysengine/assets/stonehenge_data.py +210 -0
- harddaysengine-0.1.0/src/harddaysengine/assets/synth_data.py +396 -0
- harddaysengine-0.1.0/src/harddaysengine/assets/tables.py +500 -0
- harddaysengine-0.1.0/src/harddaysengine/assets/town_data.py +153 -0
- harddaysengine-0.1.0/src/harddaysengine/assets/town_loading_data.py +58 -0
- harddaysengine-0.1.0/src/harddaysengine/assets/turn_rules.py +179 -0
- harddaysengine-0.1.0/src/harddaysengine/assets/valley_data.py +151 -0
- harddaysengine-0.1.0/src/harddaysengine/assets/village_data.py +33 -0
- harddaysengine-0.1.0/src/harddaysengine/assets/wizard_data.py +144 -0
- harddaysengine-0.1.0/src/harddaysengine/assets/wizard_screen_data.py +269 -0
- harddaysengine-0.1.0/src/harddaysengine/cli/__init__.py +1 -0
- harddaysengine-0.1.0/src/harddaysengine/cli/extract.py +80 -0
- harddaysengine-0.1.0/src/harddaysengine/cli/inspect_assets.py +189 -0
- harddaysengine-0.1.0/src/harddaysengine/cli/main.py +255 -0
- harddaysengine-0.1.0/src/harddaysengine/render/__init__.py +41 -0
- harddaysengine-0.1.0/src/harddaysengine/render/fight.py +68 -0
- harddaysengine-0.1.0/src/harddaysengine/render/overlay.py +147 -0
- harddaysengine-0.1.0/src/harddaysengine/render/postfx.py +625 -0
- harddaysengine-0.1.0/src/harddaysengine/render/presentation.py +166 -0
- harddaysengine-0.1.0/src/harddaysengine/render/renderer.py +538 -0
- harddaysengine-0.1.0/src/harddaysengine/render/scene.py +523 -0
- harddaysengine-0.1.0/src/harddaysengine/render/shaders/__init__.py +12 -0
- harddaysengine-0.1.0/src/harddaysengine/render/shaders/crt.frag +143 -0
- harddaysengine-0.1.0/src/harddaysengine/render/shaders/crt.vert +11 -0
- harddaysengine-0.1.0/src/harddaysengine/render/shaders/crt_bloom_h.frag +40 -0
- harddaysengine-0.1.0/src/harddaysengine/render/shaders/crt_bloom_v.frag +37 -0
- harddaysengine-0.1.0/src/harddaysengine/render/shaders/smooth.frag +185 -0
- harddaysengine-0.1.0/src/harddaysengine/render/shaders/smooth.vert +11 -0
- harddaysengine-0.1.0/src/harddaysengine/render/shaders/surround.frag +58 -0
- harddaysengine-0.1.0/src/harddaysengine/render/shaders/surround_blur.frag +37 -0
- harddaysengine-0.1.0/src/harddaysengine/render/viewport.py +173 -0
- harddaysengine-0.1.0/src/harddaysengine/sim/__init__.py +5 -0
- harddaysengine-0.1.0/src/harddaysengine/sim/actor.py +189 -0
- harddaysengine-0.1.0/src/harddaysengine/sim/ai_map.py +242 -0
- harddaysengine-0.1.0/src/harddaysengine/sim/ai_map_state.py +56 -0
- harddaysengine-0.1.0/src/harddaysengine/sim/ai_shop.py +83 -0
- harddaysengine-0.1.0/src/harddaysengine/sim/collision.py +445 -0
- harddaysengine-0.1.0/src/harddaysengine/sim/dice_house.py +341 -0
- harddaysengine-0.1.0/src/harddaysengine/sim/ending.py +444 -0
- harddaysengine-0.1.0/src/harddaysengine/sim/ending_jobs.py +253 -0
- harddaysengine-0.1.0/src/harddaysengine/sim/ending_palette.py +114 -0
- harddaysengine-0.1.0/src/harddaysengine/sim/ending_types.py +373 -0
- harddaysengine-0.1.0/src/harddaysengine/sim/fight.py +545 -0
- harddaysengine-0.1.0/src/harddaysengine/sim/fight_ai/__init__.py +1 -0
- harddaysengine-0.1.0/src/harddaysengine/sim/fight_ai/approach.py +178 -0
- harddaysengine-0.1.0/src/harddaysengine/sim/fight_ai/brawler.py +239 -0
- harddaysengine-0.1.0/src/harddaysengine/sim/fight_ai/caster.py +361 -0
- harddaysengine-0.1.0/src/harddaysengine/sim/fight_ai/dragon.py +301 -0
- harddaysengine-0.1.0/src/harddaysengine/sim/fight_ai/drake.py +251 -0
- harddaysengine-0.1.0/src/harddaysengine/sim/fight_ai/effects.py +33 -0
- harddaysengine-0.1.0/src/harddaysengine/sim/fight_ai/flyer.py +112 -0
- harddaysengine-0.1.0/src/harddaysengine/sim/fight_ai/guardian.py +292 -0
- harddaysengine-0.1.0/src/harddaysengine/sim/fight_ai/knight.py +131 -0
- harddaysengine-0.1.0/src/harddaysengine/sim/fight_ai/snatcher.py +226 -0
- harddaysengine-0.1.0/src/harddaysengine/sim/fight_ai/stalker.py +90 -0
- harddaysengine-0.1.0/src/harddaysengine/sim/fight_contact.py +125 -0
- harddaysengine-0.1.0/src/harddaysengine/sim/fight_hurt.py +315 -0
- harddaysengine-0.1.0/src/harddaysengine/sim/fight_moves.py +104 -0
- harddaysengine-0.1.0/src/harddaysengine/sim/fight_routines.py +80 -0
- harddaysengine-0.1.0/src/harddaysengine/sim/fight_script.py +748 -0
- harddaysengine-0.1.0/src/harddaysengine/sim/fight_setup.py +163 -0
- harddaysengine-0.1.0/src/harddaysengine/sim/fighter_rules.py +145 -0
- harddaysengine-0.1.0/src/harddaysengine/sim/fighters.py +157 -0
- harddaysengine-0.1.0/src/harddaysengine/sim/intro.py +484 -0
- harddaysengine-0.1.0/src/harddaysengine/sim/intro_types.py +163 -0
- harddaysengine-0.1.0/src/harddaysengine/sim/inventory.py +28 -0
- harddaysengine-0.1.0/src/harddaysengine/sim/location_state.py +43 -0
- harddaysengine-0.1.0/src/harddaysengine/sim/m68k.py +110 -0
- harddaysengine-0.1.0/src/harddaysengine/sim/map_dragon.py +133 -0
- harddaysengine-0.1.0/src/harddaysengine/sim/map_rules.py +117 -0
- harddaysengine-0.1.0/src/harddaysengine/sim/meeting.py +76 -0
- harddaysengine-0.1.0/src/harddaysengine/sim/overworld.py +562 -0
- harddaysengine-0.1.0/src/harddaysengine/sim/palette_fx.py +355 -0
- harddaysengine-0.1.0/src/harddaysengine/sim/rewards.py +190 -0
- harddaysengine-0.1.0/src/harddaysengine/sim/rng.py +44 -0
- harddaysengine-0.1.0/src/harddaysengine/sim/screen_fx.py +55 -0
- harddaysengine-0.1.0/src/harddaysengine/sim/service_screen.py +196 -0
- harddaysengine-0.1.0/src/harddaysengine/sim/service_screen_types.py +113 -0
- harddaysengine-0.1.0/src/harddaysengine/sim/service_types.py +40 -0
- harddaysengine-0.1.0/src/harddaysengine/sim/services.py +128 -0
- harddaysengine-0.1.0/src/harddaysengine/sim/sheet_actions.py +181 -0
- harddaysengine-0.1.0/src/harddaysengine/sim/sheet_layout.py +310 -0
- harddaysengine-0.1.0/src/harddaysengine/sim/sheet_types.py +78 -0
- harddaysengine-0.1.0/src/harddaysengine/sim/sheets.py +138 -0
- harddaysengine-0.1.0/src/harddaysengine/sim/shop_types.py +27 -0
- harddaysengine-0.1.0/src/harddaysengine/sim/shops.py +114 -0
- harddaysengine-0.1.0/src/harddaysengine/sim/sound.py +195 -0
- harddaysengine-0.1.0/src/harddaysengine/sim/stock.py +63 -0
- harddaysengine-0.1.0/src/harddaysengine/sim/stonehenge.py +235 -0
- harddaysengine-0.1.0/src/harddaysengine/sim/town_types.py +40 -0
- harddaysengine-0.1.0/src/harddaysengine/sim/towns.py +74 -0
- harddaysengine-0.1.0/src/harddaysengine/sim/trajectory.py +162 -0
- harddaysengine-0.1.0/src/harddaysengine/sim/turn_rules.py +55 -0
- harddaysengine-0.1.0/src/harddaysengine/sim/turns.py +129 -0
- harddaysengine-0.1.0/src/harddaysengine/sim/types.py +110 -0
- harddaysengine-0.1.0/src/harddaysengine/sim/valley.py +82 -0
- harddaysengine-0.1.0/src/harddaysengine/sim/village.py +39 -0
- harddaysengine-0.1.0/src/harddaysengine/sim/wizard.py +125 -0
- harddaysengine-0.1.0/src/harddaysengine/sim/wizard_types.py +95 -0
- harddaysengine-0.1.0/tests/__init__.py +1 -0
- harddaysengine-0.1.0/tests/adf/__init__.py +1 -0
- harddaysengine-0.1.0/tests/adf/test_ai_map_adf.py +230 -0
- harddaysengine-0.1.0/tests/adf/test_bank_audio_adf.py +101 -0
- harddaysengine-0.1.0/tests/adf/test_brawler_adf.py +303 -0
- harddaysengine-0.1.0/tests/adf/test_campaign_adf.py +81 -0
- harddaysengine-0.1.0/tests/adf/test_caster_adf.py +126 -0
- harddaysengine-0.1.0/tests/adf/test_computer_knight_adf.py +231 -0
- harddaysengine-0.1.0/tests/adf/test_dice_house_adf.py +140 -0
- harddaysengine-0.1.0/tests/adf/test_dragon_adf.py +180 -0
- harddaysengine-0.1.0/tests/adf/test_drake_adf.py +125 -0
- harddaysengine-0.1.0/tests/adf/test_ending_adf.py +155 -0
- harddaysengine-0.1.0/tests/adf/test_fight_defs_adf.py +234 -0
- harddaysengine-0.1.0/tests/adf/test_fight_engine_adf.py +207 -0
- harddaysengine-0.1.0/tests/adf/test_fight_palette_adf.py +143 -0
- harddaysengine-0.1.0/tests/adf/test_fight_runtime_adf.py +127 -0
- harddaysengine-0.1.0/tests/adf/test_fight_scene_adf.py +59 -0
- harddaysengine-0.1.0/tests/adf/test_fight_setup_adf.py +112 -0
- harddaysengine-0.1.0/tests/adf/test_flyer_adf.py +107 -0
- harddaysengine-0.1.0/tests/adf/test_game_fight_adf.py +183 -0
- harddaysengine-0.1.0/tests/adf/test_guardian_adf.py +132 -0
- harddaysengine-0.1.0/tests/adf/test_intro_adf.py +133 -0
- harddaysengine-0.1.0/tests/adf/test_knight_control_adf.py +215 -0
- harddaysengine-0.1.0/tests/adf/test_map_rules_adf.py +104 -0
- harddaysengine-0.1.0/tests/adf/test_meetings_adf.py +368 -0
- harddaysengine-0.1.0/tests/adf/test_real_disks.py +164 -0
- harddaysengine-0.1.0/tests/adf/test_scene_audio_adf.py +167 -0
- harddaysengine-0.1.0/tests/adf/test_scene_smoke.py +52 -0
- harddaysengine-0.1.0/tests/adf/test_service_rules_adf.py +108 -0
- harddaysengine-0.1.0/tests/adf/test_service_screens_adf.py +238 -0
- harddaysengine-0.1.0/tests/adf/test_sheet_data_adf.py +93 -0
- harddaysengine-0.1.0/tests/adf/test_sheets_adf.py +236 -0
- harddaysengine-0.1.0/tests/adf/test_shops_adf.py +258 -0
- harddaysengine-0.1.0/tests/adf/test_snatcher_adf.py +89 -0
- harddaysengine-0.1.0/tests/adf/test_sound_rules_adf.py +83 -0
- harddaysengine-0.1.0/tests/adf/test_stalker_adf.py +123 -0
- harddaysengine-0.1.0/tests/adf/test_stonehenge_adf.py +232 -0
- harddaysengine-0.1.0/tests/adf/test_synth_adf.py +148 -0
- harddaysengine-0.1.0/tests/adf/test_town_data_adf.py +77 -0
- harddaysengine-0.1.0/tests/adf/test_town_loading_adf.py +122 -0
- harddaysengine-0.1.0/tests/adf/test_towns_adf.py +261 -0
- harddaysengine-0.1.0/tests/adf/test_turns_adf.py +238 -0
- harddaysengine-0.1.0/tests/adf/test_valley_adf.py +267 -0
- harddaysengine-0.1.0/tests/adf/test_villages_adf.py +159 -0
- harddaysengine-0.1.0/tests/adf/test_wizard_data_adf.py +118 -0
- harddaysengine-0.1.0/tests/adf/test_wizard_scripts_adf.py +95 -0
- harddaysengine-0.1.0/tests/adf/test_wizard_visit_adf.py +206 -0
- harddaysengine-0.1.0/tests/conftest.py +39 -0
- harddaysengine-0.1.0/tests/fixtures/__init__.py +1 -0
- harddaysengine-0.1.0/tests/fixtures/synthetic_adf.py +236 -0
- harddaysengine-0.1.0/tests/gl/__init__.py +1 -0
- harddaysengine-0.1.0/tests/gl/test_crt_gl.py +338 -0
- harddaysengine-0.1.0/tests/gl/test_postfx_gl.py +303 -0
- harddaysengine-0.1.0/tests/gl/test_presentation_gl.py +314 -0
- harddaysengine-0.1.0/tests/gl/test_presentation_replay_gl.py +210 -0
- harddaysengine-0.1.0/tests/gl/test_renderer_gl.py +141 -0
- harddaysengine-0.1.0/tests/gl/test_scene_gl.py +255 -0
- harddaysengine-0.1.0/tests/gl/test_smooth_gl.py +415 -0
- harddaysengine-0.1.0/tests/gl/test_surround_gl.py +388 -0
- harddaysengine-0.1.0/tests/gl/test_window_modes_gl.py +69 -0
- harddaysengine-0.1.0/tests/unit/__init__.py +1 -0
- harddaysengine-0.1.0/tests/unit/ai_map_setup.py +21 -0
- harddaysengine-0.1.0/tests/unit/brawler_setup.py +70 -0
- harddaysengine-0.1.0/tests/unit/caster_setup.py +60 -0
- harddaysengine-0.1.0/tests/unit/dragon_setup.py +78 -0
- harddaysengine-0.1.0/tests/unit/drake_setup.py +53 -0
- harddaysengine-0.1.0/tests/unit/ending_setup.py +129 -0
- harddaysengine-0.1.0/tests/unit/fight_setup_data.py +30 -0
- harddaysengine-0.1.0/tests/unit/guardian_setup.py +57 -0
- harddaysengine-0.1.0/tests/unit/knight_setup.py +125 -0
- harddaysengine-0.1.0/tests/unit/map_setup.py +51 -0
- harddaysengine-0.1.0/tests/unit/meeting_setup.py +58 -0
- harddaysengine-0.1.0/tests/unit/sheet_setup.py +29 -0
- harddaysengine-0.1.0/tests/unit/synth_setup.py +96 -0
- harddaysengine-0.1.0/tests/unit/test_actor.py +52 -0
- harddaysengine-0.1.0/tests/unit/test_ai_map.py +298 -0
- harddaysengine-0.1.0/tests/unit/test_assets_synthetic.py +464 -0
- harddaysengine-0.1.0/tests/unit/test_audio_stream.py +111 -0
- harddaysengine-0.1.0/tests/unit/test_audit_present.py +66 -0
- harddaysengine-0.1.0/tests/unit/test_bank_audio.py +58 -0
- harddaysengine-0.1.0/tests/unit/test_bank_data.py +68 -0
- harddaysengine-0.1.0/tests/unit/test_brawler.py +270 -0
- harddaysengine-0.1.0/tests/unit/test_caster.py +213 -0
- harddaysengine-0.1.0/tests/unit/test_caster_rules_decoder.py +49 -0
- harddaysengine-0.1.0/tests/unit/test_cli.py +51 -0
- harddaysengine-0.1.0/tests/unit/test_collision.py +310 -0
- harddaysengine-0.1.0/tests/unit/test_computer_knight.py +217 -0
- harddaysengine-0.1.0/tests/unit/test_computer_knight_rules_decoder.py +65 -0
- harddaysengine-0.1.0/tests/unit/test_config.py +87 -0
- harddaysengine-0.1.0/tests/unit/test_creature_rules_decoder.py +63 -0
- harddaysengine-0.1.0/tests/unit/test_dice_house.py +215 -0
- harddaysengine-0.1.0/tests/unit/test_dice_house_data.py +166 -0
- harddaysengine-0.1.0/tests/unit/test_display_settings.py +340 -0
- harddaysengine-0.1.0/tests/unit/test_dragon.py +251 -0
- harddaysengine-0.1.0/tests/unit/test_dragon_rules_decoder.py +77 -0
- harddaysengine-0.1.0/tests/unit/test_drake.py +192 -0
- harddaysengine-0.1.0/tests/unit/test_drake_rules_decoder.py +58 -0
- harddaysengine-0.1.0/tests/unit/test_ending_data.py +254 -0
- harddaysengine-0.1.0/tests/unit/test_ending_jobs.py +170 -0
- harddaysengine-0.1.0/tests/unit/test_ending_run.py +103 -0
- harddaysengine-0.1.0/tests/unit/test_fight.py +274 -0
- harddaysengine-0.1.0/tests/unit/test_fight_approach.py +184 -0
- harddaysengine-0.1.0/tests/unit/test_fight_contact.py +139 -0
- harddaysengine-0.1.0/tests/unit/test_fight_hurt.py +343 -0
- harddaysengine-0.1.0/tests/unit/test_fight_moves.py +130 -0
- harddaysengine-0.1.0/tests/unit/test_fight_palette.py +205 -0
- harddaysengine-0.1.0/tests/unit/test_fight_program.py +141 -0
- harddaysengine-0.1.0/tests/unit/test_fight_routines.py +114 -0
- harddaysengine-0.1.0/tests/unit/test_fight_runtime.py +146 -0
- harddaysengine-0.1.0/tests/unit/test_fight_scene.py +142 -0
- harddaysengine-0.1.0/tests/unit/test_fight_script.py +487 -0
- harddaysengine-0.1.0/tests/unit/test_fight_setup.py +137 -0
- harddaysengine-0.1.0/tests/unit/test_fight_tables.py +59 -0
- harddaysengine-0.1.0/tests/unit/test_fighter_rules_decoder.py +67 -0
- harddaysengine-0.1.0/tests/unit/test_fighters.py +166 -0
- harddaysengine-0.1.0/tests/unit/test_flyer.py +161 -0
- harddaysengine-0.1.0/tests/unit/test_flyer_rules_decoder.py +42 -0
- harddaysengine-0.1.0/tests/unit/test_game_fight.py +235 -0
- harddaysengine-0.1.0/tests/unit/test_game_session.py +368 -0
- harddaysengine-0.1.0/tests/unit/test_guardian.py +192 -0
- harddaysengine-0.1.0/tests/unit/test_guardian_rules_decoder.py +58 -0
- harddaysengine-0.1.0/tests/unit/test_inspector_and_overlay.py +158 -0
- harddaysengine-0.1.0/tests/unit/test_intro_data.py +275 -0
- harddaysengine-0.1.0/tests/unit/test_intro_run.py +203 -0
- harddaysengine-0.1.0/tests/unit/test_layering.py +141 -0
- harddaysengine-0.1.0/tests/unit/test_m68k.py +95 -0
- harddaysengine-0.1.0/tests/unit/test_map_dragon.py +146 -0
- harddaysengine-0.1.0/tests/unit/test_map_rules.py +58 -0
- harddaysengine-0.1.0/tests/unit/test_meeting.py +48 -0
- harddaysengine-0.1.0/tests/unit/test_meeting_data.py +54 -0
- harddaysengine-0.1.0/tests/unit/test_module_player.py +151 -0
- harddaysengine-0.1.0/tests/unit/test_mog_code.py +104 -0
- harddaysengine-0.1.0/tests/unit/test_overworld.py +241 -0
- harddaysengine-0.1.0/tests/unit/test_pacing.py +152 -0
- harddaysengine-0.1.0/tests/unit/test_palette_fx.py +282 -0
- harddaysengine-0.1.0/tests/unit/test_paula.py +171 -0
- harddaysengine-0.1.0/tests/unit/test_playability_v2.py +143 -0
- harddaysengine-0.1.0/tests/unit/test_postfx.py +188 -0
- harddaysengine-0.1.0/tests/unit/test_rewards.py +121 -0
- harddaysengine-0.1.0/tests/unit/test_rng.py +60 -0
- harddaysengine-0.1.0/tests/unit/test_scene_assets.py +76 -0
- harddaysengine-0.1.0/tests/unit/test_screen_fx.py +82 -0
- harddaysengine-0.1.0/tests/unit/test_service_data.py +143 -0
- harddaysengine-0.1.0/tests/unit/test_service_screen.py +218 -0
- harddaysengine-0.1.0/tests/unit/test_service_screen_data.py +210 -0
- harddaysengine-0.1.0/tests/unit/test_services.py +147 -0
- harddaysengine-0.1.0/tests/unit/test_sheet_data.py +43 -0
- harddaysengine-0.1.0/tests/unit/test_sheets.py +229 -0
- harddaysengine-0.1.0/tests/unit/test_shop_data.py +52 -0
- harddaysengine-0.1.0/tests/unit/test_shops.py +184 -0
- harddaysengine-0.1.0/tests/unit/test_snatcher.py +162 -0
- harddaysengine-0.1.0/tests/unit/test_snatcher_rules_decoder.py +32 -0
- harddaysengine-0.1.0/tests/unit/test_sound.py +153 -0
- harddaysengine-0.1.0/tests/unit/test_sound_front.py +122 -0
- harddaysengine-0.1.0/tests/unit/test_sound_rules_decoder.py +252 -0
- harddaysengine-0.1.0/tests/unit/test_stalker.py +126 -0
- harddaysengine-0.1.0/tests/unit/test_stalker_rules_decoder.py +53 -0
- harddaysengine-0.1.0/tests/unit/test_stock.py +55 -0
- harddaysengine-0.1.0/tests/unit/test_stonehenge.py +140 -0
- harddaysengine-0.1.0/tests/unit/test_stonehenge_data.py +95 -0
- harddaysengine-0.1.0/tests/unit/test_synth.py +304 -0
- harddaysengine-0.1.0/tests/unit/test_synth_data.py +263 -0
- harddaysengine-0.1.0/tests/unit/test_tables.py +286 -0
- harddaysengine-0.1.0/tests/unit/test_town_data.py +178 -0
- harddaysengine-0.1.0/tests/unit/test_town_loading_data.py +107 -0
- harddaysengine-0.1.0/tests/unit/test_towns.py +63 -0
- harddaysengine-0.1.0/tests/unit/test_trajectory.py +81 -0
- harddaysengine-0.1.0/tests/unit/test_turn_rules.py +45 -0
- harddaysengine-0.1.0/tests/unit/test_turns.py +167 -0
- harddaysengine-0.1.0/tests/unit/test_valley.py +97 -0
- harddaysengine-0.1.0/tests/unit/test_valley_data.py +72 -0
- harddaysengine-0.1.0/tests/unit/test_viewport.py +236 -0
- harddaysengine-0.1.0/tests/unit/test_village.py +55 -0
- harddaysengine-0.1.0/tests/unit/test_village_data.py +55 -0
- harddaysengine-0.1.0/tests/unit/test_window_modes.py +216 -0
- harddaysengine-0.1.0/tests/unit/test_wizard_animation.py +105 -0
- harddaysengine-0.1.0/tests/unit/test_wizard_data.py +87 -0
- harddaysengine-0.1.0/tests/unit/test_wizard_rewards.py +77 -0
- harddaysengine-0.1.0/tests/unit/test_wizard_screen_data.py +70 -0
- harddaysengine-0.1.0/tests/unit/turn_setup.py +36 -0
- harddaysengine-0.1.0/tests/unit/valley_setup.py +79 -0
- harddaysengine-0.1.0/tests/unit/wizard_screen_setup.py +112 -0
- harddaysengine-0.1.0/tests/unit/wizard_setup.py +126 -0
- harddaysengine-0.1.0/uv.lock +1619 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: ["main"]
|
|
6
|
+
pull_request:
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
gate:
|
|
10
|
+
runs-on: ${{ matrix.os }}
|
|
11
|
+
strategy:
|
|
12
|
+
fail-fast: false
|
|
13
|
+
matrix:
|
|
14
|
+
os: [ubuntu-latest, windows-latest]
|
|
15
|
+
|
|
16
|
+
steps:
|
|
17
|
+
- name: Checkout repository
|
|
18
|
+
uses: actions/checkout@v4
|
|
19
|
+
|
|
20
|
+
- name: Install uv
|
|
21
|
+
uses: astral-sh/setup-uv@v4
|
|
22
|
+
|
|
23
|
+
- name: Install Python (from .python-version)
|
|
24
|
+
run: uv python install
|
|
25
|
+
|
|
26
|
+
- name: Install dependencies
|
|
27
|
+
run: uv sync --frozen
|
|
28
|
+
|
|
29
|
+
# Full gate: ruff format/lint, mypy, import-linter, radon, vulture, pytest (-m "not gl").
|
|
30
|
+
# `adf` tests skip automatically: CI has no disk images (BYOA).
|
|
31
|
+
- name: Quality gate
|
|
32
|
+
run: uv run python scripts/quality_gate.py
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Game data: NEVER commit disk images or anything extracted from them
|
|
2
|
+
*.adf
|
|
3
|
+
*.ADF
|
|
4
|
+
disks/
|
|
5
|
+
build/
|
|
6
|
+
reference/
|
|
7
|
+
out/
|
|
8
|
+
config.toml
|
|
9
|
+
crash.log
|
|
10
|
+
*.log
|
|
11
|
+
|
|
12
|
+
# Python / uv / build artifacts
|
|
13
|
+
__pycache__/
|
|
14
|
+
*.py[cod]
|
|
15
|
+
*$py.class
|
|
16
|
+
*.so
|
|
17
|
+
*.pyd
|
|
18
|
+
.Python
|
|
19
|
+
dist/
|
|
20
|
+
*.egg-info/
|
|
21
|
+
.venv/
|
|
22
|
+
.pytest_cache/
|
|
23
|
+
.ruff_cache/
|
|
24
|
+
.mypy_cache/
|
|
25
|
+
.import_linter_cache/
|
|
26
|
+
.coverage
|
|
27
|
+
coverage.xml
|
|
28
|
+
htmlcov/
|
|
29
|
+
.agents/
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
[importlinter]
|
|
2
|
+
root_packages =
|
|
3
|
+
harddaysengine
|
|
4
|
+
include_external_packages = True
|
|
5
|
+
|
|
6
|
+
# ----------------------------------------------------------------------------
|
|
7
|
+
# Contract 1: Strict Clean Architecture Layering
|
|
8
|
+
# High-level modules may import low-level modules, never the reverse.
|
|
9
|
+
# ----------------------------------------------------------------------------
|
|
10
|
+
[importlinter:contract:layered_architecture]
|
|
11
|
+
name = Strict Clean Architecture Layer Topology
|
|
12
|
+
type = layers
|
|
13
|
+
layers =
|
|
14
|
+
harddaysengine.cli
|
|
15
|
+
harddaysengine.app
|
|
16
|
+
harddaysengine.render
|
|
17
|
+
harddaysengine.assets
|
|
18
|
+
harddaysengine.sim
|
|
19
|
+
|
|
20
|
+
# ----------------------------------------------------------------------------
|
|
21
|
+
# Contract 2: Pure 50Hz PAL Simulation Core Isolation
|
|
22
|
+
# The simulation kernel must remain 100% deterministic, fast, and serializable.
|
|
23
|
+
# Zero C-extension rendering, windowing, audio, or disk I/O dependencies.
|
|
24
|
+
# ----------------------------------------------------------------------------
|
|
25
|
+
[importlinter:contract:pure_simulation_core]
|
|
26
|
+
name = Pure 50Hz Simulation Core (Zero Hardware/Framework Imports)
|
|
27
|
+
type = forbidden
|
|
28
|
+
source_modules =
|
|
29
|
+
harddaysengine.sim
|
|
30
|
+
forbidden_modules =
|
|
31
|
+
pygame
|
|
32
|
+
moderngl
|
|
33
|
+
PIL
|
|
34
|
+
amitools
|
|
35
|
+
pathlib
|
|
36
|
+
shutil
|
|
37
|
+
subprocess
|
|
38
|
+
socket
|
|
39
|
+
random
|
|
40
|
+
time
|
|
41
|
+
datetime
|
|
42
|
+
os
|
|
43
|
+
io
|
|
44
|
+
threading
|
|
45
|
+
secrets
|
|
46
|
+
uuid
|
|
47
|
+
harddaysengine.assets
|
|
48
|
+
harddaysengine.render
|
|
49
|
+
harddaysengine.app
|
|
50
|
+
harddaysengine.cli
|
|
51
|
+
|
|
52
|
+
# ----------------------------------------------------------------------------
|
|
53
|
+
# Contract 3: Headless Asset Pipeline Isolation
|
|
54
|
+
# ADF/OFS extraction and Amiga bitplane decoding must run headlessly in CI
|
|
55
|
+
# without requiring an OpenGL context or SDL2 display initialization.
|
|
56
|
+
# ----------------------------------------------------------------------------
|
|
57
|
+
[importlinter:contract:headless_asset_pipeline]
|
|
58
|
+
name = Headless Asset Extractor (Forbidden from importing SDL2/OpenGL)
|
|
59
|
+
type = forbidden
|
|
60
|
+
source_modules =
|
|
61
|
+
harddaysengine.assets
|
|
62
|
+
forbidden_modules =
|
|
63
|
+
pygame
|
|
64
|
+
moderngl
|
|
65
|
+
harddaysengine.render
|
|
66
|
+
harddaysengine.app
|
|
67
|
+
harddaysengine.cli
|
|
68
|
+
|
|
69
|
+
# ----------------------------------------------------------------------------
|
|
70
|
+
# Contract 4: Renderer Independence from Application Host
|
|
71
|
+
# ModernGL shaders and framebuffer passes must not depend on pygame event loops.
|
|
72
|
+
# ----------------------------------------------------------------------------
|
|
73
|
+
[importlinter:contract:renderer_independence]
|
|
74
|
+
name = ModernGL Renderer Independence from SDL2/Pygame Host
|
|
75
|
+
type = forbidden
|
|
76
|
+
source_modules =
|
|
77
|
+
harddaysengine.render
|
|
78
|
+
forbidden_modules =
|
|
79
|
+
pygame
|
|
80
|
+
amitools
|
|
81
|
+
harddaysengine.app
|
|
82
|
+
harddaysengine.cli
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.12
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# AGENTS.md: onboarding for AI coding agents
|
|
2
|
+
|
|
3
|
+
You are working on **HardDaysEngine**, a clean-room Python reimplementation of *Moonstone: A Hard
|
|
4
|
+
Days Knight* (Mindscape, 1991, Amiga). It has a deterministic 50 Hz integer simulation core and a
|
|
5
|
+
ModernGL + `pygame-ce` presentation layer. This file is the **entry point for every agent session**.
|
|
6
|
+
Read it fully before touching code. (`GEMINI.md` only points here.)
|
|
7
|
+
|
|
8
|
+
## 1. Read in this order
|
|
9
|
+
|
|
10
|
+
1. `AGENTS.md` (this file): rules and workflow.
|
|
11
|
+
2. `docs/IMPLEMENTATION_PLAN.md`: architecture, phases, and the task list with acceptance
|
|
12
|
+
criteria.
|
|
13
|
+
3. `docs/PROGRESS.md`: current status of each task, plus notes and gotchas from earlier sessions.
|
|
14
|
+
4. `docs/DECISIONS.md`: architecture decision records (ADRs). Don't contradict an ADR without
|
|
15
|
+
adding a new one that supersedes it.
|
|
16
|
+
5. `docs/ARCHITECTURE.md`: the binary format and timing specification (written in Phase 2).
|
|
17
|
+
Implementation is written **from this document**, not from reference code (ADR-001).
|
|
18
|
+
6. `DEAD_ENDS.md`: approaches that failed. Never repeat one.
|
|
19
|
+
|
|
20
|
+
## 2. Session protocol (follow every time)
|
|
21
|
+
|
|
22
|
+
1. **Pick a task.** In `docs/PROGRESS.md`, choose the first `TODO` task whose dependencies are all
|
|
23
|
+
`DONE`. If the user assigned a task, do that one instead.
|
|
24
|
+
2. **Claim it.** Set its status to `IN PROGRESS (<agent>/<date>)`.
|
|
25
|
+
3. **Study the spec.** Read the relevant section of `docs/ARCHITECTURE.md`. If it's missing or
|
|
26
|
+
ambiguous, extend the spec first (from `reference/`, see §5), then implement.
|
|
27
|
+
4. **Implement with tests.** Satisfy every acceptance criterion in the plan.
|
|
28
|
+
5. **Verify.** Run `uv run python scripts/quality_gate.py`. Every gate must pass: ruff format,
|
|
29
|
+
ruff lint (McCabe ≤ 10), mypy `--strict`, import-linter, radon (no function graded C or
|
|
30
|
+
worse), vulture, pytest.
|
|
31
|
+
6. **Record.** Set the task to `DONE` in `docs/PROGRESS.md` with short notes (deviations, gotchas,
|
|
32
|
+
follow-ups). Add an ADR to `docs/DECISIONS.md` for every design choice.
|
|
33
|
+
7. **Commit.** Use a message like `T<id>: <summary>`, one task per commit where practical.
|
|
34
|
+
|
|
35
|
+
If a task is too large for one session, split it into `T<id>a`, `T<id>b` and so on in
|
|
36
|
+
`PROGRESS.md`, and explain why.
|
|
37
|
+
|
|
38
|
+
## 3. Hard rules
|
|
39
|
+
|
|
40
|
+
### Legal and provenance (ADR-001)
|
|
41
|
+
- **Never commit game data.** That covers `*.adf`, and anything extracted from the disks: pictures,
|
|
42
|
+
cels, PNG exports, audio, modules, hunk executables, tables, and fixtures derived from real
|
|
43
|
+
disks. `.gitignore` covers `disks/` and `build/`, but you're still responsible.
|
|
44
|
+
- **Clean room.** `reference/moonstone-ace` (PolyForm Noncommercial) and `reference/openmoonstone`
|
|
45
|
+
(AGPL-3.0) are *specifications*. Describe formats and behaviour in your own words in
|
|
46
|
+
`docs/ARCHITECTURE.md`, then implement from that. Never transliterate their code, and never paste
|
|
47
|
+
byte tables from the original executables into source. Original tables (animation, timing, AI)
|
|
48
|
+
are **read at runtime** from the user's own `program` / `mog` files.
|
|
49
|
+
- Tests that need real disks use `@pytest.mark.adf` and the `adf_dir` fixture, which skips when no
|
|
50
|
+
disks are found. CI tests use **synthetic** ADF images built in `tests/fixtures/`.
|
|
51
|
+
|
|
52
|
+
### Determinism (`src/harddaysengine/sim/`)
|
|
53
|
+
- **No floats.** Integers only; fixed point where the original used it. Wrap to 16 or 32 bits where
|
|
54
|
+
the 68000 relies on overflow.
|
|
55
|
+
- **68000 ≠ Python arithmetic.** `DIVS`/`DIVU` truncate toward zero and Python `//` floors, so use
|
|
56
|
+
the helpers in `sim/` for C-style division and modulo.
|
|
57
|
+
- **No `random`, `time`, `datetime`, `pathlib`, `os` or any I/O** in `sim/`. Use the simulation PRNG.
|
|
58
|
+
Everything advances in 50 Hz ticks (one PAL VBL per tick).
|
|
59
|
+
- Preserve the original **order** of entity updates and PRNG draws.
|
|
60
|
+
- These rules are enforced by `.importlinter` and `tests/unit/test_layering.py`.
|
|
61
|
+
|
|
62
|
+
### Layering (`.importlinter`)
|
|
63
|
+
`cli -> app -> render -> assets -> sim`. A layer may import only layers to its right.
|
|
64
|
+
- `sim` imports no framework, no I/O module, and no other `harddaysengine` layer.
|
|
65
|
+
- `assets` never imports `pygame` or `moderngl`, so it runs headless in CI.
|
|
66
|
+
- `render` never imports `pygame`. It receives a `moderngl.Context` from `app`.
|
|
67
|
+
|
|
68
|
+
### No rigour theatre
|
|
69
|
+
- Never write `pass`, `TODO`, `...` bodies, placeholder returns, or `# type: ignore` /
|
|
70
|
+
`# noqa` just to silence a gate. Every function is a complete implementation. If something
|
|
71
|
+
can't be implemented yet, don't add it.
|
|
72
|
+
- Never weaken a gate config to make it pass. Fix the code, or propose an ADR and ask the user.
|
|
73
|
+
|
|
74
|
+
### Performance
|
|
75
|
+
- **No per-pixel Python loops at runtime.** Use numpy or a shader. Decoding at extraction time may
|
|
76
|
+
loop when the data is small, but prefer numpy for bitplane conversion.
|
|
77
|
+
|
|
78
|
+
### Code quality
|
|
79
|
+
- Python 3.12+, fully typed (mypy strict), ruff clean, `dataclass(slots=True, frozen=True)` for
|
|
80
|
+
decoded records.
|
|
81
|
+
- When implementing behaviour described in the spec, cite the spec section in the docstring,
|
|
82
|
+
for example `"""Picture loader (ARCHITECTURE.md §4.2)."""`.
|
|
83
|
+
|
|
84
|
+
## 4. Commands
|
|
85
|
+
|
|
86
|
+
```powershell
|
|
87
|
+
uv sync # install deps (Python 3.12, see .python-version)
|
|
88
|
+
uv run python scripts/quality_gate.py # the full gate; must be green before DONE
|
|
89
|
+
uv run pytest -m "not adf and not gl" # tests needing neither disks nor OpenGL
|
|
90
|
+
uv run pytest -m adf # tests needing the real disks
|
|
91
|
+
uv run lint-imports # layering contracts only
|
|
92
|
+
uv run harddaysengine --version
|
|
93
|
+
uv run harddaysengine --list-disks
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
ADF location, in priority order: `--adf-dir`, then the `HARDDAYSENGINE_ADF_DIR` environment variable,
|
|
97
|
+
then `adf_dir =` in `config.toml`, then `./disks/`.
|
|
98
|
+
|
|
99
|
+
## 5. When stuck
|
|
100
|
+
|
|
101
|
+
- The original behaviour is the truth. For the Amiga file formats, `reference/moonstone-ace` docs
|
|
102
|
+
and sources are the specification. `reference/openmoonstone` targets the **DOS** release: use it
|
|
103
|
+
for behaviour (combat, AI, movement), never for Amiga byte layouts.
|
|
104
|
+
- The references disagree → moonstone-ace wins (it was verified against the original 68k code).
|
|
105
|
+
Note the conflict in `docs/ARCHITECTURE.md`.
|
|
106
|
+
- You'd need to change architecture → stop, write a `PROPOSED` ADR in `docs/DECISIONS.md`, and ask
|
|
107
|
+
the user.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Dead Ends: failed approaches log
|
|
2
|
+
|
|
3
|
+
This file records approaches that failed and must **never** be repeated. Add a row whenever an
|
|
4
|
+
approach is abandoned, with enough detail that the next agent won't try it again.
|
|
5
|
+
|
|
6
|
+
| Date | Approach Tried | Why It Failed | Files Touched |
|
|
7
|
+
|------|----------------|---------------|---------------|
|
|
8
|
+
| 2026-11-14 | Treating OpenMoonstone's DOS loaders (`piv.py`, `cmp.py`, `lz77.rs`) as the Amiga format reference | Not attempted in code; ruled out during alignment. OpenMoonstone reads the **DOS** release, and the Amiga files on the ADFs use different containers. moonstone-ace is the Amiga format reference. | n/a |
|
|
9
|
+
| 2026-11-15 | Replaying a fight script from its first byte every frame (`tick // 6` steps in a throwaway job) to pick sprites, while a separate timer state machine holds the fighter's state | Script state (loops, motion blocks, frame set, armed jumps, spawned objects) is lost each frame, and animation and rules disagree. Audit v3 §6; ADR-009. The job must keep its script position across ticks and be the only fighter state. | `app/combat_bridge.py`, `sim/knight_combat.py`, `sim/monster_ai.py` |
|
|
10
|
+
| 2026-11-15 | Modelling the overworld as a node graph with hand-placed road nodes and hops per day | The original has no paths: knights move one pixel per step on the map and a proximity scan lists what is near. The graph produced an encounter on nearly every hop. ADR-009. | `sim/overworld.py`, `app/scene_assets.py` |
|
|
11
|
+
| 2026-11-15 | Patching symptoms against a green test suite (remediation passes 1 and 2) | The tests asserted the invented models, so they passed while the game stayed unplayable. Presentation work needs reviewed real-disk contact sheets (`scripts/audit_shots.py`). | `tests/unit/test_playability_v2.py` and others |
|
|
12
|
+
| 2026-11-17 | Reusing the generic dagger/align audit controller for Balok | Balok ignores hit links in flight and a landed pounce defeats the knight regardless of its HP. The audit needs ordinary evasive inputs during flight, followed by grounded melee; increasing fixture HP does not solve the pounce. Keep that controller in the audit, not in game rules. | `app/fight_audit.py` |
|
|
13
|
+
|
|
14
|
+
| 2026-11-17 | Reusing the generic dagger/align or stationary overhead audit controller for the Dragon | In its near flight the Dragon stays roughly 70 pixels above the ground: flat daggers miss, and closing for a stationary blow leads to the bite finisher. Use the ordinary action-$18 sword move with an explicitly equipped endgame knight (matching Moonstone and one protection item); keep this policy in the audit, without changing Dragon rules. | `app/fight_audit.py` |
|
|
15
|
+
|
|
16
|
+
| 2026-11-17 | Generic dagger/align and repeated action-$04 audit policies against the computer knight | The knight closes, alternates attacks and guards while the generic bot loses even with the fixture's larger HP. The ordinary heavy-action audit policy reaches a seeded win; use it only in the audit controller, without changing AI rules or original odds. | app/fight_audit.py |
|
|
17
|
+
|
|
18
|
+
| 2026-11-17 | Generic dagger/align audit policy for the natural lair-to-loot acceptance fixture | In the original lair arena the bot stalls at range and repeatedly throws while taking damage. The existing ordinary heavy-sword policy wins through the natural scripts and wave spawning. Keep this choice in the audit controller and preserve the engine's wrapped remaining-count write-back. | `app/fight_audit.py`, `tests/adf/test_sheets_adf.py` |
|
|
19
|
+
|
|
20
|
+
| 2026-11-18 | Selecting the worn sharp sword as a slot4 offer on Stonehenge sheet3 | The worn icon is an equipment region for actor field $58; sheet3 converts only existing inventory fields below $14. The slot4 drop fallback does not create a UI region. Use an exposed magic item for natural offer acceptance; do not invent a sword offer region. | `tests/adf/test_stonehenge_adf.py` |
|
|
21
|
+
| 2026-11-18 | Forcing HARDDAYSENGINE_ADF_DIR globally for a full-gate snapshot | The environment correctly takes precedence over config.toml, so the CLI invalid-config test no longer exercises its expected path. Give the snapshot a disks directory junction and leave that environment variable unset; focused pytest runs can use --adf-dir. | build/meeting_snapshot.py (ignored) |
|
|
22
|
+
| 2026-11-18 | Using only actor kind bytes to identify computer fighters before map initialization | Direct fight fixtures still have default class kinds (0..3), so their computer opponent becomes a human knight. Campaign fights use authoritative kinds after map installation; retain roster-based detection for direct pre-map fights. | app/game.py |
|
|
23
|
+
| 2026-11-19 | Requiring a sound bank to contain the skipped 32-byte header plus the original requested byte count | The original generally requests the entire file size after skipping its header; Wz.a is shorter still. DOS returns a short read and leaves the old buffer tail intact. Copy the returned file slice, including its trailing HUNK_END when present, and preserve the unwritten tail. | app/audio.py, app/paula.py, assets/bank_data.py |
|
|
24
|
+
| 2026-11-19 | Using the heavy-sword audit policy for the starting knight's full `gll2.t` lair | The last opponent remains beyond the knight's right movement limit and the pursuit stalls. The existing ranged/align audit policy wins naturally with starting equipment; use it for this campaign route without changing game rules or fixture stats. | build/campaign_probe.py (ignored), app/campaign_audit.py |
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# GEMINI.md
|
|
2
|
+
|
|
3
|
+
All agent rules for this repository live in [AGENTS.md](AGENTS.md). Read it fully before any
|
|
4
|
+
change. The essentials, so they're never missed:
|
|
5
|
+
|
|
6
|
+
- Every task closes with a green `uv run python scripts/quality_gate.py`.
|
|
7
|
+
- `sim/` is deterministic: no floats, no `random`/`time`/I/O, integers only, 50 Hz ticks.
|
|
8
|
+
- Never commit `.adf` images or anything extracted from them. `reference/` is a specification,
|
|
9
|
+
not code to copy (clean room, ADR-001).
|
|
10
|
+
- No `pass`/`TODO`/placeholder implementations, and no gate suppressions.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 HardDaysEngine contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
|
23
|
+
Moonstone: A Hard Days Knight is (c) 1991 Mindscape / Rob Anderson. This
|
|
24
|
+
licence covers the HardDaysEngine source code only, not the original game or any
|
|
25
|
+
data extracted from it.
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: harddaysengine
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Clean-room Python 3.12+ reimplementation of Moonstone: A Hard Days Knight (1991) with a deterministic 50Hz simulation core.
|
|
5
|
+
Author: Senior Systems Architect
|
|
6
|
+
License: MIT
|
|
7
|
+
License-File: LICENSE
|
|
8
|
+
Requires-Python: >=3.12
|
|
9
|
+
Requires-Dist: amitools>=0.7.0
|
|
10
|
+
Requires-Dist: esper>=3.2
|
|
11
|
+
Requires-Dist: moderngl>=5.10.0
|
|
12
|
+
Requires-Dist: numpy>=2.1.0
|
|
13
|
+
Requires-Dist: pillow>=10.4.0
|
|
14
|
+
Requires-Dist: pydantic>=2.9.0
|
|
15
|
+
Requires-Dist: pygame-ce>=2.5.2
|
|
16
|
+
Description-Content-Type: text/markdown
|
|
17
|
+
|
|
18
|
+
# HardDaysEngine
|
|
19
|
+
|
|
20
|
+
A clean-room Python 3.12+ reimplementation of the 1991 Amiga game *Moonstone: A Hard Days Knight* (Mindscape / Rob Anderson), built around a deterministic 50 Hz integer simulation core and a ModernGL + `pygame-ce` presentation layer.
|
|
21
|
+
|
|
22
|
+
## Architecture
|
|
23
|
+
|
|
24
|
+
The codebase is organized into strict unidirectional layers (`cli -> app -> render -> assets -> sim`):
|
|
25
|
+
|
|
26
|
+
- **Simulation (`src/harddaysengine/sim/`)**: deterministic 50 Hz integer/fixed-point kernel (persistent combat jobs and handlers, pixel map, turn scheduler, sheets and places, palette FX, PRNG). No floats, no wall clock, no `random`, no I/O.
|
|
27
|
+
- **Assets (`src/harddaysengine/assets/`)**: reads original Amiga `.adf` disk images (OFS) at runtime, unpacks RNC1/LZSS streams, and decodes pictures, cels, `collide.hit` attack sets, `.t` arena layouts, `program`/`mog` hunk tables, and audio banks.
|
|
28
|
+
- **Render (`src/harddaysengine/render/`)**: ModernGL (OpenGL 3.3 core) `320x256` virtual canvas, indexed palette textures, optional CRT post-process, and debug hitbox overlay.
|
|
29
|
+
- **App & CLI (`src/harddaysengine/app/`, `src/harddaysengine/cli/`)**: `pygame-ce` window host, 50 Hz fixed-timestep loop, keyboard/gamepad input, audio mixer, and CLI entry points.
|
|
30
|
+
|
|
31
|
+
## Bring Your Own Amiga Disks
|
|
32
|
+
|
|
33
|
+
This repository contains **no game data**. Place your three original Amiga disk images (901,120-byte `.adf` files, any filenames) into `./disks/`, or specify their location using:
|
|
34
|
+
|
|
35
|
+
1. `--adf-dir <path>`
|
|
36
|
+
2. `HARDDAYSENGINE_ADF_DIR` environment variable
|
|
37
|
+
3. `adf_dir = "<path>"` in `config.toml`
|
|
38
|
+
|
|
39
|
+
Never commit `.adf` images or anything extracted from them.
|
|
40
|
+
|
|
41
|
+
## Running the Game
|
|
42
|
+
|
|
43
|
+
```powershell
|
|
44
|
+
uv sync # install runtime + dev dependencies (Python 3.12)
|
|
45
|
+
uv run harddaysengine --list-disks # verify your three .adf images are detected
|
|
46
|
+
uv run harddaysengine # launch the game (default 3x scale)
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Useful CLI flags:
|
|
50
|
+
|
|
51
|
+
- `--scale <N>`: initial window size, 1..8 canvas pixels per pixel (default `3`)
|
|
52
|
+
- `--filter faithful|scanlines|crt|smooth`: presentation preset (default `faithful`, crisp pixels without effects)
|
|
53
|
+
- `--scale-mode integer|sharp-bilinear|fit`: viewport scaling mode (default `integer`)
|
|
54
|
+
- `--aspect square|pal`: source pixel shape (default `square`; `pal` gives 4:3 on the full 320x256 frame)
|
|
55
|
+
- `--crop full|playfield`: show the full 320x256 PAL canvas or crop to the 320x200 playfield (default `full`)
|
|
56
|
+
- `--fullscreen off|desktop|exclusive`: start windowed, borderless desktop fullscreen, or exclusive fullscreen (default `off`)
|
|
57
|
+
- `--vsync` / `--no-vsync`: enable or disable vertical sync (default `true`; `--no-vsync` presents once per 50 Hz tick)
|
|
58
|
+
- `--surround off|blur|solid`: decorative widescreen side-bar fill (default `off`)
|
|
59
|
+
|
|
60
|
+
Display settings can also live in `config.toml` (CLI flags win; unknown keys are an error):
|
|
61
|
+
|
|
62
|
+
```toml
|
|
63
|
+
[display]
|
|
64
|
+
scale = 4
|
|
65
|
+
filter = "crt"
|
|
66
|
+
scale_mode = "integer"
|
|
67
|
+
aspect = "square"
|
|
68
|
+
crop = "full"
|
|
69
|
+
fullscreen = "off"
|
|
70
|
+
vsync = true
|
|
71
|
+
crt_mask = "aperture" # aperture, shadow, none
|
|
72
|
+
crt_mask_strength = 0.25 # 0.0..1.0
|
|
73
|
+
crt_scanlines = 0.65 # 0.0..1.0
|
|
74
|
+
crt_curvature = 0.08 # 0.0..0.3 (0 disables curvature and corner mask)
|
|
75
|
+
crt_bloom = 0.22 # 0.0..1.0 (0 disables bloom)
|
|
76
|
+
surround = "off" # off, blur, solid
|
|
77
|
+
surround_brightness = 0.28 # 0.0..1.0 (blur mode)
|
|
78
|
+
surround_color = "#101014" # #RRGGBB (solid mode)
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Presentation presets (`--filter` or `F9` / `Shift+F9` at runtime; all presets run strictly after the palette lookup and never affect simulation or replay hashes):
|
|
82
|
+
|
|
83
|
+
| Preset | Look |
|
|
84
|
+
|---|---|
|
|
85
|
+
| `faithful` *(default)* | Even, crisp pixels at the selected aspect and scale mode with no effects |
|
|
86
|
+
| `scanlines` | Crisp pixels with output-grid scanlines (no non-integer moiré banding) |
|
|
87
|
+
| `crt` | Linear-light intensity-widening scanline beams, aperture/shadow phosphor mask, optional barrel curvature + rounded bezel, and separable bloom |
|
|
88
|
+
| `smooth` | 4× xBR-style edge-directed upscaler preserving 90° corners and dithered textures across palette cycling |
|
|
89
|
+
|
|
90
|
+
- `--inspect-assets`: launch the 50 Hz ModernGL Lair Background, Sprite, and Hitbox Inspector (`--cel kn4 --background fol1.t`)
|
|
91
|
+
- `--extract-assets`: unpack ADF assets into `--output-dir` (default `./build/assets`) with `manifest.json`
|
|
92
|
+
- `--headless-frames <N>`: run `N` 50 Hz ticks on a standalone OpenGL 3.3 context without opening a window
|
|
93
|
+
|
|
94
|
+
### Controls
|
|
95
|
+
|
|
96
|
+
At the title, press Enter to open the menu. Up/Down selects a row; Left/Right on the
|
|
97
|
+
player-count row chooses 1–4 humans. Select Start, then choose portraits with Left/Right
|
|
98
|
+
and confirm each with Enter. Keyboard slots follow portrait selection order.
|
|
99
|
+
|
|
100
|
+
| Context | Player 1 keys |
|
|
101
|
+
|---|---|
|
|
102
|
+
| Move on the map / move a sheet or town pointer | Arrow keys |
|
|
103
|
+
| Enter a nearby place or lair / select a pointer region | Enter |
|
|
104
|
+
| Choose a row when several map destinations overlap | 1–9 |
|
|
105
|
+
| Status on the map | Space or Left Ctrl |
|
|
106
|
+
| End the current map turn | E or Tab |
|
|
107
|
+
| Fight | Arrows + Space; direction selects the sword move, guard or dagger throw |
|
|
108
|
+
| Pause map or combat | P |
|
|
109
|
+
| Continue a message or Next Day | Press and release Enter or Space |
|
|
110
|
+
| Leave a sheet or town | Move the pointer to its close/Exit region and confirm |
|
|
111
|
+
| Quit the campaign to farewell on the map | Q |
|
|
112
|
+
| Cycle filter preset (not recorded in replays) | F9 (Shift+F9 backwards) |
|
|
113
|
+
| Toggle fullscreen (not recorded in replays) | F11 or Alt+Enter |
|
|
114
|
+
|
|
115
|
+
Player 2 uses WASD/F, player 3 IJKL/U, and player 4 the numeric keypad/Keypad 0 for
|
|
116
|
+
movement/fire. Gamepads use the directional pad or left stick and button 0 for fire.
|
|
117
|
+
Practice uses two human knights. All nine creature handlers, loot, shops, services,
|
|
118
|
+
place callers and the original ending are implemented; combat requires the original disks.
|
|
119
|
+
See [docs/PROGRESS.md](docs/PROGRESS.md) for acceptance evidence and documented deviations.
|
|
120
|
+
|
|
121
|
+
## Development & Verification
|
|
122
|
+
|
|
123
|
+
```powershell
|
|
124
|
+
uv run python scripts/quality_gate.py # ruff format/lint, mypy --strict, import-linter, radon, vulture, pytest
|
|
125
|
+
uv run pytest -m "not adf and not gl" # unit tests needing neither disks nor OpenGL
|
|
126
|
+
uv run pytest -m adf # integration tests against your local ./disks/*.adf
|
|
127
|
+
uv run pytest -m gl # ModernGL rendering tests
|
|
128
|
+
uv run python scripts/verify_campaign.py # input-only campaign replay + reviewed checkpoints
|
|
129
|
+
uv run python scripts/audit_shots.py --present crt --size 1920x1080 # per-preset presentation contact sheets into build/audit/
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
The campaign command writes `build/campaign/replay.json`, `verification.json` (checkpoint
|
|
133
|
+
and final SHA-256 state hashes), and `campaign.png`. It selects four human knights, walks
|
|
134
|
+
into a lair, wins with starting equipment, takes loot, buys a potion in Highwood, and advances
|
|
135
|
+
the day and moon. It replays the saved inputs in a fresh session and verifies every checkpoint;
|
|
136
|
+
rendering must leave those hashes unchanged. This is one integration route, alongside the
|
|
137
|
+
separate creature, place, ending and audio tests. Generated game-derived files stay in `build/`.
|
|
138
|
+
Use `--adf-dir <path>` or `--out-dir <path>` to change the command's paths.
|
|
139
|
+
|
|
140
|
+
See [AGENTS.md](AGENTS.md) for contributor/agent rules and [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md), [docs/DECISIONS.md](docs/DECISIONS.md), and [docs/PROGRESS.md](docs/PROGRESS.md) for technical documentation.
|
|
141
|
+
|
|
142
|
+
## Acknowledgements
|
|
143
|
+
|
|
144
|
+
HardDaysEngine is a homage to *Moonstone: A Hard Days Knight* and to the people who created it,
|
|
145
|
+
above all Rob Anderson, and to Mindscape, who published it in 1991. This project exists out of
|
|
146
|
+
admiration for their work and aims to preserve it for players who own the original game.
|
|
147
|
+
|
|
148
|
+
Thanks also to the authors of the `moonstone-ace` and `openmoonstone` projects, whose research
|
|
149
|
+
documented much of the original behaviour.
|
|
150
|
+
|
|
151
|
+
## License
|
|
152
|
+
|
|
153
|
+
MIT License — see [LICENSE](LICENSE).
|
|
154
|
+
|
|
155
|
+
*Moonstone: A Hard Days Knight* is (c) 1991 Mindscape / Rob Anderson. This license covers the `harddaysengine` source code only, not the original game or any data extracted from it. External reference projects (`moonstone-ace` and `openmoonstone`) are not included in this repository and were consulted as specifications only (see [docs/DECISIONS.md](docs/DECISIONS.md), ADR-001).
|
|
156
|
+
|
|
157
|
+
This is an independent, unofficial fan project. It is not affiliated with, endorsed by, or sponsored by Mindscape, Rob Anderson, or any current rights holder of *Moonstone*. All trademarks belong to their respective owners; the game's title is used only to describe compatibility. You must own the original game to use this software.
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
# HardDaysEngine
|
|
2
|
+
|
|
3
|
+
A clean-room Python 3.12+ reimplementation of the 1991 Amiga game *Moonstone: A Hard Days Knight* (Mindscape / Rob Anderson), built around a deterministic 50 Hz integer simulation core and a ModernGL + `pygame-ce` presentation layer.
|
|
4
|
+
|
|
5
|
+
## Architecture
|
|
6
|
+
|
|
7
|
+
The codebase is organized into strict unidirectional layers (`cli -> app -> render -> assets -> sim`):
|
|
8
|
+
|
|
9
|
+
- **Simulation (`src/harddaysengine/sim/`)**: deterministic 50 Hz integer/fixed-point kernel (persistent combat jobs and handlers, pixel map, turn scheduler, sheets and places, palette FX, PRNG). No floats, no wall clock, no `random`, no I/O.
|
|
10
|
+
- **Assets (`src/harddaysengine/assets/`)**: reads original Amiga `.adf` disk images (OFS) at runtime, unpacks RNC1/LZSS streams, and decodes pictures, cels, `collide.hit` attack sets, `.t` arena layouts, `program`/`mog` hunk tables, and audio banks.
|
|
11
|
+
- **Render (`src/harddaysengine/render/`)**: ModernGL (OpenGL 3.3 core) `320x256` virtual canvas, indexed palette textures, optional CRT post-process, and debug hitbox overlay.
|
|
12
|
+
- **App & CLI (`src/harddaysengine/app/`, `src/harddaysengine/cli/`)**: `pygame-ce` window host, 50 Hz fixed-timestep loop, keyboard/gamepad input, audio mixer, and CLI entry points.
|
|
13
|
+
|
|
14
|
+
## Bring Your Own Amiga Disks
|
|
15
|
+
|
|
16
|
+
This repository contains **no game data**. Place your three original Amiga disk images (901,120-byte `.adf` files, any filenames) into `./disks/`, or specify their location using:
|
|
17
|
+
|
|
18
|
+
1. `--adf-dir <path>`
|
|
19
|
+
2. `HARDDAYSENGINE_ADF_DIR` environment variable
|
|
20
|
+
3. `adf_dir = "<path>"` in `config.toml`
|
|
21
|
+
|
|
22
|
+
Never commit `.adf` images or anything extracted from them.
|
|
23
|
+
|
|
24
|
+
## Running the Game
|
|
25
|
+
|
|
26
|
+
```powershell
|
|
27
|
+
uv sync # install runtime + dev dependencies (Python 3.12)
|
|
28
|
+
uv run harddaysengine --list-disks # verify your three .adf images are detected
|
|
29
|
+
uv run harddaysengine # launch the game (default 3x scale)
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Useful CLI flags:
|
|
33
|
+
|
|
34
|
+
- `--scale <N>`: initial window size, 1..8 canvas pixels per pixel (default `3`)
|
|
35
|
+
- `--filter faithful|scanlines|crt|smooth`: presentation preset (default `faithful`, crisp pixels without effects)
|
|
36
|
+
- `--scale-mode integer|sharp-bilinear|fit`: viewport scaling mode (default `integer`)
|
|
37
|
+
- `--aspect square|pal`: source pixel shape (default `square`; `pal` gives 4:3 on the full 320x256 frame)
|
|
38
|
+
- `--crop full|playfield`: show the full 320x256 PAL canvas or crop to the 320x200 playfield (default `full`)
|
|
39
|
+
- `--fullscreen off|desktop|exclusive`: start windowed, borderless desktop fullscreen, or exclusive fullscreen (default `off`)
|
|
40
|
+
- `--vsync` / `--no-vsync`: enable or disable vertical sync (default `true`; `--no-vsync` presents once per 50 Hz tick)
|
|
41
|
+
- `--surround off|blur|solid`: decorative widescreen side-bar fill (default `off`)
|
|
42
|
+
|
|
43
|
+
Display settings can also live in `config.toml` (CLI flags win; unknown keys are an error):
|
|
44
|
+
|
|
45
|
+
```toml
|
|
46
|
+
[display]
|
|
47
|
+
scale = 4
|
|
48
|
+
filter = "crt"
|
|
49
|
+
scale_mode = "integer"
|
|
50
|
+
aspect = "square"
|
|
51
|
+
crop = "full"
|
|
52
|
+
fullscreen = "off"
|
|
53
|
+
vsync = true
|
|
54
|
+
crt_mask = "aperture" # aperture, shadow, none
|
|
55
|
+
crt_mask_strength = 0.25 # 0.0..1.0
|
|
56
|
+
crt_scanlines = 0.65 # 0.0..1.0
|
|
57
|
+
crt_curvature = 0.08 # 0.0..0.3 (0 disables curvature and corner mask)
|
|
58
|
+
crt_bloom = 0.22 # 0.0..1.0 (0 disables bloom)
|
|
59
|
+
surround = "off" # off, blur, solid
|
|
60
|
+
surround_brightness = 0.28 # 0.0..1.0 (blur mode)
|
|
61
|
+
surround_color = "#101014" # #RRGGBB (solid mode)
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Presentation presets (`--filter` or `F9` / `Shift+F9` at runtime; all presets run strictly after the palette lookup and never affect simulation or replay hashes):
|
|
65
|
+
|
|
66
|
+
| Preset | Look |
|
|
67
|
+
|---|---|
|
|
68
|
+
| `faithful` *(default)* | Even, crisp pixels at the selected aspect and scale mode with no effects |
|
|
69
|
+
| `scanlines` | Crisp pixels with output-grid scanlines (no non-integer moiré banding) |
|
|
70
|
+
| `crt` | Linear-light intensity-widening scanline beams, aperture/shadow phosphor mask, optional barrel curvature + rounded bezel, and separable bloom |
|
|
71
|
+
| `smooth` | 4× xBR-style edge-directed upscaler preserving 90° corners and dithered textures across palette cycling |
|
|
72
|
+
|
|
73
|
+
- `--inspect-assets`: launch the 50 Hz ModernGL Lair Background, Sprite, and Hitbox Inspector (`--cel kn4 --background fol1.t`)
|
|
74
|
+
- `--extract-assets`: unpack ADF assets into `--output-dir` (default `./build/assets`) with `manifest.json`
|
|
75
|
+
- `--headless-frames <N>`: run `N` 50 Hz ticks on a standalone OpenGL 3.3 context without opening a window
|
|
76
|
+
|
|
77
|
+
### Controls
|
|
78
|
+
|
|
79
|
+
At the title, press Enter to open the menu. Up/Down selects a row; Left/Right on the
|
|
80
|
+
player-count row chooses 1–4 humans. Select Start, then choose portraits with Left/Right
|
|
81
|
+
and confirm each with Enter. Keyboard slots follow portrait selection order.
|
|
82
|
+
|
|
83
|
+
| Context | Player 1 keys |
|
|
84
|
+
|---|---|
|
|
85
|
+
| Move on the map / move a sheet or town pointer | Arrow keys |
|
|
86
|
+
| Enter a nearby place or lair / select a pointer region | Enter |
|
|
87
|
+
| Choose a row when several map destinations overlap | 1–9 |
|
|
88
|
+
| Status on the map | Space or Left Ctrl |
|
|
89
|
+
| End the current map turn | E or Tab |
|
|
90
|
+
| Fight | Arrows + Space; direction selects the sword move, guard or dagger throw |
|
|
91
|
+
| Pause map or combat | P |
|
|
92
|
+
| Continue a message or Next Day | Press and release Enter or Space |
|
|
93
|
+
| Leave a sheet or town | Move the pointer to its close/Exit region and confirm |
|
|
94
|
+
| Quit the campaign to farewell on the map | Q |
|
|
95
|
+
| Cycle filter preset (not recorded in replays) | F9 (Shift+F9 backwards) |
|
|
96
|
+
| Toggle fullscreen (not recorded in replays) | F11 or Alt+Enter |
|
|
97
|
+
|
|
98
|
+
Player 2 uses WASD/F, player 3 IJKL/U, and player 4 the numeric keypad/Keypad 0 for
|
|
99
|
+
movement/fire. Gamepads use the directional pad or left stick and button 0 for fire.
|
|
100
|
+
Practice uses two human knights. All nine creature handlers, loot, shops, services,
|
|
101
|
+
place callers and the original ending are implemented; combat requires the original disks.
|
|
102
|
+
See [docs/PROGRESS.md](docs/PROGRESS.md) for acceptance evidence and documented deviations.
|
|
103
|
+
|
|
104
|
+
## Development & Verification
|
|
105
|
+
|
|
106
|
+
```powershell
|
|
107
|
+
uv run python scripts/quality_gate.py # ruff format/lint, mypy --strict, import-linter, radon, vulture, pytest
|
|
108
|
+
uv run pytest -m "not adf and not gl" # unit tests needing neither disks nor OpenGL
|
|
109
|
+
uv run pytest -m adf # integration tests against your local ./disks/*.adf
|
|
110
|
+
uv run pytest -m gl # ModernGL rendering tests
|
|
111
|
+
uv run python scripts/verify_campaign.py # input-only campaign replay + reviewed checkpoints
|
|
112
|
+
uv run python scripts/audit_shots.py --present crt --size 1920x1080 # per-preset presentation contact sheets into build/audit/
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
The campaign command writes `build/campaign/replay.json`, `verification.json` (checkpoint
|
|
116
|
+
and final SHA-256 state hashes), and `campaign.png`. It selects four human knights, walks
|
|
117
|
+
into a lair, wins with starting equipment, takes loot, buys a potion in Highwood, and advances
|
|
118
|
+
the day and moon. It replays the saved inputs in a fresh session and verifies every checkpoint;
|
|
119
|
+
rendering must leave those hashes unchanged. This is one integration route, alongside the
|
|
120
|
+
separate creature, place, ending and audio tests. Generated game-derived files stay in `build/`.
|
|
121
|
+
Use `--adf-dir <path>` or `--out-dir <path>` to change the command's paths.
|
|
122
|
+
|
|
123
|
+
See [AGENTS.md](AGENTS.md) for contributor/agent rules and [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md), [docs/DECISIONS.md](docs/DECISIONS.md), and [docs/PROGRESS.md](docs/PROGRESS.md) for technical documentation.
|
|
124
|
+
|
|
125
|
+
## Acknowledgements
|
|
126
|
+
|
|
127
|
+
HardDaysEngine is a homage to *Moonstone: A Hard Days Knight* and to the people who created it,
|
|
128
|
+
above all Rob Anderson, and to Mindscape, who published it in 1991. This project exists out of
|
|
129
|
+
admiration for their work and aims to preserve it for players who own the original game.
|
|
130
|
+
|
|
131
|
+
Thanks also to the authors of the `moonstone-ace` and `openmoonstone` projects, whose research
|
|
132
|
+
documented much of the original behaviour.
|
|
133
|
+
|
|
134
|
+
## License
|
|
135
|
+
|
|
136
|
+
MIT License — see [LICENSE](LICENSE).
|
|
137
|
+
|
|
138
|
+
*Moonstone: A Hard Days Knight* is (c) 1991 Mindscape / Rob Anderson. This license covers the `harddaysengine` source code only, not the original game or any data extracted from it. External reference projects (`moonstone-ace` and `openmoonstone`) are not included in this repository and were consulted as specifications only (see [docs/DECISIONS.md](docs/DECISIONS.md), ADR-001).
|
|
139
|
+
|
|
140
|
+
This is an independent, unofficial fan project. It is not affiliated with, endorsed by, or sponsored by Mindscape, Rob Anderson, or any current rights holder of *Moonstone*. All trademarks belong to their respective owners; the game's title is used only to describe compatibility. You must own the original game to use this software.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# HardDaysEngine configuration example
|
|
2
|
+
# Copy to config.toml (git-ignored) and adjust.
|
|
3
|
+
|
|
4
|
+
# Directory holding the three original Amiga .adf disk images (any file names).
|
|
5
|
+
# Can also be set with --adf-dir or the HARDDAYSENGINE_ADF_DIR environment variable.
|
|
6
|
+
# Default when unset: ./disks
|
|
7
|
+
adf_dir = ""
|