4 Commits
Author SHA1 Message Date
adminandGitHub ede235ec7a Document current tutorial flow (#7264) 2026-06-15 11:04:55 -07:00
4c720983b7 Fix stale tutorial-battle origin province reference (#6669)
Doc said Tarn's attacking army originates from province 32; the
config in tutorial_parameters.json:102 has originProvinceId: 31.
Province 32 (Ingia) is unoccupied at game start and only becomes
relevant later when The Eagle appears.

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-29 17:58:05 -07:00
47ab61d0ab Add post-battle tutorial dialogues (#6227)
* Plan post-battle tutorial dialogue in docs

Document two narrative dialogues for after the first tutorial battle:
1. Battle Aftermath - Marek on the close call, Tarn's disappearance,
   and recruiting captured lieutenants
2. Rebuild Support - Marek explains Improve and Give Alms to raise
   province support before January taxes

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Implement post-battle tutorial dialogues and triggers

Add two narrative dialogues after the tutorial battle:
- Battle aftermath: Marek on Tarn's disappearance and captured lieutenants
- Rebuild support: Marek guides player to use Improve and Give Alms

Trigger detection uses lifecycle flags to ensure correct ordering:
tutorial_battle_ended fires when battle is removed and commands arrive,
tutorial_rebuild_support fires after captured heroes phase completes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Fix rebuild dialogue: any hero can improve/alms, need 40 for taxes

Engineers and paladins are more effective, not the only ones who can
do it. Support threshold of 40 is required to collect taxes at all,
not just for higher revenue.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Highlight SupportField and refine tax instruction text

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Add loyalty warning and support deadline tutorial triggers

- November loyalty warning: Marek warns about heroes with <70 loyalty,
  highlights the loyalty label, instructs to use Give Gold or Feast
- December support deadline: Marek urges the player to have Elena give
  alms immediately if support is still below 40
- Register first vassal's loyalty label as LoyaltyLabel highlight target

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Drop 'closer than I'd like to admit' from post-battle dialogue

Marek wouldn't admit it was close — he thought it was hopeless.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Use default panel position for strategic dialogues, top for combat

Hard-code panel position based on context: if a Shardok model is active,
use "top" (combat); otherwise use default position (strategic map).
Remove panelPosition overrides from strategic dialogue JSON.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 17:00:11 -08:00
d041c68b99 Add tutorial battle system C++ implementation and docs (#5948)
* Add tutorial battle system C++ implementation and docs

Brings in the C++ tutorial battle controller and documentation from the
tutorial-scenario-system branch:
- TutorialBattleController for managing scripted battle scenarios
- Documentation describing the tutorial battle system design

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Add proto definitions and ShardokEngine integration for tutorial battles

Proto changes:
- Add TUTORIAL_ENEMY_FLED and TUTORIAL_REINFORCEMENTS_ARRIVED action types
- Add TutorialBattleConfig message to player_info.proto
- Add tutorial_battle_config field to NewGameRequest

C++ changes:
- Remove unused defenderCanFlee field from TutorialBattleController
- Integrate TutorialBattleController into ShardokEngine
- Add SetTutorialBattleConfig method to configure tutorial mode
- Check for scripted flee at end of each round in HandlePlayerTurnEnd

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Fix visibility for player_info_proto

Allow game_setup_info_proto in //src/main/protobuf/net/eagle0/common
to depend on player_info_proto from shardok/common.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Fix fire_test by moving early return inside tutorial flee block

The if (GameIsOver()) { return; } check was placed before NewRoundAction,
which caused STRUCTURES_BURNED to be skipped even for normal games. The
early return should only happen when the tutorial flee actually triggers
and ends the game.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Revert "Fix fire_test by moving early return inside tutorial flee block"

This reverts commit b0b08020873cefeaf411c07d6223ade5baad3c4e.

* Reapply "Fix fire_test by moving early return inside tutorial flee block"

This reverts commit 8038d73b57b1cf4e29c4e79e91dcb9e11b49e44d.

* Redesign tutorial system to be event-driven with configurable triggers

Replace hardcoded flee triggers with a flexible event system that supports:
- Trigger types: RoundTrigger, UnitsLostTrigger, DamageTakenTrigger, UnitKilledTrigger
- Action types: FleeAction, ReinforcementsAction
- Events fire in config order and at most once (tracked by event_id)

Key changes:
- Proto: Replace TutorialBattleConfig fields with repeated TutorialEvent
- Controller: Replace ShouldTriggerScriptedFlee/ExecuteScriptedFlee with CheckAndExecuteEvents
- Engine: Update HandlePlayerTurnEnd to use new CheckAndExecuteEvents API

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Update tutorial battle doc: vassals, 600 cavalry, new event API

- Change defender heroes from "sworn brothers" to "vassals"
- Update attacker heavy cavalry from 400 to 600 troops
- Update proto reference to show new event-driven TutorialBattleConfig
- Update C++ API docs to show CheckAndExecuteEvents method
- Remove completed ShardokEngine integration from "Remaining" section

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Move tutorial config to separate proto file

Extract TutorialBattleConfig and related messages from player_info.proto
into tutorial_battle_config.proto to avoid the code smell of having
game_setup_info.proto depend on two different player_info.proto files.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Move tutorial_battle_config.proto to common/ package

Since the proto is used by both Eagle (game_setup_info.proto) and
Shardok (TutorialBattleController), it belongs in common/, not
shardok/common/.

Updated package from net.eagle0.shardok.common to net.eagle0.common
and updated all C++ references accordingly.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Change ReinforcementsAction to use CommonUnit instead of hero names

This allows the reinforcement units to be fully specified with all
their attributes (hero stats, battalion type/size, etc.) rather than
just referencing heroes by name.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Add tutorial_battle_config.proto to Unity C# project

The new proto was missing from protos.csproj, causing Unity builds to fail.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Add go_package option and include proto in Go build

- Add go_package option to tutorial_battle_config.proto for Go code gen
- Add tutorial_battle_config_proto to common_go_proto target

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-09 19:08:32 -08:00