Commit Graph
169 Commits
Author SHA1 Message Date
西风逍遥游 e95248dbe5 Merge pull request #112 from EVEngine/codex/dialogue-procedural-generation
feat(dialogue): procedural dialogue generation v1 (.dnut C++ compiler + variables/conditions/pools)
2026-08-19 00:08:35 +08:00
西风逍遥游 8e19511202 Merge branch 'main' into codex/dialogue-procedural-generation 2026-08-18 21:58:09 +08:00
Cursor Agentand西风逍遥游 817524e76e fix(test): isolate tile collect and build xray pipelines off the render pass
TileRenderSystem::collect walks the global ECS, so leftover TileLayer
entities from earlier cases made tilesContributeDepthY (and dual-grid
depth sort) see extra draw items. Hide other layers first, matching
the rest of the map suite.

drawMeshShader always runs inside an open 3D pass, so lazily calling
vkCreateGraphicsPipelines for the xray variant crashed Lavapipe.
Create that pipeline with the shader (and recreate it on MSAA/RP
change) instead, and skip the draw if it is still missing.

Also refresh module counts after rebasing onto grid / buildingfx.

Co-authored-by: 西风逍遥游 <sunxfancy@gmail.com>
2026-08-18 13:46:25 +00:00
Cursor Agentand西风逍遥游 8a861597b4 docs: record the delivered state and add a trimming guide
Marks the architecture document as implemented, replaces the roadmap section
with what each step actually landed and the measured result, and regenerates
the module inventory against the post-change dependency graph (scene is L1 now,
gameplay modules no longer pull data, and each row names the first profile that
includes it).

Adds docs/usr/TRIMMING.md for the user-facing side: profiles, per-module
switches, how dependency closure and the configure-time conflict errors behave,
has_module() in scripts, what cannot be trimmed and why, and measured savings.
Linked from the user and developer indexes.

Headline numbers after S1-S6: dependency cycles 26 -> 0, layering back-edges
16 -> 3, JSON implementations 6 -> 1, modules using Poco 15 -> 9, boot scripts
2 -> 1, and any module trimmable on desktop where none were before.

Co-authored-by: 西风逍遥游 <sunxfancy@gmail.com>
2026-08-18 13:46:25 +00:00
Cursor Agentand西风逍遥游 ced3366ceb docs: reconcile module counts and verify quantitative claims
Count by module directory (51) throughout, and state the directory-vs-script-
class discrepancy up front: filesystem also exposes HotReload, Cmdline lives in
engine/cmdline, and data/tensor bind under different class names.

Also align the layer diagram with the script's computed depths, add math and
audio to the functional-domain table, and correct the figures that were
estimated during drafting (97 soft lookups, 202 cross-module includes,
136 Poco include sites of which 79 are JSON).

Co-authored-by: 西风逍遥游 <sunxfancy@gmail.com>
2026-08-18 13:46:04 +00:00
Cursor Agentand西风逍遥游 c4fd641115 docs: add module orchestration and trimming architecture analysis
Analyse how the 53 modules currently collaborate and why none of them can be
trimmed outside the hardcoded WASM axis, then lay out a target architecture and
a six-step route to per-module build options.

Adds scripts/module_depgraph.py, which produces the dependency graph, the
7-layer topological ordering and the cycle list the document cites. Its --check
mode fails on any back-edge outside the 16 known ones, so it doubles as the CI
guardrail for step S1.

Co-authored-by: 西风逍遥游 <sunxfancy@gmail.com>
2026-08-18 13:46:04 +00:00
西风逍遥游 b8da538300 Merge pull request #111 from EVEngine/codex/tensor-inference-quant
tensor: AITemplate-style compile pipeline + gpgpu Sequence + mini-LLM demo + weight-only quantization
2026-08-18 21:41:31 +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
西风逍遥游 40307d9f5d Merge branch 'main' into codex/building-grid-placement 2026-08-18 20:43:07 +08:00
西风逍遥游 cff9bb4d0c tensor: AITemplate-style compile pipeline, gpgpu Sequence, mini-LLM demo and weight-only quantization
Refactor the tensor module around AITemplate-style static compilation:

