GithubHelp home page GithubHelp logo

go-sc2ai's Introduction

go-sc2ai

Go implementation of the Starcraft II AI API

Quick start

Prerequisites

Build and run examples

  • Create working dir:
    mkdir /path/godev
    cd /path/godev/
  • Clone project:
    git clone [email protected]:chippydip/go-sc2ai.git
    cd go-sc2ai/
  • Build and run example:
    go run .\examples\zerg_rush

Start writing your own bot

  • Make project dir:
    mkdir /path/mycoolbot
    cd /path/mycoolbot/
    go mod init bot
    go get -u github.com/chippydip/go-sc2ai
  • Copy main.go from examples/stub_bot into your project dir
  • Build and run
    go run .
  • Add some cool new stuff
  • Build > Run > Test > Repeat
  • ???
  • PROFIT

Useful links

go-sc2ai's People

Contributors

chippydip avatar aiseeq avatar thealfreds avatar mrsombre avatar

Stargazers

Cody Dietz avatar CandyWater avatar Eduard Bader avatar  avatar Aleksandr Kurbatov avatar Mindme avatar Excess1972 avatar Olivier St-Louis-Desjardins avatar  avatar  avatar bbrombacher avatar  avatar Daniel Oliveira avatar  avatar  avatar Jeremy Hurst avatar Erik avatar  avatar  avatar Aleksey Danevge avatar Vladimir Gordeev avatar  avatar Benjamin Möckl avatar  avatar

Watchers

 avatar James Cloos avatar Excess1972 avatar  avatar  avatar Daniel Oliveira avatar Mindme avatar  avatar  avatar

go-sc2ai's Issues

Debug package

Hi,

could you add a debug package that allows easy usage of blizzards ingame debug messages/spheres/squares?

I know how to add it manually, but it would make sense to have that at the go-sc2ai package level I think. Whenever you have time! gracias

Addition of SkipReplayIf() method to replay runner

Can you add a SkipReplayIf() method to runner (and maybe even separate runner for replays from a runner for normal games)?

I'd like to be able to query the replay info struct in that method, so that I can return true if certain conditions aren't fulfilled, e.g. MMR too low.

CWD not supported for replays

This works for me:

        cwd, _ := os.Getwd()
        replayPath := filepath.Join(cwd, "data/replays/test.SC2Replay")

and this won't:

        replayPath := "data/replays/test.SC2Replay"

I presume that somewhere in the replay opening code, it uses cwd, _ := os.Executable() or something like that to get the current working directory, but if you use symlinks, etc, then using os.Executable() gives you the "wrong" path. For the same reason it also fails when we direct it at the folder as such:

        replayPath := "data/replays/

Absolute paths work.

Add GetCurrentReplay() to runner

It would be helpful to find out which replay is currently being parsed/replayed, since that information isn't available when looping on an entire folder. Maybe runner could get a runner.GetCurrentReplay() method for that purpose?

Cycling through replays causes runtime errors sometimes

This is using the SetReplay feature on a folder.
Note that I have a line in the coordinator.go code that exits StartReplay() immediately via return statement, when certain conditions aren't fulfilled (e.g. MMR too low). Then this sometimes happens:

2019-01-22 16:21:17 [Notice] panic.go:16: runtime error: invalid memory address or nil pointer dereference
2019-01-22 16:21:17 [Notice] panic.go:27: C:/Go/src/runtime/asm_amd64.s:522 in runtime.call32
2019-01-22 16:21:17 [Notice] panic.go:27: C:/Go/src/runtime/panic.go:514 in runtime.gopanic
2019-01-22 16:21:17 [Notice] panic.go:27: C:/Go/src/runtime/panic.go:82 in runtime.panicmem
2019-01-22 16:21:17 [Notice] panic.go:27: C:/Go/src/runtime/signal_windows.go:206 in runtime.sigpanic
2019-01-22 16:21:17 [Notice] panic.go:27: D:/Projects/Go/src/github.com/chippydip/go-sc2ai/client/client.go:185 in github.com/chippydip/go-sc2ai/client.(*Client).Init
2019-01-22 16:21:17 [Notice] panic.go:27: D:/Projects/Go/src/github.com/chippydip/go-sc2ai/runner/coordinator.go:327 in github.com/chippydip/go-sc2ai/runner.runAgent
2019-01-22 16:21:17 [Notice] panic.go:27: D:/Projects/Go/src/github.com/chippydip/go-sc2ai/runner/coordinator.go:304 in github.com/chippydip/go-sc2ai/runner.Run.func1
2019-01-22 16:21:17 [Notice] panic.go:27: C:/Go/src/runtime/asm_amd64.s:1334 in runtime.goexit

Is there a way to automatically download the map for replays?

Right now it looks as such when trying to run a replay that we don't have a map for (cached or otherwise):

[Notice] coordinator.go:355: Unable to get replay info: ParsingError: 
Possible corruption - Failed to open the map archive: C:\ProgramData\Blizzard Entertainment\Battle.net\Cache\2a\6f\2a6f1c32722b0c4c83149ccf543d1453fb423610327d71dc72e63601f64bfd76.s2ma

Process finished with exit code 1

Is it possible somehow to get SC2 to download the map automatically - as it would if you open the replay by hand?

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.