Giter Site home page Giter Site logo

ravaelles / atlantis Goto Github PK

View Code? Open in Web Editor NEW
56.0 10.0 12.0 40.64 MB

:earth_americas: StarCraft BroodWar :earth_asia: AI Java Framework based on JBWAPI 2.1.0 :zap:

Java 100.00% Batchfile 0.01%
ai broodwar starcraft bwapi bwmirror atlantis bot framework game

atlantis's Introduction

Atlantis

...is an extensive Java framework based on JBWAPI 2.1.0.

image

Atlantis wraps everything heavily, so you don't need to write yourself countless lines of tedious code that every bot unfortunately needs to have to do the simplest stuff. It has quite clean and re-usable code (at least it has high priority on my list).

What it can do

  • all three races can be supported, but it mainly focuses on Terran
  • enables to you to run your bot in one click from your IDE (IntelliJ IDEA recommend), just "Run" your project and it will auto run Chaoslauncher and Starcraft
  • auto-modifies bwapi.ini so you don't need to do it yourself! Can change your race, enemy race, map played and game type from AConfig class
  • includes tests and mini-maps to test on
  • handy keyboard shortcuts like: speed faster/slower (+/-), exit (Esc), screen centering on combat unit (c)
  • customizable build orders
  • takes care of the economy for you (gathering, construction)
  • assigns workers to optimal mineral fields
  • scouts to find enemy base and detects the build order used
  • if enemy goes air/hidden units responds by building e.g. Missile Turrets
  • micro-managers specific to units
  • auto-expansions
  • evaluation of unit chance to win the Near skirmish and retreating when needed
  • advanced and code wrappers for selecting units that use cache

How to install

The latest stable version is in the master branch. In develop you will find latest changes, but they might not work as expected.

  • IMPORTANT: In order to use BWAPI you have to create player profile in StarCraft. Just run StarCraft, click Single Player, BroodWar and create profile with any name. If you skip this step you will get an error.
  • First we need to install BWAPI in version 4.4.0, so click here to get it. Installation of BWAPI is a hard thing for beginners, so make sure you follow this tutorial closely.
  • Feel free to read the tutorial even further to see how a simple non-Atlantis bot would look like.
  • Make sure to follow these steps from Atlantis Wiki
  • If you've done everything correctly, you should be good to go. Run Main class of Atlantis in IDE.

Quick usage

  • Install Atlantis and use your preferred IDE.
  • See AConfig class and edit our race and enemy race to play against default AI
  • Run the application and that's it, it will automatically run StarCraft and Chaoslauncher.
  • If you got any error it probably means you've screwed the BWAPI installation.
  • Use keys 1 to 9 and +/- to change game speed; 1 is normal, 9 skips much more frames making the game crazy fast, PauseBreak to stop the game.
  • Esc makes the bot to exit gently, killing StarCraft and ChaosLauncher processes on exit

AI tournaments

You probably know it already, but take a look at: http://sscaitournament.com/

Starcraft bots that plays there online 365/24/7. Pretty cool, eh?

atlantis's People

Contributors

andertavares avatar andre-dsm avatar ravaelles avatar saityoukou avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

atlantis's Issues

Introduce modular approach via AtlantisModule class

Discussion and suggestions are greatly welcomed in Enhancement threads!

Suggested by Michal Certicky:
Implement a class/interface that would allow defining modules.

My example solution: We introduce AtlantisModule class that overrides with empty body all important methods like onFrame , onUnitCreate etc. Then basically all of the core Atlantis functionality can extend AtlantisModule and this way we can achieve full (?) modularity and easily add/remove modules. Also add modules from different repositories.

Advantage of class over interface is that new module is not forced to override all possible methods, actually it can just override one method (e.g. onFrame) and still work.

Allow to select units behind fog of war in Select

Discussion and suggestions are greatly welcomed in Enhancement threads!

Atlantis was meant to be used with BWAPI3 where you can access units behing FoW (Fog of War). BWAPI4+ forbids this, which complicates things, but is also a great occasion to make Select super-cool and super-handy.

