Byte-snake-engine/README.md

50 lines
1.8 KiB
Markdown
Raw Normal View History

2020-01-01 23:10:49 -08:00
# BattlesnakeOfficial/rules
2020-01-03 11:53:01 -08:00
[![codecov](https://codecov.io/gh/BattlesnakeOfficial/rules/branch/master/graph/badge.svg)](https://codecov.io/gh/BattlesnakeOfficial/rules)
2020-12-11 09:45:07 -08:00
[Battlesnake](https://play.battlesnake.com) rules and game logic, implemented as a Go module. This code is used in production at [play.battlesnake.com](https://play.battlesnake.com). Issues and contributions welcome!
2020-01-01 23:10:49 -08:00
2020-09-02 12:45:05 -07:00
2020-12-11 09:45:07 -08:00
## CLI for Running Battlesnake Games Locally
2020-09-02 12:45:05 -07:00
2020-12-11 09:45:07 -08:00
This repo provides a simple CLI tool to run games locally against your dev environment.
2020-09-07 09:01:50 -07:00
2020-12-11 09:45:07 -08:00
### Installation
2020-09-07 09:01:50 -07:00
2020-12-11 09:45:07 -08:00
Download precompiled binaries here: <br>
[https://github.com/BattlesnakeOfficial/rules/releases](https://github.com/BattlesnakeOfficial/rules/releases)
2020-09-07 09:01:50 -07:00
2021-01-19 15:07:25 -08:00
Install as a Go package. Requires Go 1.15 or higher. [[Download](https://golang.org/dl/)]
2020-12-11 09:45:07 -08:00
```
go get github.com/BattlesnakeOfficial/rules/cli/battlesnake
```
2020-09-07 09:01:50 -07:00
2021-01-19 15:07:25 -08:00
Compile from source. Also requires Go 1.15 or higher.
2020-12-11 09:45:07 -08:00
```
git clone git@github.com:BattlesnakeOfficial/rules.git
cd rules
go build -o battlesnake ./cli/battlesnake/main.go
```
2020-09-07 09:01:50 -07:00
2020-12-11 09:45:07 -08:00
### Usage
2020-09-07 09:01:50 -07:00
2020-12-11 09:45:07 -08:00
Example command to run a game locally:
```
battlesnake play -W 11 -H 11 --name <SNAKE_NAME> --url <SNAKE_URL> -g solo -v
```
2020-09-07 09:01:50 -07:00
2020-12-11 09:45:07 -08:00
For more details, see the [CLI README](cli/README.md).
2020-09-02 12:45:05 -07:00
2020-12-11 09:45:07 -08:00
## FAQ
2020-12-11 09:45:07 -08:00
### Can I run games locally?
Yes! [See the included CLI](cli/README.md).
### How is this different from the old Battlesnake engine?
The [old game engine](https://github.com/battlesnakeio/engine) was re-written in early 2020 to handle a higher volume of concurrent games. As part of that rebuild we moved the game logic into a separate Go module that gets compiled into the production engine.
2020-12-11 09:45:07 -08:00
This provides two benefits: it makes it much simpler/easier to build new game modes, and it allows the community to get more involved in game development (without the maintenance overhead of the entire game engine).