mirror of
https://github.com/jcreek/CosmicClash.git
synced 2026-09-11 08:23:45 +00:00
fix(project): keep comments out of project.godot and guard the settings
Godot's ConfigFile writer does not round-trip comments in project.godot. An observed rewrite deleted both `;` blocks outright and spliced the three-line `#` block above run/main_scene.dedicated_server onto the setting's own line, leaving it commented out — which would send dedicated builds to the interactive main menu instead of server_boot.tscn, with nothing failing until someone noticed a server process rendering a menu. Move the explanations into the code that owns the settings (server_boot.gd for the dedicated-server override, video_settings.gd for stretch mode and vsync) so they cannot be destroyed by a rewrite, and leave project.godot holding only assignments plus Godot's own regenerated header. Add tests/cases/test_project_settings.gd as the backstop: the feature-override assertions read project.godot as text and reject a line that has been folded into a comment, since ProjectSettings resolves `key.<feature>` overrides at load time and never exposes the suffixed key. Verified by reproducing the exact corruption, which fails the test, and it also covers the Jolt physics engine, the required autoloads, and that no test-hook autoload is ever shipped registered.
This commit is contained in:
@@ -9,6 +9,15 @@ extends Node
|
||||
#
|
||||
# Run: godot --headless --path Game res://scenes/server_boot.tscn -- --port=7777
|
||||
#
|
||||
# Dedicated *exports* reach this scene without the CLI argument above, via the
|
||||
# `run/main_scene.dedicated_server` feature override in project.godot — the same
|
||||
# project-setting mechanism the training export uses for training.tscn. That
|
||||
# override is deliberately uncommented in project.godot: Godot's ConfigFile
|
||||
# writer does not round-trip comments, and a `#` block directly above a setting
|
||||
# can be spliced into the setting's own line on rewrite, silently commenting it
|
||||
# out and sending dedicated builds to the interactive main menu instead of here.
|
||||
# `tests/cases/test_project_settings.gd` fails loudly if that ever happens.
|
||||
#
|
||||
# Deliberately does not spawn a match yet — that's Phase 2's networked_match
|
||||
# scene. This is just the process shell: listen, log, idle cheaply.
|
||||
|
||||
|
||||
@@ -8,6 +8,31 @@ extends Node
|
||||
# load) rather than overwriting them outright, so the per-arena bloom tuning
|
||||
# in arena_01/02/03.tscn survives underneath the user's preference.
|
||||
|
||||
# The two display project settings this autoload sits on top of are documented
|
||||
# here rather than in project.godot, because Godot's ConfigFile writer does not
|
||||
# round-trip comments — it drops `;` blocks outright and can splice `#` blocks
|
||||
# into the following line, silently commenting the setting out. Anything in
|
||||
# project.godot that needs an explanation must therefore be explained from the
|
||||
# code that owns it. `tests/cases/test_project_settings.gd` guards the settings
|
||||
# themselves against exactly that corruption.
|
||||
#
|
||||
# `window/stretch/mode="viewport"` + 1080p (task 0.17c): kept fixed rather than
|
||||
# moved to "disabled", deliberately. A player on a 1440p/4K display cannot
|
||||
# render native this way, and a 1080p player cannot render lower than 1080p
|
||||
# through window scaling alone — but task 0.17b's Viewport.scaling_3d_scale
|
||||
# (resolution_scale below) already covers "render lower than the window"
|
||||
# independently of stretch mode, since it scales the 3D viewport's own internal
|
||||
# resolution before this blit rather than the window itself. Task 0.15b also
|
||||
# found an unexplained ~6% non-uniform width scaling on this project's one
|
||||
# tested (Mac/Retina) machine — see multiplayer-todo.md §5.5.1 — which needs
|
||||
# understanding before stretch mode is touched, not blindly carrying into a
|
||||
# resolution-dependent change.
|
||||
#
|
||||
# `window/vsync/vsync_mode=2` (task 0.17): matches VsyncMode.ADAPTIVE below.
|
||||
# apply_vsync() overwrites it at runtime via DisplayServer as soon as this
|
||||
# autoload initializes, so the project setting is only in effect for the brief
|
||||
# pre-autoload window, and as a fallback if VideoSettings ever fails to load.
|
||||
|
||||
signal settings_changed # Arenas re-apply preset-gated Environment/light state live.
|
||||
|
||||
# MSAA_2X appended at the end, not inserted, so existing user://settings.cfg
|
||||
|
||||
Reference in New Issue
Block a user