Commit Graph
41 Commits
Author SHA1 Message Date
西风逍遥游 2e0915c3e3 Merge pull request #222 from EVEngine/codex/procgen-code-pipeline
feat(procgen): add script-first hot-reload pipelines
2026-08-24 23:41:16 +08:00
西风逍遥游 b3ee30786a feat(procgen): compare debug stages across reloads 2026-08-24 22:51:12 +08:00
西风逍遥游 74717e85b0 feat(procgen): profile script stages automatically 2026-08-24 22:47:43 +08:00
西风逍遥游 5f8a569b17 feat(procgen): cache named pipeline stages transactionally 2026-08-24 22:17:13 +08:00
西风逍遥游 1d006b8eb4 feat(procgen): add polygon and spline placement queries 2026-08-24 22:14:37 +08:00
西风逍遥游 92a502ac9a feat(procgen): reuse snapshots by stable build key 2026-08-24 21:36:01 +08:00
西风逍遥游 8a9a4bec6f feat(procgen): add terrain-aware spatial filters 2026-08-24 21:34:21 +08:00
西风逍遥游 f8627d8f23 feat(procgen): retain inspectable debug stages 2026-08-24 21:31:27 +08:00
西风逍遥游 d6d04d5f28 feat(procgen): add atomic script rebuild contexts 2026-08-24 20:58:54 +08:00
西风逍遥游 219f50b5d0 refactor(procgen): own generated object type 2026-08-24 20:57:21 +08:00
西风逍遥游 678eb7af17 feat(procgen): add composable point pipelines 2026-08-24 20:54:41 +08:00
西风逍遥游 c05c95c231 feat(procgen): improve procedural bush structure 2026-08-23 21:57:34 +08:00
西风逍遥游 8a53d9d8a6 feat(procgen): hierarchical parcel & street co-generation (EG 2024 urban modeling) 2026-08-23 17:47:19 +08:00
西风逍遥游 811eff1c3a ci(quality): warnings-as-errors gate, sanitizers, smoke, Python lint/tests
- EVENGINE_ENABLE_STRICT_WARNINGS option: MSVC /W4 /WX, GCC/Clang
  -Wall -Wextra -Werror, with documented noise suppressions and
  -isystem/-external:I for third-party headers; enabled on the
  Windows/Linux debug CI jobs.
- Fix warnings across engine, modules and tests exposed by the gate,
  including real bugs (incomplete-type deletes, Timespan microsecond
  overflow, overload hiding, enum switch gaps, dead code).
- Add Linux ASan+UBSan job, example smoke step, python-tools test
  job, ruff config (scripts+tools), weekly Linux coverage job and a
  CodeQL workflow.
2026-08-22 02:27:37 +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
西风逍遥游 4377e062dd feat: zeroerr parameter validation + Doxygen API documentation
Squashed onto current main. Adds src/engine/common/Assert.h (EV_PARAM_CHECK / EV_ASSERT backed by zeroerr), an EVENGINE_ENABLE_ASSERTS option (non-Debug builds strip ZEROERR_NO_ASSERT unless enabled), parameter checks at key entry points, Doxygen comments across headers, Doxyfile + make docs / CMake docs targets, and Windows setup + code conventions in AGENTS.md.
2026-08-19 09:01:12 +08:00
西风逍遥游 50a230f5a3 Revert "feat: zeroerr parameter validation + Doxygen API documentation (#113)"
This reverts commit 3f3e41990b, reversing
changes made to 7d6375bc95.
2026-08-19 08:36:18 +08:00
西风逍遥游 228b5a0f15 docs: add Doxygen API comments, docs target, and Windows AGENTS.md
Normalize all header comments to Doxygen @brief form and fill in missing class/method docs across engine common, cmdline, and module headers (~2368 @brief entries). Add root Doxyfile, 'make docs' target, CMake docs target, .gitignore for docs/api, README/docs/dev updates, and a Windows (native) + code-conventions section in AGENTS.md.
2026-08-19 00:13:35 +08:00
西风逍遥游 b86a9b421b fix(procgen): drop dead texture registrations for functions removed in refactor 2026-08-16 13:29:56 +08:00
西风逍遥游 455427a085 fix(procgen): restore missing closing brace lost during merge 2026-08-16 13:05:17 +08:00
西风逍遥游 d3636c7e4e Merge branch 'main' into feature/cloud-shadows 2026-08-15 23:45:14 +08:00
西风逍遥游 91940965cb Merge branch 'main' into codex/procgen-bush-generator 2026-08-15 22:02:19 +08:00
西风逍遥游 720cbf75f6 Merge pull request #68 from EVEngine/feature/procedural-textures-pbr
feat(procgen): expand procedural textures + PBR material generation
2026-08-15 22:01:40 +08:00
西风逍遥游 d1a3e07e8d Merge branch 'main' into codex/procgen-skyscraper 2026-08-15 22:01:11 +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
sunxfancy 4fdacceadd feat(procgen): dynamic clouds + real-time cloud shadows on ground
Add procedural cloud generation and dynamic cloud shadows that darken the
ground as clouds drift overhead.

