Implement runtime variable event conditions

This commit is contained in:
Jan Petykiewicz 2026-04-17 08:50:35 -07:00
commit bd9e1421a1
15 changed files with 1442 additions and 29 deletions

View file

@ -0,0 +1,37 @@
{
"format_version": 1,
"fixture_id": "packed-event-add-building-shell-save-slice-fixture",
"source": {
"kind": "captured-runtime",
"description": "Fixture pinning the explicit shell-owned descriptor frontier for recovered add-building rows."
},
"state_save_slice_path": "packed-event-add-building-shell-save-slice.json",
"commands": [
{
"kind": "service_trigger_kind",
"trigger_kind": 7
}
],
"expected_summary": {
"calendar_projection_source": "default-1830-placeholder",
"calendar_projection_is_placeholder": true,
"packed_event_collection_present": true,
"packed_event_record_count": 1,
"packed_event_decoded_record_count": 1,
"packed_event_parity_only_record_count": 1,
"packed_event_blocked_shell_owned_descriptor_count": 1,
"event_runtime_record_count": 0,
"total_event_record_service_count": 0,
"total_trigger_dispatch_count": 1
},
"expected_state_fragment": {
"packed_event_collection": {
"records": [
{
"import_outcome": "blocked_shell_owned_descriptor"
}
]
},
"event_runtime_records": []
}
}

View file

@ -0,0 +1,110 @@
{
"format_version": 1,
"save_slice_id": "packed-event-add-building-shell-save-slice",
"source": {
"description": "Tracked save-slice document pinning the recovered add-building strip on the explicit shell-owned descriptor frontier.",
"original_save_filename": "captured-add-building-shell.gms",
"original_save_sha256": "add-building-shell-sample-sha256",
"notes": [
"tracked as JSON save-slice document rather than raw .smp",
"pins descriptor 503 as recovered shell-owned parity instead of unresolved residue"
]
},
"save_slice": {
"file_extension_hint": "gms",
"container_profile_family": "rt3-classic-save-container-v1",
"mechanism_family": "classic-save-rehydrate-v1",
"mechanism_confidence": "grounded",
"trailer_family": null,
"bridge_family": null,
"profile": null,
"candidate_availability_table": null,
"named_locomotive_availability_table": null,
"locomotive_catalog": null,
"cargo_catalog": null,
"company_roster": null,
"chairman_profile_table": null,
"special_conditions_table": null,
"event_runtime_collection": {
"source_kind": "packed-event-runtime-collection",
"mechanism_family": "classic-save-rehydrate-v1",
"mechanism_confidence": "grounded",
"container_profile_family": "rt3-classic-save-container-v1",
"metadata_tag_offset": 28928,
"records_tag_offset": 29184,
"close_tag_offset": 29696,
"packed_state_version": 1001,
"packed_state_version_hex": "0x000003e9",
"live_id_bound": 75,
"live_record_count": 1,
"live_entry_ids": [75],
"decoded_record_count": 1,
"imported_runtime_record_count": 0,
"records": [
{
"record_index": 0,
"live_entry_id": 75,
"payload_offset": 29186,
"payload_len": 120,
"decode_status": "parity_only",
"payload_family": "real_packed_v1",
"trigger_kind": 7,
"active": null,
"marks_collection_dirty": null,
"one_shot": false,
"compact_control": {
"mode_byte_0x7ef": 6,
"primary_selector_0x7f0": 0,
"grouped_mode_0x7f4": 2,
"one_shot_header_0x7f5": 1,
"modifier_flag_0x7f9": 0,
"modifier_flag_0x7fa": 0,
"grouped_target_scope_ordinals_0x7fb": [0, 0, 0, 0],
"grouped_scope_checkboxes_0x7ff": [1, 0, 0, 0],
"summary_toggle_0x800": 1,
"grouped_territory_selectors_0x80f": [-1, -1, -1, -1]
},
"text_bands": [],
"standalone_condition_row_count": 0,
"standalone_condition_rows": [],
"negative_sentinel_scope": null,
"grouped_effect_row_counts": [1, 0, 0, 0],
"grouped_effect_rows": [
{
"group_index": 0,
"row_index": 0,
"descriptor_id": 503,
"descriptor_label": "Add Building Slot 1",
"target_mask_bits": 8,
"parameter_family": "world_building_spawn",
"opcode": 3,
"raw_scalar_value": 1,
"value_byte_0x09": 0,
"value_dword_0x0d": 0,
"value_byte_0x11": 0,
"value_byte_0x12": 0,
"value_word_0x14": 0,
"value_word_0x16": 0,
"row_shape": "scalar_assignment",
"semantic_family": "scalar_assignment",
"semantic_preview": "Set Add Building Slot 1 to 1",
"locomotive_name": null,
"notes": [
"descriptor recovered in the checked-in effect table as shell_owned parity"
]
}
],
"decoded_conditions": [],
"decoded_actions": [],
"executable_import_ready": false,
"notes": [
"add-building descriptor is recovered but remains shell-owned parity"
]
}
]
},
"notes": [
"recovered add-building descriptor sample"
]
}
}

