DeSS

Overview

DeSS (Deck Simulation Software) is a simple interactive program aimed for game and deck designers. I have mainly written it to help myself in developing games like Lords of Hell, but as it can be an useful tool for other people too I decided to release it. It can be used to test various starting deals, to see how multiple players making tablings would change the deck composition and how often in practise does certain combinations come up by, without need for messing around with all those pieces of cardboard and table room.

See download part for license etc.

Features

Latest release includes following features:

DeSS does not:

Screenshot

Well, a screenshot from basic command line program? But here we go... (I have bolded the user input, just to make it stand out)

1> a1,3
Tabling juggernauts, forced agreement (played)
Discarding juggernauts
Drawing fiends, night fiends, soul stones

Turn 1 Deck: 74 cards, discard: 2 cards
Table cards:
 1 High Palace of Hell
----------------------------------------------------
Player 2, Mammon:
Hand cards:
 1 Baalzebub PO      4 Mammon favor      7 Mammon favor      10 world war
 2 Baalzebub PO      5 Mammon favor      8 Mammon favor
 3 Glasya PO         6 Mammon favor      9 Mammon favor
Tabled cards:
 1 Frozen Ocean
Drawn cards:
 1 fiends
 2 night fiends
 3 soul stones

2>

Wishlist

DeSS is far from finished. Here is a list of features that I plan to add or what have been asked to be added:

The stars after each feature are my generic impression how ready I am to do them.

Documentation

This documentation (hopefully) applies to latest release.

Basic concepts

As stated in overview, DeSS is deck simulation program. It is not a game, but a tool. It is meant for single user who is in complete control, i.e. this user can do whatever he or she wants and only uses this tool to get rid of a) finding, making or proxying appropriate cards and b) shuffling, and c) needed table space.

Card numbers

Cards in DeSS are handled via their index number. You can see these index numbers with list command.

Card types

Every card has type. Normally this is default type ('-') and has no impact on program. However, it is possible to give arbitrary types for the cards and this type is then used for sorting and can be used for automatic services like 'you can never table card of type X'.

Card piles

DeSS defines following card piles: deck, discard, table, hand, and pool. Of these, hand is always player specific and pool always shared. Others can have shared one (index 0) and one for each player, plus possible piles out of player range.

Cards are moved between piles with move command. Generally there is not much difference between each deck type, except for mnemonical reasons.

Deck ("main deck") is the basic pile of cards, usually shared between all players. Deck can be hidden with gui_hide_deck so that you cannot see contents of it (if you really want that for some reason).

Discard is like main deck, except any played card also goes to discard pile. Like with main deck, the contents of discard piles can be hidden with gui_hide_discard.

Hand is, well, player's hand cards. Everyone has their own. Hand cards can be hidden with gui_hide_hand so that its contents are only shown if the current_player is same as the investigated hand.

Table is either shared or player-specific (well, you can have both). You can set that certain card types cannot be tabled, only played.

Pool is special 'temporal pile' aimed for games where you do things like 'draw 3 and select one of them, discarding rest'. There is only one pool available for all players.

Whenever any pile is referenced, it means the pile of the current player (or shared one if the player has not own pile of that type), unless the command specifically targets other pile.

Running the program

Just launch it from the command line, with init file as optional argument, followed with any deck file loaded before actual init file is executed (this will change in near future).

dess
Just launch the program without any extra initialization.

dess poker.ini [$ARG1]
Load the given init file and execute commands in it before starting the interactive command line. $ARG1 can be supplied to any load command.

DeSS init file

As an argument to dess an init file can be given. An init file is a simple text-file consisting of lines of commands executed when the program starts. It is used to initialize simulator to whatever deck system needs to be simulated, by setting various variables to correct initial values and possibly setting useful aliases (macros).

Each line is executed like it was run from dess command line. Any empty line or line starting with hash ('#') is ignored. A typical init file could look something like this:

set max_hand_size 5

# basic useful aliases
alias draw move deck,1-$0 hand
alias shuffle move discard,all deck; sort deck random

load plain52.deck
shuffle

# poker start
set players 2
draw 5; next; draw 5; next

