Lost Cities is a Javascript recreation of the popular card game "Lost Cities", both with other players and bots trained on a deep learning model
- Pull or download this repo
- ensure node is installed
- add the following packages (for console interaction)
- "@colors/colors": "^1.5.0",
- "@tensorflow/tfjs": "^4.8.0",
- "cli-table3": "^0.6.3"
Interacting with logic components
- PvP through console: node main.js
- PvAi through console: node aiMain.js
- testing: npm test
Interacting with UI components
- cd lost-cities-react
- npm start
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
- AIModel
- Initialize game state, updates it after every single move/action (both players)
- Initialize Q value, updates it after every single move/action (AI only)
- Come up with all possible states that AI may encounter
- Create a reward function (Positive rewards for favorable moves or winning the game and vice versa; rewards value can be the same for all favorable moves and vice versa)
- Create an action selection function (determined by the highest Q value in the Q table)
- Constructa neural network
- First layer/ Input layer: Uses for state obervations
- Second Layer and Third Layer: Based on the policy and Training Loop
- Fourth Layer / Output Layer: Q values table
- Convert actions into valid strings based on the Q values and action index
- Make sure reward function only return positive rewards for favorable moves and vice versa
- Bug: Cause the game call play/draw function twice there will be an extra card missing after each turn
- Perhaps train the AI before the game