Commit Graph
82 Commits
Author SHA1 Message Date
西风逍遥游 432c0722fb docs: list literal API names in new chapters so check_bindings passes
avatar/database/dialogue/sceneloader/stylize/virtualgeometry now list
getName(); camera spells getTargetX/Y/Z out in full. These chapters are
gated by scripts/check_bindings.py --strict in CI.
2026-08-22 08:36:13 +08:00
西风逍遥游 18205aabb9 docs: add 10 module chapters, voxel example, gallery links; fill script binding gaps
- New user docs: avatar, buildingfx, camera, database, dialogue, grid,
  housegen, sceneloader, stylize, virtualgeometry (all written against the
  actual addFunc surfaces; API quick-refs included). Wire them into MODULES.md.
- examples/voxel: streaming terrain + place/break demo (procedural atlas,
  setTerrain + streamAround, DDA raycast picking, orbit camera). Script logic
  verified locally (no script errors; 16 chunks / 3117 rects selected).
- README gallery links in both Readme.md and Readme.en.md.
- Script binding fixes discovered while writing the docs/examples:
  * Graphics.setCanvas accepts null (and Canvas instances) so canvas sessions
    can be ended from scripts; begin3DFrame/setMesh3DViewProj/setMesh3DView/
    setMesh3DCameraPos now exposed for script-driven 3D (voxel etc.).
  * SceneLoader.load/host exposed (previously only reload/status were bound).
2026-08-22 08:27:43 +08:00
西风逍遥游 7437224c90 api(graphics): align C++/script names, validate sampler strings, document error contracts
- Add RGBA-float drawSolidRect/drawTexturedRect overloads so the C++ names
  match the script-facing API (script already bound those names).
- Add string-based setTextureSampler(Texture*, filter, mipmap, aniso, lodBias)
  overload with strict magic-string validation (unknown filter/mipmap now
  throws instead of silently falling back to linear); keep
  setTextureSamplerParams as a deprecated alias. Script binding now targets
  the overload with an explicit cast.
- Document error contracts: DataModule encode/decode (new[] ownership +
  throws), Filesystem setSource/mount/unmount (false on recoverable failure,
  no throw), ModelData getMesh vs numeric getters (nullptr vs throw), plus a
  two-state error-semantics section in API-CONVENTIONS.md.
- Tests: TextureSampler string validation (valid + deprecated alias + typo
  throws), headless test now exercises the RGBA-float overloads.
2026-08-22 02:30:12 +08:00
西风逍遥游 2ab09dcf68 feat(script): bind Image decode, Joystick Pad axes/buttons, Mouse relative mode
- Image: expose newImageData(newImageDataFromFile)/newEmptyImageData/isCompressed and a
  full ImageData script class (getWidth/Height/Format/Size, pixel get/set, paste, clone,
  rotate). ImageData is now registered once by the Image module; drop the duplicate
  minimal registrations in Font and Model3D that could overwrite each other.
- Joystick: expose getJoystick/getJoystickFromID/getIndex/addJoystick/removeJoystick and a
  Pad class with raw axes/buttons/hats, GameController axis/button names, device info,
  and vibration. Pads stay owned by the module (non-owning script handles).
- Mouse: expose setRelativeMode/getRelativeMode plus setVisible/setPosition/setX/setY/
  setGrabbed/isGrabbed (SDL backend already implemented them).
- Tests: add image.nut/image_script.cpp and joystick.nut/joystick_script.cpp script tests,
  extend mouse.nut with relative-mode/visibility checks, wire into test CMake and the nut
  embed template.
