Godot genre moba

From nix-community/nur-combined · View interactive version

Godot genre moba is an AI agent skill from the GitHub repository nix-community/nur-combined. Expert blueprint for MOBA games including lane logic (minion wave spawning every 30s), tower aggro priority (hero attacking ally over minion over hero), click-to-move controls (RTS-style raycasting), hero ability systems (QWER cooldowns, mana cost), fog of war (SubViewport projections), and authorit

How to use this skill

Skill file

Genre: MOBA (Multiplayer Online Battle Arena)

Expert blueprint for MOBAs emphasizing competitive balance and strategic depth.

NEVER Do (Expert Anti-Patterns)

Networking & Authority

AI & Pathfinding

Gameplay & Balancing

Technical & Performance


🛠 Expert Components (scripts/)

Original Expert Patterns

Modular Components


Core Loop

  1. Lane: Player farms minions for gold/XP in a designated lane.
  2. Trade: Player exchanges damage with opponent hero.
  3. Gank: Player roams to other lanes to surprise enemies.
  4. Push: Team destroys towers to open the map.
  5. End: Destroy the enemy Core/Nexus.

Skill Chain

| Phase | Skills | Purpose |

|-------|--------|---------|

| 1. Control | rts-controls | Right-click to move, A-move, Stop |

| 2. AI | godot-navigation-pathfinding | Minion waves, Tower aggro logic |

| 3. Combat | godot-ability-system, godot-rpg-stats | QWER abilities, cooldowns, scaling |

| 4. Network | godot-multiplayer-networking | Authority, lag compensation, prediction |

| 5. Map | godot-3d-world-building | Lanes, Jungle, River, Bases |

Architecture Overview

1. Lane Manager

Spawns waves of minions periodically.

# lane_manager.gd
extends Node

@export var lane_path: Path3D
@export var spawn_interval: float = 30.0
var timer: float = 0.0

func _process(delta: float) -> void:
    timer -= delta
    if timer <= 0:
        spawn_wave()
        timer = spawn_interval

func spawn_wave() -> void:
    # Spawn 3 Melee, 3 Ranged, 1 Cannon (every 3rd wave)
    for i in range(3):
        spawn_minion(MeleeMinion, lane_path)
        await get_tree().create_timer(1.0).timeout

2. Minion AI

Simple but follows strict rules.

# minion_ai.gd
extends CharacterBody3D

enum State { MARCH, COMBAT }
var current_target: Node3D

func _physics_process(delta: float) -> void:
    match state:
        State.MARCH:
            move_along_path()
            scan_for_enemies()
        State.COMBAT:
            if is_instance_valid(current_target):
                attack(current_target)
            else:
                state = State.MARCH

3. Tower Aggro Logic

The most misunderstood mechanic by new players.

# tower.gd
func _on_aggro_check() -> void:
    # Priority 1: Enemy Hero attacking Ally Hero
    # Priority 2: Enemy Unit attacking Ally Hero
    # Priority 3: Closest Enemy Minion
    # Priority 4: Closest Enemy Hero
    var target = determine_best_target()
    if target:
        shoot_at(target)

4. Skill-Shot Ability Cycle

Implementation pattern for "QWER" targeting:

  1. Idle: Waiting for input.
  2. Telegraphed: Show indicator (skill_shot_indicator.gd) while mouse is held.
  3. Active: Spawn hitbox/projectile on release.
  4. Recovery: Brief backswing animation where movement/casting is locked.

Key Mechanics Implementation

Click-to-Move (RTS Style)

Raycasting from camera to terrain.

func _unhandled_input(event: InputEvent) -> void:
    if event.is_action_pressed("move"):
        var result = raycast_from_mouse()
        if result:
            nav_agent.target_position = result.position

Ability System (Data Driven)

Defining "Fireball" or "Hook" without unique scripts for everything.

# ability_data.gd
class_name Ability extends Resource
@export var cooldown: float
@export var mana_cost: float
@export var damage: float
@export var effect_scene: PackedScene

Godot-Specific Tips

Common Pitfalls

  1. Snowballing: Winning team gets too strong too fast. Fix: Implement "Comeback XP/Gold" mechanisms (bounties).
  2. Pathfinding Lag: 100 minions pathing every frame. Fix: Distribute pathfinding updates over multiple frames (Time Slicing).
  3. Hacking: Client says "I dealt 1000 damage". Fix: Client says "I cast Spell Q at Direction V". Server calculates damage.

Reference

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.