Pitkäaikainen haaveeni on nähdä toteutettuna geneerinen korttipelikone sekä korttipelien kuvauskieli. Korttipelikoneeseen voisi syöttää minkä tahansa korttipelin säännöt korttipelin kuvauskielellä, minkä jälkeen kone toimisi sääntöjen valvojana ja pisteiden kirjaajana. Kaikki perustuisi avoimeen lähdekoodiin ja kaikki halukkaat voisivat osallistua projektiin.
Tällainen korttipelikone mahdollistaisi pohjan esim. www-pohjaiselle palvelulle, jonne kuka tahansa voisi lähettää haluamansa korttipelin säännöt yhdenmukaistetussa muodossa ja sen jälkeen kuka tahansa voisi pelata sitä netissä. Korttipelien sääntöjen kuvaaminen eksaktisti ja tietokoneen ymmärtämässä muodossa tekisi mahdolliseksi sääntöjen kääntämisen koneellisesti eri kielille.
Pari aihetta sivuavaa projektia olen löytänyt, joista toinen jo käytännössä kuollut ja toinen lienee suunnattu hieman erityyppisten pelien alustaksi ja on lisäksi dokumentaatioltaan puutteellinen.
Korttipelikoneprojektissa olisi useita vaiheita:
Alustavat toimenpiteet: keskustelupalstan avaaminen, projektin nimeäminen, aikataulu. Tässä vaiheessa tulee myös varmistaa, ettei vastaavaa projektia ole jo olemassa. Tarvitaan googletusta useilla eri kielillä ja hakusanayhdistelmillä, jotta vältetään pyörän uudelleenkeksiminen.
Määrittely (mitä tehdään ja mitä ei tehdä): Korttipeleistä pitäisi kartoittaa erilaisia piirteitä ja kerätä kokoelma mahdollisimman erityyppisistä peleistä. Tarvittaessa korttipelikonetta voidaan rajata esim. "perinteisillä pelikorteilla pelattaviin vuoropohjaisiin peleihin", jotta projektista ei tule liian hankalaa.
Suunnittelu (miten tehdään): Pitäisi valita menetelmä, jolla eri korttipelien säännöt saataisiin elegantisti kuvattua tietokoneen ymmärtämällä tavalla. Tässä vaiheessa valittaisiin kuvauskieli, jota pelien sääntöjen määrittelyssä käytetään.
Toteutus: Tässä vaiheessa pitäisi saada speksattua korttipelien sääntöjen kuvauskieli niin hyvin, että sen pohjalle voi kuka tahansa kehittää korttipelikoneen ja päästään testaamaan sääntöjen kuvauskielen toimintaa käytännössä.
Esimerkkipelejä: myllymatti, bugami, Siperialainen vint
Problem: There is no open and universal definition language for card game rules. If there were a common language, volunteers around the world could translate existing card game rules to universal format and games could be played with card game engines which would read that universal language.
Requirements for application: Application itself can be very ascetic tool to test the card game definition language. The most important task is to specify and documentate a language which can be used to describe rules and game-related issues for as many card games as possible.
Other general/specific comments: English is preferrable language in documentation for further development
Task description in more detail: To specify a definition language (could be XML based, for example) to describe card game related issues such as playing equipment (pack), number of players, the deal, allowed messages between the players (bids), scoring, the visibility and place of the playing equipment (hand, cards on the table, different sets of cards), passing the turn, allowed moves and restrictions in different phases of the game.
The idea would be to define a way to describe card game rules in a
computer-readable form. The rule definition pack could be in a tar.gz
file, for example, containing perhaps separate files to define
- the equipment used (the type a a pack, several standard packs such as
52, 40, 36 and 32 card packs could be predefined - perhaps also a
standard set of equipment with images could be included in the pack)
- preconditions (how many players are needed for game etc.)
- the deal
- "playing equipment containers" such as hands, discard pack, table cards
and their initial properties: ownership, visibility etc.
- rules for play (allowed actions during player's turn, actions can be
moving cards from one container to another, changing their properties or
also signals to other players (such as bids in some games)
- triggers that can end the play, change the rules during the game, or
give points to players (for example when the pack is exhausted of cards
or when it is the last deal)
- scoring
Optionally there could be some way to define ID's and names for different
items and actions in the game, such as "to trump", when user plays a trump
to a trick or "to meld" when user melds cards in Canasta. These
definitions should be in a separate directory and implemented so that it
is easy for third parties to add translations.
It is up to the imagination and developer's own preferences what is the
best way to implement it. Portable it should be, so nothing completely
Windows or Linux specific, but otherwise I am open to suggestions. Perhaps
one tool or language is good for one part of the solution and other tool
is good for another. I believe there must be some elegant way to handle
the problem without banging the head to the wall and start from the
scratch.
My guess is that the most trickiest part is to define the way to describe
the allowed moves during the game. That part differs most between
different games.
The ideal solution would provide an easy (at least for someone with skills
in programming) to create a new card game rule pack using this solution.
So the solution should provide means to describe any turn based card game
[some game types can be left out of scope, if they appear difficult to
include].
At least for testing purposes, some very simple user interface (console
based is OK) should be created, which takes a card game definition pack as
input and then allows players to play accoring to the rules, gives points
etc..
Here is a small list of ideas on how this solution, which I call Sulo for
no reason, would be used:
- game developer creates a rule set for the game using Sulo, with the help
of volunteers there would be soon hundreds of game packs for Sulo
- Playing engine developers would create several game engines (to
Internet/to different operating systems/...) that would support game packs
made with Sulo
- The actual players could choose which game engine they use when they
wish to play
- Sulo itself would be open source so it would be improved and developed
during time
PS. For solitaire games there is PySol which gives tools to add new
solitaires. I think it supports over 200 different game types. There is
VASSAL game engine, whose documentation is limited and which is not
capable of describe many card games, I believe.