- Docs: update image/joystick/mouse user chapters, MODULES.md and the REVIEW log.
2026-08-20 12:31:11 +08:00
西风逍遥游 34d1fdb63b refactor(modules): clear remaining back-edges and split the largest TUs (#127)
* chore(ci): add clang-format gate, CODEOWNERS and agent collaboration rules

* refactor(modules): clear remaining back-edges and split the largest TUs

Three known dependency back-edges are gone (module_depgraph.py KNOWN_BACK_EDGES
is now empty; --check passes with 0 violations, 0 cycles):

- window -> graphics: window queries the new IWindowSurfaceHost capability
  (common/WindowSurfaceHost.h) instead of holding a Graphics pointer;
  Window::setGraphics was removed and all call sites updated.
- window -> image: Window::setIcon was replaced by setIconRGBA(const uint8_t*,
  w, h); the window no longer decodes ImageData.
- scene -> graphics: pickScreenAt / collectFrustumIdsAt implementations moved
  to graphics/ScenePicking.cpp (graphics -> scene is a legal downward edge);
  scene now depends only on spatial.

TU splits (pure moves, verified identical method sets and brace balance):

- vulkan/Graphics.cpp (5118 lines) -> Graphics.cpp (lifecycle), GraphicsPipeline,
  Graphics2D, Graphics3D, GraphicsMesh + shared GraphicsInternal.h.
- scene/Scene.cpp -> Scene.cpp (script layer / host lifecycle / serialization)
  + SceneNodes.cpp + shared SceneInternal.h.

Verified with a real build (MSVC 19.51, prebuilt third-party): full build green;
window.* and Scene.* suites pass, including scene picking/culling and GPU cases.

* refactor(graphics): narrow Graphics interfaces and clear public-header leaks

Step 4 — interface segregation:
- New lean interfaces: IGraphics2D, IGraphics3D, IResourceFactory, IPostFX
  (pure virtuals, forward-declared types only; graphics/Color.h extracted from
  Canvas.h so modules that only need the color type stop pulling Canvas.h).
- Graphics now implements all four facets; consumers can depend on the narrow
  interface they use instead of the 129-method god class.
- Migrated voxel (VoxelWorld::drawVisible -> IGraphics3D*) and model3d
  (ModelRenderer::buildRenderable(s) -> IResourceFactory&).
- Graphics.h slims from 24 sub-header includes to a handful of small type
  headers + forward declarations; the destructor moved out-of-line so
  unique_ptr effect members are destroyed where types are complete.

Step 5 — header leaks (module_depgraph.py '*' marks: 14 -> 7):
- map/TileLayer.h, particles/ParticleEmitter.h, avatar/AvatarInstance.h,
  animation/SpineAnim.h, map/TileSystem.h, model3d/ModelData.h,
  model3d/ModelRenderer.h, audio/Audio.h + Source.h, image/ImageData.h +
  Image.h, dialogue/Dialogue.h, procgen Palette/OutputSpec/TextureRecipe/
  PbrMaterial -> forward declarations, includes moved to .cpp.
- voxel/VoxelWorld.h: terrain sampler Pimpl'd (unique_ptr + out-of-line
  destructor), removing the procgen header dependency.
- gpgpu/vulkan backend headers stop pulling graphics/vulkan/Graphics.h.
- Remaining '*' marks are deliberate: tiny POD/enum headers (GridConfig,
  MapObject, BlendMode, Color), an internal backend header
  (GraphicsInternal.h -> filesystem), and lean interface references.

Verified with a full clean build (MSVC) and tests: window/Scene/voxel/
RenderSystem/Quad/shader/TextureSampler/resourceLifetime pass; broad suite
only shows the pre-existing PHYSFS-init filesystem-environment failures.

* feat(resources): revive ResourceManager as unified IAssetReloader-backed cache

* fix(resources): leak ResourceManager singleton to avoid exit-time teardown crashes

Cached CPU resources may own third-party handles (FreeType faces, Assimp
scenes, image decode handlers) whose libraries are torn down at process
exit in an unspecified TU order; destroying cached entries from the
singleton destructor can segfault at exit (seen on CI Windows in
model3d.materialApi.objMtl). Keep the singleton alive until OS reclaim;
explicit unload()/clear() still release entries during the run.

* refactor(devtools): consume business modules through capability interfaces

DevTools / cmdline no longer include business-module headers, so trimming
scene / physics / procgen / particles / audio / ui / graphics no longer
requires disabling devtools, and devtools can be switched off with
-DEVENGINE_MODULE_DEVTOOLS=OFF.

New capability interfaces in common/:
- ISceneQuery (scene) - host/node inspection + mutation + transform sync
- IRenderCapture (graphics) - render status, PNG capture, camera control,
  visible-entity snapshot, entity-ID mask, G-buffer PNGs
- IPhysicsQuery (physics) - 2D world lifecycle + ray casts
- IProcgenQuery (procgen) - recipe listing, map/mesh generation
- IParticlesQuery (particles) - emitter status + one-shot emit
- IAudioQuery (audio) - volume / stop-all
- IEditorHost (ui) - declarative editor host (used by cmdline too)

