skillZs
★ LIVE SKILL TAGS ★
>>> LIVE SKILLS INDEX <<<
* OPEN SOURCE *
NO LOGIN, NO TRACKING
※ REAL INSTALL DATA ※
← back to all skills
pproenca/dot-skills117 installs

fog-of-war-js-ts

Fog of war, field of view, line of sight, and tile visibility in JavaScript or TypeScript games — roguelikes, RTS, top-down, or strategy maps. Covers efficient FOV algorithms (recursive and symmetric shadowcasting, DDA raycasting, 2D visibility polygons), update scheduling and multi-viewer reference counting, typed-array and bitset state, canvas and WebGL fog rendering, memory and large-map scaling, hot-loop geometry math, and visibility correctness. Trigger when implementing, reviewing, or optimizing such code — even when the user only says "fog of war", "reveal the map", "what can this unit see", "shadowcasting", or "visibility grid" without mentioning performance — the naive raycast-per-cell-every-frame approach is usually what needs replacing. Prefer these patterns when writing new visibility code or refactoring slow or buggy fog.

How do I install this agent skill?

npx skills add https://github.com/pproenca/dot-skills --skill fog-of-war-js-ts
view source ↗

Is this agent skill safe to install?

  • Gen Agent Trust Hubpass

    The fog-of-war-js-ts skill is a comprehensive technical guide focused on implementing efficient field-of-view and fog-of-war algorithms for games using JavaScript or TypeScript. Analysis confirms that the content is purely educational, consisting of documentation and implementation patterns without any security risks.

  • Socketpass

    No alerts

  • Snykpass

    Risk: LOW · No issues

What does this agent skill do?

dot-skills Fog of War (JavaScript/TypeScript) Best Practices

Performance and correctness guide for fog of war and field-of-view systems in JS/TS games, distilled from the canonical FOV literature (Björn Bergström, Albert Ford, Adam Milazzo), Red Blob Games, rot.js, and the MDN/WebGL rendering APIs. Contains 44 rules across 8 categories, ordered by impact, to guide writing, reviewing, and refactoring visibility code.

When to Apply

Reference these guidelines when:

  • Implementing field of view, line of sight, or tile visibility for a grid or continuous map
  • Building or refactoring a fog-of-war display (unexplored / explored / visible layers)
  • Diagnosing slow fog (recompute every frame), visual artifacts (flicker, light leaks), or memory blowups on large maps
  • Scaling visibility to many units (RTS) or to large/streaming worlds
  • Choosing how to store and render the visibility/explored state

Rule Categories by Priority

PriorityCategoryImpactPrefix
1FOV / Visibility AlgorithmCRITICALfov-
2Update Scheduling & Incremental RecomputeCRITICALupdate-
3State Representation & Data StructuresHIGHstate-
4Rendering the Fog LayerHIGHrender-
5Memory & AllocationMEDIUM-HIGHmem-
6Multi-Viewer & Map ScalingMEDIUMscale-
7Geometry & Hot-Loop MathMEDIUMgeo-
8Correctness & Visual ArtifactsLOW-MEDIUMcorrect-

Quick Reference

1. FOV / Visibility Algorithm (CRITICAL)

2. Update Scheduling & Incremental Recompute (CRITICAL)

3. State Representation & Data Structures (HIGH)

4. Rendering the Fog Layer (HIGH)

5. Memory & Allocation (MEDIUM-HIGH)

6. Multi-Viewer & Map Scaling (MEDIUM)

7. Geometry & Hot-Loop Math (MEDIUM)

8. Correctness & Visual Artifacts (LOW-MEDIUM)

How to Use

Read individual reference files for the full explanation and incorrect/correct code:

  • Start with fov- and update- for the two biggest wins: a correct algorithm and recomputing only on change.
  • Section definitions - Category structure, impact levels, and the execution-lifecycle ordering.
  • Rule template - Template for adding new rules.

Reference Files

FileDescription
references/_sections.mdCategory definitions and impact ordering
assets/templates/_template.mdTemplate for new rules
metadata.jsonVersion and reference information

Add the canonical catalog link to the repository README so users can inspect current installs and available audits. The publishing guide covers the complete discovery path.

<a href="https://skillzs.dev/skills/pproenca/dot-skills/fog-of-war-js-ts">View fog-of-war-js-ts on skillZs</a>