GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - JavaBWAPI/JBWAPI: Pure Java BWAPI Client implementation for JVM languages

BranchesTags
Open more actions menu

Latest commit

 

History

534 Commits
534 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
.mvn/wrapper
.mvn/wrapper
 
 
bwapistructs
bwapistructs
 
 
it
it
 
 
src
src
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
build_with_openbw.md
build_with_openbw.md
 
 
mvnw
mvnw
 
 
mvnw.cmd
mvnw.cmd
 
 
pom.xml
pom.xml
 
 

Repository files navigation

Build Statues CodeQL

JBWAPI

Pure Java bwapi 4.4.0 client implementation backed by N00byEdge's JavaBWAPIBackend idea and automated by Bytekeeper.

Also contains a modified version of the pure Java BWEM implementation from BWAPI4J.

Goals

  • Have a similar (Java) interface to BWMirror to make porting BWMirror bots easy without all the DLL and JNI hassle and overhead.
  • Stay as updated as possible with the BWAPI releases.

Advantages

  • No dependency on external DLL's.
  • At least 5x faster compared to BWMirror for primitives as it directly reads the memory mapped client file. Even faster for BWAPI objects as it also avoids marshalling.
  • Supports both 32-and 64-bit Java (e.g. deeplearning4j requires 64-bit Java which BWMirror doesn't support).
  • BWEM instead of BWTA as map analyser.
  • Supports Linux "natively" using openbw, made possible by ByteKeeper.
  • Async support for realtime tournament constraints, made possible by dgant.

Warnings

  • A fake BWTA is provided for an easier transition from BWMirror. However, it translates BWTA calls to their respective BWEM calls, so specific Regions/Chokepoints etc. may differ.

Usage

Maven

Add JitPack as a repository:

<repositories>
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
</repositories>

Add JBWAPI to your dependencies in <dependencies></dependencies>:

<dependency>
    <groupId>com.github.JavaBWAPI</groupId>
    <artifactId>JBWAPI</artifactId>
    <version>2.2.0</version>
</dependency>

Gradle

Add JitPack as a repository:

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

Add JBWAPI as a dependency:

dependencies {
    implementation 'com.github.JavaBWAPI:JBWAPI:2.2.0'
}

Jar

Alternatively add the latest .jar from the releases page to your project.

Compilation

mvnw.cmd package

or if you already have maven installed

mvn package

Example

A simple Hello World bot is as easy as:

import bwapi.*;

class HelloBot extends DefaultBWListener {
	private BWClient bwClient;

	@Override
	public void onFrame() {
		Game game = bwClient.getGame();
		game.drawTextScreen(100, 100, "Hello World!");
	}

	public static void main(String[] args) {
		HelloBot bot = new HelloBot();
		bot.bwClient = new BWClient(bot);
		bot.bwClient.startGame();
	}
}

Documentation

The API documentation can be found here.

You can also ask any further questions on the SSCAIT Discord

Tutorial

If you are a just starting out with bot development, it might be helpful to follow the tutorial!

Bots

Some bots using JBWAPI (feel free to open a pull request to add yours!)

  • https://github.com/dgant/PurpleWave
  • https://github.com/Ravaelles/Atlantis
  • https://github.com/impie66/Kangaroo-Bot

Linux

If you use Linux you can choose to develop normally and run the jar and starcraft using wine or try to use openbw by following the following instructions.

About

Pure Java BWAPI Client implementation for JVM languages

Topics

apiapi-wrapperbroodwarbwapibwapi-javajavajvmjvm-languagesstarcraftstarcraft-broodwar

Resources

Readme
MIT license
Activity
Custom properties

Stars

26 stars

Watchers

5 watching

Forks

13 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.