Skip to content

feat: AI tech maximization — aggressive tech push, layered defenses, apex unit weighting - #63

Merged
linkbag merged 1 commit into
mainfrom
feat/ic-ai-tech-maximize
Mar 9, 2026
Merged

linkbag merged 1 commit into
mainfrom
feat/ic-ai-tech-maximize

Conversation

@linkbag

@linkbag linkbag commented Mar 9, 2026

Copy link
Copy Markdown
Owner

Summary

  • Rhizome 'tech' organ priority: Added 'tech' between production and expansion in Rhizome's metabolic loop. smart_hard AI now prioritizes tech advancement after production is established (credit-gated at 1200).
  • Layered defense system: Rebuilt buildDefenses() with 4 tiers (early perimeter → advanced turrets → AA guns → outer padding). Defense counts scale with game phase (+1 mid, +2 late). AA defenses (patriot_missile/flak_cannon) now actually get built.
  • Aggressive tech push for all difficulties: All AI difficulties race toward mid-tech and battle_lab. Hard/smart_hard no longer wait for vehicles to build mid-tech — credit threshold triggers instead. Battle_lab threshold lowered for easy (12 → 6 units). All difficulties now build superweapons.
  • Apex unit weighting: In mid phase, one basic infantry slot replaced by an extra main tank. In late phase, basic infantry fully removed from pool; apocalypse_tank gets 3× weight, kirov/black_eagle/prism_tank get 2× weight.

Files changed

  • src/combat/Rhizome.ts — ORGAN_PRIORITY + TECH_CREDIT_MIN + getOrganPriority() 'tech' branch
  • src/combat/AI.ts — DEFENSE_TARGET/AA_DEFENSE_TARGET/TECH_CREDIT_THRESHOLD constants, buildDefenses(), followTechTree(), buildUnitPool()
  • src/combat/Rhizome.test.ts — updated order test, mockEconomy(credits), 3 new tech-priority tests

Test plan

  • npx tsc --noEmit — clean
  • npx vitest run — 98/98 tests pass (added 2 new tests, updated 1)
  • Manual: observe AI builds tech buildings faster and transitions to apex units in late game
  • Manual: verify AA turrets appear around AI base in mid/late game

🤖 Generated with Claude Code

…apex unit weighting

All AI difficulties now race toward the tech ceiling rather than stalling at basic units.

Key changes:
- Rhizome ORGAN_PRIORITY gains 'tech' phase (power→refinery→production→tech→expansion)
  with TECH_CREDIT_MIN=1200 gate; getOrganPriority() returns 'tech' when production
  is established but no tech-category buildings exist and credits allow
- DEFENSE_TARGET increased (easy:2 medium:5 hard:6 smart_hard:8); new AA_DEFENSE_TARGET
  (easy:0 medium:2 hard:3 smart_hard:4); new TECH_CREDIT_THRESHOLD per difficulty
- buildDefenses(): 4-tier layered system (early perimeter → advanced → AA → outer padding);
  scales with phase (+1 mid, +2 late) so defenses grow with the game
- followTechTree(): hard/smart_hard no longer gated on vehicle count for mid-tech;
  credit-driven tech rush via TECH_CREDIT_THRESHOLD; battle_lab easy threshold 12→6;
  superweapons unlocked for all difficulties; Rhizome 'tech' case builds mid-tech/battle_lab
- buildUnitPool(): mid-tech phase adds extra mainTank slot, removes one basic infantry slot;
  late phase gives apocalypse_tank 3× weight, kirov/black_eagle/prism_tank 2×, removes
  both basic infantry slots to invest fully in apex units

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@linkbag
linkbag merged commit 23f9626 into main Mar 9, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant