blacken


A Java UI library for Roguelike games

Blacken is a library which provides an enhanced console-like interface. The primary purpose of this library is to assist with the development of traditional (non-tile) Roguelike games.

There are a couple of problems with using Curses:

  1. Different implementations of Curses have different features. While ncurses is the standard in Linux and (probably) Mac OS X, it is less commonly found in Windows. When pdcurses is used instead there are many missing features.
  2. Curses depends upon decent terminal emulators. Decent terminal emulators properly advertise their capabilities. Decent terminal emulators only claim to be "xterm" if they support all xterm features including Techtronix mode. There is a paucity of good terminal emulators.
  3. Due to terminal emulators claiming to have no color when they actually support the xterm-256color codes, really nasty things are done in console apps to work around the lies of terminal emulators. I hate doing nasty things to work around other people's bugs.
  4. I would really like to use the XSI Curses attributes A_HORIZONTAL, A_LEFT, A_LOW, A_RIGHT, A_TOP, and A_VERTICAL but these are in the "extended conformance level" and as far as I know nothing actually supports them. (Neither ncurses nor most terminal emulators support these features.)
  5. We need decent support of all of the available characters in Unicode without arbitrary eight or sixteen bit limitations. Proper support of the full set of Unicode characters with Curses depends both on the Curses implementation as well as the Terminal Emulator implementation. Getting the right combination may be difficult for some and impossible for others.
  6. We want font characteristics (such as bold) to not conflict with color choices. While it is possible for terminal emulators to be implemented this way, in practice I've only seen this feature on Angry Red Planet's ARPTerminal for BeOS. (By far my favorite terminal emulator and one with features that are still not found in the competition.)
  7. Existing Curses wrappers for Java do not implement all of the functions needed for basic Unicode support. More than that, some of them don't expose anything resembling the Curses API. Once I actually found the perfect combination, I'd have to write an extensive wrapper to expose all of the functionality I need.
  8. Most people don't actually understand the Curses API. They know just enough to do what they need -- if that. The assumptions and expectations of Curses are different than what you see in a GUI application and these differences confuse people. Exposing the Curses API -- like mapping a new library to the Curses API -- doesn't actually gain us anything but confusion.

In a pure man-hours assessment, it became clear that to focus on the things we wanted, we could neither use Curses, nor could we expose a true Curses API. (If our library is complete someone could implement a Curses-like API on top of it, but we won't natively use one.)

All of this points to a graphical application which presents itself as having a console-like window. Blacken is influenced by Curses, so you see things like when dealing with coordinates "y" is always before "x" (which makes sense considering that is how you would write them in a two-dimensional array). When all things are equal, Blacken will use the same name as a function in Curses. However, Blacken doesn't allow you to perform a bitwise-or of an attribute when writing a character via addch() -- you need to use a version of addch() that supports setting the attribute you want.

Project Information

The project was created on Apr 5, 2011.

Labels:
Java curses Roguelike