Skip to content
godot-clean-conflicts logo

Clean Conflicting Operations

godot-clean-conflicts

Use when Godot code has operations that conflict with each other, creating undefined behavior. Detects same property set in multiple places (_ready, _process, code + editor), same signal connected multiple times, conflicting physics modes, competing animations. Automatically resolves conflicts wi...

Asreonn/godot-superpowers0installs4stars

SKILL.md

Full skill instructions

Clean Conflicting Operations

Core Principle

One source of truth per property. Conflicting operations create undefined behavior and debugging nightmares.

What This Skill Does

Finds patterns like:

# player.gd
func _ready():
    position = Vector2(100, 100)  # Code sets position
    # BUT: .tscn also has position = Vector2(200, 200)
    # CONFLICT: Which position wins?

func _process(delta):
    rotation += delta  # Animation system ALSO modifying rotation
    # CONFLICT: Animation vs code control

Resolves to clear ownership:

# player.gd
# Position is set in .tscn (editor owns position)
# Rotation is controlled by animation (animation owns rotation)

func _process(delta):
    # Rotation conflict removed
    pass

Detection Patterns

Identifies:

Property Conflicts

  • Same property set in code (_ready) and editor (.tscn)
  • Same property modified in _process and _physics_process
  • Property controlled by animation AND code simultaneously

Signal Conflicts

  • Same signal connected multiple times
  • Duplicate lambda connections
  • Signal connect without checking is_connected()

Physics Conflicts

  • RigidBody with code-controlled position (conflicts with physics)
  • CharacterBody with physics_process AND animation control
  • Conflicting collision layers/​masks (code vs editor)

Animation Conflicts

  • AnimationPlayer and code both modifying same property
  • Multiple AnimationPlayers controlling same nodes
  • Tween and animation competing for control

When to Use

You're Debugging Unexpected Behavior

Properties have wrong values and you don't know why.

You're Experiencing Race Conditions

Sometimes works, sometimes doesn't (timing-dependent).

You're Seeing Duplicate Events

Signal fires twice, actions happen multiple times.

You're Fighting the Physics Engine

Code tries to control physics body directly.

Process

  1. Scan - Find conflicting operations across code and scenes
  2. Analyze - Determine which operation should own each property
  3. Resolve - Apply conflict resolution strategy
  4. Document - Add comments explaining ownership
  5. Validate - Ensure behavior is now deterministic
  6. Commit - Git commit per conflict resolution

Example Transformations

Conflict 1: Position Set in Both Code and Editor

Before (Conflict):

# enemy.gd
func _ready():
    position = Vector2(500, 300)  # Code says here

# enemy.tscn
[node name="Enemy" type="CharacterBody2D"]
position = Vector2(100, 100)  # Editor says here
# RESULT: Confusing! Editor shows one place, game uses another

After (Resolved - Editor Wins):

# enemy.gd
func _ready():
    # Position is set in scene file for editor visibility
    pass

# enemy.tscn
[node name="Enemy" type="CharacterBody2D"]
position = Vector2(500, 300)  # Updated to match intended position
# RESULT: What You See Is What You Get

Conflict 2: Duplicate Signal Connections

Before (Conflict):

# ui.gd
func _ready():
    button.pressed.connect(_on_button_pressed)

func setup_ui():
    button.pressed.connect(_on_button_pressed)  # CONNECTED AGAIN!
    # RESULT: _on_button_pressed fires TWICE per click

After (Resolved):

# ui.gd
func _ready():
    if not button.pressed.is_connected(_on_button_pressed):
        button.pressed.connect(_on_button_pressed)

func setup_ui():
    # Connection already exists, skip
    pass
# RESULT: Fires exactly once per click

Conflict 3: Animation vs Code Control

Before (Conflict):

# player.gd
func _process(delta):
    sprite.rotation += delta * rotation_speed  # Code controls rotation

# player.tscn has AnimationPlayer controlling sprite.rotation
# RESULT: Jittery rotation, both systems fighting