My idea is to introduce FoggedUnit class, which would extend the AUnit (AUnit is Atlantis wrapper over inaccessible BWMirror Unit class; inaccessible because it's in external .jar with private constructor).

The biggest change would be to replace Select.enemy() with:
Select.enemyVisible() , Select.enemyFogged() and Select.enemyIncludingFogged()

It would be incredibly helpful e.g. in situation where you want to look for enemy tanks in radius of 11 tiles (Shock Cannon range). This way one could simply use:
Select.enemyIncludingFogged().ofType(Siege_Tank).inRadius(11, unit)

This would return all discovered enemy tanks as accessible variables (via FoggedUnit wrapper), including those units we don't see. They're not actually BWAPI units, but our artificial entity called FoggedUnit which has:

  • type
  • position

Both AUnit and FoggedUnit should have isFogged() method which would return true for fogged unit and false for "real" unit. It's important because trying to issue unit.attack(FoggedUnit) would result in attacking Position, not the Unit, which often causes this terrible behavior of unit starting attack all the time, but never actually attacking.

I would love to hear constructive criticism as this change will affect Atlantis deeply and if handled poorly could lead to bad code readability (which is the only thing I want to avoid).

ENV naming

I've created ENV folder, copied ENV-EXAMPLE and changed sc + chaoslauncher location in file. After I renamed ENV-EXAMPLE just to ENV - getting alerts about ENV. What name file should be ?

Performance issues

As suggested in the other thread, here is a post about the performance.

I downloaded the program and ran it vs the game AI and after maybe 5-10 minutes of elapsed game time, it started to run extremely slowly. I don't know why it does, but it happened every game I tried.

It also produced a lot of output; single numbers and "RunTo" errors, which may or may not be related.

contact

Sorry, I did not know where to look, where can I send you an email? I sent you an invitation to skype [email protected], I want to assign a project

Exception on running of Main

Ever get this error when running Main?

Native code library failed to load.java.lang.UnsatisfiedLinkError: C:\Users\me\github\Atlantis\client-bridge-x86.dll: Can't find dependent libraries

I've had the really basic SSCAIT bot running before so I'm pretty sure I have everything installed ok.

Zerg & Expansions

I've run bot on many maps and it's always choose wrong coordinates to expand the base. He build it around natural, yet not in the right spot.

AKeyboard

For some reason I have this weird issue with AKeyboard. I've tried your bot in april and it was fine, now when I rechecked with eclipse oxygen it won't work. Sorry for bothering, you did very good job with this, thanks for sharing it.

Static or initial files should be located in the "bwapi-data/AI/" folder not the "bwapi-data/read/" folder

Static files should be located in the "bwapi-data/AI/" folder not the "bwapi-data/read/" folder. Similarly for the initial version of files that are initially read the first time the bot is run (e.g. initial configuration of build orders) then written by the bot as new versions (e.g. adaptation of build orders for particular opponents). The static/initial files should reside in the "bwapi-data/AI/" folder and new versions of them (if applicable) should reside in the "bwapi-data/read/" and "bwapi-data/write/" folders for reading or writing respectively. The reason is for compatibility with StarcraftAITournamentManager which is used in some of the annual competitions like AIIDE and CIG. If this is not done, I think the build order config files could fail to load because they may be missing.

I.E. the AIIDE Rules page mentions this about the "bwapi-data/read/"folder:

Before each game, the contents of the server-side read directory for your bot are copied to the client machine under 'bwapi-data/read/'. For the first round of the tournament this directory will be blank since a full round has not yet been played.

StarcraftAITournamentManager asks you whether to clear the read folders when you start a new run or do a rerun.

I know the SSCAIT competition allows users to upload their own read folder separately to the bot binaries, so it's probably not a problem for SSCAIT, but it would be good if it would work out of the box for AIIDE/CIG or anything that uses StarcraftAITournamentManager.

I notice there is also a mapData folder. Is this simply an identical copy from BWTA2? If so then why not simply use the same path as BWTA2 instead of needing a whole other copy? if it is different, why isn't it under the "bwapi-data/" folder? Whatever you think is easiest for competition organizers to manage is best.

The mapData folder could also be affected by this issue, assuming they are static, but I assume map data files like BWTA2 is treated specially by StarcraftAITournamentManager because the competition organizers decide what maps will be used in the competition - not the developers of the bots.

Exception in thread "main" java.lang.IllegalAccessError

After compile a project - I've recieved a msg of missing path to bwapi.ini. I've finded file path in code and added it. After that this msg pop up aaaand I can't figure out what to do... I've got a knowledge to print "hello world". Can anyone assist?

Exception in thread "main" java.lang.IllegalAccessError: class bwapi.WrappedBuffer (in unnamed module @0x27c20538) cannot access class sun.nio.ch.DirectBuffer (in module java.base) because module java.base does not export sun.nio.ch to unnamed module @0x27c20538
at bwapi.WrappedBuffer.(WrappedBuffer.java:20)
at bwapi.ClientData.(ClientData.java:6)
at bwapi.Client.connect(Client.java:203)
at bwapi.Client.reconnect(Client.java:90)
at bwapi.BWClient.startGame(BWClient.java:45)
at bwapi.BWClient.startGame(BWClient.java:35)
at atlantis.Atlantis.run(Atlantis.java:435)
at main.Main.main(Main.java:48)

JVM Crash

Probably unrelated to Atlantis, but did anyone else have this problem, and if not, which jre are you using?

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x6d216e8b, pid=4372, tid=0x000015e8
#
# JRE version: Java(TM) SE Runtime Environment (8.0_141-b15) (build 1.8.0_141-b15)
# Java VM: Java HotSpot(TM) Client VM (25.141-b15 mixed mode, sharing windows-x86 )
# Problematic frame:
# V  [jvm.dll+0xd6e8b]
#
# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
#
# An error report file with more information is saved as:
# G:\workspaces\workspaceSSCAI\Atlantis\hs_err_pid4372.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
#

Happens every 40 runs or so.

Allow to select enemy building positions in Select

I think that Atlantis should implement some sort of "memory" for previously seen enemy buildings. Simply maintain a set of positions at which we've seen some enemy buildings, so that we have some attack targets to choose from. The Select class might have the enemyBuildingPositions() method.

Maintaining such set shouldn't be hard. You simply add a position to it every time you see an enemy building and remove it every time you see that position and the expected building is not there any more (meaning that it's been destroyed of lifted/moved).

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.