View file

@ -0,0 +1,134 @@
{
"format_version": 1,
"fixture_id": "packed-event-runtime-variable-condition-overlay-fixture",
"source": {
"kind": "captured-runtime",
"description": "Fixture proving runtime-variable ordinary conditions gate imported records through bounded world/company/player/territory variable surfaces."
},
"state_import_path": "packed-event-runtime-variable-condition-overlay.json",
"commands": [
{
"kind": "service_trigger_kind",
"trigger_kind": 7
},
{
"kind": "service_trigger_kind",
"trigger_kind": 8
}
],
"expected_summary": {
"calendar_projection_source": "base-snapshot-preserved",
"calendar_projection_is_placeholder": false,
"company_count": 3,
"player_count": 2,
"territory_count": 2,
"packed_event_collection_present": true,
"packed_event_record_count": 5,
"packed_event_decoded_record_count": 5,
"packed_event_imported_runtime_record_count": 5,
"event_runtime_record_count": 5,
"world_runtime_variable_count": 2,
"company_runtime_variable_owner_count": 1,
"player_runtime_variable_owner_count": 1,
"territory_runtime_variable_owner_count": 1,
"total_event_record_service_count": 5,
"total_trigger_dispatch_count": 2
},
"expected_state_fragment": {
"world_runtime_variables": {
"1": 111,
"2": 211
},
"company_runtime_variables": {
"1": {
"2": 222
}
},
"player_runtime_variables": {
"1": {
"3": 333
}
},
"territory_runtime_variables": {
"7": {
"4": 444
}
},
"packed_event_collection": {
"records": [
{
"import_outcome": "imported"
},
{
"import_outcome": "imported"
},
{
"import_outcome": "imported"
},
{
"import_outcome": "imported"
},
{
"import_outcome": "imported",
"decoded_conditions": [
{
"kind": "world_variable_threshold",
"index": 1,
"comparator": "eq",
"value": 111
},
{
"kind": "company_variable_threshold",
"target": {
"kind": "selected_company"
},
"index": 2,
"comparator": "eq",
"value": 222
},
{
"kind": "player_variable_threshold",
"target": {
"kind": "selected_player"
},
"index": 3,
"comparator": "eq",
"value": 333
},
{
"kind": "territory_variable_threshold",
"target": {
"kind": "all_territories"
},
"index": 4,
"comparator": "eq",
"value": 444
}
]
}
]
},
"event_runtime_records": [
{
"record_id": 71,
"service_count": 1
},
{
"record_id": 72,
"service_count": 1
},
{
"record_id": 73,
"service_count": 1
},
{
"record_id": 74,
"service_count": 1
},
{
"record_id": 75,
"service_count": 1
}
]
}
}

View file

@ -0,0 +1,9 @@
{
"format_version": 1,
"import_id": "packed-event-runtime-variable-condition-overlay",
"source": {
"description": "Overlay import combining company/player/territory runtime context with the runtime-variable condition sample."
},
"base_snapshot_path": "packed-event-territory-player-overlay-base-snapshot.json",
"save_slice_path": "packed-event-runtime-variable-condition-save-slice.json"
}

View file

