Commit Graph

14 Commits

Author SHA1 Message Date
Brian Fertig b42a71bf2f feat: add radar detection system with jamming and contacts
Introduce a second detection layer independent of line-of-sight vision.
Radar buildings (Radar Tower, Advanced Radar) provide coverage that reveals
unit positions through fog as contacts, while Radar Jammers can blind enemy
radar within range without affecting normal sight.

Key changes:
- Add three sensor buildings: Radar Tower, Advanced Radar, Radar Jammer
- Implement computeRadar() with jamming logic and stampDisc() optimization
- Add isDetectedBy() for radar contact detection
- Draw radar contacts as green diamond blips in WorldView
- Show radar contacts as neutral green pips on minimap
- Expand build grid to 2 rows and artwork sheets to 4 rows
- Refuse repair orders on airborne units; builders stop chasing airborne targets
- Add validation for radarRange and jamRange in rules compiler
- Update sprites.md documentation and add comprehensive tests
2026-08-01 14:51:05 -06:00
Brian Fertig 71e455650b feat: introduce dedicated armor classes for air and fortifications
Add `air` and `fortification` armor classes to enable more nuanced
balance. Aircraft now use `air` class instead of light/medium, and
defensive turrets use `fortification` instead of `structure`, allowing
weapons to specialize against planes and defenses without affecting
other targets.

- Add armor classes to all 12 weapons with appropriate multipliers
- Adjust weapon stats (sniperrifle, rocketpod, shoulderrocket)
- Reduce HP on several combat units for balance
- Reclassify aircraft and defensive turrets to new armor classes
2026-08-01 14:02:22 -06:00
Brian Fertig ac063d34a6 feat(total-annihilation): overhaul command system, patrol routes, and Commander death sequence
- Add repair and rally command buttons with custom glyphs and tooltips
- Refactor bottom command bar into a structured, discoverable grid with
  visibility filtering per selection type
- Replace patrol's there-and-back with a circuit-based route system;
  CTRL-clicking extends the patrol instead of stacking orders
- Builders guarding structures now repair damage first, then assist
  production — assist to producing factories now works correctly
- Add Commander death cascade: nuclear blast, outward vaporization wave,
  and screen-wide flash timed to the audio sample
- Introduce `fortification` and `air` armor classes; rebalance weapons,
  unit HP, and ranges across the roster
- Remove the static hint line; all commands now have prompts and button
  tooltips instead
- Add verification tests for patrol routes, guarding builders, vaporised
  entity rendering, and the full command bar
2026-08-01 13:56:41 -06:00
Brian Fertig f9e971b305 feat(totalannihilation): overhaul flight model to strafing behavior
Replace hover-based aircraft movement with a two-state system: LANDED
(grounded, cannot shoot, vulnerable to all weapons) and FLYING (at
cruise speed, uses air domain protection). Aircraft can no longer stop
in mid-air; armed units execute strafing passes with overshoot and
come-about logic.

Key changes:
- Add `liftFrac` simulation state for altitude, `airborne` dynamic flag
  (vs static `isAir`) so landed aircraft are ordinary ground targets
- Implement `stepStraferOrders` for aircraft that overfly targets and
  repeat passes; idle aircraft clear hostile keepout zones
- Add `overshoot` and `keepout` flight properties to fighter/bomber
- AI gains static defense (Laser Tower, Missile Launcher) at skill 4+,
  with threat-based placement and economy gating
- Fighter gains ground gun (pintlegun); air management uses `airClaimed`
  set instead of interceptor-only classification
- Update campaign m05 seed (71644) to compensate for balance shifts
- Update tooltips, documentation, and tests for new behavior

Closes #1234
2026-08-01 13:15:58 -06:00
Brian Fertig 2b6132031a feat(totalannihilation): add flight animation and factory production dials
- Add `flight` blocks to Fighter, Bomber, and Hover Constructor in rules JSON
  defining height, takeoff time, and landing time
- Implement purely cosmetic altitude system: units ease upward when given
  orders and settle back down when idle, using smoothstep easing
- Shadow stays pinned to ground position, fades in and shrinks as altitude
  increases — the gap between body and shadow sells the height
- Health/build bars move with the lifted body; selection ring stays on ground
- Add production dials (progress pies) on the player's own factories:
  top-left shows whole queue progress, top-right shows unit on the bench
