Skip to content

feat: Planet buttons; CombatDebugger; Chores#1314

Merged
EttyKitty merged 14 commits into
Adeptus-Dominus:mainfrom
EttyKitty:pr/stuff
Jul 11, 2026
Merged

feat: Planet buttons; CombatDebugger; Chores#1314
EttyKitty merged 14 commits into
Adeptus-Dominus:mainfrom
EttyKitty:pr/stuff

Conversation

@EttyKitty

@EttyKitty EttyKitty commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

Summary by cubic

Adds a structured combat debugger across the combat flow and writes a detailed log at battle end. Refactors planet action UI to dynamic buttons[]/shutters[] with clearer rules, plus tighter faction/ownership logic and alerts.

  • New Features

    • Added CombatDebugger: in‑memory buffer with categories (SYSTEM, TARGETING, SHOOTING, DAMAGE, CLEANUP); flushes to combat_debug_*.log with battle info; cleaned up on destroy; includes resolve_label for readable unit names.
    • Instrumented logs across enemy/player targeting, ranged/melee decisions, scr_clean damage, array compression/column destruction, and turn start markers; flush on combat end.
  • Refactors & Fixes

    • Planet actions: replaced button1..5 with buttons[]/shutters[]; shutters auto-scale and block click-through (obj_p_fleet/obj_en_fleet and scr_void_click); rules use PlanetData.has_enemy_force()/has_any_force(); handles Space Hulk (“Raid” + “Bombard”) and clean add/remove of “+Recruiting”.
    • Systems: grouped helpers under “Global Functions”; moved format_time/format_codeblock to string utils; fixed arrays_to_string_with_counts comma bug; marine location truncation now preserves planet numerals; bomb selector shows full ship names and removes string_delete warning.
    • Factions/ownership: eFACTION enum made explicit with _COUNT and applied in enemy AI and star ownership; xenos_and_heretics() now excludes Ecclesiarchy; corrected Ork/Tyranid/Chaos/Tau reset paths, Daemon planets forced to Chaos; improved “Cleansed” alert conditions and messaging.

Written for commit a992c24. Summary will update on new commits.

Review in cubic

@EttyKitty EttyKitty changed the title I have no idea how to name composite PRs feat: I have no idea how to name composite PRs Jul 10, 2026
@github-actions github-actions Bot added the Type: Feature Adds something new label Jul 10, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 29 files

Confidence score: 5/5

  • Safe to merge after the addressed issues were fixed.

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread objects/obj_p_fleet/Draw_0.gml Outdated
Comment thread scripts/CombatDebugger/CombatDebugger.gml Outdated
Comment thread objects/obj_ncombat/Alarm_7.gml
Comment thread objects/obj_star_select/Draw_64.gml
Comment thread objects/obj_star_select/Draw_64.gml
Comment thread objects/obj_pnunit/Alarm_0.gml Outdated
Comment thread objects/obj_pnunit/Alarm_0.gml Outdated
Comment thread objects/obj_pnunit/Alarm_0.gml Outdated
Comment thread objects/obj_enunit/Alarm_0.gml Outdated
Comment thread objects/obj_enunit/Alarm_0.gml Outdated
@EttyKitty EttyKitty changed the title feat: I have no idea how to name composite PRs feat: Planet buttons; CombatDebugger; Chores Jul 10, 2026
Comment thread scripts/CombatDebugger/CombatDebugger.gml
Comment thread objects/obj_star_select/Draw_64.gml Outdated
Comment thread objects/obj_star_select/Draw_64.gml
@kilo-code-bot

kilo-code-bot Bot commented Jul 10, 2026

Copy link
Copy Markdown

Code Review Summary

Status: 1 Issue Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
objects/obj_bomb_select/Draw_0.gml 177 Comment 'Delete the string from the 20th character onwards' is misleading — the on-line truncation was removed in a prior commit; the actual pixel-based truncation now only occurs at the draw_unit_buttons call on line 184
Files Reviewed (1 file)
  • objects/obj_bomb_select/Draw_0.gml - 1 issue

Reply with @kilocode-bot fix it to have Kilo Code address this issue.

Previous Review Summaries (6 snapshots, latest commit 67f6ac5)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit 67f6ac5)

