Recommend
18 
 Thumb up
 Hide
43 Posts
1 , 2  Next »   | 

Hive» Forums » News

Subject: New Hive AI! (beta) rss

Your Tags: Add tags
Popular Tags: a-tester [+] [View All]
Chris Pacejo
United States
Boston
Massachusetts
flag msg tools
badge
Avatar
mbmbmbmbmb
Hi all, I've been working on a Hive AI in my spare time just for fun. I've gotten it good enough that I can't beat it, so I figure it's time to share. You can try it out at http://bugs.pacejo.net/. It is text-based (no graphical board), so you will need to know BoardSpace.net notation (e.g. wA1 bQ/) and have a physical (or virtual) set on hand.

NOTE: I have currently limited the number of active sessions to keep my server from being overloaded; if you are unable to connect this is probably why. I'll raise this limit if it proves to be a problem. If you need to suspend an active game please bookmark it; you can return to the bookmark later and pick up right where you left off.

Please let me know if you find any bugs or dumb AI behavior! The only bugs I know of currently is that the engine will not detect move cycles (which should result in a draw), and Pillbug-immobilization is not saved across sessions; these are in my TODO. And I am only a beginner Hive player so I cannot judge how bad the AI is (Though to me it seems that its openings are poor, its midgame is mediocre, and its endgame is solid; which tells me I need to enhance the heuristic function.)

Enjoy!
10 
 Thumb up
2.27
 tip
 Hide
  • [+] Dice rolls
Kolja Geldmacher
Germany
Niedersachsen
flag msg tools
designer
badge
Avatar
mbmbmbmbmb
Please, sell it to the guys who made the android app. It still has no ai...
Fh
5 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Dave Dyer
United States
Playa Del Rey
California
flag msg tools
designer
Avatar
mbmbmbmbmb
How does it fare against the AI at boardspace? Surely you must have tried a game or two?
3 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Chris Pacejo
United States
Boston
Massachusetts
flag msg tools
badge
Avatar
mbmbmbmbmb
ddyer wrote:
How does it fare against the AI at boardspace? Surely you must have tried a game or two?


Only one game so far (which my AI won). Not very scientific I will try some more when I get a chance; maybe this weekend.
4 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Dave Dyer
United States
Playa Del Rey
California
flag msg tools
designer
Avatar
mbmbmbmbmb
If your AI has the chops, maybe we can arrange to incorporate
it into Boardspace. A better hive robot is on a lot of wish lists.
5 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Chris Pacejo
United States
Boston
Massachusetts
flag msg tools
badge
Avatar
mbmbmbmbmb
Played some more games vs. Dumbot:

HV-Dumbot-guest-2014-11-16-1234 (Bugs win; despite me fat-fingering initial bG1 as bA1)
HV-guest-Dumbot-2014-11-16-1252 (Dumbot win)
HV-guest-Dumbot-2014-11-16-1355 (Bugs win)

These games are sometimes bizarre. In particular the -1252 game Bugs made a lot of do-nothing moves; I think it knew it was going to lose for much of that game.
1 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Scrumpy Jack
United Kingdom
flag msg tools
badge
Avatar
mbmbmbmbmb
can you add use all?

use {ladybug,mosquito,pillbug,all}
 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Christian Sperling

Brisbane
Australia
msg tools
Avatar
mbmbmbmbmb
Whatever creates a stronger HIVE AI, I will support it! To have a credible AI opponent I believe there is no other way for now than to implement an opening library with standard moves. The current bots lose their games against experts already in the first 5 moves when they make a single mistake there.
Additionally some basic rules should be added to the code, for example: Never start a game with an ant (at least not when playing at maximum strength).
If any Hive AI developer has some specific questions - feel free to drop me a message and I will see, if I can provide helpful advice.
7 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Chris Pacejo
United States
Boston
Massachusetts
flag msg tools
badge
Avatar
mbmbmbmbmb
Eucalyx wrote:
To have a credible AI opponent I believe there is no other way for now than to implement a opening library with standard moves. The current bots lose their games against experts already in the first 5 moves when they make a single mistake there.
Additionally some basic rules should be added to the code, for example: Never start a game with an ant (at least not when playing at maximum strength).


