No description
Find a file
Torben e8e20c53ad
Add a "Version" field to GameMap Meta (#83)
* initial concept for versioning
* simple uint version implementation
* tidy up dependencies
2022-06-15 15:51:42 -07:00
.github DEV 1253: Upgrade to Go 1.18.1 (#70) 2022-05-02 13:57:07 -07:00
cli DEV 1364: Allow solo games with all rulesets through the CLI (#80) 2022-06-08 15:45:20 -07:00
client change all "int32" types to "int" (#75) 2022-05-25 11:17:41 -07:00
maps Add a "Version" field to GameMap Meta (#83) 2022-06-15 15:51:42 -07:00
test DEV 559: Refactor CLI and add customizations (#57) 2021-11-25 14:07:56 -08:00
.gitignore Bump to Go 1.17 2022-01-10 22:25:46 +00:00
.goreleaser.yml Working goreleaser. 2020-12-10 21:08:08 -08:00
board.go change all "int32" types to "int" (#75) 2022-05-25 11:17:41 -07:00
board_test.go change all "int32" types to "int" (#75) 2022-05-25 11:17:41 -07:00
cases_test.go DEV-1096 - add a new "pipeline" concept (#67) 2022-04-19 15:52:57 -07:00
CODE_OF_CONDUCT.md Create CODE_OF_CONDUCT (#36) 2021-04-05 22:34:36 -07:00
constants.go DEV 953: Add basic maps support to CLI (#74) 2022-05-25 11:24:27 -07:00
constrictor.go reorder built-in ruleset stages so game over is checked first (#79) 2022-06-01 15:21:27 -07:00
constrictor_test.go reorder built-in ruleset stages so game over is checked first (#79) 2022-06-01 15:21:27 -07:00
CONTRIBUTING.md Create CONTRIBUTING.md 2021-10-01 15:33:48 -07:00
go.mod DEV 1253: Upgrade to Go 1.18.1 (#70) 2022-05-02 13:57:07 -07:00
go.sum Add a "Version" field to GameMap Meta (#83) 2022-06-15 15:51:42 -07:00
LICENSE Add standard LICENSE 2020-01-01 17:40:37 -08:00
pipeline.go DEV 953: Add basic maps support to CLI (#74) 2022-05-25 11:24:27 -07:00
pipeline_internal_test.go DEV-1096 - add a new "pipeline" concept (#67) 2022-04-19 15:52:57 -07:00
pipeline_test.go DEV-1096 - add a new "pipeline" concept (#67) 2022-04-19 15:52:57 -07:00
rand.go DEV-1313: Add additional map types (#76) 2022-06-01 11:39:31 -07:00
README.md DEV 1253: Upgrade to Go 1.18.1 (#70) 2022-05-02 13:57:07 -07:00
royale.go reorder built-in ruleset stages so game over is checked first (#79) 2022-06-01 15:21:27 -07:00
royale_test.go reorder built-in ruleset stages so game over is checked first (#79) 2022-06-01 15:21:27 -07:00
ruleset.go DEV 1364: Allow solo games with all rulesets through the CLI (#80) 2022-06-08 15:45:20 -07:00
ruleset_internal_test.go DEV 953: Add basic maps support to CLI (#74) 2022-05-25 11:24:27 -07:00
ruleset_test.go DEV 1364: Allow solo games with all rulesets through the CLI (#80) 2022-06-08 15:45:20 -07:00
solo.go reorder built-in ruleset stages so game over is checked first (#79) 2022-06-01 15:21:27 -07:00
solo_test.go DEV-1096 - add a new "pipeline" concept (#67) 2022-04-19 15:52:57 -07:00
standard.go reorder built-in ruleset stages so game over is checked first (#79) 2022-06-01 15:21:27 -07:00
standard_test.go change all "int32" types to "int" (#75) 2022-05-25 11:17:41 -07:00
wrapped.go reorder built-in ruleset stages so game over is checked first (#79) 2022-06-01 15:21:27 -07:00
wrapped_test.go change all "int32" types to "int" (#75) 2022-05-25 11:17:41 -07:00

BattlesnakeOfficial/rules

codecov

Battlesnake rules and game logic, implemented as a Go module. This code is used in production at play.battlesnake.com. Issues and contributions welcome!

CLI for Running Battlesnake Games Locally

This repo provides a simple CLI tool to run games locally against your dev environment.

Installation

Download precompiled binaries here:
https://github.com/BattlesnakeOfficial/rules/releases

Install as a Go package. Requires Go 1.18 or higher. [Download]

go get github.com/BattlesnakeOfficial/rules/cli/battlesnake

Compile from source. Also requires Go 1.18 or higher.

git clone git@github.com:BattlesnakeOfficial/rules.git
cd rules
go build -o battlesnake ./cli/battlesnake/main.go

Usage

Example command to run a game locally:

battlesnake play -W 11 -H 11 --name <SNAKE_NAME> --url <SNAKE_URL> -g solo -v

For more details, see the CLI README.

FAQ

Can I run games locally?

Yes! See the included CLI.

How is this different from the old Battlesnake engine?

The old game 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.

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

Feedback

  • Do you have an issue or suggestions for this repository? Head over to our Feedback Repository today and let us know!