- Pass real delta time to render() for framerate-independent takeoff animation
- Update sprites.md with flight system docs and art implications
- Add stub scene support and comprehensive verification tests
2026-08-01 09:41:03 -06:00
Brian Fertig cff1f02d9b feat: add air domain system with fighters, bombers, and hover units
Introduce a two-layer domain system (ground/air) that separates units into
independent simulation layers. Air units ignore the nav grid, never collide
with ground units, and can only be targeted by weapons listing "air" in their
targets. Hover units gain water-crossing ability via the move class cost table.

New content:
- Fighter (air interceptor with AA cannons)
- Bomber (ground-attack aircraft with bomb rack)
- Hover Constructor (water-crossing builder)
- Airfield (produces all three air units)

AI gains air superiority management: interceptors hunt enemy aircraft instead
of joining ground pushes, and the production mix auto-counters observed enemy
air. Ground anti-air (rocket troopers/tanks) also gain targeting weight.

Rendering adds a dedicated depth band for aircraft above all ground actors,
plus a displaced shadow sprite for altitude perception. HUD tooltips display
domain and weapon targeting information.

Validation ensures domain/moveClass agreement, requires at least one anti-air
weapon when air units exist, and excludes air classes from corridor generation.
Comprehensive test fixtures cover domain separation, collision, splash, and
order handling.
2026-08-01 09:00:37 -06:00
Brian Fertig 39059a3551 feat(total-annihilation): add rocket trooper, constructor, and advanced vehicle plant
Introduce three new entities:
- Rocket Trooper: anti-armor infantry with shoulder-mounted guided rocket
- Constructor: unarmed tracked builder to replace lost commander build capacity
- Advanced Vehicle Plant: 4×4 factory with doubled production bays

Update AI composition weights and counter logic for the new units. Fix
byDef map to use Object.create(null) so the "constructor" key doesn't
shadow Object.prototype.constructor and silently poison gap calculations.

Add procedural art shapes for all three, register proc shapes in TARules,
update sprite frame assignments, and add core-structures assets.
2026-07-25 19:52:26 -06:00
Brian Fertig c835096610 feat(total-annihilation): polish visuals, audio, and game balance
- Add TA-specific sound effects (machinegun, 50cal, rocket variants, unit/vehicle loss)
- Add background artwork and update core-units sprite sheet with correct path and dimensions
- Introduce pintle gun weapon with burst fire mechanics
- Switch weapon sounds to TA-themed audio; support sound arrays for random variant picking
- Add impactSound field to projectile weapons, propagated through sim events
- Reduce unit build times and increase structure HP for better pacing
- Enable idle breathing/rotation animations on resource generators
- Replace solid-color backdrop with painted background image on main menu
- Fix camera state cleanup so menus render correctly after gameplay
2026-07-25 19:51:25 -06:00
Brian Fertig b479b6a21f feat: overhaul Bloxorz rendering, mechanics, and level design; update Total Annihilation visuals
Bloxorz:
- Rewrite renderer with axonometric projection, rigid 3D box rolling, and continuous face shading
- Introduce new tile types: heavy switches (standing-only), soft switches, hold pads, fragile ground, split cubes, and teleporters
- Redesign all 36 levels using hand-authored ASCII maps in the generator, organized into six progressive acts
- Add design gates to verify solvability, mechanic necessity, and difficulty progression across acts
- Improve input handling with a directional compass, WASD/arrow key resolution, and smooth teleport/fall animations
- Update tutorial to document new mechanics and tile behaviors

Total Annihilation:
- Extend unit/building sight range to cover weapon max range + 2 tiles for improved fog visibility
- Implement crossfade between wireframe and finished sprites for building construction
- Switch to full-color assets by removing army tinting, and update artwork JSON paths/sizes
- Adjust weapon stats (damage, reload times) in rules
- Update sprites documentation to reflect the new visual pipeline
2026-07-25 14:50:23 -06:00
Brian Fertig 929d27e188 feat: add Bloxorz game, balance Total Annihilation weapons
- Add Bloxorz as a new logic game with tutorial support
- Register Bloxorz in games registry, main scene, and game room dispatch
- Preload bloxorz.json artwork data in PreloadScene
- Fix arm-structures artwork path and frame dimensions for Total Annihilation
- Balance Total Annihilation weapon stats:
  - Increase tankgun damage (95→145)
  - Decrease rocketpod damage (130→80)
  - Decrease towerlaser damage but increase fire rate (62→52, 1.4→0.4s reload)
  - Decrease towermissile damage but increase fire rate (175→135, 4.5→1.5s reload)