Yes, I've been considering an opening library, but I'm not by any means an experience Hive player. Do you know where I can find the current "best" opening library? Is this covered in Play Hive Like A Champion?

FWIW I've never seen my AI start with an ant. One of its metrics is total mobility; it realizes pretty quickly that opening with an ant hinders that. (Usually it does some sequence like hopper-ant-queen, then pins its opponent's queen with the ant.)
1 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Scrumpy Jack
United Kingdom
flag msg tools
badge
Avatar
mbmbmbmbmb
ok so I'm in a dreadful position (your AI likes to pin!)

wQ
wS1 \wQ
bQ /wS1
bA2 bQ\
bA3 bA2-
bA1 bA3/
wG1 -bA2
wG3 /wG1
wA1 \wG3
wS2 \wA1
wG2 wS2/
bB1 wS1
bB2 wQ
turn white
board hash: f1fa2c07f59b6324



why can't I move wG3 -bQ (which is the same as wG3 wS2-)?
wG3 is the bottom G

your AI tells me illegal move.
 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Chris Pacejo
United States
Boston
Massachusetts
flag msg tools
badge
Avatar
mbmbmbmbmb
SJack wrote:
can you add use all?

use {ladybug,mosquito,pillbug,all}


Done!
1 
 Thumb up
0.05
 tip
 Hide
  • [+] Dice rolls
Chris Pacejo
United States
Boston
Massachusetts
flag msg tools
badge
Avatar
mbmbmbmbmb
SJack wrote:
ok so I'm in a dreadful position (your AI likes to pin!)


Before I added the queen-surroundedness metric, it would routinely stalemate by nearly completely pinning its opponent

Quote:
why can't I move wG3 -bQ (which is the same as wG3 wS2-)?


I'll check this particular board out when I get home tonight. It's possible that what Bugs thinks the board is is different than what you have on the table in front of you; when I started developing I was constantly mis-placing pieces. But I won't rule out a bug yet
1 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Chris Pacejo
United States
Boston
Massachusetts
flag msg tools
badge
Avatar
mbmbmbmbmb
SJack wrote:

why can't I move wG3 -bQ (which is the same as wG3 wS2-)?