- Optimizer: DCE, constant folding, elementwise chain fusion, matmul/conv
  bias+activation epilogue fusion, liveness-based static memory planning,
  topological group execution order.
- KernelGen: shape-baked GLSL per fused group; two-pass softmax/layernorm;
  shared-memory SDPA; naive + 16x16 tiled matmul templates.
- GpuBackend: arena buffer allocation per memory plan, matmul autotuning,
  single command-buffer submission via the new gpgpu::Sequence (uploads,
  dispatches and downloads recorded once per run, Kompute-style).
- shaderc in-process GLSL->SPIR-V on Windows (no glslc.exe dependency),
  with glslc spawn fallback.
- CPU reference kernels shared by eager and the compiled interpreter;
  no-Vulkan fallback keeps compiled graphs runnable headless.

Neural-network coverage: softmax/logsoftmax, layernorm/rmsnorm (with
weight/bias), gelu/silu, conv1d/conv2d, pool, embedding, concat/slice,
axis reduces, argmax, cast, fused SDPA (+masked), resize2d, batched
matmul, seeded random.

Weight-only quantization (activations stay fp32):
- fp16 (IEEE half), fp8 (e4m3), fp4 (e2m1), int8, int4 with per-group
  block scales (MXFP-style: scale = maxAbs / format max magnitude).
- Quantized weights capture into graph Const nodes; CPU interpreter
  dequantizes at materialization; GPU matmul/embedding kernels dequantize
  inline from packed uint buffers (naive matmul variant).
- TF::quantizeWeight API + script binding.

Mini-LLM validation (TinyStories-gpt2-3M, 8 layers d=64):
- test/tensor_llm.cpp builds the full GPT-2 graph from engine ops and
  matches numpy reference: probs within 3e-7, greedy generation 24/24
  identical (~100 ms/token CPU), compiled path exact.
- tensor.llm.quantizedDtypes: fp16/int8/fp8/int4 all keep 16/16 greedy
  top-1 (fp4 16/16 with proper block scaling), weights 27.6 MB -> 3.3-13 MB.
- scripts/export_tiny_gpt2.py converts a PyTorch .bin checkpoint (no torch
  dependency) plus GPT-2 tokenizer into engine assets + numpy reference.

Tests: gpgpu 8/8, tensor 31/31 (original suite) + tensor.llm.* + tensor.quant.*
Assets in test/assets/mini_llm are gitignored (regenerate via the script).
2026-08-18 17:42:38 +08:00
西风逍遥游 7820703cfa feat(building): 统一 Grid 抽象 + 3D 放置 + 多样式 Tilemap 打通
对照 Unity Grid/Tilemap 与 Grid Placement System 架构补齐建筑放置能力:

- 新增 grid 模块:GridConfig(rectangle/hexagon/isometric/staggered/iso-z-as-y、cellGap、stagger、XY/XZ 平面轴)+ 投影/占地旋转纯函数;map::TileProjection 委托复用,公开 API 不变。
- PlacementWorld 支持可选 GridConfig、多通道占用(channel)、bindTileLayer + GID 地形懒解析、XZ 平面 3D 放置、surface 表面接口(内置 plane)。
- BuildingDefinition 新增 channel/renderMode/visual2d/visual3d;rotationMode 支持 hex(60°)。
- 新增 buildingfx 渲染桥:按定义生成/同步 Renderable2D/3D、鬼影+占地光标、2D/3D 网格可视化。
- 新增 PlacementSession(放置/拆除/旋转/指针更新)。
- 测试:grid/building/buildingfx 新用例(REQUIRE 级)+ map/sceneloader 回归;示例 building-tilemap(等距/六角)、building-3d(XZ 地面)。
- 顺带修复 HEAD 上 sceneloader 未迁移 SceneLink 新 API 导致的编译失败(SceneLoader.cpp / test/sceneloader.cpp)。
2026-08-18 17:41:01 +08:00
sunxfancy d715992a3a feat(hotreload): add dev-server remote hot reload for mac/iOS/Android
Add a development-server based remote hot reload so script/resource changes
made on the host are synced and reloaded live on devices whose game bundle is
read-only (iOS app bundle, Android APK).

