fs-gg-line-drawing

Calculates Bresenham and supercover lines and checks grid-based line-of-sight with opacity predicates.

Updated Jul 6, 2026
One-click install
npx skills add https://github.com/FS-GG/FS.GG.Game --skill fs-gg-line-drawing
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: fs-gg-line-drawing
Source: https://github.com/FS-GG/FS.GG.Game/tree/main/template/product-skills/fs-gg-line-drawing
Command: npx skills add https://github.com/FS-GG/FS.GG.Game --skill fs-gg-line-drawing

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill enables the drawing of straight lines between two grid cells and checking line-of-sight in a grid-based simulation, essential for pathfinding, visibility, and collision detection.

Core Features & Use Cases

  • Line Drawing: Calculate the Bresenham line between two cells and the supercover line that touches every cell.
  • Line-of-Sight: Determine if one cell is visible from another based on an opacity predicate.
  • Use Case: This Skill can be used to determine if a unit can see or attack another unit in a grid-based game.

Quick Start

Use the fs-gg-line-drawing skill to draw a line from cell (0,0) to cell (5,2) and check if cell (0,0) can see cell (5,2).

Frequently Asked Questions about fs-gg-line-drawing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I calculate a line of sight on a grid between two points?

Line of sight on a grid is calculated by tracing a line between two cells and evaluating an opacity predicate along the path. If no opaque cells block the traced path, visibility between the two points is confirmed.

What is the difference between Bresenham and supercover line drawing on a grid?

Bresenham line drawing calculates a minimal path of cells between two points, while supercover line drawing includes every cell the geometric line touches. Supercover ensures complete grid coverage for collision detection.

How do I check if a unit can see another unit in a grid-based game?

To check unit visibility, trace a line between the two unit cells and apply an opacity predicate to each cell in the path. If the predicate identifies no blocking obstacles, the target unit is visible.

Do I need integer-based geometry to use grid line drawing for pathfinding?

Yes, integer-based geometry calculations are required for grid line drawing. A consistent grid cell indexing system must be maintained to accurately calculate lines and perform collision detection.

When should I use supercover lines instead of standard Bresenham lines for collision detection?

Use supercover lines when collision detection requires identifying every grid cell intersected by a path. Standard Bresenham lines provide a minimal cell path, potentially missing edge collisions that supercover captures.