After (Resolved - Animation Wins):

# player.gd
func _process(delta):
    # Rotation is controlled by animation system
    # Code can trigger animations: animation_player.play("rotate")
    pass

# AnimationPlayer has full control of sprite.rotation
# RESULT: Smooth animation, clear ownership

Conflict 4: Physics Body Position Control

Before (Conflict):

# enemy.gd
extends RigidBody2D

func _physics_process(delta):
    position = target_position  # CONFLICT with physics engine!
    # Physics engine wants to control position
    # Code also tries to control position
    # RESULT: Jittery movement, physics fighting code

After (Resolved - Use Correct Body Type):

# enemy.gd
extends CharacterBody2D  # Changed to CharacterBody for code control

func _physics_process(delta):
    position = target_position  # Now appropriate for CharacterBody
    # CharacterBody2D is designed for code-controlled movement
    # RESULT: Smooth movement, no conflict

Alternative Resolution (Keep RigidBody):

# enemy.gd
extends RigidBody2D

func _physics_process(delta):
    # Use forces instead of direct position control
    apply_force((target_position - position) * force_strength)
    # Work WITH physics engine, not against it
    # RESULT: Realistic physics-based movement

Conflict Resolution Strategies

1. Editor Wins (Position/​Rotation/​Scale)

Move code-defined values to .tscn for editor visibility.

2. Code Wins (Dynamic State)

Remove editor values when code needs full control.

3. Animation Wins (Animated Properties)

Code triggers animations, doesn't modify properties directly.

4. Physics Wins (RigidBody)

Use forces/​impulses instead of direct property control.

5. One-Time Initialization

Establish clear pattern: editor for initial, code for changes.

What Gets Created

  • Conflict resolution documentation
  • Comments explaining ownership decisions
  • Updated code removing conflicts
  • Updated .tscn files with correct values
  • Git commits per conflict type resolved

Smart Analysis

Detects conflict severity:

  • Critical - Causes crashes or data corruption
  • High - Causes incorrect behavior
  • Medium - Causes performance issues
  • Low - Causes confusion but works

Prioritizes resolution:

  1. Critical conflicts first
  2. High-impact conflicts
  3. Performance conflicts
  4. Clarity conflicts

Integration

Works with:

  • godot-sync-static-positions - Resolves position conflicts specifically
  • godot-split-scripts - Separation helps prevent conflicts
  • godot-refactor (orchestrator) - Runs as part of full refactoring

Safety

  • Each resolution strategy validated
  • Behavior preserved or intentionally changed with approval
  • Rollback on validation failure
  • Original code preserved in git history

When NOT to Use

Don't "fix" if:

  • Intentional override pattern (editor default, code overrides)
  • Temporary value (code initializes, then releases control)
  • State machine pattern (different modes own property at different times)
  • Animation blending (intentional property sharing)

Not all conflicts are bugs - some are architectural patterns.

Common Conflicts

Conflict TypeSymptomResolution
Position in _ready + .tscnWrong position in gameEditor wins (move to .tscn)
Duplicate signal connectionEvent fires multiple timesCheck is_connected() first
Animation + code rotationJittery animationAnimation wins (remove code)
RigidBody position controlPhysics glitchesUse forces instead
_process + _physics_processInconsistent behaviorChoose one based on need

Benefits

  • Predictability - Behavior is deterministic
  • Debuggability - Clear ownership makes issues obvious
  • Performance - No redundant operations
  • Maintainability - Clear patterns for future changes
  • WYSIWYG - Editor preview matches game behavior

Documentation Added

For each resolution, adds comments like:

# Position is controlled by .tscn (editor-visible)
# Rotation is controlled by AnimationPlayer "idle"
# Scale is controlled by code (dynamic resizing)

Clear ownership = clear code.

More skills from Asreonn

godot-sync-camera-positions logo
Asreonn/godot-superpowers

godot-sync-camera-positions