Thanks for the pic! I thought grasshoppers could only hop across hex edges, not along them? At least this is the way it seems to me from the illustration in the official rules? (The text isn't clear on this.)
1 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Scrumpy Jack
United Kingdom
flag msg tools
badge
Avatar
mbmbmbmbmb
you're right, it's my mistake. it's the first game I played with a pointy edge of a tile facing up (needed for the move notation) which threw me a bit.

I'll pay more attention next time.

Love the shell. I live on the command line, so If you big this up with a web interface, I do hope you keep this shell too.
 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Kolja Geldmacher
Germany
Niedersachsen
flag msg tools
designer
badge
Avatar
mbmbmbmbmb
Your right Chris.
This Grasshoppers only legal move would be wG3 /wS2
FH
1 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Chris Pacejo
United States
Boston
Massachusetts
flag msg tools
badge
Avatar
mbmbmbmbmb
SJack wrote:
you're right, it's my mistake. it's the first game I played with a pointy edge of a tile facing up (needed for the move notation) which threw me a bit.


I usually play flat-side-up too and get similarly confused

Quote:
Love the shell. I live on the command line, so If you big this up with a web interface, I do hope you keep this shell too.


Definitely! I plan to keep at least both the telnet CLI and a RESTful (i.e. non-AJAX) web UI as lowest-common-denominator options.
1 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Randall Ingersoll
United States
Port Orange
Florida
flag msg tools
mbmbmbmbmb
colanderman wrote:
Do you know where I can find the current "best" opening library? Is this covered in Play Hive Like A Champion?



No, unfortunately there is not an opening library in my book. I have been working on a book on openings, but have not had a lot of time to devote to it. Maybe this will prompt me to make some time!
3 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Scrumpy Jack
United Kingdom
flag msg tools
badge
Avatar
mbmbmbmbmb
Flashhawk wrote:
This Grasshoppers only legal move would be wG3 /wS2


are you certain?
 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Kolja Geldmacher
Germany
Niedersachsen
flag msg tools
designer
badge
Avatar
mbmbmbmbmb
SJack wrote:
Flashhawk wrote:
This Grasshoppers only legal move would be wG3 /wS2


are you certain?

Ahm.. yes!?!
 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Chris Pacejo
United States
Boston
Massachusetts
flag msg tools
badge
Avatar
mbmbmbmbmb
Flashhawk wrote:
Your right Chris.
This Grasshoppers only legal move would be wG3 /wS2
FH


Other grasshopper (the one at the bottom, not the top-left). That hopper can move \wS2 and bB1/.
1 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Chris Pacejo
United States
Boston
Massachusetts
flag msg tools
badge
Avatar
mbmbmbmbmb
A (textual) web interface is now available at http://bugs.pacejo.net/. Please give it a try!

(As before if you have connection errors, it is possible that it has reached its connection limit and you should try again later.)
1 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Scrumpy Jack
United Kingdom
flag msg tools
badge
Avatar
mbmbmbmbmb
Can you show me my submitted move on the "board" before the AI routine starts?
Currently, on a 20 second AI timeout, i have the impression that it takes 20 seconds to submit my move.
Perhaps also add "thinking" after my move submission during the AI routine. That would match the "turn white" once the AI has submitted.

Perhaps change "turn white" to "white's turn" but that's just being fussy.
 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Chris Pacejo
United States
Boston
Massachusetts
flag msg tools
badge
Avatar
mbmbmbmbmb
SJack wrote:
Can you show me my submitted move on the "board" before the AI routine starts?


Good idea; done!

Quote:
Perhaps change "turn white" to "white's turn" but that's just being fussy.


Those are commands meant to be copy + pasted into the command line client in setup mode. (The human-readable equivalent is in the "Status" line near the top, it reads "white to play" or "black to play".) Soon I'm just going to replace that box with graphical output (and maybe make that box's original contents available under an "Export to command-line client" button).
2 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Ryan James
United States
Davis
California
flag msg tools
mbmbmbmbmb
There seems to be a mild bug (pun not intended). After the following game -- a win for white -- the game reported that it was a draw.

wQ .
bA2 \wQ
bA3 bA2-
bB2 /bA2
wG1 bB2\
wG2 wG1-
bA1 wG2-
wB1 /wG1
bB1 \wB1
bG1 \bB1
wS2 /bG1
bQ wS2\
wA1 bQ\
wS1 -wA1
wA2 \wS1
1 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Chris Pacejo
United States
Boston
Massachusetts
flag msg tools
badge
Avatar
mbmbmbmbmb
autoplectic wrote:
There seems to be a mild bug (pun not intended). After the following game -- a win for white -- the game reported that it was a draw.


Thanks for testing! Visualized here: http://bugs.pacejo.net/hive-client#x=&t=B&b=wQ@.,bA2@*wQ,bA3....

The reason for this is that I've permanently enabled the "black-draw rule", which states that, if black could surround wQ the very next turn after white surrounds bQ, it is considered a draw rather than a white win. The intent is to counteract the (slight but measurable, as noted in other threads) benefit white enjoys by going first.

(In the above example, either bA1 or bG1 can complete surrounding wQ.)

I'll add an option to disable this rule (as well as the "no-queen-first-move" rule), as I agree it's confusing for those who are used to the standard Hive rules.
1 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
1 , 2  Next »   | 
Front Page | Welcome | Contact | Privacy Policy | Terms of Service | Advertise | Support BGG | Feeds RSS
Geekdo, BoardGameGeek, the Geekdo logo, and the BoardGameGeek logo are trademarks of BoardGameGeek, LLC.