Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Start here — REDESIGN: EVOLUTION

Read [docs/AGENT_HANDOFF.md](docs/AGENT_HANDOFF.md) before editing. It is the current continuation entry point; the conversation history is not required.

## Current assignment boundary

The owner resumed implementation after the documentation handoff. **FR-01 Road squad kernel is complete in Core and headless scenarios; FR-02 Animated squad slice is next.** Normal Godot play does not yet expose Garrison controls or animation. When assigned to continue, read the kernel contract and add that playable integration. Routine implementation choices within this plan do not require another approval round.

## Project rules

- Work on `Ege-redevelop`. Inspect Git status/branch first; preserve existing uncommitted work. Do not switch or rewrite the branch, delete Git metadata, or push/delete remote branches without the owner's explicit instruction.
- Active game: `Redesign-Evolution/`, Godot 4.7.2 .NET presentation with an independent C# simulation. Course restrictions and legacy compatibility requirements are retired. Do not restart the Java audit or engine comparison.
- Current playable slice: twelve-wave Emberwatch Expedition. Road squad simulation exists; its UI/animation, Stoneford, profile unlocks and the frontier map remain pending. The Windows ZIP predates FR-01. Circuits are deferred for reassessment after the squad/map work.
- Source of truth for the next tasks: FR-01–FR-07 in [docs/FRONTIER_CAMPAIGN_PROPOSAL.md](docs/FRONTIER_CAMPAIGN_PROPOSAL.md). The larger roadmap remains in [docs/REDESIGN_EVOLUTION_ROADMAP.md](docs/REDESIGN_EVOLUTION_ROADMAP.md).
- Keep gameplay authority in Core; Godot owns presentation/input/audio. Preserve deterministic tick behavior, atomic commands, pause/speed semantics and the earlier regression scenarios. Do not let animation callbacks determine combat outcomes.
- Deliver small playable slices. Update `docs/DEVELOPMENT_PROGRESS.md`, the task checklist and `docs/AGENT_HANDOFF.md` when a milestone, limitation or next step changes. Distinguish implemented, tested and proposed features.
- Use `dev.cmd` for the documented Windows build/test/run/smoke/export workflow. `.tools/` and `.artifacts/` are ignored local directories and may be absent in another checkout.
- Latest verification: 96 passing tests, existing Godot UI smoke, squad/no-squad command witnesses and earlier regression scenarios. The smoke log contains a sandbox certificate-store diagnostic. Verify the baseline when beginning further implementation; do not claim the older Windows export contains squad work.

See the handoff for the first patch scope, code entry points, known balance risks, verification commands and a continuation prompt.
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
# REDESIGN: EVOLUTION

A new PC tower defense game about elemental reactions and connected defenses. Active implementation: Godot 4.7.2 .NET with independent C# simulation. Course requirements and legacy formats are retired.
A PC tower defense game about an arcane frontier, tower specialization and elemental reactions. Active implementation: Godot 4.7.2 .NET with independent C# simulation. Course requirements and legacy formats are retired.

## Continuing the project? Start here

**Read [the agent handoff](docs/AGENT_HANDOFF.md).** It contains the current state, exact next task, code entry points, verification commands and a ready-to-paste continuation prompt. Root [AGENTS.md](AGENTS.md) directs repository-aware agents to the same handoff.

As of 2026-10-21, development has resumed from `856cb2d` on `Ege-redevelop`. **FR-01 road squad simulation is implemented**, with 96 passing tests and the existing Godot UI smoke passing. Its Garrison controls and animations are not yet available in normal play; the next milestone is **FR-02 Animated squad slice**. The existing Windows ZIP predates this kernel work.

The direction is **road warriors → stronger animation → a second battlefield and persistent map unlocks → mastery/challenges and results graphs**. The [squad kernel contract](docs/ROAD_SQUAD_KERNEL.md) records implemented rules, provisional values and measured balance limitations. The [frontier task checklist](docs/FRONTIER_CAMPAIGN_PROPOSAL.md) tracks the remaining work; Circuits are deferred for reassessment.

Check Git status before editing and preserve local changes. FR-01 source and documentation changes are currently uncommitted; include them when transferring work to another checkout.

## Play and develop

