Commit Graph
10 Commits
Author SHA1 Message Date
Leonid PershinandClaude Opus 4.8 a684c23cd9 Add Climate and day/night ambient lighting
CI / build-test (push) Successful in 1m11s
Climate (Core) layers a continuous seasonal-plus-daily temperature and the
current season over the Calendar, registered via context.UseClimate. A new
Lighting module (Graphics) adds DayNight: a daylight factor and ambient
color from the calendar's time of day, pushed into the renderer's new
AmbientLight (multiplied into world-space sprites only, so the scene
darkens at night while screen-space overlays stay readable) and exposed as
a sampleable SampleAt for the simulation. Both deterministic and GPU-free,
covered by tests; docs updated.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-12 16:45:49 +03:00
Leonid PershinandClaude Opus 4.8 4b91b60f38 Calendar: expose time of day (hour/minute)
CI / build-test (push) Successful in 1m7s
Add Hour, Minute and MinuteOfDay to Calendar, decomposing DayProgress into
a 24x60 in-game clock so games can show a date and time, not just the day
number. Covered by a test.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-12 13:09:58 +03:00
Leonid PershinandClaude Opus 4.8 f791ee6c95 Add Calendar: in-game days layered over GameClock
CI / build-test (push) Successful in 1m11s
Introduce a Calendar in Core that turns scaled clock time into whole
in-game days plus a fraction-of-day, with a configurable SecondsPerDay.
Pausing or changing TimeScale slows or stops it automatically. Pure
read-side and deterministic, registered via context.UseCalendar(...),
mirroring GameSpeed. Covered by xUnit tests; docs updated.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-12 09:46:53 +03:00
Leonid Pershin ef1111bcb6 Enhance audio management and documentation
CI / build-test (push) Successful in 1m10s
Added a MasterVolume property to the AudioManager for unified control over sound effects and music volume. Updated the Play method to incorporate MasterVolume adjustments. Enhanced documentation in CLAUDE.md and architecture.md to reflect changes in audio management and overall engine architecture. Introduced a new test project for audio functionalities in the solution file.
2026-06-12 08:41:39 +03:00
Leonid Pershin c30e2ce764 Remove obsolete project files for MrGameEng.AI, MrGameEng.Assets, MrGameEng.Atlases, and MrGameEng.Collisions modules. Introduce new AssetManager and related classes for asset loading and management, including support for texture atlases and mod definitions. Enhance mod loading capabilities with DefDatabase and LanguageManager for JSON-based definitions and localization. Implement a shelf packing algorithm for efficient texture atlas creation. 2026-06-12 07:47:04 +03:00
Leonid Pershin fd6343bd09 @
CI / build-test (push) Failing after 1m8s
Add MrGameEng.AI utility-AI module; format codebase with CSharpier

New MrGameEng.AI module (ResponseCurve, Consideration, UtilityAction,
UtilityAi selector, Blackboard) plus CSharpier formatting applied across
the whole engine. Documents the CSharpier convention in CLAUDE.md.
@
2026-06-12 07:19:10 +03:00
Leonid PershinandClaude Fable 5 501d81e19f Fix engine-wide code review findings
CI / build-test (push) Failing after 1m7s
Collisions: init bucket heads to -1 (QueryAabb hung before the first
rebuild), reset query stamps on truncated QueryAabb (later queries
silently dropped entities), inside-origin raycasts hit at fraction 0 for
circles too, exactly-touching boxes now pair like touching circles.

Graphics: render into the letterbox viewport so the picture matches
ScreenToWorld/WorldToScreen instead of stretching; Y-sort by the
transform pivot rather than the quad center; lock-free snapshot
LayerRegistry (parallel submit read it unsynchronized); validate
InitialCapacity; warn when UseRenderer2D drops options of a later scene.

Core: scenes are explicitly single-use (re-loading threw silently
duplicated systems/entities before — now it throws), Scene.RegisterUnload
for per-scene resources, a switch requested during the reveal phase
covers again instead of hard-swapping, borderless fullscreen
(HardwareModeSwitch off), InputCapture service for input-suppressing
overlays, host disposes the transition renderer and IDisposable services
on shutdown.

Input: game input reads as released while InputCapture is held; mouse
position and wheel freeze so deltas stay zero.

DevConsole: holds InputCapture while open (typing no longer drives the
camera), Revision increments only under the lock, quoted command
arguments, history capped at 256.

UI: scene Desktop skips Myra input processing while the console is open
(clicks no longer fall through), is disposed on scene unload, and Myra
init no longer depends on a process-static flag.

Audio: validate channel count/sample rate before stopping the previous
track, empty looped oggs no longer hang FillBuffers, the instance stops
when a non-looping track drains (IsPlaying was stuck true).

Atlases: metadata v2 stores per-source size+mtime snapshots, so
timestamp-preserving copies and renames invalidate correctly; loader
checks the version and disposes pages on partial load failure; shared
pages never exceed a non-POT MaxPageSize; oversized items pack first
onto exact-size pages instead of splitting an open shared page; the CLI
validates numeric options.

Assets.Generator: file names are escaped in XML docs and string
literals, members no longer collide with the enclosing class (CS0542),
and the Assets root is resolved against build_property.projectdir so
nested "Assets" directories do not shift region paths.

Pathfinding: queries throw when the grid was resized after construction;
generation stamps survive int overflow.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-11 21:18:08 +03:00
Leonid Pershin d6f19b9119 Migrate test projects from xunit 2.9.3 to xunit.v3 3.2.2
CI / build-test (push) Successful in 1m6s
Test projects become executables (OutputType=Exe) as required by v3.
Satisfy the new xUnit1051 analyzer by passing TestContext cancellation
tokens in the generator compilation test.
2026-06-11 05:50:09 +03:00
Leonid PershinandClaude Fable 5 2b7d4c4fef Add scene transitions (fade, wipe) to SceneManager
Switch(scene, transition) covers the old scene, swaps at full coverage
(hiding slow OnLoad), then reveals the new one. Built-in Fade and Wipe
transitions draw through TransitionRenderer (BasicEffect quad, no
SpriteBatch); custom transitions subclass Transition. Runs on unscaled
time so it works while gameplay is paused; Switch during a transition
replaces the pending target.

Sample: Tab now fades into the stress scene and wipes back.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-11 04:27:54 +03:00
Leonid Pershin ff2231a8ab Update README.md to include project description, developer documentation links, and license information.
CI / build-test (push) Successful in 1m6s
2026-06-11 04:03:07 +03:00