- Implement the previously stubbed `eve dev` command as a small HTTP file
  server (GET /manifest, /raw/<path>, /ping) serving a game directory.
- Extend HotReload with a background remote-sync client: poll the server
  manifest, compare mtime/size, download changed files into a writable overlay
  directory mounted at "/" via the new Filesystem::mountRealDirectory, and
  queue changed virtual paths for the script layer to dofile/reload.
- Wire it into load.nut: config.devServer/devSyncMs, shared handle_change(),
  poll_remote_reload(), and a `eve run --dev-server <url>` CLI override.
- Add iOS/Android hot-reload dir helpers and cleartext-HTTP platform config
  (iOS ATS + NSLocalNetworkUsageDescription, Android usesCleartextTraffic).
- Add test/remotesync.cpp covering overlay shadowing, end-to-end sync, and
  unreachable-recovery; update docs.
2026-08-18 16:23:27 +08:00
西风逍遥游 011b8b7b5e Merge branch 'main' into codex/scene-ecs-integration 2026-08-18 10:55:33 +08:00
西风逍遥游 fad42086de Merge pull request #104 from EVEngine/codex/card-ui
feat(card): add C++ card game UI module
2026-08-18 10:40:31 +08:00
西风逍遥游 34a9a63bfa Merge pull request #105 from EVEngine/codex/eve-mcp-host
feat(mcp): headless eve mcp host with AI-crafted MVVM editors
2026-08-18 10:40:21 +08:00
西风逍遥游 88baf1d1a6 fix(card): avoid font linkage in webgpu build 2026-08-18 09:50:04 +08:00
西风逍遥游 6b965edb63 Merge origin/main into codex/card-ui 2026-08-18 09:22:32 +08:00
西风逍遥游 27012cbc41 Merge pull request #102 from EVEngine/tools/gamedev-support
feat(devtools): add runtime console and REPL
2026-08-18 00:31:52 +08:00
西风逍遥游 21b6e18ad1 Merge pull request #101 from EVEngine/feature/rx
feat(rx): add reactive programming module
2026-08-18 00:31:28 +08:00
西风逍遥游 0a24d91b73 Merge pull request #93 from EVEngine/feature/virtual-geometry-nanite
feat(virtualgeometry): add Nanite-style virtualized geometry rendering
2026-08-18 00:30:37 +08:00
西风逍遥游 1c755f8940 feat(scene): scene/script-ECS integration, generic links, serialization & picking
Scene module overhaul: per-node script entities (SceneObject/SceneEntity/NodeRef), script ECS view-cache perf, generic multi-link system (renderable/physics/camera/audio), API completeness (transform getters, hierarchy ops, quaternions, tags/layer), incremental transforms, id index, reconcile moves, node events, JSON serialization, ray/frustum picking, spatial-index sync and SceneLoader auto AABB. Includes Cmdline/PhysFS argv0 robustness fix for unit tests.
2026-08-17 22:45:18 +08:00
西风逍遥游 4b24d1a157 feat(mcp): headless eve mcp host with AI-crafted MVVM editors
Adds 'eve mcp': a desktop-only headless MCP host (stdio by default, --port for TCP, --root for the project). It runs the full runtime, attaches DevTools (eve_eval / eve_run_script / snapshot), and starts the new EditorHost module that renders JSON-defined editor Views (ImGui) bound two-way to Squirrel ViewModel tables (MVVM), persists editors under editors/, and exposes the eve_host_* tool family (apply/state/set_value/events/capture/script/shutdown...). The stdio transport uses a background stdin reader and keeps stdout JSON-RPC-only; script print() is routed to stderr.