Sample real init files are provided with the program.

Deck file

Deck file is a file that describes the used deck. It is a normal text file with one line for one card (or multiples of identical card). Any empty line or line starting with hash ('#') is ignored. The format for card line is:

[count] <card name> [(type)]

Count is number of these cards in the deck. If it is zero, card is ignored. Card name is anythign you desire, although very long ones are not fully shown in dess. If you have only one card of certain name and want to start its name with a number, put count as 1. Type is optional card type which can be used with certain automatic services. In addition it is used as primary sorting key. If no type is given, it is set as ('-') althought this is not normally seen anywhere.

Thus, a simple deck file looks like this:

7 white rabbit
3 wheel of fortune
10 spectator
1 100 deadly knives (s)

Sample real deck files are provided with the program.

Command interface

Command interface is simple. Very simple. There is no (currently) history, command filling or any other advanced features. Just type your command and press the return. The syntax is normally:

<command> [arg1] [arg2]

Several commands can be given, separating each with semicolon (';'). However, if any problems are encountered when executing any command, all remaining commands in the line are not executed for safety reasons. Thus, if you write command line foo; draw 3 the second command is never executed (unless if there is an alias for foo) (exception: when defining aliases, everything after the alias command is included in it)

Warning: if you use several card handling commands, remember that indexes may change between these two commands. Thus command line move hand,1 table; move hand,3 table wields different result than move hand,1,3 table as in first one the source pile is shifted one step.

DeSS commands

DeSS has (almost) minimal set of commands to handle card piles and manipulate program flow To counter this, a powerful alias command is supplied. All commands are automatically completed, i.e. you do not have to write quit as q is (normally) sufficient. This can be turned off by setting gui_command_completion to zero. In addition, if the command is followed by any number, you can omit the space between the command and the number.

You can also preceed the command with question mark ('?') just to show what it is expanded to and what is the format. Use asterisk ('*') at the start of the command to suppress output of that command, as if echo would be set to zero.

alias [key] [commands]
Alias 'key' to given commands. Note that these commands can include semicolons (';') in them, i.e. everything after key are put into alias and is not handled like separate commands. Be careful when aliasing as you can shadow normal commands. Alias can have variables $0, $1 and so on, of which $0 gets the first argument given to aliased command and so on.

If you call this command without commands to alias, just show that alias. If no key is given either, show all currently defined aliases.

See following chapter for alias magicks.

help
Show all commands, including aliases
info [player]
Show all cards and other information about given player, or if none given, current one with extra information (turn, deck size etc.). Use 'all' and 'others' to list all or all but current players, respectively.
list [player,]<target-pile>
Show contents of target pile of given player (or current one). Use 'all' to show all players, and 'others' to all but current.
load <target-pile> <deckfile>
Load specified deckfile into target-pile. Note that absolutely nothing is done to cards in other piles and the current target-pile is nuked, so this offers a nice way to mess your simulation. If you specify deckfile as $ARG1 then the second argument given to the program will be used.
move [player,]<source-pile,cards> [player,]<target-pile>
This all-powerful command moves cards between piles For cards you can use a comma separated list, with support of 'all' (all cards in source pile) and ranges (like '1-10', '#4' to mean '1-4' and '2-' to mean all from 2 onward). If the range is out of pile size, the command is not executed if variable strict_ranges is set. The player can also be set as 'all' (or 'others') in which case command is executed once for each player (or once for all but current player) (only either target or source pile can have 'all' or 'others' players)

It is very handy to define aliases for normal actions like table, discard or draw. See supplied init files and alias magicks chapter, below.

next
Change current_player to next one. Add one to turn if it is first player's turn again.
player <setting<> [value]
Edit player settings. Currently supported:
  • player shuffle: shuffle all players
  • player name Abba,Boo,..: set player names (output only)
  • player nuke played: nuke played cards
quit
Quit program (unless disabled with disable_quit)
random [low,]<high>
Return random number from between low and high, or 1 and high if no low given, including both ends
set [variable] [value]
Set given variable to given value. Variable name is automatically completed if gui_variable_completion is set (default). If no value given, show the current value. If no variable is given either, list all variables with their current values.
sort [player,]<target> [random|reverse]
Sort given target pile (of given player, or 'all'). As extra rule, you can force of random sorting or reverse the current order.
unalias <alias>
Remove given alias