Use when Godot background layers or elements follow the camera at runtime but show incorrect position in editor. Detects camera-following patterns and syncs editor position to match typical runtime state. Makes editor preview accurately show what players will see during gameplay.

4 0
View
godot-refactor logo
Asreonn/godot-superpowers

godot-refactor

Use when Godot project has code-created objects, tight coupling via direct references, monolithic scripts over 150 lines, or needs scene-first architecture with signals and composition. Orchestrates all 5 code quality mini-skills: extract-to-scenes, split-scripts, add-signals, extract-resources, ...

4 0
View
godot-split-scripts logo
Asreonn/godot-superpowers

godot-split-scripts

Use when Godot scripts exceed 150 lines or have multiple responsibilities. Detects scripts doing too many things (player movement + combat + inventory + UI). Automatically splits into focused scripts following Single Responsibility Principle, preserves behavior exactly, and creates git commits pe...

4 0
View
godot-convert-shaders logo
Asreonn/godot-superpowers

godot-convert-shaders

Converts Godot 3.x shader code to Godot 4.x shader syntax. Updates SCREEN_TEXTURE to screen_texture uniform, DEPTH_TEXTURE to depth_texture uniform, texture() function changes, built-in varyings updates, and light function signature changes. Essential for rendering and visual effect migrations.

4 0
View
godot-migrate-tilemap logo
Asreonn/godot-superpowers

godot-migrate-tilemap

Migrates legacy TileMap (Godot 4.0-4.2) to new TileMapLayer system (Godot 4.3+). Handles TileMap node conversion, API migration (set_cell to set_cells_terrain_connect), TileSet resource updates, physics layer mapping, navigation layer conversion, and custom data preservation. Essential for upgrad...

4 0
View
godot-setup-animationtree logo
Asreonn/godot-superpowers

godot-setup-animationtree

Use when setting up AnimationTree nodes for state machine-driven animation, creating AnimationNodeStateMachine graphs, configuring BlendSpace2D/3D for locomotion blending, implementing state transition conditions, or creating animation blend trees for complex animation mixing. Supports player cha...

4 0
View
godot-extract-resources logo
Asreonn/godot-superpowers

godot-extract-resources

Use when Godot code has hardcoded game data in const arrays, dictionaries, or embedded values. Detects inline data like enemy stats, item definitions, level configurations. Automatically extracts to .tres resource files, making data visible in editor, easily modifiable, and supports data-driven d...

4 0
View
godot-modernize-input logo
Asreonn/godot-superpowers

godot-modernize-input

Use when handling input in Godot 4.x projects and need to modernize patterns. Generates Input Map configurations from hardcoded key checks, sets up joypad rumble (Godot 4.x feature), implements gyroscope/accelerometer input on mobile, creates context-sensitive input handling for different game st...

4 0
View
godot-sync-parallax logo
Asreonn/godot-superpowers

godot-sync-parallax

Use when Godot ParallaxBackground/ParallaxLayer nodes show incorrect positions in editor due to parallax multipliers. Calculates correct editor positions based on camera start position and parallax motion scale. Makes parallax layers preview realistically in editor, matching gameplay appearance.

4 0
View
godot-setup-export logo
Asreonn/godot-superpowers

godot-setup-export

Use when setting up multi-platform exports for Godot projects, configuring export presets, icons, feature tags, build scripts, or CI/CD pipelines

4 0
View
godot-generate-tests logo
Asreonn/godot-superpowers

godot-generate-tests

Use when developing Godot games and need comprehensive test coverage for GDScript classes, signals, scene initialization, and integration flows. Generates GUT framework unit tests, integration tests, mock/stub helpers, and CI/CD test runner configuration.

4 0
View
godot-fix-positions logo
Asreonn/godot-superpowers

godot-fix-positions

Use when Godot project has position conflicts between editor (.tscn) and code (.gd), camera-following backgrounds, or runtime positions don't match editor preview. Orchestrates all 3 position sync mini-skills: sync-static-positions, sync-camera-positions, and sync-parallax. Each operation targets...

4 0
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View