Tests: stdio handshake + tools/list round trip, host editor binding (VM<->View sync, set_value -> VM write + onChange events, save/reload persistence). Docs updated (AI与MCP支持.md, 命令行设计.md, tools/eve-mcp README) with the editor JSON protocol and Codex stdio setup.
2026-08-17 22:43:08 +08:00
西风逍遥游 c7aa76f6c7 feat(card): add C++ card game UI module 2026-08-17 22:16:28 +08:00
西风逍遥游 0b8cfca633 feat(devtools): add runtime console and REPL 2026-08-17 22:06:16 +08:00
sunxfancy 38312f4a4f feat(rx): add reactive programming module 2026-08-17 22:01:48 +08:00
西风逍遥游 3bc03bbf02 Merge pull request #100 from EVEngine/codex/ik-chain-solve
feat(ik): add chain solve, pole vector, tip rotation, influence
2026-08-17 19:52:24 +08:00
西风逍遥游 353c6fc450 feat(ik): add chain solve, pole vector, tip rotation, influence 2026-08-17 17:43:27 +08:00
sunxfancy 788adcbb53 Merge remote-tracking branch 'origin/main' into feature/virtual-geometry-nanite
# Conflicts:
#	CMakeLists.txt
#	src/engine/CMakeLists.txt
#	src/modules/graphics/Graphics.cpp
#	src/modules/graphics/Graphics.h
2026-08-17 17:14:42 +08:00
西风逍遥游 7b27945c88 Merge branch 'main' into codex/ai-scene-director 2026-08-17 17:10:24 +08:00
西风逍遥游 f07774109b Merge pull request #96 from EVEngine/codex/sprite-stacking
feat(spritestack): sprite-stacking pseudo-3D rendering
2026-08-17 16:28:59 +08:00
西风逍遥游 0d0d97dbbb Merge pull request #98 from EVEngine/codex/i18n-module
feat(i18n): add game localization module
2026-08-17 16:02:04 +08:00
西风逍遥游 d71b126636 feat(particles): particle system feature set (P0-P2)
Rendering: rotation render fix, additive/opaque blend modes, flipbook animation, gradients and lifetime curves, unified DrawItem2D render path (Vulkan + WebGPU).

Simulation: timed bursts, prewarm, line/ring shapes, gravity, damping, velocity limits/curves, inherit velocity, local/world space, collision (bounds + resolver), CPU noise, sub-emitters, stretched trails, overflow policies, dt caps, offscreen sim skip.

Advanced: radial force fields, custom particle shaders, pooled Light2D particle lights, opt-in GPU-accelerated simulation with automatic CPU fallback.

Fixes: Vulkan pipeline builder lifetime bug (crash on window init), emitter-life emission timing, emit() syncs attachment position.

Tests: new coverage incl. scale regression (128 emitters).
2026-08-17 15:27:43 +08:00
sunxfancy b954ac9fd5 feat(i18n): add game localization module
Add an i18n module (eve.I18n) for game localization:
- Load per-language JSON locale tables from VFS or raw JSON.
- Dot-path key lookup with {name} placeholder substitution.
- CLDR-style plural rules (en/fr/ru/pl/cs/zh and more).
- Fall back to default language, then to the raw key.
- Optional file auto-reload via update(dt).

Self-contained JSON parser (no Poco) so it builds on WASM too.
Includes C++ + Squirrel script tests, user/module docs, an
examples/i18n demo, and i18n integration in the dialogue example.
2026-08-17 14:54:50 +08:00
西风逍遥游 fe7b68deb4 feat(spritestack): sprite-stacking pseudo-3D rendering 2026-08-17 13:58:03 +08:00
西风逍遥游 4e61805c69 feat(story-scene-agent): story-to-qualified-stage orchestrator + example
One-line story -> stage brief (parse_stage) -> creative-brain plan -> build
via scene_director -> scene-qc inspection/fix loop -> report + screenshots.
Reuses the in-repo creative-brain and scene-qc packages; ships a dry-run
in-memory executor and tests, an empty examples/ai-stage host, an openCode
subagent, and the AI场景导演 integration doc that doubles as the
agent-queryable scene-director spec.
2026-08-17 10:10:37 +08:00
西风逍遥游 79127ed354 feat(scene-director): agent-drivable scene-authoring kit + engine MCP tools
Add the scene_director Squirrel kit (src/scripts/scene_director.nut) with
spawn/move/scale/rotate/remove/material/lighting/camera/cameras/info/modify/
reset, embedded into the engine and exposed to host games as
eve.sceneDirectorScript. New MCP tools (eve_scene_director_install/status,
eve_scene_reset, eve_scene_modify, eve_scene_info, eve_camera_generate) are
thin dispatchers over the kit, so agents can place props, set lighting,
frame cameras, inspect truth and reset the stage through MCP alone.

