UNPKG

3.74 kBMarkdownView Raw
1# Agent vs. Agent
2
3Agent vs. Agent is intended to be a collection of simple games that can be played by computer programs developed by people of various levels of experience. Agent vs. Agent targets small groups of people, and attempts to provide the tools necessary to conduct competitive agent vs agent combat. The ultimate goal is to help facilitate learning, whether that be through exploring new languages, learning new concepts, or smashing your co-workers egos.
4
5# Current games
6
7* Hearts
8* Ultimate tic tac toe (in the works)
9
10[![Build Status](https://travis-ci.org/phillc/agentvsagent.png)](https://travis-ci.org/phillc/agentvsagent)
11
12# This is an alpha release
13
14* The server isn't stable... it will leak memory (games don't clean up after them selves), it will crash when a client does something unexpected (like disconnect in the middle of a turn...), it will still assign disconnected players to games (and then crash).
15* The transport layer may change. The API might change.
16* I want to make the barrier to entry much lower, but I haven't tackled it yet.
17* See the milestones for more information.
18
19## Goals
20
21* Privately deployable: decentralized for low infrastructure costs
22* Support many languages: for a larger audience
23* Human playable games: to be able to see how your work is doing
24* Low barrier to entry: so anyone can start a server and challenge others
25
26## Installation
27
28* Install node: [via package manager](https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager)
29* npm install -g agentvsagent
30* run `ava` for command options
31
32## Starting an agent
33
34* Clone or download this repository.
35* Copy the files in the dist/::game::/::language::/ directory
36
37## Tips
38
39* Basic
40 * Isolate your logic to the starter agent in a different file/module, to reduce conflict if the api changes.
41 * Keep your agent under source control
42* Advanced
43 * Unit test at least your supporting code
44
45## Your first hearts agent
46
47Simple heuristics should make a hearts agent very competitive. The sample agents already provide a list of cards that are valid to play, and then they choose from that list randomly.
48
49* Your first step could be to take that list of valid cards, and sort them from low to high, and play the lowest card.
50* Make another agent, and play cards from high to low and compare the results.
51* Eventually, add a condition that if the Queen of Spades can be played safely, do so.
52* Your next heuristic could be as simple as playing the highest card that can be played safely, or play the highest card if the trick has no points.
53
54From there, you should be able to code against other scenarios as you observe the behaviors of your agent while playing against it in the web UI.
55
56## Potential game ideas
57
58* Team games: Spades, Bridge
59* Variable # of players:
60* Pathing: Othello (Reversi), Blokus, Tsuro, Cyclades
61
62## Contributing
63
64### Mac OSX installation instructions:
65
66* Fork project on github and clone
67* run `npm install`
68* run tests via `make test`
69
70The command `make setup` has a more complete setup, including thrift
71
72## In need of
73
74Sample agents for languages
75
76## Known major issues
77
78* When a bot disconnects, the server still attempts to send them a message and will cause an exception
79
80## Changelog
81
82# 0.0.14
83
84* Reduced number of exceptions to one
85
86# 0.0.12
87
88* Changed position from an enumerable to a string *turns ouut to be potentially backwards incompatible*
89
90# 0.0.11
91
92* Implemented turn time
93* Nicer error messages
94* Cleaned up server input
95* Cleaned up Sample agents
96
97# 0.0.10
98
99* Implemented validation of legal plays
100
101# 0.0.9
102
103* Haskell bot
104
105# 0.0.6
106
107* Hearts human player implemented
108
109
110## Credits
111
112* Thrift: http://thrift.apache.org/
113* Cards: https://github.com/selfthinker/CSS-Playing-Cards