Commit Graph

28 Commits

Author SHA1 Message Date
git 75d6051eca Split Q3 workflow into composable sub-workflows
Breaks the monolithic Quake3 per-frame workflows into reusable include-based sub-workflows (input, physics, combat, render, overlay, postfx) and adds a screenshot-check component for the screenshot package. Introduces new workflow JSONs (q3_input, q3_physics, q3_combat, q3_render, q3_overlay, q3_postfx, q3_screenshot_check) and updates q3_frame and screenshot q3_frame to include them. Implements SDL software overlay steps (hud, crosshair, hitmarker, mapselect, menu_frame) and software overlay begin/end rendering steps with corresponding headers and source files; removes the old q3_overlay_draw implementation. Updates CMakeLists and workflow parser/registrar to register and build the new sources. This refactor improves composability and reusability of workflow sections.
2026-05-04 19:45:21 +01:00
git 2ecc36e632 Add Q3A-faithful HUD and Choose Level map-select screen
HUD (always-visible, replaces text debug overlay):
- Large digit sprites from gfx/2d/numbers/*_32b.tga at 1.75x scale
- Bottom-left: armor value (gold) + iconr_yellow.tga + health value + face icon
- Bottom-right: icona_machinegun.tga + ammo count
- Crosshair from gfx/2d/crosshaira.tga (falls back to dot)
- Reads q3.player_health / q3.player_armor / q3.player_ammo context keys

Map-select screen (DrawMapSelectScreen, shown when q3.menu_screen == "map_select"):
- Levelshot image from levelshots/{MAP}.jpg, red-bordered, centered
- Map short name + long name from scripts/arenas.txt (ParseArenas)
- Bot opponent face icon from models/players/{bot}/icon_default.tga
- Left/right navigation arrows (gs_arrows_l/r.tga)
- BACK / SKIRMISH / FIGHT buttons at bottom

Infrastructure:
- ParseArenas() reads arenas.txt from PK3 into arena_data_ map at startup
- LoadOrGetLevelshot() caches levelshot SDL_Texture* by uppercase map name
- DrawHudNumber() draws integer using digit sprite array with gold tint
- All new textures cleaned up in destructor

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-04 19:45:21 +01:00
git ad04bbed95 Redesign Q3 menu to match Q3A main-menu visual style
- Replace panel-box layout with full-screen black background
- Draw frame1_l + frame1_r side-by-side at full width to form the Q3A
  circular bull-horn ring emblem behind the menu items
- Render "QUAKE III ARENA" title using prop font at 1.5×/1.1× scale with
  an orange glow pass via font1_prop_glo.tga, matching Q3A style
- Menu items now render at 1.0× scale in red (unselected) or bright
  yellow-white with glow halo (selected), centered on screen
- Add copyright footer matching Q3A exact text
- Load font1_prop_glo.tga as prop_glo_tex_ for title and hover effects
- Update menu.json main screen to Q3A items: SINGLE PLAYER, MULTIPLAYER,
  SETUP, DEMOS, CINEMATICS, MODS, EXIT

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-04 19:45:21 +01:00
git c23f53b0be Add MD3 model rendering and fix Q3 bot/weapon visuals
- Add workflow_q3_md3_load_step: load MD3 models from PK3 with correct
  CCW winding, 1/64 xyz scale + 0.03125 world scale, and per-frame VBs
- Add workflow_q3_md3_draw_step: viewmodel (weapon) + world-space MD3
  drawing; barrel oriented along model X → world forward
- Add workflow_q3_bots_draw_step: 3-part bot model chain
  (lower→upper→head via MD3 tags) + weapon attachment
- Add workflow_q3_bots_spawn_step: spawn bots at indices 1+ so they
  never overlap the player's spawn point (index 0)
- Add workflow_q3_bots_update_step: bot AI (idle/chase/shoot/dead FSM)
- Fix workflow_q3_menu_update_step: menu starts closed (was open)
- Fix workflow_postfx_composite_step: GPU readback via
  SDL_DownloadFromGPUTexture captures full 3D scene for screenshots
- Fix Metal GPU validation: always bind 2 sampler slots; reuse albedo
  as dummy shadow map when no shadow texture is available
- Reorder q3_frame.json: screenshot trigger nodes run before
  postfx_composite so screenshot_output_path is set in time

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-02 23:47:50 +01:00
git 8abe642baf Wire up real Quake 3 menu system with PK3 assets
- Multi-screen menu hierarchy (main/setup/player/controls/options/map_select)
  defined in packages/quake3/config/menu.json, loaded at runtime
- Overlay renderer loads real Q3 assets from pak0.pk3 via libzip+stb_image:
  cut_frame.tga (panel), frame1_l/r.tga (decorations), font1_prop.tga (text)
- Proportional font renderer using exact Q3 propMap table (ioquake3 source)
- Centered in-game panel matching ioquake3 layout
- Two-level DAG loop: outer_loop reloads map, inner game_loop runs per frame
- value.set_if atomic step added; movement_active computed by DAG (bool.not)
- Mouse grab, physics move, weapon update driven by movement_active context key
- BSP collision cleanup on map reload to prevent ghost geometry
- SDLK_q → SDLK_Q fix for SDL3; window close button exits both loops
- quake3_screenshot package: renders 240 frames, saves BMP, exits

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-05-02 22:40:07 +01:00
git a12c575a7e Add Q3 pickups draw step and hit UI
Introduce a new Quake3 pickups draw workflow step to render in-world pickup icons and register it: add WorkflowQ3PickupsDrawStep (header + implementation), register the step in WorkflowRegistrar, and include the source in CMakeLists. Update the q3_frame workflow JSON to insert a draw_pickups node into the frame graph. Enhance the overlay to show weapon damage in the HUD and draw weapon/hit visuals, and update weapon logic to mark hits and accumulate damage (q3.last_shot_hit, q3.hit_marker_until_frame, q3.damage_done). Also fix trailing newline in CMakeUserPresets.json.
2026-05-02 21:36:40 +01:00
git 4905d85667 Add Quake 3 menu and weapon workflow steps 2026-05-02 21:26:20 +01:00
git 48b6f6ce76 Add Quake 3 BSP entity interactions 2026-05-02 21:04:26 +01:00
git 9ec17a5302 Add Metal shaders for Quake 3 BSP 2026-05-02 20:52:51 +01:00
git 6835084939 feat(gameengine): FPS overlay, adaptive vsync, stair tuning, smart GUI launcher
- overlay.fps: SDL software renderer → GPU texture quad, top-right corner,
  yellow EMA-smoothed FPS counter; LOADOP_LOAD preserves scene beneath it
- debug.screenshot: one-shot step that writes status txt + BMP then pushes
  SDL_EVENT_QUIT for automated visual feedback loop
- Adaptive vsync: graphics.gpu.init "auto" present_mode queries actual monitor
  refresh rate via SDL_GetCurrentDisplayMode; ≥120 Hz → VSYNC, <120 Hz → MAILBOX
  Fixes vsync cap on 165/170 Hz monitors reporting as 240 Hz in settings
- Fixed present_mode wiring: q3_game.json gpu_init_viewport node now passes
  present_mode as a direct parameter (workflow variables are not seeded into
  context by the executor, so the variable section was dead data)
- Stair climbing: probeReach 0.45→0.70 for earlier detection, jam detection
  nudges player up after 100 ms of horizontal blockage, step_height tuned to 0.6
- Physics dt: real wall-clock delta clamped to [1/600, 1/30] so 240 Hz displays
  don't run physics 4× faster than intended
- GUI smart search paths: _candidate_build_dirs() scans all generator dirs ×
  build types × flat and Conan-nested layouts, sorted by CMakeCache.txt mtime;
  _find_binary() picks freshest sdl3_app.exe; packages loaded relative to
  __file__ so gui works from any working directory

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-30 20:29:37 +01:00
git c53f39601d feat(gameengine): floaty low-grav jumps for fun-feel q3 movement
Replace held-jump-extends-height (Mario-style) with a Q3-style impulse
jump: set vel.y once on press, gravity does the rest. Apply per-player
gravity scaling symmetrically in air (rising and falling) so jumps don't
feel floaty going up but heavy coming down.

Tune q3_frame for a fun, floaty feel rather than authentic Q3 numbers:
gravity_scale 0.55 (≈55% Earth) + jump_velocity 5.5 → ~2.8m apex,
~2s airtime. Trades rocket-dodge utility for hang-time enjoyment.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-30 15:21:28 +01:00
git a52ffd4ba9 feat(gameengine): add player inertia and tune Q3 movement to feel weighty
physics.fps.move was directly setting linearVelocity each frame on the
ground, producing the classic "no inertia" snap-stop feel. Replace with
a CalcFriction-style ramp: velocity accelerates toward target by
ground_accel * dt, decelerates to zero by ground_friction * dt when
input is released.

Tune the quake3 frame loop to match a modern shooter rather than vanilla
Q3 arcade speeds:
  - walk 4.5 m/s (was 8.0 — ~30 km/h is a sprint, not a walk)
  - sprint 1.5x (was 2.0x — 6.75 m/s top speed)
  - jump 0.9m / 0.22s (was 2.0m / 0.4s — Halo-ish hop, not a moon jump)
  - air control 0.15 (was 0.5 — less floaty mid-jump)
  - gravity_scale 1.6 (was 0.3 — was actually pushing the player UP
    when falling because of how the (gravityScale - 1.0) extra-force
    multiplier worked)

Defaults for the new ground_accel (35) / ground_friction (30) params
keep other workflows that use physics.fps.move feeling snappy without
having to update them.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-30 15:13:20 +01:00
git d9af1fb5bf feat(gameengine): auto-detect Steam game data via ${env:VAR} placeholders
Workflow JSON params can now reference environment variables (e.g.
${env:QUAKE3_PAK0}) which are expanded at JSON load time. A new Python
detector reads the Windows registry and parses libraryfolders.vdf to
locate Steam libraries, then resolves known-game files into env vars
that dev_commands.py exports before launching the engine. Lets users
with legitimate Steam-owned game data run packages like quake3 without
hardcoded paths.

Also fixes os.execv on Windows (Invalid argument with spaced paths) by
falling back to subprocess.call.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-30 14:58:29 +01:00
git 8bed50f43d feat(gameengine): fix BSP winding + decompose loader into 7 chainable workflow steps
Fix CW→CCW winding bug on polygon/mesh faces (types 1,3) that caused
backface culling to discard half the geometry. Decompose the monolithic
bsp.load step (1028 lines) into atomic workflow steps chainable via
JSON connections — each step only runs when connected:

- bsp.load: open pk3, read + validate BSP, store raw data in context
- bsp.lightmap_atlas: build lightmap atlas, upload to GPU
- bsp.parse_spawn: parse entity lump for spawn point
- bsp.build_geometry: build face geometry with CW→CCW winding fix
- bsp.extract_textures: load textures from pk3 with mipmaps
- bsp.upload_geometry: upload merged VB/IB to GPU
- bsp.build_collision: create Bullet physics convex hull collision

Shared BSP structs extracted to bsp_types.hpp. Workflow JSON updated
to chain: load → lightmap → geometry → textures → upload → collision → spawn.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 13:27:55 +00:00
git bd4448c6cc feat(gameengine): Quake 3 BSP map loader with Bullet physics collision
- bsp.load: parse Q3 BSP from pk3 (zip) archives via libzip
- Extracts vertices, faces, meshverts from BSP lumps
- Coordinate conversion: Q3 Z-up → engine Y-up
- Configurable scale (default 1/32 = Q3 units to meters)
- Skips sky, clip, trigger, caulk, hint textures
- Bullet btBvhTriangleMeshShape collision from BSP geometry
- draw.map: graceful fallback when shadow texture missing
- Q3 game workflow: FPS controls, 90° FOV, walk around maps
- Tested with q3dm17 (The Longest Yard): 8486 verts, 5128 tris
- libzip added to cmake dependencies

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 10:53:52 +00:00
git d46105e8ed feat(gameengine): TAA, mipmaps with anisotropic filtering, LOD bias
- postfx.taa: temporal anti-aliasing with Halton jitter, neighborhood clamping,
  Karis tonemap for stable history, configurable blend_factor from JSON
- Texture loader: auto-generate full mipmap chain via SDL_GenerateMipmapsForGPUTexture
- 16x anisotropic filtering on all textures
- LOD bias 0.5 to reduce moire patterns on high-frequency textures at distance
- TAA shader: 3x3 neighborhood clamp with expanded bbox to reduce flicker
- Ping-pong history buffers for temporal accumulation
- Sub-pixel jitter via Halton(2,3) sequence, 16-frame cycle

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 10:32:00 +00:00
git 915e18d67b feat(gameengine): glTF map loading, draw.map with JSON texture mapping
- map.load: Assimp-based glTF/GLB scene loader with auto physics generation
- draw.map: renders all map meshes with JSON-driven texture-to-mesh mapping
- export_room_gltf.py: exports seed workflow physics bodies to GLB
- Seed demo room exported as map.glb (14 static meshes)
- Texture mapping configurable per mesh name pattern in workflow JSON
- Maps can be edited in Blender and re-exported

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 10:16:37 +00:00
git 5805fcc17a feat(gameengine): sprint, crouch, variable-height jump, air control
- Shift to sprint (1.8x speed), Ctrl to crouch (0.4x speed + lower camera)
- Smooth animated crouch via eye height lerp (no snap)
- Variable-height jump: hold space longer = jump higher, release for short hop
- Raycast ground detection for reliable jump triggering
- Air control for mid-air strafing (Quake-style)
- Configurable gravity scale for floaty/snappy feel
- All parameters driven from workflow JSON (no hardcoded values)
- Ctrl polled in input.poll step
- Camera reads crouch height override from physics.fps.move context

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 09:59:16 +00:00
git a4aee87b88 refactor(gameengine): remove hardcoded defaults from spotlight steps, pure JSON-driven
- spotlight.setup: generic parameter passthrough, no hardcoded defaults
- spotlight.update: all values from spotlight.state JSON, zero fallbacks
- aim_distance now explicit in workflow JSON (was hardcoded 50.0f)
- C++ steps are pure executors, all config lives in workflow definitions

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 08:55:51 +00:00
git 487631458a refactor(gameengine): extract spotlight.update step, distance fog, volumetric improvements
- Extract spotlight logic from render.prepare into dedicated spotlight.update step
- render.prepare now only handles camera, shadow, and lighting uniforms
- spotlight.update runs per-frame after render.prepare, reads spotlight.state from context
- Aim distance configurable via JSON (aim_distance parameter)
- Camera-local offset for spotlight origin (matches viewmodel position)
- Direction computed from torch position toward camera aim point (natural beam alignment)
- Add distance fog to whole room (exponential, dark blue-grey)
- Volumetric beam: 48 steps, UE4 interleaved gradient noise, cubic cone falloff
- Fog density increased for visible beam effect

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 08:54:04 +00:00
git 7ac5ef1d20 feat(gameengine): Windows/AMD build, SPIRV shaders, spotlight, volumetric beam, FPS flashlight
Build system:
- Fix generate_cmake.py backslash paths and UTF-8 encoding for Windows
- Auto C++20 in conan deps, auto-detect VS install location
- dev_commands.py: add generate, all --run commands, platform-aware bootstrap
- Add assimp to cmake_config.json link libraries
- Fix CMakeUserPresets.json duplicate preset issue

Cross-platform C++:
- UUID generation: Windows rpc.h/UuidCreate with #ifdef _WIN32
- HOME env var fallback to USERPROFILE on Windows
- Shader format detection for D3D12/DXIL Vulkan driver

Shader pipeline (12 new SPIRV shaders):
- Port all Metal shaders to Vulkan GLSL (PBR, shadows, post-FX, compute)
- SDL3 GPU descriptor set convention (set 0-3)
- Combined image samplers for Vulkan compatibility
- Bootstrap-driven shader path rewriting (msl↔spirv automatic per platform)

Rendering features:
- spotlight.setup: generic atomic workflow step, attach to camera or static
- PBR spotlight with cone attenuation, distance falloff, wrap lighting
- Volumetric light beam (16-step ray march through dust/fog in spotlight cone)
- geometry.create_flashlight: procedural flashlight mesh (cylinder + head + lens)
- draw.viewmodel: FPS weapon-style rendering locked to camera view
- model.load: Assimp-based 3D model loader (OBJ/GLB/FBX/BLEND)
- Indoor ambient lighting fix, SSAO bypass for Vulkan clip-space

Performance:
- Frame loop logging suppressed via _in_frame_loop context flag

Assets:
- Real PBR textures from ambientCG (CC0): wood floor, concrete ceiling
- Seed demo: dark room + flashlight beam + Quake-style viewmodel

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 08:33:35 +00:00
git 1b33adcd6a feat: restore large gameengine assets; move postgres package-lock to frontends/postgres
- Restore materialx resources, bgfx examples/deps, audio assets to gameengine/
- Move postgres/package-lock.json → frontends/postgres/ (TS apps live in frontends/)
- Skip pyodide (intentionally removed in metabuilder-small)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-09 22:56:18 +00:00
git 75b67f8683 sync: align fat repo structure with metabuilder-small
Remove stale dirs/files superseded by metabuilder-small's reorganization:
- Old YAML entity/seed files (migrated to JSON)
- Root-level workflowui/ (moved to frontends/workflowui/)
- Prisma, Pyodide, old hooks, bun.lock artifacts
- Legacy scratch docs (txt/, docs/, deployment/*.md)
- Stale CI workflows consolidated in small

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-09 22:46:13 +00:00
git 862cc29457 various changes 2026-03-09 22:30:41 +00:00
git d0dbb64ebd chore: Cleanup unused imports and fix gameengine build
- Remove unused Layout import from JSONUIPage
- Remove unused imports from codegen components and hooks
- Fix assimp 3mf exporter conflict with libzip (duplicate symbols)
- Add SDL input service include
- Update workflow step string handling for type safety
- Add Qt6 CMakeUserPresets.json
- Add gameengine CodeQL build script

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 09:00:49 +00:00
git 156715f36d Fix gameengine include path: mesh_types.hpp
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 22:22:37 +00:00
git 43f5021ccb stuff 2026-01-22 02:00:16 +00:00
git 6fbc47a2db feat: Add SDL3CPlusPlus game engine to gameengine/
Import SDL3CPlusPlus C++ game engine with:
- SDL3 + bgfx rendering backend
- Vulkan/Metal/DirectX shader support
- MaterialX material system
- Scene framework with ECS architecture
- Comprehensive test suite (TDD approach)
- Conan package management
- CMake build system

This provides the native C++ foundation for the Universal Platform's
Game and 3D capability modules.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 16:29:20 +00:00