Procgen (CPU, fully testable):
- CloudField: deterministic, seamlessly-tiling, time-animated 2D cloud
  coverage over the XZ plane (domain-warped value-noise fBm, wind drift,
  wisp detail). coverageAt(x,z,t), sample(...).
- CloudShadow: projects clouds along the sun onto the ground plane
  (coverageAt / shadowFactorAt / bake), accounting for sun direction and
  cloud altitude.
- New recipes: tex.cloud (cloud cover), tex.cloud_shadow (projected
  ground shadow coverage).
- Procgen module + script API: newCloudField/newCloudShadow,
  cloudCoverageAt/cloudShadowFactor, sampleCloud/sampleCloudShadow.

Graphics (real-time):
- setCloudShadows() packs {strength, worldCell, time, wind, coverage,
  detail} into the Mesh3D UBO (default strength 0 = no change).
- mesh3d PBR shaders (Vulkan GLSL + regenerated SPIR-V, and WebGPU WGSL)
  sample an inline seamless cloud field in world XZ and modulate the
  primary directional light.

Tests: CloudField reproducibility/animation/seamless tiling, wind drift,
shadow projection & factor bounds, recipe generation, module API, and a GPU
render test proving clouds darken the ground and the effect resets when
disabled. Verified no regression on the default PBR path (ClassicScenes
pbrChart + hexplanet render tests).
2026-08-15 21:42:07 +08:00
西风逍遥游 72252ad218 procgen: add procedural 3D small bush (mesh.bush)
Add a deterministic low-poly small-bush recipe to procgen. It clusters
squashed foliage ellipsoids under a dome silhouette, adds emergent woody
twigs and optional leaf cards, using a two-region atlas (bark/foliage)
consistent with mesh.tree.

- src/modules/procgen/algorithms/BushMesh.{h,cpp}: recipe implementation
- MarchingCubes.cpp: register mesh.bush in MeshRecipeRegistry
- test/procgen.cpp: reproducibility/styles, option validation, render dump
- examples/bush-generator/: interactive showcase + Kenney CC0 mini-forest
  derived atlas with attribution
- docs/dev/程序化生成模块设计.md: document mesh.bush

Verified: procgen suite 57/57 passing, render dump produces 900x700 PNG.
2026-08-15 20:54:30 +08:00
西风逍遥游 e4e0cefcba Merge branch 'main' into codex/procgen-roguelike-generator 2026-08-15 20:52:33 +08:00
sunxfancy d253dc5ab1 feat(procgen): expand procedural textures + PBR material generation
Add 10 new albedo texture recipes (rock, wood, ripple, cloth, ornament,
spot, zebra, wall, cement, mud) alongside the existing soil/stone/marble/
water/sky_cloud, and introduce full metallic-roughness PBR generation.

A texture is now described by a single TextureRecipeDef (albedo ramp +
displacement field + PBR knobs), so both an albedo ImageData recipe
(tex.*) and a complete PBR set (pbr.*: albedo/normal/roughness/metallic/
height/ao) are derived from the same pixel-aligned height field, with
seamless tiling support.

Expose generatePbrMaterial + pbr recipe listing on the Procgen module and
script bindings. Add tests for expanded recipes, PBR reproducibility,
map ranges, and module/error paths.
2026-08-15 20:51:29 +08:00
西风逍遥游 fc65093e44 feat(procgen): add linear tileable structure mesh recipes
Add a general method for procedural, linearly arranged tileable props
(fence, stone wall, bridge, Great Wall, hedge, cheval de frise). Each
recipe repeats a single unit segment along the X axis; x=0 and x=segLength
cross-sections match so tiling is seamless. Primitives are axis-aligned
boxes (addAABB) and oriented beams (addBeam) with per-face normals and UVs;
UV uses absolute world coords * uvRepeat so wood/brick grain is continuous
across seams.

