Giter Club home page Giter Club logo

battlebattle-simulator's Introduction

BattleBattle Simulator

A Java simulator for the BattleBattle card game.

Simulator JavaFX Application

Simulator JavaFX Application

Requirements

  • Java 1.8+

  • Maven

Usage

There are two main programs in this project:

  1. Run the main program in SimulatorApplication.java to run the simulator with a friendly user-interface designed in JavaFX. This interface allows you to change the health and tokens of all the cards that were found on runtime in the com.davidvyee.battlebattlesimulator.card.impl package. You may also customize the number of simulations to run for each combination.

  2. Run the main program in Simulator.java to run each combination of cards in com.davidvyee.battlebattle.simulator.card.impl. The simulator outputs a results CSV file in the same directory as the program and also outputs the CSV content to standard output (stdout). By default, this program will run 1000 simulations per combination.

Packaging the JavaFX Application

Using Maven, you can compile and package the simulator into an executable JavaFX JAR and native executable file by running the following command:

mvn jfx:jar jfx:native

The executable JAR and native application will be located under target\jfx.

Adding New Cards

Add new cards into the com.davidvyee.battlebattle.simulator.card.impl package and override the necessary methods and hooks to achieve the desired card stats and abilities. Cards that are added to this package are found on runtime via Java Reflection.

Debugging

To debug a new card, create a new JUnit test for the card and change the log4j log level to DEBUG or TRACE:

log4j.rootLogger=TRACE, Console
log4j.logger.com.palette.battlebattle.simulator.card.Card=TRACE, cardappender

Assumptions and Limitations

The Simulator currently has the following limitations:

  • The simulation applies token-requiring powers only once. In other words, cards cannot pay for a power twice in order to apply the ability twice in a given round.

  • The simulation does not evaluate the sensibility of a round in the context of possible future rounds. It only considers whether an action can produce a winnable outcome for the current round and if a token should be spent or not.

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.