Expand All @@ -25,6 +35,8 @@ Active content lives in `Redesign-Evolution/Game/Content/expedition.json` (forma

`dev.cmd sim` runs the expedition through ordinary commands. After building, use `dotnet Redesign-Evolution/SimRunner/bin/Debug/net8.0/Redesign.SimRunner.dll --balance` for frost/fire/steel and passive controls across seeds 1/7/42; add `--risk` to accept every Overrun. Individual runs accept `--strategy fire --seed 42`. `--roster`, `--evolution` and `--foundation` select the earlier scenarios; `--no-build` verifies defeat. `dev.cmd benchmark` measures reference scans versus spatial queries, not graphics FPS. Automated victories establish feasibility; human difficulty/enjoyment playtesting remains necessary.

Add `--squad` to an expedition CLI run or balance batch to exercise the new Garrison through ordinary commands. This reserves one tower foundation and adds guard contribution/casualty/engagement statistics. It is an early strategy experiment: several previously winning builds lose after this purchase change, so squad balance remains an explicit FR-02 task.

## Project

- `Redesign-Evolution/Core`: independent authoritative simulation.
Expand Down
6 changes: 4 additions & 2 deletions Redesign-Evolution/Core/Definitions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ public sealed record TowerDefinition(string Id, int Cost, int Damage, double Ran
double ForkRadius = 0, int ForkDamagePercent = 50);
public sealed record EnemyDefinition(string Id, int Health, double Speed, int Bounty, int LeakDamage,
int Armor = 0, double ShieldRadius = 0, int ShieldPercent = 0, string Name = "",
HealingDefinition? Healing = null, BossDefinition? Boss = null, int SlowResistancePercent = 0);
HealingDefinition? Healing = null, BossDefinition? Boss = null, int SlowResistancePercent = 0,
MeleeDefinition? Melee = null);
public sealed record SpawnGroup(string EnemyId, int Count, int IntervalTicks, int DelayTicks = 0);
public sealed record WaveDefinition(string Title, string Briefing, SpawnGroup[] Groups, int ClearGold = 0, int HealthPercent = 100);
public sealed record MapDefinition(string Id, string Title, int Width, int Height, int TileSize,
Expand All @@ -33,7 +34,7 @@ public sealed record MapDefinition(string Id, string Title, int Width, int Heigh

public sealed record GameDefinition(int FormatVersion, string Id, int StartingGold, int StartingLives,
MapDefinition Map, TowerDefinition[] Towers, EnemyDefinition[] Enemies, WaveDefinition[] Waves,
CombatDefinition? Combat = null, ExpeditionDefinition? Expedition = null)
CombatDefinition? Combat = null, ExpeditionDefinition? Expedition = null, GarrisonDefinition? Garrison = null)
{
public GameDefinition Copy() => this with
{
Expand Down Expand Up @@ -118,5 +119,6 @@ public void Validate()
Require(wave.HealthPercent is >= 25 and <= 300, $"wave {i + 1}: health percentage");
}
ExpeditionContent.Validate(this);
SquadContent.Validate(this);
}
}
26 changes: 26 additions & 0 deletions Redesign-Evolution/Core/Route.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,30 @@ public Point At(double distance)
i = ~i;
return points[i - 1] + (points[i] - points[i - 1]) * ((distance - ends[i - 1]) / (ends[i] - ends[i - 1]));
}

/// <summary>Closest authored road point; equal distances prefer earlier route progress.</summary>
public double NearestProgress(Point position)
{
var bestDistance = double.PositiveInfinity;
var progress = 0d;
for (var i = 1; i < points.Length; i++)
{
var segment = points[i] - points[i - 1];
var offset = position - points[i - 1];
var fraction = Math.Clamp((offset.X * segment.X + offset.Y * segment.Y) / segment.LengthSquared, 0, 1);
var distance = (points[i - 1] + segment * fraction - position).LengthSquared;
if (distance >= bestDistance) continue;
bestDistance = distance;
progress = ends[i - 1] + fraction * (ends[i] - ends[i - 1]);
}
return progress;
}

public bool TryGetProgress(Point position, out double progress)
{
progress = 0;
if (!double.IsFinite(position.X) || !double.IsFinite(position.Y)) return false;
progress = NearestProgress(position);
return (At(progress) - position).LengthSquared <= 1e-12;
}
}
Loading
Loading