Recipes: mesh.fence, mesh.stonewall, mesh.bridge, mesh.greatwall,
mesh.hedge, mesh.chevaldefrise. Shared params: segments, segLength,
height, depth, thickness, scale, uvRepeat.
2026-08-15 17:58:19 +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
西风逍遥游 a36b5837de feat(procgen): add procedural 3D skyscraper generator
Add mesh.skyscraper recipe producing a deterministic setback-tiered tower
with a window grid and optional spire. Window quads are raised a thin lip
above each facade so openings read under directional lighting without
coplanar z-fighting.

- Register recipe in MeshRecipeRegistry
- Add topology/height/reproducibility unit tests
- Add render smoke test outputting out/skyscraper.png
- Add interactive example examples/skyscraper-generator/
- Update procgen and module design docs
2026-08-15 17:51:17 +08:00
西风逍遥游 3147becb83 Merge pull request #62 from EVEngine/cursor/procgen-heightmap-sampling
feat(procgen): terrain heightmap sampling for pixels and tilemaps
2026-08-15 16:47:26 +08:00
西风逍遥游andCursor 5b2bcdcbef feat(procgen): add Perlin heightmap sampling for pixels and tilemaps
Provide a deterministic sample(x, y) terrain function so height can be queried at any map coordinate, baked into an in-memory heightmap, or classified into a Grid2D for tilemap generation.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-15 15:09:12 +08:00
西风逍遥游 5460b79412 Merge branch 'main' into codex/random-rock-generator 2026-08-15 14:22:35 +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
西风逍遥游 3f3f01298d feat(procgen): add procedural tree generator 2026-08-15 12:41:06 +08:00
西风逍遥游 c0b2b125e5 feat(procgen): add random low-poly rock generator 2026-08-15 12:35:08 +08:00
西风逍遥游andCursor Agent 30c98b286f feat(procgen): add Wave Function Collapse and Marching Cubes (#33)
- wfc.simple: tiled WFC with dungeon/cave/terrain presets → Grid2D
- mesh.marchingcubes: Lorensen/Cline MC over sphere/torus/noise/terrain fields
- MeshBuild CPU mesh + Procgen buildMesh/generateMesh bindings
- Graphics::newMeshFromArrays for GPU upload
- tests, example keys 6–8, docs

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2026-08-11 20:41:43 +08:00
西风逍遥游andCursor Agent 6f290b2a1d feat(procgen): 程序化生成模块 Phase A/B(地图 + 贴图) (#5)
* docs(procgen): add procedural generation module design

Capture confirmed product direction (runtime map-first, textures
second, pixel/low-poly RPG) plus API sketch, algorithm registry,
configurable outputs, and Phase A checklist.

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

* docs(procgen): list procgen in module summary table

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

* feat(procgen): Phase A runtime map generation with DTL

Add eve.Procgen module: semantic Grid2D, algorithm registry, palettes,
and TileLayer/JSON outputs. Built-ins use Dungeon Template Library
(BSP, cellular cave, maze, perlin terrain) plus local drunkard walk.
Includes tests and examples/procgen demo.

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

* feat(procgen): Phase B runtime pixel texture recipes

Add seamless value-noise texture generation with banded color ramps
for soil/stone/marble/water/sky_cloud, ImageData/Texture/normal outputs,
and script bindings for gfx.newTexture / drawTexturedRect.

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

* fix(test): qualify eve::image::ImageData in procgen tests

Bare image:: failed to resolve under `using namespace eve::procgen`,
breaking unit_test builds on Linux/Windows/macOS CI.

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

* fix(procgen): link EVProcgen in tests and fix Apple Clang DTL build

unit_test was missing EVProcgen, causing undefined references on Linux/Windows.
Avoid the DTL umbrella header (broken Voronoi CRTP on Apple Clang) and provide
DrawJagged* compat shims that define the missing drawOperatorArray.
Verified locally: linux-debug build, unit_test link, and all 13 procgen ctests.

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

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2026-08-09 08:47:27 +08:00