Status: 1 Issue Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
objects/obj_bomb_select/Draw_0.gml 177 Comment 'Delete the string from the 20th character onwards' is misleading — the on-line truncation was removed in a prior commit; the actual pixel-based truncation now only occurs at the draw_unit_buttons call on line 184
Files Reviewed (1 file)
  • objects/obj_bomb_select/Draw_0.gml - 1 issue

Reply with @kilocode-bot fix it to have Kilo Code address this issue.

Previous review (commit 0250487)

Status: 1 Issue Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
scripts/scr_star_ownership/scr_star_ownership.gml 49 Uses hardcoded magic number 10 instead of eFACTION.CHAOS in ownership reset block (outer condition already refactored)
Files Reviewed (5 files)
  • objects/obj_bomb_select/Draw_0.gml - 1 change (string_delete → string_truncate, equivalent behavior)
  • scripts/macros/macros.gml - eFACTION enum made explicit with _COUNT (functionally equivalent)
  • scripts/scr_draw_management_unit/scr_draw_management_unit.gml - location string refactor with planet numeral separation
  • scripts/scr_enemy_ai_a/scr_enemy_ai_a.gml - planet_saved condition simplified to xenos_and_heretics()
  • scripts/scr_star_ownership/scr_star_ownership.gml - ORK/CHAOS/TYRANIDS ownership reset logic + enum refactor (1 WARNING found)

Fix these issues in Kilo Cloud

Previous review (commit 59bda1e)

Status: 1 Issue Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
scripts/scr_star_ownership/scr_star_ownership.gml 49 Uses hardcoded magic number 10 instead of eFACTION.CHAOS in ownership reset block (outer condition already refactored)
Files Reviewed (5 files)
  • objects/obj_bomb_select/Draw_0.gml - 1 change (string_delete → string_truncate, equivalent behavior)
  • scripts/macros/macros.gml - eFACTION enum made explicit with _COUNT (functionally equivalent)
  • scripts/scr_draw_management_unit/scr_draw_management_unit.gml - location string refactor with planet numeral separation
  • scripts/scr_enemy_ai_a/scr_enemy_ai_a.gml - planet_saved condition simplified to xenos_and_heretics()
  • scripts/scr_star_ownership/scr_star_ownership.gml - ORK/CHAOS/TYRANIDS ownership reset logic + enum refactor (1 WARNING found)

Fix these issues in Kilo Cloud

Previous review (commit e68792e)

Status: No Issues Found | Recommendation: Merge

Files Reviewed (2 files)
  • objects/obj_star_select/Draw_64.gml
  • scripts/scr_void_click/scr_void_click.gml

Previous review (commit d7b48b2)

Status: 3 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 3
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
objects/obj_star_select/Draw_64.gml 60 Hit detection loop uses array_length(shutters) instead of array_length(buttons). Because shutters only grows and is never trimmed, switching from a planet with many buttons to one with fewer leaves stale shutters holding old hit rectangles. Clicking those invisible areas prevents the star-select panel from closing.
objects/obj_star_select/Draw_64.gml 157 has_enemy_force() guard was removed from the "Purge" button. The original code only offered Purge when enemy forces were present; the refactored path shows it on any populated planet where the player has a fleet, including the player's own friendly worlds.
objects/obj_star_select/Draw_64.gml 174 has_enemy_force() guard was removed from the "Purge" button. The original code only offered Purge when enemy forces were present; the refactored path shows it on any populated planet where the player has forces, including the player's own friendly worlds.
Files Reviewed (5 files)
  • objects/obj_star_select/Draw_64.gml - 3 issues
  • objects/obj_star_select/Create_0.gml
  • objects/obj_p_fleet/Draw_0.gml
  • scripts/CombatDebugger/CombatDebugger.gml
  • scripts/scr_PlanetData/scr_PlanetData.gml

Fix these issues in Kilo Cloud

Previous review (commit d236bad)

Status: 3 Issues Found | Recommendation: Address before merge

Overview

