|
BGonline.org Forums
Opening book format proposal - Computer content
Posted By: eXtreme Gammon
Date: Monday, 31 January 2011, at 4:19 a.m.
I am starting to work on a format to store the new opening book for XG2.
As the data is coming from the community, I want that data to be available to everyone. That means 2 things:the file format will be documented and public I will make a separate tool that can be downloaded and used free of charge (I will make it only for windows, but I am sure other people can work on a version for other OS).
This post is more targeted to the people of the community with programming experience (Frank Berger and Michael Petch comes to mind), but feedback from anyone is welcomed.
I always had a thing for fixed size structure so that's what i am proposing. The idea is not to have something compact but something easy to use.
The structure declaration is in Pascal (Delphi to be accurate) but i am sure C++ or C# programmer will read it without problem.
Note that Pascal align by default on integer (the only place it matter is for the position as it is 26 bytes, it will be align as a 28 bytes data)
Thanks for your feedback on what you think should be changed or added.
Xavier Dufaure de Citres
//All strings are Unicode (2-bytes per character)
TEngineOpeningBookV2 = record
case EntryType : integer of
0 : (
Magic : Dword; // Leters OBDB or $4244424F
MajorVersion : integer; // version of file structure, currently 1
MinorVersion : integer; // subversion of file structure, currently 0
RecordSize : integer; // Record size for easy conversion in case it changes, currently 256
LastUpdate : TdateTime; // Last time the database was edited
FileVersion : String[8]; // User defined
Description : String[96]; // Name of the opening book
);
1 : (
Notes : String[96]; // can have multiple record. they need to be concatenated to form the full notes.
);
2 : ( // player1 refers to the player on roll in the resulting position
Source : String[32]; // source, typically the person who made the Rollout
Pos : PositionEngine; // list of 26 shortint, positive numbers mean player 1 checkers, negative for player2
Cube : integer; // cube value as value=2^cube
CubePos : integer; // 0=center; +1=own; -1=opponent
Score : array [1..2] of integer; // score player1 and player2
Jacoby : integer; // 0 = False 1 = True
Beaver : integer; // 0 = False 1 = True
CrawFord : integer; // 0 = False 1 = True
Eval : array [0..5] of single; // Winning chances as loose bg, loose gammon, loose single, win single, win gammon, win backgammon
Equity : single; // cubeful normalized equity
Level : integer; // 100=Ro; 1000=XGR; 1001=XGR+; 100=RO; N=N-ply
// for normalization purpose GnuBG 2-ply should be stored as 3
ProgramName : integer; // 0=XG; 1=Snowie; 2=GnuBG; 3=BGBlitz
ProgramMajor : integer; // Major version of the program that made the analyze
ProgramMinor : integer; // Minor version of the program that made the analyze
ROGames : Dword; // For RO, number of game rolled
ROStd : single; // For RO, standard deviation of the normalized equity
ROChecker : integer; // For RO, level used for checker play
ROCube : integer; // For RO, level used for cube
RORotation : integer; // For RO, 0=rotate on 36 dice, 1=rotate on 21 dice
// probably only for XG, old version (<1.10) were making RO using 21 dice rotation
ROSeed : integer; // For RO, seed used
ROTruncation : integer; // For RO, truncate after ROTruncation moves, 0 for none
Filler : Array [0..22] of integer; //unused, for future addition
);
end;
Notes:integer is a 32 bit signed value dword is a 32 bit unsigned value single is a 32 bit single precision floating point value TDatetime is a single which is the number of days since 1/1/1900
|
BGonline.org Forums is maintained by Stick with WebBBS 5.12.