Repository navigation
Add params/get inspection and runtime-editable game master state - #396
Closed
concordia-claw wants to merge 2 commits into
Closed
concordia-claw wants to merge 2 commits into
concordia-claw wants to merge 2 commits into
Conversation
- New shared editor/CLI commands: `params ID [COMPONENT]` lists an instance's prefab parameters (value, default, type and the matching `set` command) or a built component's constructor parameters and editable state; `get ID FIELD` and `get ID COMPONENT FIELD` read one value. Both are read-only and work while a run is active. - The generic simulation's component info now reports each component's constructor parameters, so `params narrator generative_clock` shows how prefab parameters reach a component. - GenerativeClock (`time`), Locations (`entity_locations`) and WorldState (`state`) advertise editable dynamic state; `set_state` validates the edited values. - contrib GameMasterSimultaneous: FixedIncrementClock initializes its base class (it previously failed on `_logging_channel`), the default start time now parses, and new `use_variable_increments` and `call_to_action` parameters allow fixed-length rounds and short custom player prompts. - Docs: editor-commands.md and the CLI README cover params/get, editable game master state, and the fact that structured logs are compressed, so grep on a raw log undercounts; use the log tools or dump first.
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
concordia-claw
force-pushed
the
feat/editor-params-get-dynamic-state
branch
from
October 6, 2026 12:20
d711d8b to
fa1a56e
Compare
jzleibo
previously approved these changes
Oct 6, 2026
copybara-service Bot
pushed a commit
that referenced
this pull request
Oct 6, 2026
-- fa1a56e by concordia-claw <concordia-claw@users.noreply.github.com>: Add params/get inspection and runtime-editable game master state - New shared editor/CLI commands: `params ID [COMPONENT]` lists an instance's prefab parameters (value, default, type and the matching `set` command) or a built component's constructor parameters and editable state; `get ID FIELD` and `get ID COMPONENT FIELD` read one value. Both are read-only and work while a run is active. - The generic simulation's component info now reports each component's constructor parameters, so `params narrator generative_clock` shows how prefab parameters reach a component. - GenerativeClock (`time`), Locations (`entity_locations`) and WorldState (`state`) advertise editable dynamic state; `set_state` validates the edited values. - contrib GameMasterSimultaneous: FixedIncrementClock initializes its base class (it previously failed on `_logging_channel`), the default start time now parses, and new `use_variable_increments` and `call_to_action` parameters allow fixed-length rounds and short custom player prompts. - Docs: editor-commands.md and the CLI README cover params/get, editable game master state, and the fact that structured logs are compressed, so grep on a raw log undercounts; use the log tools or dump first. COPYBARA_INTEGRATE_REVIEW=#396 from concordia-claw:feat/editor-params-get-dynamic-state fa1a56e PiperOrigin-RevId: 994463500 Change-Id: Ibb1f50f5176cdecaca5e119f979a33b1d7117f9f
get_state() returns a read-only Mapping; pyrefly rejected the item assignments in the new dynamic-state tests.
Collaborator
|
Closing this pull request as the changes have already been merged into |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This adds read-only
paramsandgetcommands to the shared editor/CLI grammar. It also makes the situated game master's state editable at runtime, and fixes the contrib simultaneous game master. I found these gaps while making a tutorial for the project editor andconcordia-session.paramsandget.params IDlists an instance's prefab parameters with value, default, type and the exactsetcommand.params ID COMPONENTlists a built component's class, constructor parameters, editable state and other state fields.params simulationlistspremiseandmax_steps.get ID FIELDreads one value, using the same paths asset.get ID COMPONENT FIELDreads one component state field from the preview, or from the runtime afterview runtime.concordia-session. They never change the draft and are allowed while a run is active.generic.Simulationnow reports each component's constructor signature (parameters). For example,params narrator generative_clockshows that the situated game master passesclock_descriptionandstart_timetoGenerativeClockaspromptandstart_time.GenerativeClock(time),Locations(entity_locations) andWorldState(state) now implementget_dynamic_state. Theirset_staterejects badly typed values. A paused run can therefore move the clock or a character, for exampleedit narrator generative_clock time '"11:45 AM"'.GameMasterSimultaneousfixes.FixedIncrementClocknow callssuper().__init__(). Before, building the prefab failed with anAttributeErroron_logging_channel.start_timewasNone, which crashedstrptimewith aTypeError. It now defaults to a parseable date, and the fallback also catchesTypeError.use_variable_incrementsparameter:Falsemakes every step exactlytime_period_minuteslong.call_to_actionparameter: it replaces the default request for a 10-sentence plan, for example "How many fish does {name} catch this round?".editor-commands.mdand the CLI README document the new commands and editable state. They also explain that structured logs are compressed: repeated content is stored once and referenced by hash, so grep on a raw log undercounts. In one tutorial run, a phrase had 725 raw matches but 1,584 afterconcordia-log dump.An observation that this PR does not change:
SimultaneousNarrativeEventResolutionasks formax(400, 25 × time_period_minutes)words per step. A one-day step (1440 minutes) therefore demands a 36,000-word narrative, with retries. The pond example in the editor uses 15-minute rounds for this reason.Test plan
pytest concordia: 1,091 passed, including new tests insession_commands_test.py,world_state_test.pyandsimultaneous_resolution_gm_test.py.pyrefly check concordia(1.2.0, as pinned inrequirements.txt) andpylint --errors-only concordiaare clean. The second commit fixes the read-onlyMappingassignments in the new world-state tests that CI flagged.feat/android-project-editor-demo-001branch passes on top of this branch (79 tests).🤖 Generated with Claude Code