GithubHelp home page GithubHelp logo

ludii_gdl's Introduction

Ludii_GDL

Translate Ludii to GDL

Notebook

code the translator via Jupyter-notebook which is draft version

PropNet

code the translator as seperate files, but there are some bugs which could lead to failure currently. Those bug will be fixed later

PropNet Directory

  • ReadFile.py: read the ludii file and get the key information
  • CONSTANT.py: containing the constant which is global variables
  • Ludii2GDL.py: calling the translating component(tanslate game, players, equipment, rules) and write GDL file
  • main.py: run the translator
  • Ludii_keyword: translate the Ludii to GDL based on keyword
  • Ludii_file: existing ludii file
  • GDL_file: translated gdl filee

Keyword implmented

KEYWORD-1: Game, Players, Equipment, Board, Piece, Region, Rules, Start, Play, End.

KEYWORD-2: Square, Line, Each, ForEach, Top, Bottom.

KEYWORD-3: Mover, Empty, Add, Apply, Expand, Remove, Stack(FIX BUG)

KEYWORD-4: ColumnSize, IsEnemyAt, StepForwardToEmpty, ReachWin.

Game

Format: (Game <string>)

  • <string>: the name of Game

Players

Format: (Players <int|list>)

  • <int|list>:
    • int: the number of players
    • list: the list of players

Equipment

Format: (Equipment )

  • : the ludii that including basic information of game

Board

Format: (Board (<square|line> ))

  • <square|line>:
  • square: square game
  • line: line game
  • : the size of game:
    if it is board game, the size is NxN; if it is line game, the size is 1xN.

Piece

Format: (Piece <string> <KEYWORD>)

  • <string>: the name of Piece
  • <KEYWORD>:
  • if is <P1|P2|etc.>, it indicates the the player-1 is
  • if is , it indicates that all piece in this game is (it always is 'Pawn')

Regions

Format: format: ((regions <P1|P2|etc> (sites <Top|Bottom>)))

  • <P1|P2|etc>: the player
  • sites <Top|Bottom>: the PX sites on the Top or Bottom of board

Rules

Format: (Rules <Ludii>)

  • <Ludii>: it is ludii that descript the rules of game

Start

Format: (start {(place <string-Piece> (), etc})

  • place: a keyword
  • <string-Piece>: the name of Piece, which is defined on keyword-Piece
  • : define the move of game

Play

Format: (play <Ludii-Move>)

  • <Ludii-Move>: define the move of game

End

Format: format: (end <Ludii-End>)

  • <Ludii-End>: define the terminal of game

Square:

it is square game

Line:

it is line game

Top:

The Top area of board

Bottom:

the bottom area of board

Each:

define the name of each piece

ForEach:

define the legal move of each piece

Mover:

current players

Empty:

the cell is blank

Add:

add the piece on a cell

Format: (move add(to <Ludii-Cell>))

  • : the status of the cell

Apply:

excuting the move

Format: (Apply <Ludii-Move>):

  • <Ludii-Move>: define the move of game

Expand:

expand direction{From top to bottom; From bottom to Top}

Format: (Expand (sites <Top|Bottom>)):

  • <Top|Bottom>: if it is Top, expanding from bottom to Top; if it is Bottom, expanding from Top to Bottom

Remove:

Any piece owned by the current player can be removed from the board.

Format: (remove (sites )):

  • : existing piece on this cell

Stack:The bug has been fixed, it could work for stack function, applied in connect-4

specifies if the piece is added on top of a stack or not.

ColumnSize:

count the size of special column

IsEnemyAt:

judge special cell is empty or not

StepForwardToEmpty:

the legal move for a piece is move forward, including front-left, front & front-right

ReachWin:

if mover reaches the opponent's start point, the mover win the game

GDL Version

There are two version for determine the Line

  • the version-1: it contains the variable and using (++ x1 x2) etc. to determine the Line
  • the version-2: it is more complicated. It means that it wirte down all situation that it is Line, which means that larger board size has more situation For GDL, the version-1 is more effective, because it could describe the game with less code. Moreover, convert to PropNet, the Version-1 PropNet is smaller than the Verson-2 PropNet. However, the Version-2 PropNet is more effective on training NN. The connect-4 as the example, training NN using version-1 PropNet takes 1408s for 50 self-play games; training NN using version-2 PropNet takes 1087s for 50 self-play games. Currently, I will explore the reason of this condition if i have enough time.

ludii_gdl's People

Contributors

dgwgiegie avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.