I propose we have an AI tournament. Decide on a game and a way to run the bots. We could agree on a language or if that is not possible, write a text protocol for the bot to use to communicate with the game server.
Name:
Anonymous2015-06-25 8:09
Go playing bots written in Go.
Name:
Anonymous2015-06-25 13:59
>>2 I don't want to learn Go, but a Go tournament would be a fun challenge.
Name:
Anonymous2015-06-25 19:39
>>2 Go is too hard. Pick something easier. Like weighted rock paper scissors or something. Or a simple fighting game with punches and blocks.
Name:
Anonymous2015-06-25 19:54
how about gomoku?
Name:
Anonymous2015-06-25 20:28
>>5 I hadn't heard of it before but sure, it looks like a good choice. It should be a game where you can write a novice bot in 15 minutes, to make it easier to participate for time constrained people. https://en.wikipedia.org/wiki/Gomoku
(define (board-ref board board-corner point) (if (not (point-on-board? point board-corner)) (error "Index out of range" point board-corner)) (vector-ref board (point->index point board-corner)))
(define (board-set! board board-corner point value) (if (not (point-on-board? point board-corner)) (error "Index out of range" point board-corner)) (vector-set! board (point->index point board-corner) value))
(define (player-still-chain? board board-corner player) (lambda (point) (and (point-on-board? point board-corner) (eq? player (board-ref board board-corner point)))))
;; Fix the append to make it efficient. (define (all-bit-strings len) (if (= len 1) '((0) (1)) (let ((lower (all-bit-strings (- len 1)))) (append (map (lambda (bit-str) (cons 0 bit-str)) lower) (map (lambda (bit-str) (cons 1 bit-str)) lower)))))
;; All directions are all non-zero bit strings. ;; all-bit-strings has the zero bit string at the front, ;; so just cdr it. (define (all-directions dimension) (cdr (all-bit-strings dimension)))
(define (find-max-length-of-move point still-chain? all-directions) (apply max (map (lambda (direction) (+ (count-chain-length point (lambda (p) (point-sum p direction)) still-chain?) ;; count length going forwards (count-chain-length point (lambda (p) (point-sub p direction)) still-chain?) ;; count length going backwards -1)) ;; center point is counted twice. all-directions)))
Why don't you just run a dedicated server in any language you want and give us the protocol to interact with it? That way we can make bots in curl, netcat, C, Scheme, APL or whatever the fuck we want.
Name:
Anonymous2015-06-26 1:37
New version. Changed some game code a little and added a naive bot that calculates the longest chains for each move on the board and picks a random one from that.
Haven't written it yet. What format would you want? sexp? json? I'll just write a scheme bot that proxies move requests over a socket. You can run these all locally.
(define (board-ref board board-corner point) (if (not (point-on-board? point board-corner)) (error "Index out of range" point board-corner)) (vector-ref board (point->index point board-corner)))
(define (board-set! board board-corner point value) (if (not (point-on-board? point board-corner)) (error "Index out of range" point board-corner)) (vector-set! board (point->index point board-corner) value))
(define (player-still-chain? board-read board-corner player) (lambda (point) (and (point-on-board? point board-corner) (eq? player (board-read point)))))
;; Fix the append to make it efficient. (define (all-bit-strings len) (if (= len 1) '((0) (1)) (let ((lower (all-bit-strings (- len 1)))) (append (map (lambda (bit-str) (cons 0 bit-str)) lower) (map (lambda (bit-str) (cons 1 bit-str)) lower)))))
;; All directions are all non-zero bit strings. ;; all-bit-strings has the zero bit string at the front, ;; so just cdr it. (define (all-directions dimension) (cdr (all-bit-strings dimension)))
;; It's assumed that the center point belongs to the player. (define (find-max-length-of-move point still-chain? all-directions) (apply max (map (lambda (direction) (+ (count-chain-length (point-sum point direction) (lambda (p) (point-sum p direction)) still-chain?) ;; count length going forwards (count-chain-length (point-sub point direction) (lambda (p) (point-sub p direction)) still-chain?) ;; count length going backwards 1)) ;; center point is not counted. all-directions)))
- - D - - p - - B d j j j - - - - - D s - p F F B d - - - - - - - - s - - p c c c d M - - - - - - s H H - J - - q M - - g - u - e Y r r r J - - q - - g u u e e Y k k k S S E - q - - g N R R b w - t - - - E - - - - N - K b P w - t - - n n n o - - - K b - P - - t - y y m o - - - - - a L L l - T h h m o C - A A G I a - l z T - i h - - C V - G I a f l z x - i i - - - V - - - Z Z f z - x - X - - O - - Q Q - - f z - W - X - - O - U U m - - - z - - W -
Now ai2 will respond to threats. If an opponent is about it win, it moves in the way. base64'd the gzipped source because posting the source every time was getting spammy.
>>21 The only good open source games used to be commercial. There are no exceptions. What about counter-strike 1.6? I heard valve released the source to that and there is a linux port. Either that or it was leaked. I can't remember now.
If noone says anything I'm just going to make a versus danmaku that puts robocode to shame.
Name:
Anonymous2015-06-28 2:54
>>26 I'll participate only if I can play as Marisa.
Name:
Anonymous2015-06-28 3:36
>>27 Is there any public domain touhou game art I can use that you know of?
Name:
Anonymous2015-06-29 4:24
What spatial data structure should I used for danmaku? Naive check collisions between all pairs wouldn't be so bad because you only need to check between the player and unfriendly bullets.
Name:
Anonymous2015-06-29 13:34
>>29 it's O(n) to loop through all bullets and test again the player, you're not going to get better than that.
>>30 Yeah, but then the AIs will need to rescan the bullets for dodging purposes. I think I'll throw them into buckets by distance from their enemy player so players can loop through bullets that are within certain distance categories.
You have to loop through all bullets to update their positions anyway. Even if you have several thousand, the CPU can do a million times more operations per second.