Game Types
Each game variation needs to have its own sub-directory in the "Game Types" directory. As a convention, the name of the sub-directory should match the name of the game variation. A minimum of 3 files needs to exist within this sub-directory. They are:
The spec file
All of the rules defining how the variation will play need to be specified within a text file named game.ini. This file needs to be composed of a number of Sections. A section is delineated within the game.ini file by placing its name within brackets on a line, e.g., "[General]". Each Section will then need to contain one or more key/value pairs, that need to be specified on a line with a key=value syntax, e.g., "Name=Klondike". Given the above, example General and Game sections for a new game variation called Clear Fork might look like this: [General] Name=Clear Fork Author=redllar [Game] Decks=2 AllowWrap=1 KingsOnly=0 CardXOffset=3 CardYOffset=3 MaxRandDeltas=1 NumCardWide=8 NumCardHigh=8 NumCardsDealt=36
Sections
Following is the list of sections that need to be specified within the game.ini file in order for your game variation to operate correctly. The section names given with an "N" should actually be numbered from 1 to some ending value, e.g., "[Stock1]" and "[Stock2]".
- General
- Game
- EasyMode
- HardMode
- Stock
- Waste
- Foundation
- Tableau
- Reserve
- StockN
- WasteN
- FoundationN
- TableauN
- ReserveN
- DealtCardN
- Layout
- Rules
- EasyOnOptions
- EasyOffOptions
- HardOnOptions
- HardOffOptions
- EasyWinnable
- HardWinnable
General
This section needs to contain the keys that do not having anything specific to do with how the game variation will play:
- Name
- What's displayed in the "Game Type Selection" dialog's game types list.
- Author
- Specifies who made it.
Game
This section needs to contain the keys that apply to the game variation as a whole:
- Decks
- Indicates the number of decks required to play the game. Currently one 1 deck games are supported.
- Addition
- Defaults to 0, a 1 or above indicates that this is an addition type game as well as indicating what the sum of the 2 picked cards needs to be in order for the pair to be moved to the Foundation.
- AllowWrap
- Defaults to 0, a 1 indicates that king on ace plays are allowed in the Tableau.
- KingsOnly
- Defaults to 0, a 1 indicates that only card stacks starting with a king may be moved to an empty Tableau pile.
- CardXOffset
- Indicates the spacing between horizontally adjacent piles in units of screen pixels. A value of 3 is typically used for game types with 8 or more Tableau piles and 11 for game types with 7 or fewer.
- CardYOffset
- Indicates the spacing between vertically adjacent piles in units of screen pixels. A value of 3 is typically used for game types with 8 or more Tableau piles and 11 for game types with 7 or fewer.
- MaxRandDeltas
- A value of 1 indicates to YaZZle that it should calculate the values used when the "randomly placed cards" option is enabled. A value of 1 should almost always be given unless the card piles are to be placed so close together that the "randomly placed cards" option needs to be ignored. In that case a value of 0 should be given.
- NumCardWide
- A decimal value that indicates how wide the playing area needs to be in units of card widths.
- NumCardHigh
- A decimal value that indicates how tall the playing area needs to be in units of card heights.
- NumCardsDealt
- Indicates how many cards are to be dealt from the Stock to the Tableau to begin a new game.
- StartRankCard
- Defaults to 0, indicating this option isn't used. Otherwise, this value indicates what rank the Foundation piles will take their starting rank from.
EasyMode
This section needs to contain the keys that apply to the game variation when it's being played in Easy mode:
- CheckFree
- Defaults to 0, a 1 indicates that the number of empty Reserve and Tableau piles should be counted up and compared against the number of cards the game player is attempting to move as a stack. The move will not be allowed if the number of cards in the stack is greater than the number of free "cells."
- KingsOnly
- Defaults to 0, a 1 indicates that only card stacks starting with a king may be moved to an empty Tableau pile.
- Take3
- Defaults to 0, a 1 indicates that 3 cards are to be dealt from the Stock to the Waste instead of the usual 1.
HardMode
This section needs to contain the keys that apply to the game variation when it's being played in Hard mode:
- CheckFree
- Defaults to 0, a 1 indicates that the number of empty Reserve and Tableau piles should be counted up and compared against the number of cards the game player is attempting to move as a stack. The move will not be allowed if the number of cards in the stack is greater than the number of free "cells."
- KingsOnly
- Defaults to 0, a 1 indicates that only card stacks starting with a king may be moved to an empty Tableau pile.
- Take3
- Defaults to 0, a 1 indicates that 3 cards are to be dealt from the Stock to the Waste instead of the usual 1.
Stock
This section needs to contain the keys that apply only to Stock piles:
- Piles
- Defaults to 0, the number of Stock piles needed.
- NumCardWide
- A decimal value that indicates how wide each Stock pile needs to be in units of card widths.
- NumCardHigh
- A decimal value that indicates how tall each Stock pile needs to be in units of card heights.
- Visibility
- Defaults to 1, a 0 indicates that each Stock pile will not be made visible to the game player.
Waste
This section needs to contain the keys that apply only to Waste piles:
- Piles
- Defaults to 0, the number of Waste piles needed.
- NumCardWide
- A decimal value that indicates how wide each Waste pile needs to be in units of card widths.
- NumCardHigh
- A decimal value that indicates how tall each Waste pile needs to be in units of card heights.
Foundation
This section needs to contain the keys that apply only to Foundation piles:
- Piles
- Defaults to 0, the number of Foundation piles needed.
- NumCardWide
- A decimal value that indicates how wide each Foundation pile needs to be in units of card widths.
- NumCardHigh
- A decimal value that indicates how tall each Foundation pile needs to be in units of card heights.
- AllowWrap
- Defaults to 0, a 1 indicates that king on ace plays are allowed in the Foundation.
- MaxCardsShown
- Defaults to 13, indicates the maximum number of cards displayed for a given pile.
- MaxVisible
- Defaults to 13, indicates the maximum number of cards displayed for a given pile.
- MaxXRandDelta
- If the [Game]MaxRandDeltas value is 1, this decimal value indicates the maximum horizontal displacement in card width units that a "randomly placed" card may be positioned in the pile.
- MaxYRandDelta
- If the [Game]MaxRandDeltas value is 1, this decimal value indicates the maximum vertical displacement in card height units that a "randomly placed" card may be positioned in the pile.
- OriginXOff
- Defaults to 0, a decimal value that indicates the horizonal displacement in card width units that will be used in positioning the 2nd through the last cards in the pile.
- OriginYOff
- Defaults to 0, a decimal value that indicates the vertical displacement in card height units that will be used in positioning the 2nd through the last cards in the pile.
Tableau
This section needs to contain the keys that apply only to Tableau piles:
- Piles
- Defaults to 0, the number of Tableau piles needed.
- NumCardWide
- A decimal value that indicates how wide each Tableau pile needs to be in units of card widths.
- NumCardHigh
- A decimal value that indicates how tall each Tableau pile needs to be in units of card heights.
- CardXDownOff
- A decimal value that indicates how far the next face down card in the pile needs to be horizontally displaced in units of card widths.
- CardYDownOff
- A decimal value that indicates how far the next face down card in the pile needs to be vertically displaced in units of card heights.
- CardXUpOff
- A decimal value that indicates how far the next face up card in the pile needs to be horizontally displaced in units of card widths.
- CardYUpOff
- A decimal value that indicates how far the next face up card in the pile needs to be vertically displaced in units of card heights.
- CheckFree
- Defaults to 0, a 1 indicates that the number of empty Reserve and Tableau piles should be counted up and compared against the number of cards the game player is attempting to move as a stack. The move will not be allowed if the number of cards in the stack is greater than the number of free "cells."
- CheckInOrder
- Defaults to 0, a 1 indicates that a moved card stack needs to be checked for being in its correct sequence order before it will be allowed to be moved to a new pile.
- ColorCheck
- Defaults to 0, a 1 indicates that the first card of a moved card stack needs to be of the same color as the card that the stack is being moved onto before it will be allowed to be moved to a new pile. A 2 indicates that the first card of a moved card stack needs to be of a different color than the card that the stack is being moved onto before it will be allowed to be moved to a new pile.
- MaxAllowed
- Defaults to 13, indicates the maximum number of cards allowed to be moved onto a given pile.
- MaxCards
- Defaults to 13, indicates the maximum number of cards allowed to be moved onto a given pile.
- SequenceCheck
- Defaults to 0, a 1 indicates that the first card of a moved card stack needs to be next in rank sequence from the card that the stack is being moved onto before it will be allowed to be moved to a new pile. A 2 indicates that the first card of a moved card stack needs to be just prior in rank sequence from the card that the stack is being moved onto before it will be allowed to be moved to a new pile. A 3 indicates that the first card of a moved card stack needs to be either next in rank sequence or just prior in rank sequence from the card that the stack is being moved onto before it will be allowed to be moved to a new pile.
- SuitCheck
- Defaults to 0, a 1 indicates that the first card of a moved card stack needs to be of the same suit as the card that the stack is being moved onto before it will be allowed to be moved to a new pile.
Reserve
This section needs to contain the keys that apply only to Reserve piles:
- Piles
- Defaults to 0, the number of Reserve piles needed.
- NumCardWide
- A decimal value that indicates how wide each Reserve pile needs to be in units of card widths.
- NumCardHigh
- A decimal value that indicates how tall each Reserve pile needs to be in units of card heights.
- CardXUpOff
- A decimal value that indicates how far the next face up card in the pile needs to be horizontally displaced in units of card widths.
- CardYUpOff
- A decimal value that indicates how far the next face up card in the pile needs to be vertically displaced in units of card heights.
- MaxAllowed
- Defaults to 1, indicates the maximum number of cards allowed to be moved onto a given pile.
- MaxXRandDelta
- If the [Game]MaxRandDeltas value is 1, this decimal value indicates the maximum horizontal displacement in card width units that a "randomly placed" card may be positioned in the pile.
- MaxYRandDelta
- If the [Game]MaxRandDeltas value is 1, this decimal value indicates the maximum vertical displacement in card height units that a "randomly placed" card may be positioned in the pile.
- MaxVisible
- Defaults to 1, indicates the maximum number of cards displayed for a given pile.
StockN
There should be [Stock]Piles of these sections, with N varying from 1 to [Stock]Piles. Each one of these sections needs to contain the keys that apply only to the Nth Stock pile:
- X
- The x location of the Nth Stock pile in units of card widths.
- Y
- The y location of the Nth Stock pile in units of card heights.
WasteN
There should be [Waste]Piles of these sections, with N varying from 1 to [Waste]Piles. Each one of these sections needs to contain the keys that apply only to the Nth Waste pile:
- X
- The x location of the Nth Waste pile in units of card widths.
- Y
- The y location of the Nth Waste pile in units of card heights.
FoundationN
There should be [Foundation]Piles of these sections, with N varying from 1 to [Foundation]Piles. Each one of these sections needs to contain the keys that apply only to the Nth Foundation pile:
- X
- The x location of the Nth Foundation pile in units of card widths.
- Y
- The y location of the Nth Foundation pile in units of card heights.
TableauN
There should be [Tableau]Piles of these sections, with N varying from 1 to [Tableau]Piles. Each one of these sections needs to contain the keys that apply only to the Nth Tableau pile:
- X
- The x location of the Nth Tableau pile in units of card widths.
- Y
- The y location of the Nth Tableau pile in units of card heights.
ReserveN
There should be [Reserve]Piles of these sections, with N varying from 1 to [Reserve]Piles. Each one of these sections needs to contain the keys that apply only to the Nth Reserve pile:
- X
- The x location of the Nth Reserve pile in units of card widths.
- Y
- The y location of the Nth Reserve pile in units of card heights.
DealtCardN
There should be [Game]NumCardsDealt of these sections, with N varying from 1 to [Game]NumCardsDealt. Each one of these sections needs to contain the keys that apply only to the Nth dealt card:
- PileType
- The type of the pile that is to receive the Nth dealt card: F (foundation), R (reserve), T (tableau), or W (waste).
- PileNumb
- The number of the pile of a given PileType type that is to receive the Nth dealt card.
- PileFace
- How the Nth dealt card is dealt, face up (U) or face down (D).
- PileRank
- If a specific card needs to be dealt as the Nth card, this value along with the PileSuit value will indicate which card it is. The valid values are 1 for ace through 13 for king. Default value is a space, indicating that a random card is to be dealt.
- PileSuit
- If a specific card needs to be dealt as the Nth card, this value along with the PileRank value will indicate which card it is. The valid values are C for clubs, D for diamonds, H for hearts, or S for spades. Default value is a space, indicating that a random card is to be dealt.
- GrabBack
- Defaults to 0, a 1 indicates that the background of the pile to which the card is being dealt needs to be captured prior to drawing the card at the pile's location. This is currently needed to help YaZZle get around a drawing bug having to do with overlapping pile placements, such as is the case with the Pyramid game type.
Layout
This section needs to contain the keys that indicate the names of the files that are used to display an image in the help text that gives the game player a picture of what the game layout is like:
- Image
- Indicates the name of the layout help image file that contains the RGB channels.
- Alpha
- Indicates the name of the layout help image file that contains the alpha channel.
Rules
This section is currently not utilized.
EasyOnOptions
This section is currently not utilized.
EasyOffOptions
This section is currently not utilized.
HardOnOptions
This section is currently not utilized.
HardOffOptions
This section is currently not utilized.
EasyWinnable
This section is currently not utilized.
HardWinnable
This section is currently not utilized.
The bitmap file
The bitmap file needed is the same one defined as the [Layout]Image file. It is also referenced within the help html file. And it needs to be consistent with the other game type's help images.
Given these requirements, it is necessary for it to be specifically defined:
- it needs to be a .bmp
- it needs to be named game.bmp
- its dimensions needs to be 200x150 with 256 colors
- it needs to be a window "screen shot" of the entire YaZZle window right after the start of a new game
- the YaZZle window's dimensions needs to be 698x523
- the skin in use needs to be plastique
The html file
It is important to have consistent help, especially from one game type to the next. In addition, at runtime YaZZle concatenates a given game type's html file with 2 other html files in order to build a "cached" html file that will contain the leftside menu as well as one that will present a complete game types list. As such, the html file needed has specific requirements:
- it needs to be named game.html
- it needs to make use of the Help/help.css style sheet
- its organization should be the same as the other game types (Winning, The Layout, The Deal, Game Play, Notes, Decks, Difficulty, Strategy, Easy Play, and Hard Play sections)
- its layout should be the same as the other game types
- it must only contain the head and body sections and the body section must only contain the "content" body div
Please make use of one of the distributed game type html files to start with, adhering to its overall organization and layout, when creating your game type help file. Especially if you wish to have your game type included in any future release of YaZZle or if you wish to have your game type usable in any future release of YaZZle.