@ -0,0 +1,479 @@
{
"format_version": 1,
"save_slice_id": "packed-event-runtime-variable-condition-save-slice",
"source": {
"description": "Tracked save-slice document proving runtime-variable ordinary conditions gate a packed world-variable effect.",
"original_save_filename": "captured-runtime-variable-condition.gms",
"original_save_sha256": "runtime-variable-condition-sample-sha256",
"notes": [
"tracked as JSON save-slice document rather than raw .smp",
"uses overlay-backed company/player/territory context while proving world/company/player/territory runtime-variable conditions together"
]
},
"save_slice": {
"file_extension_hint": "gms",
"container_profile_family": "rt3-classic-save-container-v1",
"mechanism_family": "classic-save-rehydrate-v1",
"mechanism_confidence": "grounded",
"trailer_family": null,
"bridge_family": null,
"profile": null,
"candidate_availability_table": null,
"named_locomotive_availability_table": null,
"locomotive_catalog": null,
"cargo_catalog": null,
"company_roster": null,
"chairman_profile_table": null,
"special_conditions_table": null,
"event_runtime_collection": {
"source_kind": "packed-event-runtime-collection",
"mechanism_family": "classic-save-rehydrate-v1",
"mechanism_confidence": "grounded",
"container_profile_family": "rt3-classic-save-container-v1",
"metadata_tag_offset": 33280,
"records_tag_offset": 33536,
"close_tag_offset": 34944,
"packed_state_version": 1001,
"packed_state_version_hex": "0x000003e9",
"live_id_bound": 75,
"live_record_count": 5,
"live_entry_ids": [71, 72, 73, 74, 75],
"decoded_record_count": 5,
"imported_runtime_record_count": 5,
"records": [
{
"record_index": 0,
"live_entry_id": 71,
"payload_offset": 33568,
"payload_len": 160,
"decode_status": "executable",
"payload_family": "real_packed_v1",
"trigger_kind": 7,
"one_shot": false,
"compact_control": {
"mode_byte_0x7ef": 7,
"primary_selector_0x7f0": 0,
"grouped_mode_0x7f4": 2,
"one_shot_header_0x7f5": 0,
"modifier_flag_0x7f9": 0,
"modifier_flag_0x7fa": 0,
"grouped_target_scope_ordinals_0x7fb": [0, 0, 0, 0],
"grouped_scope_checkboxes_0x7ff": [1, 0, 0, 0],
"summary_toggle_0x800": 1,
"grouped_territory_selectors_0x80f": [-1, -1, -1, -1]
},
"text_bands": [],
"standalone_condition_row_count": 0,
"standalone_condition_rows": [],
"grouped_effect_row_counts": [1, 0, 0, 0],
"grouped_effect_rows": [
{
"group_index": 0,
"row_index": 0,
"descriptor_id": 39,
"descriptor_label": "Game Variable 1",
"target_mask_bits": 8,
"parameter_family": "runtime_variable_scalar",
"opcode": 3,
"raw_scalar_value": 111,
"value_byte_0x09": 0,
"value_dword_0x0d": 0,
"value_byte_0x11": 0,
"value_byte_0x12": 0,
"value_word_0x14": 0,
"value_word_0x16": 0,
"row_shape": "scalar_assignment",
"semantic_family": "scalar_assignment",
"semantic_preview": "Set Game Variable 1 to 111",
"grouped_target_subject": "whole_game",
"grouped_target_scope": "whole_game",
"recovered_locomotive_id": null,
"locomotive_name": null,
"notes": [
"descriptor recovered from checked-in EventEffects semantic catalog"
]
}
],
"decoded_actions": [
{
"kind": "set_world_variable",
"index": 1,
"value": 111
}
],
"executable_import_ready": true,
"notes": [
"runtime variable world sample"
]
},
{
"record_index": 1,
"live_entry_id": 72,
"payload_offset": 33728,
"payload_len": 160,
"decode_status": "executable",
"payload_family": "real_packed_v1",
"trigger_kind": 7,
"one_shot": false,
"compact_control": {
"mode_byte_0x7ef": 7,
"primary_selector_0x7f0": 99,
"grouped_mode_0x7f4": 2,
"one_shot_header_0x7f5": 0,
"modifier_flag_0x7f9": 1,
"modifier_flag_0x7fa": 0,
"grouped_target_scope_ordinals_0x7fb": [1, 1, 1, 1],
"grouped_scope_checkboxes_0x7ff": [1, 0, 0, 0],
"summary_toggle_0x800": 1,
"grouped_territory_selectors_0x80f": [-1, -1, -1, -1]
},
"text_bands": [],
"standalone_condition_row_count": 0,
"standalone_condition_rows": [],
"grouped_effect_row_counts": [1, 0, 0, 0],
"grouped_effect_rows": [
{
"group_index": 0,
"row_index": 0,
"descriptor_id": 44,
"descriptor_label": "Company Variable 2",
"target_mask_bits": 1,
"parameter_family": "runtime_variable_scalar",
"opcode": 3,
"raw_scalar_value": 222,
"value_byte_0x09": 0,
"value_dword_0x0d": 0,
"value_byte_0x11": 0,
"value_byte_0x12": 0,
"value_word_0x14": 0,
"value_word_0x16": 0,
"row_shape": "scalar_assignment",
"semantic_family": "scalar_assignment",
"semantic_preview": "Set Company Variable 2 to 222",
"grouped_target_subject": "company",
"grouped_target_scope": "selected_company",
"recovered_locomotive_id": null,
"locomotive_name": null,
"notes": [
"descriptor recovered from checked-in EventEffects semantic catalog"
]
}
],
"decoded_actions": [
{
"kind": "set_company_variable",
"target": {
"kind": "selected_company"
},
"index": 2,
"value": 222
}
],
"executable_import_ready": true,
"notes": [
"runtime variable company sample"
]
},
{
"record_index": 2,
"live_entry_id": 73,
"payload_offset": 33888,
"payload_len": 160,
"decode_status": "executable",
"payload_family": "real_packed_v1",
"trigger_kind": 7,
"one_shot": false,
"compact_control": {
"mode_byte_0x7ef": 7,
"primary_selector_0x7f0": 12,
"grouped_mode_0x7f4": 2,
"one_shot_header_0x7f5": 0,
"modifier_flag_0x7f9": 0,
"modifier_flag_0x7fa": 0,
"grouped_target_scope_ordinals_0x7fb": [1, 1, 1, 1],
"grouped_scope_checkboxes_0x7ff": [1, 0, 0, 0],
"summary_toggle_0x800": 1,
"grouped_territory_selectors_0x80f": [-1, -1, -1, -1]
},
"text_bands": [],
"standalone_condition_row_count": 0,
"standalone_condition_rows": [],
"grouped_effect_row_counts": [1, 0, 0, 0],
"grouped_effect_rows": [
{
"group_index": 0,
"row_index": 0,
"descriptor_id": 49,
"descriptor_label": "Player Variable 3",
"target_mask_bits": 2,
"parameter_family": "runtime_variable_scalar",
"opcode": 3,
"raw_scalar_value": 333,
"value_byte_0x09": 0,
"value_dword_0x0d": 0,
"value_byte_0x11": 0,
"value_byte_0x12": 0,
"value_word_0x14": 0,
"value_word_0x16": 0,
"row_shape": "scalar_assignment",
"semantic_family": "scalar_assignment",
"semantic_preview": "Set Player Variable 3 to 333",
"grouped_target_subject": "player",
"grouped_target_scope": "selected_player",
"recovered_locomotive_id": null,
"locomotive_name": null,
"notes": [
"descriptor recovered from checked-in EventEffects semantic catalog"
]
}
],
"decoded_actions": [
{
"kind": "set_player_variable",
"target": {
"kind": "selected_player"
},
"index": 3,
"value": 333
}
],
"executable_import_ready": true,
"notes": [
"runtime variable player sample"
]
},
{
"record_index": 3,
"live_entry_id": 74,
"payload_offset": 34048,
"payload_len": 160,
"decode_status": "executable",
"payload_family": "real_packed_v1",
"trigger_kind": 7,
"one_shot": false,
"compact_control": {
"mode_byte_0x7ef": 7,
"primary_selector_0x7f0": 12,
"grouped_mode_0x7f4": 2,
"one_shot_header_0x7f5": 0,
"modifier_flag_0x7f9": 0,
"modifier_flag_0x7fa": 0,
"grouped_target_scope_ordinals_0x7fb": [1, 1, 1, 1],
"grouped_scope_checkboxes_0x7ff": [1, 0, 0, 0],
"summary_toggle_0x800": 1,
"grouped_territory_selectors_0x80f": [7, -1, -1, -1]
},
"text_bands": [],
"standalone_condition_row_count": 0,
"standalone_condition_rows": [],
"grouped_effect_row_counts": [1, 0, 0, 0],
"grouped_effect_rows": [
{
"group_index": 0,
"row_index": 0,
"descriptor_id": 54,
"descriptor_label": "Territory Variable 4",
"target_mask_bits": 4,
"parameter_family": "runtime_variable_scalar",
"opcode": 3,
"raw_scalar_value": 444,
"value_byte_0x09": 0,
"value_dword_0x0d": 0,
"value_byte_0x11": 0,
"value_byte_0x12": 0,
"value_word_0x14": 0,
"value_word_0x16": 0,
"row_shape": "scalar_assignment",
"semantic_family": "scalar_assignment",
"semantic_preview": "Set Territory Variable 4 to 444",
"grouped_target_subject": "territory",
"grouped_target_scope": "named_territory",
"recovered_locomotive_id": null,
"locomotive_name": null,
"notes": [
"descriptor recovered from checked-in EventEffects semantic catalog"
]
}
],
"decoded_actions": [
{
"kind": "set_territory_variable",
"target": {
"kind": "ids",
"ids": [7]
},
"index": 4,
"value": 444
}
],
"executable_import_ready": true,
"notes": [
"runtime variable territory sample"
]
},
{
"record_index": 4,
"live_entry_id": 75,
"payload_offset": 34208,
"payload_len": 224,
"decode_status": "executable",
"payload_family": "real_packed_v1",
"trigger_kind": 8,
"one_shot": false,
"compact_control": {
"mode_byte_0x7ef": 6,
"primary_selector_0x7f0": 99,
"grouped_mode_0x7f4": 2,
"one_shot_header_0x7f5": 0,
"modifier_flag_0x7f9": 2,
"modifier_flag_0x7fa": 2,
"grouped_target_scope_ordinals_0x7fb": [0, 0, 0, 0],
"grouped_scope_checkboxes_0x7ff": [1, 0, 0, 0],
"summary_toggle_0x800": 1,
"grouped_territory_selectors_0x80f": [-1, -1, -1, -1]
},
"text_bands": [],
"standalone_condition_row_count": 4,
"standalone_condition_rows": [
{
"row_index": 0,
"raw_condition_id": 2241,
"subtype": 4,
"flag_bytes": [111, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
"candidate_name": null,
"comparator": "eq",
"metric": "Game Variable 1",
"semantic_family": "numeric_threshold",
"semantic_preview": "Test Game Variable 1 == 111",
"requires_candidate_name_binding": false,
"notes": []
},
{
"row_index": 1,
"raw_condition_id": 2246,
"subtype": 4,
"flag_bytes": [222, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
"candidate_name": null,
"comparator": "eq",
"metric": "Company Variable 2",
"semantic_family": "numeric_threshold",
"semantic_preview": "Test Company Variable 2 == 222",
"requires_candidate_name_binding": false,
"notes": []
},
{
"row_index": 2,
"raw_condition_id": 2251,
"subtype": 4,
"flag_bytes": [77, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
"candidate_name": null,
"comparator": "eq",
"metric": "Player Variable 3",
"semantic_family": "numeric_threshold",
"semantic_preview": "Test Player Variable 3 == 333",
"requires_candidate_name_binding": false,
"notes": []
},
{
"row_index": 3,
"raw_condition_id": 2256,
"subtype": 4,
"flag_bytes": [188, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
"candidate_name": null,
"comparator": "eq",
"metric": "Territory Variable 4",
"semantic_family": "numeric_threshold",
"semantic_preview": "Test Territory Variable 4 == 444",
"requires_candidate_name_binding": false,
"notes": []
}
],
"negative_sentinel_scope": {
"company_test_scope": "selected_company_only",
"player_test_scope": "selected_player_only",
"territory_scope_selector_is_0x63": true,
"source_row_indexes": [0]
},
"grouped_effect_row_counts": [1, 0, 0, 0],
"grouped_effect_rows": [
{
"group_index": 0,
"row_index": 0,
"descriptor_id": 40,
"descriptor_label": "Game Variable 2",
"target_mask_bits": 8,
"parameter_family": "runtime_variable_scalar",
"opcode": 3,
"raw_scalar_value": 211,
"value_byte_0x09": 0,
"value_dword_0x0d": 0,
"value_byte_0x11": 0,
"value_byte_0x12": 0,
"value_word_0x14": 0,
"value_word_0x16": 0,
"row_shape": "scalar_assignment",
"semantic_family": "scalar_assignment",
"semantic_preview": "Set Game Variable 2 to 211",
"grouped_target_subject": "whole_game",
"grouped_target_scope": "whole_game",
"recovered_locomotive_id": null,
"locomotive_name": null,
"notes": [
"descriptor recovered from checked-in EventEffects semantic catalog"
]
}
],
"decoded_conditions": [
{
"kind": "world_variable_threshold",
"index": 1,
"comparator": "eq",
"value": 111
},
{
"kind": "company_variable_threshold",
"target": {
"kind": "condition_true_company"
},
"index": 2,
"comparator": "eq",
"value": 222
},
{
"kind": "player_variable_threshold",
"target": {
"kind": "selected_player"
},
"index": 3,
"comparator": "eq",
"value": 333
},
{
"kind": "territory_variable_threshold",
"target": {
"kind": "all_territories"
},
"index": 4,
"comparator": "eq",
"value": 444
}
],
"decoded_actions": [
{
"kind": "set_world_variable",
"index": 2,
"value": 211
}
],
"executable_import_ready": true,
"notes": [
"runtime variable conditions gate a world-variable effect"
]
}
]
},
"notes": [
"runtime variable condition executable sample"
]
}
}