Combat Basics logo

Combat Basics

Organization
SummerEngine
combat-basics

Damage: hitbox and hurtbox Areas, a reusable Health component, damage signals, knockback, projectiles.

Overview

PublisherSummerEngine
Repositorysummer
Skill namecombat-basics
Stars
91
Forks
8
Bundled files
2
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 2 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by SummerEngine on GitHub. Read the source before you install it.

Installation

Install the Combat Basics AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/SummerEngine/summer/tree/main/library/skills/combat-basics
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/SummerEngine/summer.git /tmp/summer
mkdir -p .claude/skills
cp -r /tmp/summer/library/skills/combat-basics .claude/skills/combat-basics
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Combat Basics in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Combat Basics on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Combat Basics is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Combat Basics

The standard combat pattern is hitbox + hurtbox + health, wired by signals. Build it component-first: the same three pieces work for player, enemies, and destructibles.

The layer model (set this up first)

Attacks are Area2D/Area3D, not solid bodies. A hitbox (the attack) detects a hurtbox (the thing that can be hurt) via collision layers/masks:

Nodeon layermasks (detects)
Player hurtboxPlayerHurtEnemyHit
Player hitbox (sword)PlayerHitEnemyHurt
Enemy hurtboxEnemyHurtPlayerHit
Enemy hitboxEnemyHitPlayerHurt

Rule: every combat Area masks only the OPPOSING side. This is why the player's sword never damages the player. An Area reports area_entered only for areas on a layer in its OWN mask, so the hurtbox below (which listens) must mask the opposing hitbox layer; a hurtbox with an empty mask never registers a hit.

Name the layers once so you are not counting bits by hand — summer_project_setting(key="layer_names/2d_physics/layer_4", value="PlayerHit") (use layer_names/3d_physics/... for 3D), one call per layer.

Health component (reuse everywhere)

Attach to any damageable node. It owns HP and fires signals; UI and death logic just listen.

gdscript
class_name Health extends Node

signal damaged(amount: int, current: int)
signal died

@export var max_health: int = 100
var current: int

func _ready() -> void:
	current = max_health

func take_damage(amount: int) -> void:
	if current <= 0:
		return
	current = maxi(0, current - amount)
	damaged.emit(amount, current)
	if current == 0:
		died.emit()

func heal(amount: int) -> void:
	current = mini(max_health, current + amount)

Hurtbox -> Health

The hurtbox is an Area on the body; when a hitbox overlaps it, read the hitbox's damage and route it to the Health node.

gdscript
extends Area2D   # Hurtbox, child of the character

@export var health_path: NodePath
@onready var health: Health = get_node(health_path)

func _ready() -> void:
	area_entered.connect(_on_area_entered)

func _on_area_entered(hitbox: Area2D) -> void:
	if hitbox.has_method("get_damage"):
		health.take_damage(hitbox.get_damage())

Hitbox

gdscript
extends Area2D   # Hitbox, child of weapon or attack

@export var damage: int = 10
func get_damage() -> int:
	return damage

Enable the hitbox only during the active frames of a swing (toggle monitoring/monitorable or the CollisionShape's disabled), driven by an AnimationPlayer track. An always-on melee hitbox hits on touch, which feels wrong.

Death, knockback, feedback

  • On died: queue_free(), spawn a death VFX, drop loot, add_kill() on your game manager. For the player, switch to a GAME_OVER state instead of freeing.
  • Knockback: push the victim velocity = (victim.global_position - attacker.global_position).normalized() * force, decay it each frame.
  • Every hit needs feedback or it reads as broken: a flash (modulate to white for 0.05s), a damage number (floating Label), a small screen shake, a hitstop (Engine.time_scale = 0.05 for one frame). Silent damage feels like a no-op.

Projectiles (short version)

An Area2D/3D that moves forward and calls take_damage on what it hits, then frees itself.

gdscript
extends Area2D   # projectile

@export var speed: float = 600.0
@export var damage: int = 15
var direction: Vector2 = Vector2.RIGHT

func _ready() -> void:
	body_entered.connect(_on_hit)
	get_tree().create_timer(3.0).timeout.connect(queue_free)  # lifetime

func _physics_process(delta: float) -> void:
	position += direction * speed * delta

func _on_hit(body: Node) -> void:
	if body.has_node("Health"):
		body.get_node("Health").take_damage(damage)
	queue_free()

Homing, piercing, AoE, and pooling many bullets are in this skill's references/projectiles-and-aoe.md — read it only when you need one of those.

Traps

  • Hitbox on the wrong layer/mask = no hits or friendly fire. Verify the layer table above before debugging the scripts.
  • Two Areas with neither monitoring nor monitorable never report overlap.
  • Freeing a node mid-signal can error - defer with queue_free() (safe), not free().
  • Damaging in _process instead of on overlap = continuous per-frame damage.

Applying it in Summer Engine

  • Scripts (health.gd, hurtbox.gd, hitbox.gd, projectile.gd) are files: create with summer_write_file(path=..., content=..., create_only=true), change with summer_replace_text. Check each with summer_get_script_errors.
  • Nodes (the Area, its CollisionShape, the Health child) are scene mutations: summer_add_node / summer_set_prop with scenePath, or one summer_batch with AddNode / SetProp ops so the scene saves once. Set collision_layer and collision_mask as integers (bit values), not layer names.
  • Prove a hit with a RunVerification probe (see playtesting-a-feature): spawn or find one enemy, press the attack action, report() the enemy's Health.current before and after. A static scene check cannot show that a hit registered.

From a shell

No Summer MCP tools in this session? Run each one as a command; when summer --version is missing or below 4.0, use npx -y summer-engine@latest in place of summer. Fields are flags in kebab-case (--scene-path res://main.tscn) or one --input '<json>', and summer ops describe <op> prints the exact input. The summer-cli skill has the rest.

In this skillCommand
summer_add_nodesummer engine add-node
summer_batchsummer engine batch
summer_get_diagnosticssummer engine get-diagnostics
summer_get_script_errorssummer engine get-script-errors
summer_project_settingsummer engine project-setting
summer_read_filesummer engine read-file
summer_replace_textsummer engine replace-text
summer_save_scenesummer engine save-scene
summer_set_propsummer engine set-prop
summer_write_filesummer engine write-file

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Combat Basics AI skill do?

Damage: hitbox and hurtbox Areas, a reusable Health component, damage signals, knockback, projectiles.

Why use Combat Basics on TypingMind?

Because you install it once and use it with any model. Combat Basics is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Combat Basics in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/SummerEngine/summer/tree/main/library/skills/combat-basics. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Combat Basics?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Combat Basics?

As many as you like. As long as a model supports skills, you can use Combat Basics with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Combat Basics AI skill free?

Yes. It is published on GitHub by SummerEngine under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