Providers register in their module constructors. DevTools rewires McpServer
(render/scene/procgen/physics/particles/audio/host tools), SceneInspect
(now delegates to ISceneQuery + IRenderCapture) and RenderVision (uses
IRenderCapture::capturePngDataUrl); cmdline/Mcp.cpp uses IEditorHost.

manifest: devtools DEPS graphics scene physics procgen particles audio ui
image event filesystem -> event; cmdline DEPS filesystem ui -> filesystem.

Verified: full build green; devtools.mcp.* tests pass; broad suite shows
only the pre-existing PHYSFS-init filesystem-environment failures.

* style: apply clang-format to changed lines after dev merge

* fix(webgpu): include RenderControl/TextureSampler explicitly after Graphics.h slimming

* fix(webgpu): provide newFont/print stubs to satisfy IGraphics2D/IResourceFactory vtables

* fix(common): make ProcgenQuery.h self-sufficient (cstdint/utility for GCC)
2026-08-20 05:53:33 +08:00
西风逍遥游 c7de064bf4 Merge remote-tracking branch 'origin/main' into codex/ui-viewport-terrain-editor
# Conflicts:
#	src/modules/sceneloader/SceneLoader.cpp
#	test/sceneloader.cpp
2026-08-19 09:11:05 +08:00
西风逍遥游 a2dd8d7fb1 feat(ui): two-pass layout, images, events, virtualization, viewport
Gap-closing work for the declarative UI module vs UE/Unity/Godot:

- Layout: real measure pass (measureTree) + pure flexArrange with
  margin/padding/min-max/percent/anchor/absolute placement; window size,
  anchors and percentage sizing; script layout props.
- Widgets: Image/ImageButton (engine textures + nine-patch + tint/uv),
  Combo, text wrapping + CJK font candidates/ranges, InputText 1024B,
  virtualized ScrollList/virtualList.
- Events: script onClick/onChange callbacks with structured payloads
  (keeps the poll queues for compatibility).
- Tooling: UI JSON save/load (saveTreeJson/loadTreeJson), host pos tween
  animation, gamepad nav, per-frame UI stats.
- Viewport: embedded offscreen render target widget with input routing;
  RenderSystem3D::renderToCanvas preview pass + Graphics::renderScene3DToCanvas;
  editor.newHeightmapMesh/updateHeightmapMesh for heightmap terrain;
  examples/terrain-editor demonstrating orbit camera + raise/lower brush.
- Tests: 32 UI tests including real-window Vulkan smoke for the viewport.
2026-08-19 09:07:55 +08:00
西风逍遥游 3c1ff324ac Merge branch 'main' into codex/model3d-material-api 2026-08-19 07:44:47 +08:00
西风逍遥游 92e0c653a2 Merge pull request #115 from EVEngine/codex/network-module-improvements
network: reliable UDP transport, RPC and multi-peer host
2026-08-19 07:44:19 +08:00
西风逍遥游 6f3552a7c2 Merge pull request #116 from EVEngine/codex/voxel-engine-gap-improvements
feat(voxel): close feature/perf gap vs mainstream voxel engines
2026-08-19 07:43:01 +08:00
西风逍遥游 e98f125f21 feat(voxel): close feature/perf gap vs mainstream voxel engines
- Cross-chunk seam culling via GreedyMesher::ChunkSampler; border edits now
  invalidate the adjacent chunk; air writes no longer allocate chunks
- selectVisible meshes only after range/frustum culling
- DDA voxel raycast (CPU + script getters)
- Parallel remeshDirty(maxThreads) with serial fallback; output equals serial
- Vertex AO: Minecraft-style 4-corner AO packed 2bit x 4, Vulkan instancing +
  voxel_rect shaders (SPIR-V .inc regenerated); WebGPU accepts params (TODO)
- Persistence: serializeWorld/deserializeWorld (EVVX LE) + saveWorld/loadWorld;
  unloadChunksOutside + streamAround for player-centered streaming
- Terrain: reuse procgen::TerrainSampler (no new module), setTerrainParams +
  terrainHeightAt; script setTerrain/streamAround