The kit's cross-references are written explicitly as scene_director.<field>
to avoid Squirrel table-closure 	his resolution, and cameras() uses a
fixed 6-way compass table (no math-lib dependency) so it works both in the
engine and in plain ssq test VMs.
2026-08-17 10:10:09 +08:00
sunxfancy fed7c3ff11 Merge remote-tracking branch 'origin/main' into feature/virtual-geometry-nanite 2026-08-16 21:49:45 +08:00
sunxfancy 2f13169b68 feat(virtualgeometry): add Nanite-style virtualized geometry rendering
Add a virtualgeometry module implementing a Nanite-inspired virtualized
geometry pipeline on the Vulkan backend:

- Cluster DAG preprocess (CPU): greedy meshletization + QEM edge-collapse
  hierarchical LOD, with per-cluster bounding spheres and geometric error.
- GPU-driven culling (compute): frustum + screen-space-error LOD selection
  that emits exactly one cluster per DAG branch (no gaps/overlaps).
- Software cluster rasterizer (compute): fills a visibility buffer
  (packed depth<<16 | clusterId) via atomicMin.
- Visibility-buffer resolve (CPU readback + resolve shader reference).
- Module facade (VirtualGeometry / VirtualGeometryRenderer) reusing the
  gpgpu compute backend; LodSelection CPU reference for tests.
- 14 unit tests (CPU preprocess + LOD-transition sweep + GPU end-to-end),
  shader compile script, example, and design doc.
2026-08-16 21:49:40 +08:00
西风逍遥游 2d05741d88 Merge remote-tracking branch 'origin/main' into codex/mcp-new-features 2026-08-16 19:10:00 +08:00
西风逍遥游 072c454150 feat(mcp): add RenderVision — vision-model description of rendered frames
Adds a vision-model bridge (devtools/RenderVision) that captures the
current frame (Graphics readback -> PNG data URL) and sends it with
engine render parameters to an OpenAI-compatible vision model over
plain HTTP, returning prose that describes the frame and explains the
render-parameter <-> visual-result correspondence for other LLM agents.

- New MCP tools:
  - eve_render_describe (fresh/reason; cached otherwise)
  - eve_render_vision_config (set/read config, key masked)
- Breakpoint hit and runtime-error pause auto-flag a pending dump that
  McpServer::poll performs on the main (render) thread.
- Config via env (EVE_VISION_BASE_URL/API_KEY/MODEL/PATH/TIMEOUT_MS)
  or the config tool.
- No TLS/OpenSSL is linked, so the endpoint must be plain HTTP (works
  with local Ollama/vLLM/LM Studio).
