User Tools

Site Tools


en:rpd:ballistica_mechanic

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

en:rpd:ballistica_mechanic [2026/01/01 19:45] – namespace move Mikeen:rpd:ballistica_mechanic [2026/01/01 19:46] (current) – external edit 127.0.0.1
Line 1: Line 1:
 +====== Ballistica System ======
  
 +{{ rpd:images:ballistica_system.png|Ballistica System }}
 +
 +The **Ballistica System** is the line-of-sight and pathfinding system used in Remixed Dungeon to determine if a ranged attack can hit its target.
 +
 +==== Description ====
 +The Ballistica system is used to calculate line of sight between two points in the dungeon and to determine valid paths for ranged attacks, projectiles, and zapping abilities. It's named after the Italian word "ballistica" meaning ballistics.
 +
 +==== Mechanics ====
 +  * **Line of Sight (LoS):** Determines if there's an unblocked path between attacker and target
 +  * **Path Calculation:** Finds a potential path for direct ranged attacks
 +  * **Range Limitation:** Sets the maximum effective range of ranged abilities
 +  * **Obstacle Handling:** Accounts for walls, doors, and other environmental obstacles
 +
 +==== Usage ====
 +  * **Zapping Attacks:** Used to determine if a zapping mob (like Warlock) can hit a target
 +  * **Wand Usage:** Determines valid targets for wands
 +  * **Projectile Weapons:** Used for ranged weapon targeting
 +  * **Trap Triggers:** Some traps use Ballistica for activation detection
 +
 +==== Technical Details ====
 +  * **Path Length:** Returns the length of the calculated path
 +  * **Obstacle Detection:** Stops pathfinding when encountering blocking terrain
 +  * **Direct Line Path:** Calculates straight-line paths factoring in dungeon geometry
 +
 +==== Code References ====
 +  * **Java Implementation:** [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/java/com/watabou/pixeldungeon/mechanics/Ballistica.java|Ballistica.java]]
 +  * **Path Calculation:** [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/java/com/watabou/pixeldungeon/mechanics/Ballistica.java#L50-L80|Ballistica path calculation method]]
 +  * **Usage in Warlock:** [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/java/com/watabou/pixeldungeon/actors/mobs/Warlock.java#L70-L72|canAttack method using Ballistica]]
 +  * **Usage in Tengu:** [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/java/com/watabou/pixeldungeon/actors/mobs/Tengu.java#L58-L60|Tengu using Ballistica for distance attacks]]
 +  * **Ballistica Constructor:** [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/java/com/watabou/pixeldungeon/mechanics/Ballistica.java#L25-L45|Ballistica initialization]]
 +  * **Terrain Blocking:** [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/java/com/watabou/pixeldungeon/mechanics/Ballistica.java#L85-L90|How blocking terrain is handled]]
 +  * **Field of View Integration:** [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/java/com/watabou/pixeldungeon/levels/Level.java#L200-L210|Integration with field of view system]]
 +  * **Machine-readable data:** [[mr:ballistica_mechanic|mr:ballistica_mechanic]]
 +
 +==== See Also ====
 +  * [[en:rpd:zapping|Zapping Mechanics]]
 +  * [[en:rpd:warlock_mob|Warlock]] - Uses Ballistica for ranged attacks
 +  * [[en:rpd:tengu_mob|Tengu]] - Uses Ballistica for distance attacks
 +  * [[en:rpd:wands|Wands]] - Use Ballistica for targeting
 +  * [[en:rpd:mechanics|Game Mechanics]]
 +
 +{{tag> rpd mechanics ballistica line_of_sight ranging pathfinding}}