- CPU tests + gap-analysis/module/user docs; local MSVC harness 1741 checks pass
2026-08-19 04:13:21 +08:00
西风逍遥游 cc576c264a feat(model3d): material/texture API + auto-assembly renderer
ModelData gains material accessors (base color, metallic/roughness, opacity, two-sided), texture queries by type name (base_color/diffuse/normals/height/...), and embedded texture decode to RGBA8 ImageData. New model3d::buildRenderable(s) helpers assemble Renderable3D from a decoded model (node transform baked, material/PBR/textures applied), bound to Squirrel as Model3D::createRenderable.

Normals for assets missing authored normals now default to smooth generation: CMake applies an idempotent configure-time patch to medialoader switching aiProcess_GenNormals -> aiProcess_GenSmoothNormals.
2026-08-19 04:12:54 +08:00
西风逍遥游 d75e3bcf0d network: reliable UDP transport, RPC and multi-peer host
- UdpLink: reliable/unreliable/unreliable-ordered UDP with ACK/retransmit,
  fragmentation, heartbeat and loss simulation; main-thread pump routing
- NetRpc: u16 msgId + payload envelope, C++ handlers and script closures
- NetHost: shared-socket multi-peer routing with auto peer ids and lifecycle
  events (peerconn/peerdisconn)
- NetReader/NetWriter: typed little-endian serialization primitives
- TcpSocket: queued sends with partial-write/would-block handling; connect
  timeout unit fix; UDP socket buffers raised to 1MiB
- Tests mirrored in test/network.cpp; docs: design spec + user module doc
2026-08-19 04:08:24 +08: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
西风逍遥游 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
西风逍遥游 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
西风逍遥游 21b6e18ad1 Merge pull request #101 from EVEngine/feature/rx
feat(rx): add reactive programming module
2026-08-18 00:31:28 +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
西风逍遥游 c7aa76f6c7 feat(card): add C++ card game UI module 2026-08-17 22:16:28 +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
西风逍遥游 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
西风逍遥游 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
西风逍遥游 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
西风逍遥游 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
西风逍遥游 21e496f53a Merge pull request #66 from EVEngine/codex/procgen-roguelike-generator
feat(procgen): Roguelike-style level generator (level.roguelike) + Grid2D detail layer
2026-08-15 22:00:38 +08:00
西风逍遥游 6a32179adc docs(procgen): document linear tileable structure recipes 2026-08-15 17:59:10 +08:00
西风逍遥游 a1f977ffc8 feat(procgen): add level.roguelike generator + detail layer
Add a seed-driven room-and-corridor dungeon generator inspired by
RoguelikeGenerator Pro, and extend Grid2D with a per-cell detail layer so
generators can carry wall-autotile direction masks, floor-pattern variants
and scattered decor tiles alongside the semantic grid.

- new algorithm "level.roguelike": rooms/corridors, configurable rules
  (roomCount/min/max, corridorStyle, floorPattern, decorDensity/Set,
  autotile, padding/spacing/corridorWidth), deterministic from a seed
- Grid2D.setDetail/getDetail + detail() accessor (palette/GID compatible)
- procgen.autotileGrid(grid): write 8-bit wall-direction masks into any grid
- procgen.randomSeed(): fresh non-zero seed helper
- examples/roguelike-generator: interactive 2D/2.5D render test with CC0
  dungeon tileset (Buch, OpenGameArt)
- test/roguelike_generator.cpp: reproducibility, structure, rules, manual
  fill, autotile, randomSeed (8 cases, all pass)