- Compiles cleanly on MSVC (C++20); tests extended for new tools.
2026-08-16 16:10:26 +08:00
西风逍遥游 17f2a9ea3d Merge pull request #84 from EVEngine/EVEngine-deps-restructure
deps: own libraries in external/, third-party deps in third-party/
2026-08-16 15:58:11 +08:00
西风逍遥游 a7fe86cd9f Merge pull request #77 from EVEngine/codex/mcp-new-features
feat(mcp): expose engine runtime features as MCP tools
2026-08-16 13:55:04 +08:00
西风逍遥游 0dfc18c08f deps: own libraries in external/, third-party deps in third-party/
Move the user-maintained VKBuilder from the third-party aggregate into external/ (git submodule), and relocate the third-party DungeonTemplateLibrary and Box3D from external/ into the third-party aggregate (previously pushed to EVEngine/third-party). Update .gitmodules, include paths, DTL/box3d build wiring, and docs.
2026-08-16 13:34:12 +08:00
西风逍遥游 179d50b8c7 Merge branch 'main' into codex/day-night-cycle
Integrate the latest main (weather system, outline shader, camera controller,
model converter, hidpi-ui). Resolve additive conflicts in shared registration
files so both the day/night and weather modules are registered:
- src/modules/CMakeLists.txt, src/engine/CMakeLists.txt, test/CMakeLists.txt
- src/scripts/load.nut, docs/usr/MODULES.md
2026-08-16 12:49:19 +08:00
西风逍遥游 af58355ab2 Merge remote-tracking branch 'origin/main' into codex/mcp-new-features 2026-08-16 12:48:10 +08:00
西风逍遥游 dbc9361907 Merge pull request #80 from EVEngine/codex/model-converter-blender 2026-08-16 12:33:34 +08:00
西风逍遥游 0bd283e054 feat(plugin): add model converter that drives Blender bpy to reshape primitives 2026-08-16 03:56:07 +08:00
西风逍遥游 7f64b19550 feat(daynight): time-of-day cycle with solar orbit, procedural skybox and night lighting
Add a DayNight module (src/modules/daynight) exposing eve.DayNight() to script:
- A 24-hour clock (configurable speed / pause) derives the sun elevation and
  azimuth each frame, repositioning the directional light so the sun sweeps the
  sky over the day and fades to zero below the horizon.
- A procedural IBL sky cubemap (sky gradient + sun disc + deterministic night
  stars) is regenerated per sun-angle bucket and registered as the 3D env map,
  so both the skybox angle and the reflected sky follow the sun.
- Night light systems, each a set of Light3D entities toggled by name:
  moonlight (cool directional), starlight (ambient boost), fire (warm point
  light at a set position) and fireflies (a ring of gently-drifting points).

Add examples/daynight: a 3D diorama with a UI panel and hotkeys to pause/speed
the clock and toggle moonlight, fire and fireflies.

Add test/daynight.cpp (9 cases) and docs/usr/modules/daynight.md. Verified with
a syntax-only compile per the weather module precedent.
2026-08-16 03:55:38 +08:00
西风逍遥游 090283a743 feat(mcp): expose engine runtime features (scene/procgen/physics/render/particles/audio) as MCP tools
Add 18 new MCP tools to the embedded McpServer so agents can drive
the live game beyond the debugger surface:
- scene/entity query + transform mutation
- procgen recipe enumeration, map grid generation, mesh build
- 2D physics world create/list/raycast/remove
- render status + frame screenshot (PNG)
- particle emitter spawn, audio master control

Tool handlers use ModuleManager to reach Scene/Procgen/Physics/
Graphics/Particles/Audio and degrade gracefully when a module is
not mounted. Extend the tools/list and unit-test coverage.
2026-08-16 02:44:25 +08:00
西风逍遥游 a673e0ea05 feat(weather): real-time precipitation, lightning and wind system
Add a Weather module (src/modules/weather) exposing eve.Weather() to script:
- Rain and snow rendered as camera-facing billboards animated in the vertex
  shader from a few per-frame uniforms (time/wind/intensity), with alpha-tested
  procedural streak/flake textures and distance fog.
- Wind exposed as a global vector field (speed + direction) feeding the
  precipitation shaders for tilt and drift.
- Lightning: jagged, midpoint-displaced bolts (tapered quad strips) that flicker
  and decay, with an optional key-light flash value for the scene.
- Presets: clear / drizzle / rain / storm / snow / fog, with smooth intensity
  transitions and storm mood (sky darkening, sun falloff, fog, ambient).

Add examples/weather: a 3D diorama (trees, pillars, rocks, ground) with a UI
panel and hotkeys to switch weather and tune intensity/wind/lightning.

Docs: docs/usr/modules/weather.md with API reference and notes on mature weather
rendering techniques. Weather module verified with a syntax-only compile.
2026-08-16 00:52:13 +08:00