snengame/README.md

90 lines
3.1 KiB
Markdown
Raw Normal View History

2021-07-16 15:52:18 -04:00
# Defense of the SnederDome
A quick and dirty prototype of a game server for snengame.
2021-07-23 12:10:49 -04:00
Contains local debug isntance (engine), server (server), and a client (client).
2021-07-16 15:52:18 -04:00
Written in-between concussion dizzy spells; some decisions made to minimize having to think hard about them.
2021-07-23 12:10:49 -04:00
Other decisions made to deal with Websockets, which I'm learning as I go, and having multiple games running.
2021-07-16 15:52:18 -04:00
## What's implemented
2021-07-25 15:35:57 -04:00
* All cards and effects (Jokers are Valkyires)
2021-07-16 15:52:18 -04:00
* A hacky loop to test out game commands
2021-07-29 15:03:07 -04:00
* Janky clients (one command prompt, one slightly nicer command prompt) and server
2021-07-16 15:52:18 -04:00
## What's not implemented
2021-07-29 15:03:07 -04:00
* better clients
2021-07-23 12:10:49 -04:00
## How to build
2021-07-29 15:03:07 -04:00
Run "make all" to generate all four binaries (engine,client,client2,server).
2021-07-23 12:10:49 -04:00
Otherwise, run "make [binary name]" to geneerate a specific one.
2021-07-29 15:03:07 -04:00
## How to use clients
"client" is a raw command line option that lets you control everything sent to the server outside of polling.
"client2" has a TUI interface that shows the current state at all times and will automatically update on server BroadcastUpdate events
Both use the following commands:
2021-07-29 15:29:49 -04:00
### Session Commands:
2021-07-29 15:29:31 -04:00
2021-07-29 15:03:07 -04:00
Session commands can be input at any time
Session commands are prefixed with "0":
0 query: Tell the server you're looking for a game
0 join: Join the game the server created for you
0 leave: Leave the game and kill the client
### State Commands:
State commands are prefixed with "1":
1 b: Tell the server you're ready. If both players have readied up, choose to go first and start the game
1 s: Start your turn if possible
1 e: End your turn if possible
1 g: Get a copy of the current game state
### Action commands:
Action commands are prefixed with "2":
2 s: Scry your life points in cards
2 d <x>: Draw card at position x from your most recent scry
2 p <x> <y>: play card at postion x in your hand to postion y on your side of the board (from the left)
2 m <x> <y>: move card at position x on the board to position y on the board
2 a <x> <y>: attack position y with card at position x on the board
2021-07-16 15:52:18 -04:00
## How to test
2021-07-23 12:10:49 -04:00
Run the engine binary to use the built in game loop.
2021-07-16 15:52:18 -04:00
Commands are entered like so:
2021-07-16 15:53:50 -04:00
2021-07-16 15:52:18 -04:00
s|a <player id> <command character> arguments
State Commands:
2021-07-16 15:53:50 -04:00
2021-07-16 15:52:18 -04:00
d: Print debug screen
g: Print game screen
b: Begin game
s: Start turn
e: End turn
Action Commands:
2021-07-16 15:53:50 -04:00
2021-07-16 15:52:18 -04:00
s: Scry your life points in cards
d <x>: Draw card at position x from your most recent scry
p <x> <y>: play card at postion x in your hand to postion y on your side of the board (from the left)
m <x> <y>: move card at position x on the board to position y on the board
a <x> <y>: attack position y with card at position x on the board
Example Commands:
2021-07-16 15:53:50 -04:00
2021-07-16 15:52:18 -04:00
s 1 d: (available to both players at any time) show debug screen
s 1 g: (available to both players at any time) show game screen
s 1 s: Start Player 1 (Sentinal)'s turn
a 2 p 0 1: Player 2 (Scourge) places the card at hand position 0 on board position 1
a 2 d 2: Player 2 (Scourge) draws the card at position 2 of their most recent scry
## Other notes:
2021-07-29 15:03:07 -04:00
Player 1 (the top side of the board) is known as Sentinal and is the first person to join the match.
2021-07-16 15:52:18 -04:00
Player 2 (the bottom side of the board) is known as Scourge.
Yes these are from DOTA Allstars