- docs: procgen module page + user guide shortcut table
2026-08-15 17:56:42 +08:00
西风逍遥游 01223e1149 Merge branch 'main' into codex/hex-grid-planet 2026-08-15 13:19:27 +08:00
西风逍遥游 a1e7fffe99 feat(procgen): add hex-grid planet generator 2026-08-15 13:11:27 +08:00
西风逍遥游 3aeb636b68 Merge branch 'main' into codex/procedural-tree-generator 2026-08-15 12:45:43 +08:00
西风逍遥游 3f3f01298d feat(procgen): add procedural tree generator 2026-08-15 12:41:06 +08:00
西风逍遥游 0b06713d13 Harden thread pool task lifetime and event wakeups 2026-08-14 22:40:52 +08:00
西风逍遥游 6adfc8086c feat(graphics): implement hardware MSAA support for 3D scene color pass
- Added functionality to enable hardware MSAA (2x, 4x, 8x) for the 3D scene color pass, enhancing edge quality for 3D models and voxels.
- Introduced `setMsaaSamples` and `getMsaaSamples` methods in the Graphics API to control MSAA sample count.
- Updated RenderControl to include MSAA as a feature, with default settings for enabling/disabling.
- Modified the rendering pipeline to accommodate MSAA, including adjustments to render passes and framebuffers.
- Enhanced documentation and tests to cover new MSAA functionality and ensure stability across various scenarios.
2026-08-14 10:15:07 +08:00
西风逍遥游andCursor Agent c0d9fe4a7d test(hex): 程序化六边形关卡套件(FOV / 光照 / 寻路 / 拾取 / 粒子) (#50)
* test(hex): add procedural hex dungeon levels for engine QA

Cross-module simulation levels exercise hex tilemap procgen, FOV,
2D lighting, spatial pickup + inventory, and particles. Includes a
playable examples/hex-levels demo with level select and a pipeline crawl.

Co-authored-by: 西风逍遥游 <sunxfancy@gmail.com>

* test(hex): expand levels 06–15 and fog-raid pipeline

Add Flow Field swarm, cell-cost detours, multi-revealer perception,
FoW mask/algorithms, camera pick, dual-grid, procgen variants,
QuadTree cull, multi-light, particle/stash transfer, and a fog-raid
pipeline. Update the playable hex-levels demo for levels 6–9.

Co-authored-by: 西风逍遥游 <sunxfancy@gmail.com>

* test(hex): add fixture JSON data and data-driven hex tests

Expand catalog/items/loot/seeds/perception fixtures, handcrafted maps,
and particle configs. Wire the hex-levels demo to load items and particle
JSON plus fixtures.nut loot tables. Register hex_level_data.cpp coverage.

Co-authored-by: 西风逍遥游 <sunxfancy@gmail.com>

* test(hex): fix data fixtures assertions for zeroerr and sparse gens

Avoid CHECK_EQ on bag->addItem (double-eval), and only enforce minWalkable
on dungeon.bsp in the seeds matrix smoke.

Co-authored-by: 西风逍遥游 <sunxfancy@gmail.com>

* feat(hex): boot each level from distinct catalog configs

Enrich catalog/fixtures with per-level FOV, light, cell-cost, and enable
flags. Wire examples/hex-levels to apply those boot settings on level
switch. Add hex.data.catalog.bootEachLevelDistinctConfig to verify each
catalog entry starts with its own applied configuration.

Co-authored-by: 西风逍遥游 <sunxfancy@gmail.com>

* docs(hex): note per-level boot configs in data README

Co-authored-by: 西风逍遥游 <sunxfancy@gmail.com>

* test(hex): add levels 16–20 and extra data-driven coverage

Expand simulation with facing-cone FOV, flow+cell-cost, seed
reproducibility, corner peek, equipment equip, and torchEscort /
catalogRaid pipelines. Add fixture tests for perception gates, all loot
tables, enable-flag consistency, seed path samples, map markers,
defaults, equipment slots, and mist particles on dungeon.

Co-authored-by: 西风逍遥游 <sunxfancy@gmail.com>

* docs(hex): clarify expanded test coverage in README

Co-authored-by: 西风逍遥游 <sunxfancy@gmail.com>

* test(hex): add levels 21–25 and broader fixture validation

Cover hex world↔tile roundtrip, FOV memory clear, findGroupPath,
multi-algo FOV smoke, blocked-cell sync, and costlyFogPickup pipeline.
Add data tests for loot/item referential integrity, feature tags,
particle schema, algorithm registration, ring-door path, categories,
detection margin, and door walkability.

Co-authored-by: 西风逍遥游 <sunxfancy@gmail.com>

* feat(hex): expand catalog to 31 levels (0–30) and playable cycle

Add levels 16–30 with distinct boot configs (facing cone, flow+cost,
maze/WFC/drunkard, mist particles, raid combo). Regenerate fixtures.nut
with LEVEL_IDS; main.nut cycles all catalog levels via N/B. Add
simulation cases 26–30 and catalog presence tests.

Co-authored-by: 西风逍遥游 <sunxfancy@gmail.com>

* fix(hex): harden level 02/17 against non-portable procgen paths

macOS CI failed hex.level.02.dynamicFov (empty path) and
hex.level.17.flowPlusCellCost (path length == 2) because spawn↔exit
layouts from DTL/std distributions differ across libstdc++ vs libc++.
Use handcrafted hex maps so FOV memory and flow+cost assertions are
platform-stable.

Co-authored-by: 西风逍遥游 <sunxfancy@gmail.com>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2026-08-13 11:54:41 +08:00
西风逍遥游andCursor Agent 6be72c4c8f feat(particles): 2D/3D dynamic bone emission + expanded tests (#48)
* feat(particles): emit from Spine and IK 2D/3D dynamic bones

Extend ParticleEmitter attach beyond AnimPose to SpineSkeleton and
IK Skeleton2D/Skeleton3D, with getAttachKind and broader unit tests.

Co-authored-by: 西风逍遥游 <sunxfancy@gmail.com>

* test(particles): expand dynamic bone attach coverage

Add edge cases (null/OOB, invalid plane), multi-emitter, rate-tracking,
pause/detach sync, Spine scale via module update, IK offset/yz/Solver3D,
AnimPose clip sampling, and empty skin-filter fallback.

Co-authored-by: 西风逍遥游 <sunxfancy@gmail.com>

* test(particles): add attach lifetime, forces, and skin plane cases

New particles_attach_more.cpp covers emitter life/buffer on bones,
rebind, scale extremes, emission area, radial origin, Solver2D step
tracking, Spine rotated offsets, preset/stop/start, and skin xz/yz.

Co-authored-by: 西风逍遥游 <sunxfancy@gmail.com>

* test(particles): add reset/config/force/skin-filter attach cases

particles_attach_extra.cpp covers reset/moveTo/applyConfig with attach,
ellipse+tangential forces, dt edge cases, kind cycling, Spine rate bob,
Solver3D step, skin filter/buffer, and CesiumMan attach-by-name.

Co-authored-by: 西风逍遥游 <sunxfancy@gmail.com>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2026-08-13 11:28:29 +08:00
西风逍遥游 2e32afd71b feat(graphics): enhance rendering capabilities with 3D pipeline and ambient occlusion
- Added a new 3D rendering pipeline section in the documentation, detailing initialization, VKBuilder, and asynchronous frame handling.
- Updated the Ambient Occlusion module to support depth-based sampling, allowing for improved visual fidelity in 3D scenes.
- Introduced new shader functionalities for ambient occlusion and global illumination, enhancing the overall rendering quality.
- Updated GBuffer to include hardware depth texture for more accurate depth sampling in 3D rendering.
- Enhanced the RenderControl to manage new features for ambient occlusion and global illumination, ensuring they are enabled by default.

Co-authored-by: 西风逍遥游 <sunxfancy@gmail.com>
2026-08-13 10:01:04 +08:00
西风逍遥游andCursor Agent 9736798df1 feat(animation): 2D sprite-sheet and Spine region animation (#44)
* feat(animation): add 2D sprite-sheet and Spine region animation

Implement SpriteSheet/SpriteClip/SpriteAnim for frame animation with Quad
binding, and a Spine .atlas + skeleton JSON subset (bones/slots/region
attachments) that feeds the shared DrawItem2D queue via SpineAnim.

Co-authored-by: 西风逍遥游 <sunxfancy@gmail.com>

* fix(animation): atlas page props, SpriteAnim getLoop, test polish

Parse unindented Spine atlas page keys (size/format/...), move SpriteAnim
getLoop out of line to avoid incomplete type, and harden sprite/spine tests.

Co-authored-by: 西风逍遥游 <sunxfancy@gmail.com>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2026-08-12 20:46:37 +08:00
西风逍遥游andCursor Agent 544779079f Add Material, RenderControl, and sampleable G-buffer for post effects (#43)
Introduce a compilable render feature control (shadow/gbuffer/forward/hair),
package shading into Material+ModelPart attachable to Renderable3D, and fill
sampleable linear-depth/normal (optional albedo) G-buffer targets while
keeping forward HW z-testing and CSM shadows.

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2026-08-12 20:25:41 +08:00
西风逍遥游andCursor Agent 2aabe03720 Add hair/fur card rendering with Kajiya-Kay anisotropic shader (#42)
Introduce mesh3d_hair GLSL shaders with alpha-blended Vulkan pipeline
(no back-face cull, depth write disabled). Expose gfx.newHairShader(),
Renderable3D.setHair() for a back-to-front transparent pass in
RenderSystem3D, plus HairShader helpers and unit tests.

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2026-08-12 18:35:47 +08:00