RogueBasin
Menu (Edit):
Contents:
  1. Roguelike Library For Java
    1. Introduction
    2. Features
    3. Examples
      1. Field of Vision
      2. Field of Vision in a cone
      3. Line of Sight/Projectile path

Roguelike Library For Java


Official site of Roguelike Library for Java

Developer - datta_sid

Released - 2007 Dec 15

Updated - 2013 May 02

This is a modular easy to use Java library for developing Roguelike Games.

Introduction


The purpose of this library will be to provide functions like Line of Sight, Field of View, Pathfinding, Dungeon generation, etc that you will need for writing your Roguelike, but the code that is either hard to find or hard to separate out from existing projects.

Features


Currently this library provides the following :

  • Field of View
  • Cone Field of Vision
    • Precise Permissive Field of View
    • Shadow casting.
  • Line of Sight
    • Bresenham
    • Symmetric Bresenham
    • Opportunistic Bresenham
    • Precise Permissive Field of View
    • Shadow casting.
  • Projection
    • Bresenham
    • Symmetric Bresenham
    • Opportunistic Bresenham
    • Precise Permissive Field of View
    • Shadow casting

Examples


Some examples of this library in action :

Field of Vision

Precise Permissive Field of View


         ......
     ..  .......
     ..  .........
      .. .........
  ..   . .........
  ...  .......... ..
 ..#... .#.....#....
 .......#..........
 ..............#....
 #........@.........
 ...........#
 .....#.......
 ..# #.........
    ...........#
   ..............
   ...............
   ......#..#.....
     .#.........
      .........

Shadow Casting

          .
      . .......
    .............
    ..............
  .  ... ..........
  ..# ............#
  .... .............
 ..#... .#.....#....
 .......#...........
 ..............#....
 #........@..........
 ...........#.......
 .....#....... .....
 ..# #.......... ...
    ...........#.# .
  ...............
  ................
   ......#..#.....
    ..#.........#
      .........
          .

Field of Vision in a cone


          @
          ....
           ....
           ......
           ...#....
            ... ...
            .... .
            .....
             ...
             ..

Line of Sight/Projectile path

Shadow Casting

.#..............#...#
..........#..........
..........@.#....#...
........./.....#.....
.........|...........
#.....#.#|...........
..#...../......#.....
.##..............#..#
............#........
.......#......##.....
.....*...............
.....................

Precise Permissive Field of View

.#..............#...#
..........#..........
..........@.#....#...
........./.....#.....
.........|...........
#.....#.#|...........
..#...../......#.....
.##..../.........#..#
.......|....#........
....../#......##.....
.....*...............
.....................

Bresenham

......
.@....
.#\...
..|...
..*...
......