Skip to content

Entze/Strategy-Game-Engine

Repository files navigation

Strategy Game Engine

GitHub Build Workflow Status GitHub Manual Workflow Status

Gradle 7.6 Java

A strategy game engine written in Java.

Installation

Gradle

Jitpack (no GitHub Account required)

Add the following to your build.gradle:

repositories {
    maven { url 'https://jitpack.io' }
}

dependencies {
    implementation("com.github.Entze:Strategy-Game-Engine:v1.0.4")
}

GitHub Packages (GitHub Account required)

Add the following to your build.gradle:

repositories {
    maven {
        url = uri("https://maven.pkg.github.com/Entze/Strategy-Game-Engine")
        credentials {
            username = project.findProperty("gpr.user") ?: findProperty("github.actor") ?: System.getenv("GITHUB_ACTOR")
            password = project.findProperty("gpr.key") ?: findProperty("github.token") ?: System.getenv("GITHUB_TOKEN")
        }
    }
}

dependencies {
    implementation("at.ac.tuwien.ifs.sge:sge:1.0.4")
}

This requires that either gpr.user or github.actor are set in the gradle config or the environment variable GITHUB_ACTOR is set (equivalently for the key/token).

Usually this can be done by adding a gradle.properties with the (unquoted) key value pairs like so:

github.actor=MyUserName
github.token=ghp_...

Maven

See the GitHub packages page for a guide how to add sge as a dependency in a maven project.

From Source

./gradlew jar shadowJar sourcesJar javadocJar

This produces four jar files (in build/libs/):

One executable

  • sge-1.0.4-exe.jar (Executable)

And three jars usually used for development

  • sge-1.0.4.jar (Library)
  • sge-1.0.4-sources.jar (Sources)
  • sge-1.0.4-javadoc.jar (Documentation)

Usage

For an extensive overview see:

java -jar sge-1.0.4-exe.jar --help

If you want to let two agents agent1.jar and agent2.jar play a game of game.jar against each other run the command:

java -jar sge-1.0.4-exe.jar match game.jar agent1.jar agent2.jar

There is also a manual available.

Available Games

Name Latest Version
Risk GitHub release (latest by date)
Hexapawn GitHub release (latest by date)
Kalaha GitHub release (latest by date)
Dicepoker GitHub release (latest by date)

Available Agents

Name Latest Version
Alpha-Beta GitHub release (latest by date)
Monte-Carlo-Tree-Search GitHub release (latest by date)
Random GitHub release (latest by date)

Contributing

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.

License

GNU AGPLv3