rpd:line_of_sight
Differences
This shows you the differences between two versions of the page.
| rpd:line_of_sight [2025/12/20 03:24] – Update line_of_sight page with code references and technical details mike | rpd:line_of_sight [2025/12/20 03:29] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Line of Sight ====== | ||
| + | **Line of Sight** is a fundamental game mechanic that determines what areas and entities the hero can see and interact with. | ||
| + | |||
| + | ==== Basic Concept ==== | ||
| + | * Line of sight determines which tiles are visible to the hero | ||
| + | * The hero can typically see in a circular radius around their position | ||
| + | * Walls and other solid obstacles block line of sight | ||
| + | * Some effects can extend or restrict the hero's line of sight | ||
| + | |||
| + | ==== Applications ==== | ||
| + | * **Movement**: | ||
| + | * **Ranged Attacks**: Ranged weapons require an unobstructed line of sight to the target | ||
| + | * **Spells**: Many spells require line of sight to affect targets | ||
| + | * **Detection**: | ||
| + | |||
| + | ==== Mechanics ==== | ||
| + | * Light sources can affect line of sight in dark areas | ||
| + | * Some abilities or items can grant extended vision | ||
| + | * Darkness or fog effects can reduce line of sight | ||
| + | * Certain terrain features may block or redirect line of sight | ||
| + | * Implemented using the **ShadowCaster** class which calculates visibility from a central point | ||
| + | |||
| + | ==== Technical Implementation ==== | ||
| + | * The game maintains a boolean array `fieldOfView` for each level which tracks visibility | ||
| + | * Uses ShadowCaster algorithm to determine visible cells from character position | ||
| + | * LOS blocking terrain is flagged using TerrainFlags.LOS_BLOCKING | ||
| + | * Level objects can also block line of sight with the `losBlocker()` method | ||
| + | |||
| + | ==== Code References ==== | ||
| + | * Core implementation: | ||
| + | * Level visibility: [[https:// | ||
| + | * LOS blocking flags: [[https:// | ||
| + | * Level objects LOS: [[https:// | ||
| + | |||
| + | ==== Related Pages ==== | ||
| + | * [[rpd: | ||
| + | * [[rpd: | ||
| + | * [[rpd: | ||
| + | * [[rpd: | ||
| + | |||
| + | {{tag> rpd mechanics}} | ||
rpd/line_of_sight.txt · Last modified: by 127.0.0.1
