Gnect

Table of Contents

  1. The Object of The Game
  2. The Velena Engine
  3. Gnect's Menus and Toolbar
  4. The Preferences Dialogue
  5. Command Line Options
  6. Custom Tile Sets and Themes
  7. Questions, Updates and Bug Reports
  8. Troubleshooting
  9. Acknowledgements
  10. License

The Object of the Game

Gnect is a Four in a Row game for GNOME. The object is to build a line of four of your counters while trying to stop your opponent (human or computer) building a line of his/her/its own. A line can be horizontal, vertical or diagonal.

Here's a very good spot on the WWW for information about strategy, similar software, links, etc.

The Velena Engine

Gnect's main computer player is Giuliano Bertoletti's public domain Velena Engine, a sophisticated piece of software using "AI" techniques rather than "brute force" alone. If set to its highest skill level, and if it makes the first move in a new game, it will not lose. Even if it doesn't make the first move, it's still extremely hard to beat.

For detailed information about the Velena Engine, please visit Velena's homepage.

Gnect's Menus and Toolbar

Only a couple of items deserve notes...

Undo (in the Games menu and on the toolbar) can undo more than just the last move - it can take you right back to an empty board. If you're playing against the computer, the undo function assumes it's your last move you want to undo - it's therefore forced to undo the computer's last move before undoing yours. If a computer player made the very first move, that first move will not be undone.

Draw grid (in the Settings menu) toggles the drawing of a grid over the background image. This only affects themes that use full-window background images.

The Preferences Dialogue

Player Selection

Appearance

Miscellaneous

Command Line Options

--debugging

Causes Gnect to display information that might help if you're troubleshooting or bored.

--seed=ARG

Seeds the random number generator with the value you specify with ARG, rather than letting Gnect seed it using the system clock. (Either way, the --debugging option will show you the seed used.)

-xARG and -yARG

Specify the position of Gnect's window on the desktop.

As with other GNOME apps, the --help option will list more options.

Custom Tile Sets and Themes

Gnect's tile sets (I suggest PNG format) contain six tiles of equal size, lined up horizontally. From left to right:

  1. Player one's counter as it'll appear on the main board
  2. Player two's counter as it'll appear on the main board
  3. Main board background
  4. Top row background
  5. Player one's counter as it'll appear on the top row
  6. Player two's counter as it'll appear on the top row

Example:
Image: a 300 by 50 pixel tile set, containing six 50 by 50 pixel tiles.

Gnect automatically calculates the tile dimensions:

    tile height = tile set height
    tile width  = tile set width / 6
    

That is, your tiles can be square or rectangular - and any size you like. Most of the tile sets that come with Gnect use square tiles measuring 40x40 pixels ("small"), 45x45 ("medium") and 50x50 ("large").

Try to stick to certain colours for each player - not always possible, but anyway - it helps people adjust when meeting a new tile set for the first time. Here's the system I've used so far:

You can save your tile sets in either ~/.gnect/pixmaps/ (which you'll have to create yourself) or the pixmap directory created when Gnect was installed (probably either /usr/share/pixmaps/gnect/ or /usr/local/share/pixmaps/gnect/).

Before Gnect can use your new tile set, you'll need to write a theme file for it. It's just a plain text file with a .gnect extension. Here's an example: buttonshop_50x50.gnect

    #
    # This is an example Gnect theme file.
    #

    # This theme's title (required)
    Title = Button Shop

    # The tile set (required)
    Tileset = tileset_50x50_buttonshop.png

    # A short description of player
    # one's counter (required)
    Player1 = Green

    # A short description of player
    # two's counter (required)
    Player2 = Yellow

    # Details (optional)
    Tooltip = A tribute to button makers everywhere
    

Save buttonshop_50x50.gnect in either ~/.gnect/themes/ or the data directory created when Gnect was installed (probably either /usr/share/gnect/ or /usr/local/share/gnect/).

Next time you run Gnect it'll find the new theme and, assuming the pixmap exists, you'll be able to select Button Shop via preferences.

So, what if you want a full-window background image, rather than just one small tile repeated over the background? First, decide on the tile set you want to use. Work out the dimensions of a 7 column by 7 row background image using that tile set (eg., a 240x40 tile set is based on 40x40 pixel tiles - so a full-window background would measure 280x280 pixels). Add the following lines to a theme file:

    # Full-sized background image (optional)
    Background = bg_50x50_buttonshop.jpg
    

You can use pretty much any file format you like for the background image. Save it in the same location as your tile set files.

If the tile set you use with that background uses transparency, the background will show through the transparent bits. Also, the third and fourth tiles (ie. the background tiles) in the tile set will not be drawn if you specify a background image.

If you want a grid of a specific colour (the default is black) drawn over your background image, add a line like this to your theme file:

    # Draw a grid of this colour (optional)
    GridRGB = RGB:FF/FF/FF
    

You can specify the grid colour in other formats, too. For example:

    GridRGB = white
    

If you don't want a grid (say, your background image has one built in), add the NoGrid keyword (it needs no value).

    # Never draw a grid with this theme (optional)
    NoGrid
    

Note that Gnect can only draw a grid if the theme uses a background image.

Questions, Updates and Bug Reports

To see if you have the most recent version, please visit Gnect's homepage. If you'd like to complain about a bug, or if you have a question or suggestion, feel free to email me.

Along with Gnect, you should have received files named README, TODO, INSTALL and COPYING. Read them if you'd like more information than this document covers.

Extra themes can be found on Gnect's homepage.

Troubleshooting

If Gnect stops working for no apparent reason, your best bet is to delete your Gnect preference file (probably ~/.gnome/gnect). Gnect should build a new one, leaving out anything troublesome. If that doesn't work, make sure there's at least one theme file in Gnect's data directory (see above: Custom Tile Sets & Themes) and that it names a tile set that really does exist in Gnect's pixmap directory. If that doesn't work, email me and complain.

Acknowledgements

License

Gnect is released under the GNU General Public License.


Timothy Musson, trmusson@ihug.co.nz, 2001.02.02