Commit graph

207 commits

Author SHA1 Message Date
e7a4362a66 add http handler into play.go
this allows for http game creation
2025-08-18 21:31:31 -07:00
442970f17c this was never supposed to be here 2025-08-18 21:30:02 -07:00
38368ba151 add db package
db package allows for writing games to postgres db
2025-08-18 21:29:05 -07:00
7426ddaf74 fix spacing
this totally was not an ai commit
2025-08-16 20:33:22 -07:00
4de6ada927 add frames array and comments for db insertion
Some checks failed
Test / Format (gofmt) (push) Has been cancelled
Test / Lint (golangci-lint) (push) Has been cancelled
Test / Test (go test) (push) Has been cancelled
Test / Build CLI (go install) (push) Has been cancelled
2025-08-15 12:27:45 -07:00
8d35f26ac2 add ability capture frames for later serving
Some checks are pending
Test / Format (gofmt) (push) Waiting to run
Test / Lint (golangci-lint) (push) Waiting to run
Test / Test (go test) (push) Blocked by required conditions
Test / Build CLI (go install) (push) Blocked by required conditions
2025-08-15 12:18:20 -07:00
bvanvugt
13cdcc771a Bump dependencies.
Some checks are pending
Test / Format (gofmt) (push) Waiting to run
Test / Lint (golangci-lint) (push) Waiting to run
Test / Test (go test) (push) Blocked by required conditions
Test / Build CLI (go install) (push) Blocked by required conditions
2024-01-20 07:11:51 +00:00
Brad Van Vugt
c9780bd334 Update devcontainer. 2023-09-29 02:32:34 +00:00
Brad Van Vugt
63fbac59ef Update gitignore. 2023-09-29 02:32:29 +00:00
Brad Van Vugt
bcb2f8d894
Update devcontainer.json 2023-09-28 19:20:26 -07:00
Brad Van Vugt
97a3fa46a9
Create devcontainer.json 2023-09-28 19:20:13 -07:00
bvanvugt
f0eb19f7d5 Nailed it. 2023-02-20 04:47:22 +00:00
bvanvugt
df4fb5bafc Live testing FINAL (3) 2023-02-20 04:45:09 +00:00
bvanvugt
a37aa7ca59 Live testing FINAL v2 2023-02-20 04:30:32 +00:00
bvanvugt
432881d0b7 Live testing FINAL 2023-02-20 04:26:06 +00:00
bvanvugt
f387a06813 More more live testing! 2023-02-20 04:23:42 +00:00
bvanvugt
5543176e7c More live testing! 2023-02-20 04:19:25 +00:00
bvanvugt
eee744ab56 More live testing! 2023-02-20 04:16:05 +00:00
bvanvugt
7f5f799403 Live testing! 2023-02-20 04:12:10 +00:00
bvanvugt
5cc74e7443 Fix makefile. 2023-02-20 04:04:04 +00:00
bvanvugt
839ea036c2 Revert test workflow changes (gopath is broken) 2023-02-20 00:31:41 +00:00
bvanvugt
4f4cd62a87 Move test commands into Makefile. 2023-02-20 00:25:17 +00:00
bvanvugt
465a59bc88 Update GA go version. 2023-02-19 17:21:00 +00:00
bvanvugt
0b1fbb5423 Gofmt. 2023-02-19 17:17:59 +00:00
bvanvugt
a1bf6ec0ff Update go version and linting. 2023-02-19 17:12:03 +00:00
Rob O'Dwyer
1940f03d40 standard initial food spawn for snail mode 2023-02-10 14:45:24 -08:00
Corey Alexander
ef9c766d8a
Revert SnailMode to not use PreUpdate (#121)
In the fall me and Jonathan worked on an update to the Engine
specifically with SnailMode in mind, and refactored SnailMode to use
this new `PreUpdate` method

This allowed us to not have to use off-board hazards as state!

However we want to use Snail Mode for our first Community Tournament!
And the web engine doesn't support PreUpdate yet, so we are reverting
Snail Mode to its old Pre-PreUpdate version :lol:
2023-02-09 16:21:02 -08:00
Aman Gupta
932f5418df
README.md modified (#120) 2022-12-15 09:47:32 -08:00
Chris Hoefgen
0bc228ff34
Adding default values for the Royale ruleset and game map (#119) 2022-12-05 15:11:34 -08:00
Rob O'Dwyer
82e1999126
DEV-1761: New rules API (#118)
* DEV-1761: Clean up Ruleset interface (#115)

* remove legacy ruleset types and simplify ruleset interface

* remove unnecessary settings argument from Ruleset interface

* decouple rules.Settings from client API and store settings as strings

* DEV 1761: Add new BoardState and Point fields (#117)

* add Point.TTL, Point.Value, GameState and PointState to BoardState

* allow maps to access BoardState.GameState,PointState

* add PreUpdateBoard and refactor snail_mode with it

* fix bug where an extra turn was printed to the console

* fix formatting

* fix lint errors

Co-authored-by: JonathanArns <jonathan.arns@googlemail.com>
2022-10-28 16:49:49 -07:00
Rob O'Dwyer
639362ef46
DEV 1916: Fix output issues in CLI (#114)
* adding testing of output file and write line for /end

* fix regression in latency rounding for board
2022-10-20 13:16:52 -07:00
Rob O'Dwyer
5f60ccbba8
DEV 1793: Track latency, status codes, and errors from CLI games (#113)
* track latency and status code from CLI games

* actually track errors from snake responses
2022-10-04 15:53:29 -07:00
Rob O'Dwyer
3094a3041f update CLI README to reflect flag updates 2022-09-29 15:48:47 -07:00
Rob O'Dwyer
e6e36ce46f
DEV-1703: Avoid spawning food on hazards for islands and bridges map (#112)
* move PlaceFoodFixed and PlaceSnakesInQuadrants to maps package

* don't spawn food on hazards in islands/rivers and bridges maps
2022-09-22 16:09:01 -07:00
Rob O'Dwyer
35e5a53005 remove codecov action on pull request 2022-09-13 13:41:50 -07:00
Rob O'Dwyer
c4247945ca
DEV 1676: Add maps helper functions (#111)
* add utility methods to Editor and BoardStateEditor

* add Meta.Validate

* allow setting Meta.MinPlayers to zero

* remove uints in map sizes

* use Meta.Validate in HazardPitsMap
2022-09-13 13:11:43 -07:00
Chris Hoefgen
c5810d8604
map now respects 0% food spawn chance (#110) 2022-09-06 15:20:07 -07:00
Rob O'Dwyer
09aea9c49d
DEV 1666: Fix /end requests and clean up logging (#109)
* ensure /end request is always called, and refactor win/draw logic

* clean up logging and error handling during initialization

* automatically generate friendly snake names

* title-case snake names

* print out list of alive snake names instead of count

* log snake names, IDs, and URLs at startup

* print out state for turn zero
2022-09-02 14:35:55 -07:00
Chris Hoefgen
006f394355
New Island and Bridges variations (#107)
* Adding two new variations with hazards along the edges

* Implementing code review feedback
2022-08-26 13:37:30 -07:00
Chris Hoefgen
0061425c7e
Hazard Pits Map (#108)
* added the new hazard map with custom start locations

* tweaked comments/logic

* cleaning up functionality

* unit test plus bug fixes

* fixing unnecessary error
2022-08-26 10:26:48 -07:00
Chris Hoefgen
7fa55be26c
only spawn centre food on setup when settings.MinimumFood is > 0 (#106) 2022-08-26 09:26:48 -07:00
Blayne Campbell
ba3b882e1b
Castle Wall Hazard Map (#101)
* castle_wall map

Wall of hazards around the board with dangerous bridges.

- add support for all standard board sizes
- hazard placement for all board sizes

* passage food placement for all board sizes

* 4 snake starting positions for all maps

* only one food can spawn on a bridge

* support 8 snakes for all board sizes

support 12 snakes on XLarge and XXLarge board sizes

* max 2 food sm/med/lg and max 4 food on xlg/xxlg

no food in the first 10 turns

* sort generated hazard positions

* remove 'uninteresting' castle wall map board sizes

* refactor castle wall map to align with #103

* align map castle wall meta Name with ID

* set MinPlayers to 1 for castle wall map

* pass max snake/food and startPosition to priv func

* fix castle wall food placement and refactor tests

* avoid food spawn by snake heads on castle wall map

- fixes forced food spawning infront of snake issue on large & xlarge maps with double walls
2022-08-26 09:11:19 -07:00
Blayne Campbell
2668788683
add tags to map info cli output (#105)
* add tags to map info cli output

* simplify map list range expression
2022-08-25 16:15:58 -07:00
Josh LaFayette
fbbec6a7f5
Snail mode (#98)
* Add snail-mode map

* snail-mode: cap max hazards to 7

- Ensure that no more than 7 hazards are added to a square. This
  fixes a bug where some squares were getting way too many hazards
  applied to them.  There must be some other bug at work here as
  well.
- Change author names to be github usernames instead of first names

* snail-mode: fix bug with eliminated snakes

- Ensure that hazard snail-trail is not added for eliminated snakes

* Update from Stream July 31

Added comments to most functions and important bits of code

Also changed the map so that instead of a fixed number of 7 hazards,
we add hazards equal to the length of the snake.

* snail-mode: add TAG_EXPERIMENTAL and TAG_HAZARD_PLACEMENT

* snail-mode: use Point as map key

Co-authored-by: Corey Alexander <coreyja@gmail.com>
2022-08-19 10:23:33 -07:00
Chris Hoefgen
f82cfe5309
Rivers and Bridges map refactor (#103)
* Separated out rivers and bridges into its own file with three map variants

* fixing tags

* removed extra 4 starting positions from the medium map since it only supports 8 players

* update GetUnoccupiedPoints to consider hazards with a flag

* use new utility method to fine unoccupied points and enforce map sizes

* changed up casting to make IsAllowable() more usable
2022-08-19 10:09:04 -07:00
Rob O'Dwyer
7d769b01b6
new cause of death by hazard (#104) 2022-08-18 16:20:50 -07:00
Rob O'Dwyer
b1ddd2f4ca
Add wrapped_constrictor game mode and support for map tags (#102)
* add support for wrapped_constrictor game mode

* add tags to map metadata
2022-08-17 13:03:09 -07:00
Blayne Campbell
ffeb401377
add 'map' cli command to provide map information (#100)
* add 'map' cli command

- provides the following map information functions:
  - list all available maps in the global registry
  - display map metadata

- update docs with map command examples

* add list and info subcommands to map cli command

* rename map command list and info factory functions

* add --all flag to map info subcommand

* handle cmd.Help error
2022-08-09 15:06:28 -07:00
Chris Hoefgen
91106aec09
Add decay logic to healing pools (#97)
* adding logic to remove healing pools periodically to prevent extended length games

* Fix for the case where ShrinkEveryNTurns is not set
2022-08-08 14:57:34 -07:00
Chris Hoefgen
215a0ea998
DEV-1558-healing-pools-map (#94)
* Adding a basic map that adds a few hazards based on fixed coordinates to the map.

* Used wrong board size definitions
2022-07-28 11:07:27 -07:00