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:
* 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>
* 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
* 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
* added the new hazard map with custom start locations
* tweaked comments/logic
* cleaning up functionality
* unit test plus bug fixes
* fixing unnecessary error
* 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
* 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>
* 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
* 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
Previously the CLI would exit immediately with an error if a snake
returned a response with invalid JSON.
Now the CLI continues running the game and a snake with an invalid
response continues in the direction of it's last move.
Also logs a warning with details about the invalid response. Where
possible, the log includes the response body in case it contains helpful
info.
* change map support for large #'s of snakes
* test square board fn
* format comment
* add whitespace
* better support large #'s of snakes on small boards
* include an intermediate xlarge size
* Commit from Stream
We got the maze working decently well!
Started off with exploring the repo a bit and getting used to the Map
stuff
The Maze is working pretty well except the mazes that are generated
aren't actually complete-able yet. They end up creating spaces that are
blocked off from the rest of the map
The maze generation algo is based off 'Recursive division method' mostly
following this Wiki
This looked to always create a 'valid' maze, while mine doesn't so need
to figure out what my bug is, cause I'm pretty sure there is one!
* I think we got maze generation working!
Did a lot, should have commited more lol
Got map generation working where I can see it go frame by frame, and
think we squashed the last few bugs with wall generation and hole
cutting
Now need it to actually make a new maze when you finish this first one
* We can run on a bigger board now, and we place the food randomly on the board after you grab it the first time
* Make sure my health is always 100 so don't have to worry about that lol
* Fix placing of food on maze to NOT be on an existing hazard and after 3 foods make a new maze
* Maze generation works better now and a bit of cleanup
* Committing old code
* Got state saving as Hazards Bits Working well, I think whats up next is making the map grow each level
* Draw maze in the center of the board, the maze grows as you complete levels until it fills the entire board
* Ran go fmt
* Remove my little debugging script that I added
* Revert changes I made initially to the map interface
* Move my copy-pasted printMap function to my map specifically
* Go fmt
* Write some doc comments and fix some weird code artifacts
* A few more comments and one last go fmt
* Cut less holes, this makes the maze more exciting
* Add version to Metadata and go fmt again
* Can collapse this down
* Random food spawns are more fun for sure
* add minimal support for serving a game to the board UI
* We did 3 main things here:
- Fixed the bug where hazards were getting multi-stacked
- Fixed the bug where the food could spawn on top of the snake head
- Fixed the lint errors
* Games aren't infinite now, they end by not spawning a food when you have reached a certain number of turns at the max board size
* Extract some functions to make deciding when the game is over easier
* Get evil mode implemented to force the game to end
* Fix small bugs about where we spawned the food in evil mode
* Have the snake keep growing by adding tail segments to match the current level. We start at two length because 1 lenth snakes look weird on the board since they don't have a neck to orient themselves. Here we also fix a bug where evil mode was trying to place food off the map
* Run go fmt
* Add the missing meta-data pieces
* Support a smaller board without the change of infinite loops and change the name of the maze
* Rename the actual struct and fix the tests to not make extra snakes when the map doesn't support it
* Revert "add minimal support for serving a game to the board UI"
This reverts commit 0ac3592c7669ab1bccd7bd3322adffbef5e911ce.
* add minimal support for serving a game to the board UI
* Cleanup and extract and function to place food so we don't have basically the same body twice. This also will prevent the initial food spawn from being right next to the snake
* Revert "add minimal support for serving a game to the board UI"
This reverts commit c1a3b134213dabf44df56e3ca1e6d30ff8aaa516.
* Fix lint
* 2 length snakes are silly, so lets start with 3 each time
* We start out with 3 length snakes, and a fixed set of map sizes
Co-authored-by: Rob O'Dwyer <odwyerrob@gmail.com>
* add minimal support for serving a game to the board UI
* refactor into new board package
* support reporting errors and author names to board
* support passing an alternate board URL
* avoid using IPv6 for local URL
* use rules.Point instead of a custom Point type for board package
* use zero for generic communication error code in cli
* rename createGameEvent to buildFrameEvent
* tests for conversion from boardState/snakeState to game frame
* fix for rivers and bridges snake start positions
* update max player count, add unit test
* set player count to 12 (max for smallest size)
* fix: one of the 19x19 spawn points
* randomize snake placement at start positions
* randomly choose starts in quadrants
* fix: check that start positions are valid
* modify food placement to avoid hazards
* allow initial food placement for 8 snakes on 7x7
* fix logic to be for small board
* fix inverted logic
* logic should be actually <= 4 snakes, not 7
* WIP: initial data model for new meta props
* WIP: implemented new props
* test and bug fix:
- add coverage of players and sizes
- fix unlimited map size bug
* FIX: update supported players for arcade to 6
* fix: test should be min -> max, not max->max
* Change some naming and the FixedSizes function
* update comment to reflect API changes
* improve comment clarity
* rename field for improved clarity
* change some more "map" -> "board" wording
* add helper to draw a ring of hazards
* refactor tests to not be internal tests
* add "hz_inner_wall" map
* add "hz_rings" map
* fix map registry
* fix: edge case bugs in drawRing
* remove println
* add "hz_columns"
* add "hz_rivers_bridges" map
* WIP: implementing spiral hazards map
* finish basic testing of 'hz_spiral'
* include first turn
* add "hz_hazards" map
* remove incorrect author
* add "hz_grow_box" map
* add "hz_expand_box" map
* add "hz_expand_scatter" map
* remove debug
* document the new "Range" method
* - use rules.RulesetError instead of generic error
- use a rules.Point for map rivers and bridgets map key
* use rules.RulesetError instead of errors.New
* provide more detail about boundar conditions
* fix documentation (max can be == min)
* add unit tests
* add "namcap" map
* adjust hazards and starting food positions
* add food randomly, not on top of hazards
* add exits on the top and bottom
* rename to arcade_maze
* add maps README
* test for ArcadeMazeMap
* adjustments to hazards in arcade_maze