2026-07-25 10:30:30 -06:00
Brian Fertig 4e56c3bfae feat(totalannihilation): add victory conditions, new defensive towers, and combat improvements
- Introduce configurable victory modes: "commander" (default, kill enemy commander) and
  "annihilation" (fight until army can no longer produce)
- Add Laser Tower (1x1, hitscan) and Missile Launcher (2x2, guided with min-range dead zone)
  as buildable defensive structures with new towerlaser and towermissile weapons
- Units now hold at weapon range when attacking buildings instead of closing to point-blank,
  controlled by new engageHoldFraction constant (0.45)
- Replace center-to-center distance with surface distance for building targets; buildings are
  treated as rectangles with true half-extents, improving combat accuracy
- Buildings (towers) now freely traverse and aim in all directions regardless of art orientation
- Commander unit flagged with isCommander; victory conditions validate presence of commanders
- Update campaign missions to use destroyCommander objective; reseed m02 (old seed unwinnable
  after combat balance changes)
- Add skirmish setup UI for selecting victory conditions
- Update AI skill ladder verification thresholds to account for engage hold behavior
- Add comprehensive tests for victory conditions and defensive structures
2026-07-25 08:23:11 -06:00
Brian Fertig 23c558a5d4 feat(totalannihilation): add commander self-healing and improved build queue UX
- Add self-healing system for units with `selfHeal` definition (e.g. Commander)
  - Healing pauses for 30 seconds after taking damage to prevent out-healing fights
  - Rates converted to per-tick at load time for efficient simulation
- Improve build queue interaction: use CTRL (or Cmd) to chain multiple builds,
  release to cancel placement automatically — no need to press Esc or click again
- Track queue modifier state from DOM events for robustness across focus loss
2026-07-24 21:25:22 -06:00
Brian Fertig e7da172896 feat: add Total Annihilation game with campaign, AI, and full engine
Add a complete Total Annihilation clone including:

- TotalAnnihilationGame.js: Main scene with fixed-step loop, input handling,
  camera controls, selection, orders, and match lifecycle
- TAHud.js: Resource strip with flow rates, selection info, build/production
  grid, minimap with fog of war, and toast notifications
- TAScreens.js: Main menu, skirmish setup, campaign list, pause menu, and
  victory/defeat results
- totalannihilation-campaign.json: 6 hand-authored campaign missions with
  escalating difficulty (skill 1→5)
- tools/genTACampaign.js: Campaign generator that bakes terrain from the
  seeded map generator
- tools/verifyTotalAnnihilation.js: 13-section end-to-end test suite covering
  rules integrity, artwork, economy, pathfinding, combat, fog of war,
  map generation, serialization, AI skill ladder, and campaign winnability
- tools/lib/taStubScene.js: Minimal Phaser stub for headless testing

Engine improvements:
- TALogic.js: Swept projectile collision (no tunneling), quadratic AoE
  falloff, manual weapon support (D-Gun), unrecoverable elimination, onTick
  callback for AI stepping
- TAAI.js: Skill-based economy ladders, simultaneous factory+economy growth,
  sticky focus-fire, home defense gating by skill, tune/profile overrides
- TANav.js: fitField dilation for unit clearance, stale fit mask invalidation
- TAWorldView.js: _addWorld for layer ordering, frame-accurate zoom anchor
  math, container depth sorting every frame
- TARules.js: autoRangeOf excludes manual weapons, manual flag compilation

Art & data:
- Mayan civilization artwork added to civilization-artwork.json
- Several opponents switched to mayan citySheet
- totalannihilation-rules.json: balanced unit stats, new commanderlaser weapon,
  restructured AI skill tuning, formatted JSON
- sprites.md: complete art spec for drop-in PNG sheets
- Registered in gamesRegistry, assetManifest, PreloadScene, GameRoomScene,
  and soundtrack service
2026-07-24 20:57:40 -06:00
Brian Fertig 93b4877c2d **Update game icons assets**
Refresh game icons in both source (PSD) and exported (PNG) formats to reflect updated design.
2026-07-24 16:01:13 -06:00