Giter Site home page Giter Site logo

jbwapi's Introduction

Build StatusTotal alertsLanguage grade: Java

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 type 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.

Warnings

  • A fake BWTA is provided for easier porting from BWMirror, but 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 as a dependency:

<dependency>
    <groupId>com.github.JavaBWAPI</groupId>
    <artifactId>JBWAPI</artifactId>
    <version>1.1.1</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:1.1.1'
}

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!

jbwapi's People

Contributors

bytekeeper avatar jabbo16 avatar jaspergeurtz avatar jordanfly avatar

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.