Severity Count
WARNING 3
CRITICAL 0
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
scripts/CombatDebugger/CombatDebugger.gml 135 reset() seeks to position 0 without clearing the buffer. After flush() saves and calls reset(), stale bytes from the previous battle remain. A subsequent shorter battle leaves trailing old data in the buffer; the next flush() writes those bytes to disk, producing log files with garbage from the prior battle.
objects/obj_star_select/Draw_64.gml 185 Churn button logic dropped the is_enemy guard. The original code only offered churn actions on enemy planets (if (is_enemy)); the refactored path shows them on any planet where !p_data.has_enemy_force(), including the player's own friendly worlds.
objects/obj_star_select/Draw_64.gml 279 Shutter draw loop uses shutters[i] with no bounds check. shutters has only 6 slots (initialised in Create_0.gml). If array_length(buttons) exceeds 6 (e.g. fleet actions + upgrade + recruiting), shutters[6] is an out-of-bounds read.
Files Reviewed (8 files)
  • scripts/CombatDebugger/CombatDebugger.gml - 1 issue
  • objects/obj_star_select/Draw_64.gml - 2 issues
  • objects/obj_star_select/Create_0.gml
  • objects/obj_star_select/obj_star_select.yy
  • objects/obj_p_fleet/Draw_0.gml
  • objects/obj_ncombat/Alarm_7.gml
  • objects/obj_ncombat/CleanUp_0.gml
  • objects/obj_ncombat/Create_0.gml
  • objects/obj_ncombat/KeyPress_13.gml
  • objects/obj_ncombat/obj_ncombat.yy
  • objects/obj_enunit/Alarm_0.gml
  • objects/obj_pnunit/Alarm_0.gml
  • scripts/scr_PlanetData/scr_PlanetData.gml
  • scripts/scr_array_functions/scr_array_functions.gml
  • scripts/scr_array_functions/scr_array_functions.yy
  • scripts/scr_clean/scr_clean.gml
  • scripts/scr_general_variable_functions/scr_general_variable_functions.yy
  • scripts/scr_ini_functions/scr_ini_functions.yy
  • scripts/scr_json_functions/scr_json_functions.yy
  • scripts/scr_logging_functions/scr_logging_functions.gml
  • scripts/scr_logging_functions/scr_logging_functions.yy
  • scripts/scr_serialization_functions/scr_serialization_functions.yy
  • scripts/scr_string_functions/scr_string_functions.gml
  • scripts/scr_string_functions/scr_string_functions.yy
  • scripts/scr_struct_functions/scr_struct_functions.yy
  • scripts/scr_void_click/scr_void_click.gml

Fix these issues in Kilo Cloud


Reviewed by step-3.7-flash-20260528 · Input: 543.2K · Output: 79K · Cached: 7.4M

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 5 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread objects/obj_star_select/Draw_64.gml
Comment thread objects/obj_star_select/Draw_64.gml
Comment thread objects/obj_star_select/Draw_64.gml
Comment thread objects/obj_star_select/Draw_64.gml
Comment thread objects/obj_star_select/Draw_64.gml
cubic-dev-ai[bot]
cubic-dev-ai Bot previously approved these changes Jul 10, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 issues found across 2 files (changes from recent commits).

Re-trigger cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 5 files (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread objects/obj_bomb_select/Draw_0.gml Outdated
Comment thread scripts/scr_enemy_ai_a/scr_enemy_ai_a.gml Outdated
Comment thread scripts/scr_star_ownership/scr_star_ownership.gml Outdated
Comment thread scripts/scr_enemy_ai_a/scr_enemy_ai_a.gml Outdated
Comment thread scripts/scr_star_ownership/scr_star_ownership.gml Outdated
Comment thread scripts/scr_star_ownership/scr_star_ownership.gml Outdated

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 4 files (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread objects/obj_bomb_select/Draw_0.gml Outdated
Comment thread objects/obj_bomb_select/Draw_0.gml Outdated

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 issues found across 1 file (changes from recent commits).

Requires human review: Auto-approval blocked by 1 unresolved issue from previous reviews.

Re-trigger cubic

@EttyKitty EttyKitty merged commit eb1d9e5 into Adeptus-Dominus:main Jul 11, 2026
5 checks passed
@EttyKitty EttyKitty deleted the pr/stuff branch July 11, 2026 00:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Size: Big Type: Feature Adds something new

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant