Skip to content

v0.0.2: Implement various units, sound effects and food supply.

Choose a tag to compare

@haroldo-ok haroldo-ok released this 01 Aug 13:38

Full Changelog: v0.0.1...v0.0.2

🔊 1. PSG SFX Driver (M68K Integration)

  • Hardware Channel: Offloaded sound requests (0x1B00 | id) via Mars_PlaySFX() to the Master 68000 driving the Programmable Sound Generator (PSG).
  • 14 Sound Effects: Includes UI navigation (SELECT, ERROR), entity feedback (MOVE, ATTACK, START_BUILD, BUILD_COMPLETE, DEPOSIT, TRAIN, SAVE), and dynamic VBlank pitch sweeps (e.g., BUILD $350 \rightarrow 80\text{Hz}$, DEATH $120 \rightarrow 600\text{Hz}$, white-noise HIT at $E6, and Victory/Defeat fanfares).

⚔️ 2. Expanded Roster & Siege Mechanics

  • 3-Tier Unit Training (Barracks):

  • Melee: Footman (Human 0) / Grunt (Orc 1) — $400\text{G}$.

  • Ranged: Archer (Human 8) / Spearman (Orc 9) — $450\text{G} / 50\text{L}$.

  • Siege: Catapult (Human 4 / Orc 5) — $700\text{G} / 150\text{L}$, $80\text{HP}$, 8 range, $15+10$ damage, 22-frame travel time.

  • Catapult Splash Damage: Implemented hurt_area(cx, cy, 2, attacker, damage) on projectile expiration, dealing area-of-effect damage within a 2-tile radius to all hostiles.


🏰 3. Base Building & Macro Mechanics

  • Defensive Towers: Types 36 (Human) / 37 (Orc) ($120\text{G}/60\text{L}$). Features auto-target acquisition within 6 tiles, 90-frame cooldown, and ranged arrow fire. Existing level towers now actively defend.
  • Lumber Mill & Economy: Types 42/43 ($150\text{G}/100\text{L}$). Owning a Lumber Mill activates a +25% yield bonus, boosting worker lumber carrying capacity from 100 to 125 units per return trip.
  • Worker Repair Loop: Workers can now approach damaged friendly structures ($\text{Type} \ge 32$) and restore $8\text{HP}$ per 30 frames at the cost of $1\text{G}$ with throttled repair audio.
  • Food Supply System: Town Halls & Farms ($32/33$) grant $+4$ food capacity each (minimum 4). Units cost 1 food each. Training is blocked with an ERROR SFX if the player is at the supply cap.

💾 4. Savegame V3 Protocol & Fog Persistence

  • Explored Map State: Added a 512-byte bitfield mapping 4,096 map cells ($1\text{ bit} = \text{explored}$) so explored territory is preserved across cartridge SRAM save/load cycles instead of resetting to black.
  • Backward Compatibility & Compact Packing:
  • Capped entity and lumber limits (MAX_ENTITIES 64, MAX_LUMBER 64) to fit the full save payload comfortably within 1,756 bytes (under the 2,048-byte SRAM ceiling).
  • The V3 decoder maintains fallback support for V1 ($14\text{B}/\text{ent}$) and V2 ($15\text{B}/\text{ent}$) save files.

🎮 Updated Control Scheme Quick Reference

Selection Button / Combination Action
Worker Orders C (Cycle Order) Cycles through: MOVE $\rightarrow$ HARVEST $\rightarrow$ FARM $\rightarrow$ BARRACKS $\rightarrow$ TOWER $\rightarrow$ L MILL $\rightarrow$ REPAIR
Worker Quick-Build X / Y X: Build Farm
Barracks C (Cycle Unit) Cycles through: Melee $\rightarrow$ Ranged $\rightarrow$ Siege
Barracks Quick-Train X / Y / Z X: Train Melee
Barracks Order B Confirm training current selected unit type

📊 Feature Progression Matrix

Feature Version 7 Version 8 Version 9 Version 10
PSG Audio Driver ✅ (14 SFX)
Ranged Units (Archer/Spearman)
Defensive Towers & AI
Catapults & AOE Splash
Food Supply System
Lumber Mill (+25% Yield)
Building Repair Mechanics
SRAM Fog Persistence ❌ (V1) ❌ (V2) ❌ (V2) ✅ (V3)