Commit graph

21 commits

Author SHA1 Message Date
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
Chris Hoefgen
7d9a9fb1ab
DEV-1556-sinkholes-map (#96)
* initial map implementation

* added support for larger/smaller boards

* basic unit test
2022-07-28 11:07:16 -07:00
Torben
663c377cc4
change map support for large #'s of snakes (#92)
* 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
2022-07-07 11:14:30 -07:00
Corey Alexander
08cb7ae61d
[Custom Map] Single Player Maze (#81)
* 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>
2022-07-04 10:25:28 -07:00
Chris Hoefgen
f6c3ed0791
speeding up how fast the expanding box grows from every 15 to every 12 turns (#89) 2022-06-28 14:46:21 -07:00
Torben
9d6b1147cd
fix for rivers and bridges snake start positions (#85)
* 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
2022-06-28 14:41:01 -07:00
Torben
3180429688
Add player and board size meta data to all game maps (#84)
* 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
2022-06-19 20:09:17 -07:00
bvanvugt
cb014e7b37 Add food and snake spawn locations to Arcade Maze. 2022-06-16 17:26:09 +00:00
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
Brad Van Vugt
0f15f34bdf
Add two more food spawns to Arcade Maze map. 2022-06-15 10:42:41 -07:00
Torben
f0dc0bcb38
DEV-1313: Add additional map types (#76)
* 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
2022-06-01 11:39:31 -07:00
Rob O'Dwyer
aa38bcd0eb
DEV 1283: Arcade maze map (#77)
* 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
2022-05-31 07:29:34 -07:00
Rob O'Dwyer
1adbc79168
DEV 953: Add basic maps support to CLI (#74)
* remove squad support and switch to using pipelines only in RulesBuilder

* remove spawn_food.standard from legacy ruleset definitions

* bugfix: Royale map generates Standard food

* add maps support to CLI

* add automated tests for all registered GameMap implementations

* update README
2022-05-25 11:24:27 -07:00
Torben
3bd1e47bb4
change all "int32" types to "int" (#75) 2022-05-25 11:17:41 -07:00
Rob O'Dwyer
e94d758a9b
DEV 1303: Add empty and royale maps and update game map interface (#72)
* move random generator into Settings

* add empty and royale maps

* place snakes on either cardinal or corner positions first
2022-05-17 15:45:56 -07:00
Rob O'Dwyer
6fa2da2f01 tests for SetupBoard and UpdateBoard and a bugfix 2022-05-11 16:30:08 -07:00
Rob O'Dwyer
1dcc1352cc add RegisterMap for testing convenience 2022-05-11 08:28:50 -07:00
Rob O'Dwyer
dab9178a55
DEV 1247: Add a new map generator interface (#71)
* reorganize code

* first draft of map generator interfaces

* add explicit random interface to board helpers

* implement standard map

* rename Generator to GameMap

* allow initializing snakes separately from placing them

* add random number generator to Settings

* updates to GameMap interface

* add helpers for creating and updating BoardState with maps
2022-05-11 08:26:28 -07:00