@ Necklace of the Eye

How to create configurations

Note: NotEye is still under development. You can play with provided configurations, but if you try to communicate using the NotEye protocol or to create a sophisticated configuration or something else, you would probably run into some problems, because many things are not documented yet, and some things which should work do not (some special cases which I have not found use for yet, this happens mostly with 3D and ISO views). I prefer to finish and then write the docs. If you want to work with NotEye already, but don't understand something, please send me an e-mail to zeno@attnam.com.

Note: you can run NotEye with a parameter (e.g. noteye noteye.log), this way any problems will be sent to a diagnostic log file.

You should probably start from one of the configurations provided as examples (frozen.noe, crawl.noe, doomrl.noe, adom.noehydra.noe contains lots of hacks to make NotEye display hex and is more difficult). Copy it to gamename.noe and add it to the menu in the noteye.noe file.

The amount of work depends on how original the game's display is, and how complete do you want your tileset to be. In some cases it should be enough to simply copy one of the provided configuration files, and modify some numbers. Usually you will need to modify the mapregion variable. It says which part of the screen contains the map in the given roguelike. If there is something original, or you want more complicated features, you will probably need to learn some Lua and understand how NotEye works.

'caller' is a script that either runs the game or tells the users to care for themselves. The first parameter of caller3 is the full game of the name, and the second one is used as both the name of the executable and the name of the directory where the game is expected to be found.

Lua is designed so that you can replace functions by your own implementations (which can call the original ones), and NotEye uses this. If you want to provide tiles for more things, it is probably the easiest to modify the xtileaux function (copy the implementation from the DoomRL or ADOM config and modify it). If the game incorrectly guesses the position of the player character, you can try changing the ispc function (like hydra.noe which makes sure that the @ sign is white, so that we don't take an e-mail address for a map), or the copymap function if the first method does not work. If you don't like how some things are colored on the minimap, change the xminimap function. And so on.

OK, here is a short description of concepts available in NotEye:

Object

Objects include images, fonts, tiles, screens, and game processes. You create objects by calling functions implemented by NotEye, and use them by calling other functions. These functions return numbers which act as identifiers for these objects. You can use delete(x) to delete objects, and objcount() to know how many objects have been allocated so far.

Image

Images are just that, images, that is, rectangular blocks of pixels. The following Lua functions work on images:

Graphics to display

Gfx is an Image, so saveimage, setpixel, getpixel, and imgcopy functions work on it — you need to give Gfx (which equals 1) as the image. Also the following are required:

Screen

A screen is a rectangular block of Tiles. Screens can be drawn on an Image, and also can be connected to a Process, so that the Screen contains the console output from a roguelike.

Tiles

Screens are made of Tiles. This is a general concept that encompasses both console characters that roguelikes output and the tiles shown on screen, and even is allowed to include 3D information about how a tile will look in the FPP view. You can create new tiles with the following: These functions return the tile index that you can use on screens.

Fonts

Fonts are created with F = newfont(I, x, y, trans). I is an image which contains the characters. There are x characters in each row, and y columns (there should be x*y == 256). The value 'trans' contains the color treated as transparent. You can get the tile for the given character with fget(F, ch), e.g. fget(F, "@").

Process

Processes are games, command shells, and other things that NotEye can run and process its screens. The screen associated to a process is filled with tiles of form:
tilemerge(tilefill(vgaget(BACKGROUND)), tilerecolor(fget(Font, CHAR), vgaget(FOREGROUND)))
which can be correctly displayed using drawscreen. You can also process this form using functions gch (get character), gco (get foreground color (as a full color, not palette index), gba (get background color), gp2 (get just the character, without the background).

(to be continued)



You can contact me at zeno@attnam.com, or at RogueTemple or New Attnam forums (Z), or at my blog.


Return to NotEye

Thanks to Slashie for hosting this at RogueTemple!