Encounter Simulator: AI should prefer a single-target control spell when tactically good

Open
#9 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
typescript
Domain
ai, game-dev

Research direction

Start in selectAction.ts and review the existing Int-driven-targeting and wasted-resource-avoidance heuristics. Reproduce the ranged-cantrip/control-spell case from combinedFeatureParity.test.ts and compare with the workaround in runEncounter.spellcasting.test.ts. Done means a caster can prefer a single-target control effect against a clearly dangerous target while preserving existing attack and AoE behavior.

Written by the indexing model from the issue text.

Description

enhancement

Summary

Found during #5's milestone 13 closing verification: the targeting AI (selectAction.ts) only prefers a save-based spell/action over a plain attack when either no attack is usable at all, or the save is an AoE hitting 2+ targets. A caster with both a ranged cantrip and a strong single-target control spell (e.g. Hold Person) will essentially always just attack — it never voluntarily casts the control spell, even when locking down a dangerous enemy would clearly be the stronger tactical choice.

Confirmed real, not theoretical

Proven by combinedFeatureParity.test.ts (milestone 13): a test scenario with both a cantrip and a control spell available had to be built with a melee-only cantrip to force the caster toward the spell at all, matching a workaround already used in runEncounter.spellcasting.test.ts (milestone 11). With any ranged attack option present, the control spell goes unused.

Suggested follow-up

Extend selectAction.ts's heuristics with a "worth it" evaluation for single-target save-based control effects — e.g. prefer a control spell against a target that's clearly the bigger threat (highest damage output, or the one currently threatening a low-HP ally), similar in spirit to the existing Int-driven-targeting and wasted-resource-avoidance heuristics already documented there.

This affects both the animated single-run viewer and Monte Carlo win-rate accuracy for any scenario with a support/control caster.

Dominant language
TypeScript
Stars
0
Forks
0
Avg merge
1d 18h
Merged PRs (30d)
2

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from RamonGebben/kernel-dm-toolbox

All issues in RamonGebben/kernel-dm-toolbox

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.