Alias magicks

As the basic command set is very limited you most probably want to define lots of useful aliases. Some tips and guidelines:

  • To draw X cards from deck to hand, use alias like move deck,#$0 hand
  • To shuffle discard into main deck, use alias somewhat like *move discard,all deck; sort deck random (the asterisk is to suppress output of move)
  • To force target player to discard X cards at random, use alias like sort $0,hand random; move $0,hand,#$1 discard

See supplied sample init files for further alias tricks (plus some other tricks like how to simulate multiple shared decks)

DeSS variables

You get a full list of variables by typing set in the program. Any 'boolean' type variable is 'false' when set to 0, or works otherwise.

auto_discard_pool
Is pool automatically discarded when player changed (with next command, does not apply if set used)
current_player
current_turn
Current 'game' status.
echo
Does program echo results of most commands. By setting this to zero you can silent the program, but any 'print' commands still output normally. Has same effect as having asterisk ('*') before any command.
fixed_pile
Card types which cannot be moved to different pile, i.e. they can be only moved within same pile type (from hand to hand, for example). Several card types can be defined with some separator like comma (',')
gui_card_numbers
Is card index shown before the card
gui_command_completion
Is partial commands completed
gui_disable_quit
Disable quitting via quit command
gui_hide_card_type
Do not show card type before its name
gui_hide_deck
Hide contents of any deck, only show its size
gui_hide_discard
Hide contents of any discard pile, only show its size
gui_hide_hand
Hide contents of hand cards (except for the size), except if the current_player is same as the hand owner
gui_min_per_column
Minimum number of cards shown per column in card listings
gui_strict_move
If this variable is set to non-zero, move command with illegal source cards is not executed
gui_variable_completion
Is partial variables (in set command) completed
max_hand_size
Maximum hand size for player. If exceeded, next cannot be used
play_not_table
Card types which cannot be tabled but are played instead (added to played pile and discarded). Several card types can be defined with some separator like comma (',')
players
Number of players in 'game'. Practically means that 'all' refer to player numbers 1 to this value, and 'next' would change to player 1 (and turn is increased) if this value is exceeded as current player number. Note that you can still manipulate piles of other players
private_deck
If set to non-zero, each player (can) have own deck and discard pile. Otherwise you cannot handle other than shared (index 0) of main deck and discard pile
private_table
If set to non-zero, each player (can) have own table pile. Otherwise only shared (index 0) can be used.

Download

Requirements

Some new perl (yeah this really has not been tested in any other machine than my redhat laptop which has perl v5.8.0) Then you need some text editor to edit init and deck files, and some kilobytes of free disk space for your own files (the program does not write anything to your system).

License

This software is free. Do whatever you want with it. No warrantly or anything exists to it. However, if used for anything big or so, I'd appreciate that tell you me about it. If you want to contribute new features, email (marjola ÄT iki.fi) or /msg me (rpr at Ircnet) instead of simply forking it, as I could find those features useful, too.

Changelog

Version 1.2.2 (16.5.2003):

Version 1.2.1 (15.5.2003):

Version 1.2 (15.5.2003):

Version 1.1.1 (13.5.2003):

Version 1.1 (12.5.2003):

Version 1.0 (9.5.2003):

Supplied files

Following files should be part of the DeSS packet:
dess
The program itself (a perl program)
index.html
This documentation
poker.ini and plain52.deck
Sample init file for plain poker game and deck of standard 52 cards
mtg.ini and black.deck
Sample init file for Magic: the Gathering deck constructing tests and sample mono-black deck. Note that this is mainly meant for testing out possible starts, ignoring any opponent.
loh.ini and loh.deck, loh_realms.deck, loh_oaths.deck, and loh_specials.deck
Lords of Hell deck init file and deck definations, as a sample for much more complicated use.

And the packet itself: dess.tgz (gnuzipped tarball) or dess.zip (version 1.2.1, release 15.5.2003, about 16kB)


My homepage