This repository has been archived by the owner on Apr 16, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
about.html
445 lines (392 loc) · 15.6 KB
/
about.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>SkullSpace :: Game AI Hackathon</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<link rel="shortcut icon" type="image/x-icon" href="/img/logo.png" />
<link rel="icon" type="image/x-icon" href="/img/logo.png" />
<!-- Le styles -->
<link href="/css/bootstrap.min.css" rel="stylesheet">
<style type="text/css">
body {
padding-top: 20px;
padding-bottom: 40px;
}
/* Custom container */
.container-narrow {
margin: 0 auto;
max-width: 700px;
}
.container-narrow > hr {
margin: 30px 0;
}
/* Main marketing message and sign up button */
.jumbotron {
margin: 60px 0;
text-align: center;
}
.jumbotron h1 {
font-size: 72px;
line-height: 1;
}
.jumbotron .btn {
font-size: 21px;
padding: 14px 24px;
}
/* Supporting marketing content */
.marketing {
margin: 60px 0;
}
.marketing p + h4 {
margin-top: 28px;
}
</style>
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="/js/html5shiv.js"></script>
<![endif]-->
<!-- fork me on github stuff, from http://codepo8.github.com/css-fork-on-github-ribbon/ -->
<style>
#forkongithub a {
background:#a00;
color:#fff;
text-decoration:none;
font-family:arial, sans-serif;
text-align:center;
font-weight:bold;
padding:5px 40px;
font-size:1rem;
line-height:2rem;
position:relative;
transition:0.5s;
}
#forkongithub a:hover {
background:#060;
color:#fff;
}
#forkongithub a::before, #forkongithub a::after {
content:"";
width:100%;
display:block;
position:absolute;
top:1px;
left:0;
height:1px;
background:#fff;
}
#forkongithub a::after {
bottom:1px;
top:auto;
}
@media screen and (min-width:1000px) {
#forkongithub {
position:absolute;
display:block;
top:0;
left:0;
width:200px;
overflow:hidden;
height:200px;
}
#forkongithub a {
width:200px;
position:absolute;
top:60px;
left:-60px;
transform:rotate(-45deg);
-webkit-transform:rotate(-45deg);
box-shadow:4px 4px 10px rgba(0,0,0,0.8);
}
}
</style>
</head>
<body>
<div class="container">
<div class="masthead">
<ul class="nav nav-pills pull-right">
<li><a href="/">Home</a></li>
<li class="active"><a href="/about/">About</a></li>
<li><a href="/contact/">Contact</a></li>
<li><a href="/rules/">Rules</a></li>
<li><a href="/stats/">Stats</a></li>
<li><a href="/api/">API</a></li>
</ul>
<h3><a class="muted" href="http://skullspace.ca/">SkullSpace</a></h3>
</div>
<hr>
<div class="jumbotron">
<h1>Game AI Hackathon</h1>
<p class="lead">September 19th – 21st, 2014</p>
<a class="btn btn-large btn-success" href="/gameai-sdk-v3.zip">Download SDK v3</a>
</div>
<hr>
<div class="span12">
<div class="span12">
<h3>SkullWhist</h3>
<p>The game for this event is <em>SkullWhist</em>, a heavily
modified form
of <a href="https://en.wikipedia.org/wiki/Bid_whist">Bid
Whist</a>. It has been modified to be quicker (one round),
simpler (static trump suit, no kitty), and two-player (not
four). The name SkullWhist was chosen due to its
undisputable awfulness.</p>
<p>To start a game, both bots must trigger
the <strong><a href="/api/new-game/">new-game</a></strong> endpoint. Once two bots are
matched, both will be given a hand consisting of 13 random cards from
a standard 52-card deck, and the remaining cards will be thrown
out. Each card has a suit, which is one of:</p>
<dl class="dl-horizontal">
<dt>C</dt>
<dd>Clubs</dd>
<dt>D</dt>
<dd>Diamonds</dd>
<dt>H</dt>
<dd>Hearts</dd>
<dt>S</dt>
<dd>Spades</dd>
</dl>
<p>In addition, each card will have a value between 1 and 13,
inclusive. Using integers helps avoid the need to add conversion
logic between face cards and integer values in the bots.</p>
<p>Once each bot has been given their hand of cards for the game, they
must submit a bid to the server using
the <strong><a href="/api/bid/">bid</a></strong> endpoint. The bid must be an integer
between 1 and 13, inclusive, and represents the number of rounds
(also called <em>tricks</em>) the bot thinks it can win based on the
cards in its hand. Once bidding has completed, play begins.</p>
<p>Each round consists of two turns, one for each bot. In the first
round, the order of the turns is chosen randomly, and is indicated
to the bot by the
<code>your-turn</code> key returned by
the <strong><a href="/api/status/">status</a></strong> endpoint. The bot that leads
the round, meaning having the first turn, may choose to play any
card in its hand. If the bot instead has the second turn in the
round, it is restricted in the card it may play. The card played in
the first turn of a round determines the suit for the round, and the
bot with the second turn must play a card matching that suit if it
has any cards of that suit remaining in its hand. If the bot with
the second turn has no cards matching the suit of the card played in
the first turn, it may choose to play any card in its hand.</p>
<p>Once both turns have been taken, and both cards have been played,
for a round, the server determines the winner of the round and
awards a trick to one of the two bots, and grants the winning bot
the lead turn on the next round. The winner of a round is determined
as follows:</p>
<ul>
<li>If the cards both had the same suit, the card with the greatest
value wins</li>
<li>If the cards had different suits:
<ul>
<li>If the second card's suit was Spades, the second card
wins</li>
<li>Otherwise, the first card wins</li>
</ul></li>
</ul>
<p>The rules for awarding a trick are complicated by Spades being the
trump suit, which gives any card in the suit of Spades the following
properties:</p>
<ul>
<li>When comparing a card in the suit of Spades to a card of another
suit, the card in the Suit of spades wins</li>
<li>When comparing two cards in the suit of Spades, the card with
the greatest value wins</li>
</ul>
<p>Once 13 rounds have been played, the server will score the
game. Scoring gives great weight to the accuracy of each bot's bid
when compared to the tricks it has been awarded. The score for each
bot is calculated as follows:</p>
<ul>
<li>If the number of tricks matches the bid:
<ul><li><code>score = bid * +10</code></li></ul>
</li>
<li>If the number of tricks is less than the bid:
<ul><li><code>score = bid * -10</code> <strong>negative</strong></li></ul>
</li>
<li>If the number of tricks is greater than the bid:
<ul><li><code>score = (bid * +10) + (tricks - bid)</code></li></ul>
</li>
</ul>
<p>Seeing the rules written out like this is more difficult to understand than an
example, so here are some:</p>
<pre>1) This shows that a bot with more accurate bidding logic can match the
score of a bot with smarter playing logic:
Bot 1 had bid = 1 and tricks = 11
--> score = (1 * +10) + (11 - 1) = 10 + 10 = 20
Bot 2 had bid = 2 and tricks = 2
--> score = (2 * +10) = 20
2) This shows that when two bots both play it safe on bidding, the bot with
the smarter playing logic will win:
Bot 1 had bid = 1 and tricks = 7
--> score = (1 * +10) + (7 - 1) = 10 + 6 = 16
Bot 2 had bid = 1 and tricks = 6
--> score = (1 * +10) + (6 - 1) = 10 + 5 = 15
3) This shows that when two bots both fail to make their bid, they both
receive negative scores. As scores are compared numerically, Bot 2 would
win by virtue of its lower bid:
Bot 1 had bid = 8 and tricks = 7
--> score = (8 * -10) = -80
Bot 2 had bid = 5 and tricks = 6
--> score = (5 * -10) = -50</pre>
<p>The number of tricks awarded to each player in any completed game will add up to
13, the number of rounds.</p>
<p>After scoring has completed, both bots will be released from their game by the
server, and will be free to call the <strong><a href="/status/new-game/">new-game</a></strong> endpoint again. Unlike regular
Bid Whist which accumulates scores across multiple rounds, ending when one
player has reached a certain score threshold, each game of SkullWhist consists
of a single, independent round.</p>
</div>
<div class="span12">
<h3 id="glossary">Glossary</h3>
<dl class="dl-horizontal">
<dt>Bid</dt><dd>An integer between 1-13, inclusive.</dd>
<dt>Round</dt><dd>An interaction consisting of two turns.</dd>
<dt>Suit</dt><dd>One of Clubs, Diamonds, Hearts, and Spades.</dd>
<dt>Trick</dt><dd>A round that has been scored</dd>
<dt>Trump</dt><dd>A card in the suit of Spades.</dd>
<dt>Turn</dt><dd>The playing of a card by a bot.</dd>
<dt>Value</dt><dd>An integer between 1-13, inclusive.</dd>
</dl>
</div>
<div class="span12">
<h3 id="ai">AI</h3>
<p>This game has 13 decisions in it. The decisions are as follows:</p>
<ol>
<li>What number of tricks to bid, from 1-13</li>
<li>Which card to play in round 1, from 13 options</li>
<li>Which card to play in round 2, from 12 options</li>
<li>Which card to play in round 3, from 11 options</li>
<li>Which card to play in round 4, from 10 options</li>
<li>Which card to play in round 5, from 9 options</li>
<li>Which card to play in round 6, from 8 options</li>
<li>Which card to play in round 7, from 7 options</li>
<li>Which card to play in round 8, from 6 options</li>
<li>Which card to play in round 9, from 5 options</li>
<li>Which card to play in round 10, from 4 options</li>
<li>Which card to play in round 11, from 3 options</li>
<li>Which card to play in round 12, from 2 options</li>
</ol>
<p>In round 13, only one card is left, and therefore the bot has no
choice in which card is played. Currently, the example bots all
choose randomly from the set of all the valid choices allowed,
leading to any two example bots to each win about half the time in
our server burn-in tests.</p>
<p>There are two main facets of the AI for a bot: bidding and playing.</p>
<p>The bidding algorithm gets to make choice 1. Careful bidding is
important as tricks awarded that are within the value of the bid are
worth ten times more than extra tricks above the bid, and bidding
too high is catastrophic, especially in this single-round version of
the game.</p>
<p>The playing algorithm gets to make choices
2-13. The <strong><a href="http://gameai.skullspace.ca/api/status/">status</a></strong>
endpoint offers both the opponent's ID and its bid for this round,
which can be used to tailor your bot's strategy. The opponent's bid
is made available to you only after your bot has bid.</p>
<p>
Some things to think about when designing your AI, in no particular order:
</p>
<ul>
<li>
Does the bid your opponent makes tell you anything about the cards it has?
For example: The number of trump, or the number of cards above 10, or something else?
</li>
<li>
You know your opponent has 13 cards out of 52, and you also know what your
13 cards are, so you have some idea of what they can and cannot have in
their hand to start.
</li>
<li>
When an opponent plays an off-suit card in the second turn, you know that
they no longer have any cards in the suit of the card played in the first
turn.
</li>
<li>When you have the opportunity to play an off-suit card, consider whether
you want to:
</li>
<ul>
<li>
Play one of your trump cards
</li>
<li>
Play a card that has no current strategic value
</li>
<ul>
<li>
A card in a suit you know the opponent no longer has, and can
therefore be trumped by them
</li>
<li>
A low-value card in a suit you know your opponent still has but will
reduce the number of cards you have in that suit, so you can trump in
that suit sooner.
</li>
</ul></ul></ul>
<p>
One endpoint that is not used by the example bots is
<strong><a href="http://gameai.skullspace.ca/api/old-game/">old-game</a></strong>, which lets you
look up all the information related to a game once it is over. This information
includes the starting hands dealt to each player, the bids, the tricks, the
scores, and the events of each round. You may also find the statistics and
records pages on the website useful, especially notable are the 'versus'
comparisons between bots if you are looking to make your AI opponent-specific.
</p>
<p>
That's all I have to say about your AI right now, other than a suggestion to
retain the basic interaction model provided in the example bots.
</p>
<p>
If another endpoint is needed to implement something for your bot, ask me (Mak)
on IRC and I'll consider it if I have time.
</p>
</div>
<div class="span12">
<h3>Future</h3>
<p>
Assuming this event isn't a discouraging disaster, I hope to have another,
larger event in 2015. If that interests you, please sign up to our mailing list
to be contacted about future developments:
</p>
<p>
https://groups.google.com/a/skullspace.ca/forum/#!forum/gameai
</p>
</div>
<div class="span12">
<br> <hr>
<br>
<h3 align="center">About SkullSpace, hosting organization</h3>
<div class="row-fluid marketing">
<div class="span12" align="center">
[<a href="https://twitter.com/SkullSpaceWpg">Twitter</a>]
[<a href="https://www.facebook.com/SkullSpaceWpg">Facebook</a>]
[<a href="http://www.meetup.com/Skullspace-Winnipegs-hackerspace/events/190250512/">Meetup</a>]
</div>
<div class="span12">
<p><a href="http://skullspace.ca/">SkullSpace</a> is a hackerspace in
Winnipeg, founded December 2010. It is a place for hackers, builders,
programmers, artists, and anybody interested in how stuff works to
gather in a common place and help focus their knowledge and
creativity. The hackerspace is located at
<a href="http://tinyurl.com/mzka28q ">2nd Floor, 374 Donald
St.</a></p>
<p>On the third Saturday of each month, SkullSpace holds a
<a href="https://en.wikipedia.org/wiki/Hackathon">hackathon</a>. A
hackathon is an open day where we have talks, projects, socialization,
and more! It's open to the public and free to check out. Past
hackathons have included baking cupcakes and mailing them overseas,
lectures on music creation and estoteric programming languages, and
bicycle repair and maintenance.</p>
<p>SkullSpace holds weekly meetings, every Tuesday at 6pm in our
hackerspace. If you're interested in joining come down and check
one out!</p>
</div>
</div>
</div> <!-- /container -->
<!-- Le javascript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="/js/jquery.min.js"></script>
<script src="/js/bootstrap.min.js"></script>
</body>
</html>