This is a Java client (bot) for the Jass challenge server. It is a fork of the challenge java client.
We use Monte Carlo Tree Search (MCTS) with determinization and domain knowledge to beat the best machine and humand Jass players in the Schieber variant.
Build the app with
./gradlew build
Make sure gradle is installed.
Run this app either with docker:
docker build -t jass-the-ripper . # make sure you are in the root directory of this project
docker run -it --rm -p 80:80 jass-the-ripper # specify the ports if needed (also update the dockerfile)
or gradle:
./gradlew run -Pmyargs=ws://127.0.0.1:3000,1 --no-daemon # change the websocket host and port if needed. The value after the comma is the chosenTeamIndex of the bot to be started
Run specific test
./gradlew test --tests to.joeli.jass.client.strategy.training.ArenaTest.train
Run experiment
./gradlew runExperiment
Run experiment as a background process
nohup ./gradlew runExperiment > nohup.out &
Train network
python3 src/main/java/to/joeli/jass/client/strategy/training/python/train.py 0010 cards/
nohup python3 src/main/java/to/joeli/jass/client/strategy/training/python/train.py 0010 cards/ > nohup.out &
Start REST endpoint:
nohup ./gradlew startServer > nohup.out &
JassTheRipper bots:
- http://jasstheripper.joeli.to/random-playout
- http://jasstheripper.joeli.to/light-playout
- http://jasstheripper.joeli.to/heavy-playout
- http://jasstheripper.joeli.to/runs-100000
- http://jasstheripper.joeli.to/rule-based-trumpf
- http://jasstheripper.joeli.to/mcts-trumpf
- http://jasstheripper.joeli.to/random-playout-dnn-trumpf
HSLU opponents:
- http://10.180.39.12:5001/randomsimple
- http://10.180.39.12:5001/soismcts-100000-trump
- http://10.180.39.12:5001/dnn-max-policy-trump
- http://10.180.39.12:5001/dnn-max-value-trump
- http://10.180.39.12:5001/prob-ismcts-trump
- http://10.180.39.12:5001/det-mcts-random-random
- http://10.180.39.12:5001/det-mcts-prob-random
Tournament Server available on: https://jass-server.abiz.ch/
UI available on: https://jassteppich.abiz.ch/
This client allows you to easily develop a bot for the Jass challenge.
###Wiki (Server): https://github.com/webplatformz/challenge/wiki
###JassChallenge2017 If you are an enrolled student in switzerland, you are welcome to participate the JassChallenge2017 competition in April '17
---------------------- LINK TO OUR REGISTRATION PAGE ----------------------
Clone this repository and start (gradlew run
) the Application class:
public class Application {
//CHALLENGE2017: Set your bot name
private static final String BOT_NAME = "awesomeJavaBot";
//CHALLENGE2017: Set your own strategy
private static final RandomJassStrategy STRATEGY = new RandomJassStrategy();
private static final String LOCAL_URL = "ws://localhost:3000";
public static void main(String[] args) throws Exception {
String websocketUrl = parseWebsocketUrlOrDefault(args);
Player myLocalPlayer = new Player(BOT_NAME, STRATEGY);
startGame(websocketUrl, myLocalPlayer, SessionType.TOURNAMENT);
}
}
The client needs the challenge server to connect to. Clone the challenge server and run npm start. For more information go to Jass challenge server repository.
To implement your own bot you need to provide an implementation of the JassStrategy interface:
public interface JassStrategy {
Mode chooseTrumpf(Set<Card> availableCards, GameSession session);
Card chooseCard(Set<Card> availableCards, GameSession session);
default void onSessionStarted(GameSession session) {}
default void onGameStarted(GameSession session) {}
default void onMoveMade(Move move, GameSession session) {}
default void onGameFinished() {}
default void onSessionFinished() {}
}
To test your bot against other bots, such das the random bot, you need to start your own tournament.
- start the challenge server:
npm start
- Browse to http://localhosthost:3000
- Enter some user name:
4. Enter some tournament name and press Enter
- Join your bots, they should appear on the next page
Thanks to fluescher for creating this skeleton.