Commit Graph
4 Commits
Author SHA1 Message Date
西风逍遥游 a8b8e83128 refactor: consolidate engine architecture contracts 2026-08-27 12:54:48 +08:00
西风逍遥游 08614ed194 feat: add playable galgame demo 2026-08-25 22:45:53 +08:00
西风逍遥游 54dea0d561 feat: state hot reload for scripts and state machines
Adds a capture -> reload -> restore pipeline so code/asset changes can be hot-applied without resetting running state:

- common: StateValue (JSON-compatible state tree) + IStateProvider capability interface.
- devtools: Snapshot v2 (script roots + native provider section, v1 compatible, strict rejection of non-data roots), ReloadSession (begin/commit/abort), eve.dev script API (stateRoots / beginStateReload / commitStateReload / abortStateReload).
- load.nut: three-phase soft reload (capture -> dofile -> restore) with migrate_instance / remap_instances helpers and eve_before_reload / eve_after_reload hooks.
- dialogue + AnimStateMachine: IStateProvider for phase/vars/rng and params/current state.
- animation: AnimClip::adopt + AnimClipRegistry + 'animclip' IAssetReloader so .eva content reloads keep clip identity.
- rpg + card: IStateProvider for casting/cooldowns and card phases.
- Tests: stateValue, snapshot v2/strict, reload script protocol, dialogue, animation state machine + reload, rpg/card state roundtrips.
2026-08-21 19:46:25 +08:00
西风逍遥游 703b5e5353 feat(dialogue): procedural dialogue generation v1
Add data-driven procedural dialogue to eve.Dialogue:

- Variables: setVar/getVar*/hasVar/clearVar/clearVars with global and
  scene scopes; the scene scope auto-clears when the selected Scene host
  changes (polled in update()).
- Conditions: structured tables ({var,op,value} with eq/ne/gt/ge/lt/le/
  has/missing, all/any/not, script predicates) + evalCondition().
- Line pools: loadPoolsFromTable() with weight/when/meta/tags, seeded
  weighted selection (setRandomSeed), per-pool no-repeat history, and
  playLine()/playPool() that resolve {var} interpolation or i18n keys and
  auto-apply meta.expression/motion to bound avatars.
- .dnut authoring format compiled by a new C++ parser (DnutParser):
  loadPoolsFromDnut(source, path) / loadPoolsFromDnutFile(path); parse
  errors surface path:line via getLastPoolsError(). The previous Squirrel
  compiler script and its engine wiring are removed.
- Example (examples/dialogue) uses pools.dnut with mood/hour variables,
  scene-scope auto-clear demo, and hot reload via eve_asset_reload.
- Tests: C++ unit tests (dialogue_proc.cpp) covering variables,
  conditions, pools, selection/dedupe, meta, i18n, scene auto-clear and
  the .dnut parser; Squirrel integration test for the script-facing API.
- Docs: design doc updated with the new content model / API / format.
2026-08-18 21:08:19 +08:00