|
Project Information
Members
Featured
Downloads
Links
|
JNI-BWAPIBuild a StarCraft AI in Java! Updates
OverviewThis project provides a JNI interface for the Brood War API using the shared memory bridge. Compatible with BWAPI 3.6 and available under the LGPL. This project provides a Java interface for developers interested in participating in the StarCraft AI Competition.
The JNI interface provides several advantages over the previous socket-based ProxyBot interface. First, the interface uses the BWAPI shared memory bridge which lessens the communication bottleneck between C++ and Java and prevents cheating using direct memory access. Second, the BWAPI utility functions (e.g. canBuildHere) can be now be called from Java. Finally, the use of JNI should result in easier project maintainability and extensibility.
Getting StartedThe best way to get started is to first browse the information available at the BWAPI project and set up the example AI. It is highly recommended that you have experience in setting up a BWAPI bot before investigating this library. Past instructions for using BWAPI are available here and here, and the BWAPI manual is provided here. This disclaimer is necessary, because the infrastructure for developing a StarCraft agent is more complicated than I want to admit. However, the fact that it is possible to write AI for StarCraft transcends configuration difficulties, because of the greatness that is StarCraft AI research. First, set up an environment for building a remote AI client. This is the ExampleAIClient project included in the BWAPI release. Make sure to specify a release build. You'll also need to modify your BWAPI setup for a remote process. In bwapi-data/bwapi.ini set the ai_dll module to null and at this point, you should be set up for remote AI clients. Note, additional steps need to be taken if you are developing in Windows 7: all processes using shared memory need to be run in administrator mode (right click->properties->Compatibility->Run As administrator). This is to overwrite privileges restricting direct memory access across processes. If you are using an eclipse development environment, then it is necessary to enable this setting for both eclipse and javaw.exe And now for the JNI-BWAPI instructions. There are two main components to this project. The source code in src/c contains the c++ facing code that interacts directly with the BWAPI bridge. Most of the code in this directory is generated (via JNIHeader.bat), the exception being ExampleAIClient.cpp which is the binding between the shared memory bridge and the Java process. The second component is the Java code provided, which encapsulates most of the c++ and BWAPI complexity. To get up and running check out the example AI provided. Hopefully I'll be able to get more people involved and provide additional support for Java developers interesting in exploring StarCraft AI. For now, this library is specifically targeted at developers with experience with BWAPI that wish to develop an agent in a managed memory environment. The provided DLL should be enough to get started, but if you are in need of additional features, feel free to post issues or join the project. DevelopersInterested in improving the project? There are several areas for improvement including:
If you have recommendations for improving the project or would like to help contribute, then feel free to use the issue tracker or join as a contributor. ProjectsThe following projects are using JNI-BWAPI: Links
LegalStarCraft, Brood War and Blizzard Entertainment are trademarks or registered trademarks of Blizzard Entertainment, Inc. in the U.S. and/or other countries. ©1998 Blizzard Entertainment, Inc. All rights reserved. |