Dominion Strategy Forum

Please login or register.

Login with username, password and session length
Pages: [1] 2 3 ... 7  All

Author Topic: Play Temporum online, single-player against AI!  (Read 45618 times)

0 Members and 1 Guest are viewing this topic.

GendoIkari

  • Adventurer
  • ******
  • Offline Offline
  • Posts: 9756
  • Respect: +10839
    • View Profile
Play Temporum online, single-player against AI!
« on: January 19, 2015, 12:47:28 pm »
+26

http://www.pittersplace.com/temporum

Ok, so last weekend I decided on a whim to try and build a Temporum client in JavaScript. And to my surprise, I was able to do it! So the site is rough in terms of design. Then again, so was Isoropic. Now, this isn't a new Isotropic, mainly because there's no multiplayer support. No sever-side code at all; 100% JavaScript. But it works. The AI is pretty stupid, but provides a very basic benchmark as to if a strategy is at all viable.

So the game has all but 1 of the player cards implemented, and all but about 10 of the zone cards implemented. The 10 zones are picked randomly at the start of each game. To start a new game, refresh the page (I strive for usability, clearly).

Before you click a zone to move at the start of your turn, you can change history below you back and forth as much as you want, rather than making a "change history? yes or no" decision.

Suggestions and bug reports welcome; and keep in mind I've only actually been working on this for a week!

If you don't know how to play Temporum, then this site isn't going to teach you the rules... but it's as simple as Dominion, so you can just read through the rulebook online to self-teach.
« Last Edit: January 19, 2015, 01:44:14 pm by GendoIkari »
Logged
Check out my F.DS extension for Chrome! Card links; Dominion icons, and maybe more! http://forum.dominionstrategy.com/index.php?topic=13363.0

Thread for Firefox version:
http://forum.dominionstrategy.com/index.php?topic=16305.0

GendoIkari

  • Adventurer
  • ******
  • Offline Offline
  • Posts: 9756
  • Respect: +10839
    • View Profile
Re: Play Temporum online, single-player against AI!
« Reply #1 on: January 19, 2015, 12:50:22 pm »
0

So "AI only" mode just has all players be AI; the game will end almost immediately, then you can see who won and use the log to see what they did. I ran 100 5-player games this way to see if there was any turn-order advantage. The results:

Player 5: 26 wins
Player 2: 20 wins
Player 3: 20 wins
Player 1: 18 wins
Player 4: 16 wins

Of course this tells us very little about any possible turn-order advantage in a real game, because the AI definitely doesn't take advantage of any possible turn-order advantage. But still interesting to note.
Logged
Check out my F.DS extension for Chrome! Card links; Dominion icons, and maybe more! http://forum.dominionstrategy.com/index.php?topic=13363.0

Thread for Firefox version:
http://forum.dominionstrategy.com/index.php?topic=16305.0

Kirian

  • Adventurer
  • ******
  • Offline Offline
  • Posts: 7096
  • Shuffle iT Username: Kirian
  • An Unbalanced Equation
  • Respect: +9416
    • View Profile
Re: Play Temporum online, single-player against AI!
« Reply #2 on: January 19, 2015, 01:06:26 pm »
+1

So "AI only" mode just has all players be AI; the game will end almost immediately, then you can see who won and use the log to see what they did. I ran 100 5-player games this way to see if there was any turn-order advantage. The results:

Player 5: 26 wins
Player 2: 20 wins
Player 3: 20 wins
Player 1: 18 wins
Player 4: 16 wins

Of course this tells us very little about any possible turn-order advantage in a real game, because the AI definitely doesn't take advantage of any possible turn-order advantage. But still interesting to note.

Optimized or no, I'm all but certain even without running the numbers that those are indistinguishable from random for n=100.
Logged
Kirian's Law of f.DS jokes:  Any sufficiently unexplained joke is indistinguishable from serious conversation.

Watno

  • Margrave
  • *****
  • Offline Offline
  • Posts: 2745
  • Shuffle iT Username: Watno
  • Respect: +2984
    • View Profile
Re: Play Temporum online, single-player against AI!
« Reply #3 on: January 19, 2015, 01:10:52 pm »
+1

I think there's something wrong. I can't see any pawns or crowns, and can't figure out how to change history. I attached a screenshot of what it looks like for me.
I'm using Firefox on Windows 8, tell me if you need details.

EDIT: Ok, once you are in a zone you can change history, pretty sure there's still something missing though.
« Last Edit: January 19, 2015, 01:14:13 pm by Watno »
Logged

jsh357

  • Margrave
  • *****
  • Offline Offline
  • Posts: 2577
  • Shuffle iT Username: jsh357
  • Respect: +4343
    • View Profile
    • JSH Gaming: Original games
Re: Play Temporum online, single-player against AI!
« Reply #4 on: January 19, 2015, 01:13:49 pm »
0

I'm sure it will improve in time.  Thank you based GendoIkari.
Logged
Join the Dominion community Discord channel! Chat in text and voice; enter dumb tournaments; spy on top players!

https://discord.gg/2rDpJ4N

GendoIkari

  • Adventurer
  • ******
  • Offline Offline
  • Posts: 9756
  • Respect: +10839
    • View Profile
Re: Play Temporum online, single-player against AI!
« Reply #5 on: January 19, 2015, 01:20:57 pm »
0

I think there's something wrong. I can't see any pawns or crowns, and can't figure out how to change history. I attached a screenshot of what it looks like for me.
I'm using Firefox on Windows 8, tell me if you need details.

EDIT: Ok, once you are in a zone you can change history, pretty sure there's still something missing though.

Just tried it in Firefox for the first time, and yeah, weird. I only had done Chrome so far. Looks like images just aren't showing up in Firefox at all... will look into it.
Logged
Check out my F.DS extension for Chrome! Card links; Dominion icons, and maybe more! http://forum.dominionstrategy.com/index.php?topic=13363.0

Thread for Firefox version:
http://forum.dominionstrategy.com/index.php?topic=16305.0

GendoIkari

  • Adventurer
  • ******
  • Offline Offline
  • Posts: 9756
  • Respect: +10839
    • View Profile
Re: Play Temporum online, single-player against AI!
« Reply #6 on: January 19, 2015, 01:25:34 pm »
+1

I think there's something wrong. I can't see any pawns or crowns, and can't figure out how to change history. I attached a screenshot of what it looks like for me.
I'm using Firefox on Windows 8, tell me if you need details.

EDIT: Ok, once you are in a zone you can change history, pretty sure there's still something missing though.

Ok, works in Firefox now!
Logged
Check out my F.DS extension for Chrome! Card links; Dominion icons, and maybe more! http://forum.dominionstrategy.com/index.php?topic=13363.0

Thread for Firefox version:
http://forum.dominionstrategy.com/index.php?topic=16305.0

Jorbles

  • Saboteur
  • *****
  • Offline Offline
  • Posts: 1468
  • Respect: +532
    • View Profile
Re: Play Temporum online, single-player against AI!
« Reply #7 on: January 19, 2015, 01:28:28 pm »
+2

This is awesome! Thanks so much for sharing this!
Logged

Watno

  • Margrave
  • *****
  • Offline Offline
  • Posts: 2745
  • Shuffle iT Username: Watno
  • Respect: +2984
    • View Profile
Re: Play Temporum online, single-player against AI!
« Reply #8 on: January 19, 2015, 01:37:53 pm »
+1

Well, that was quick. I'll try a game.
Logged

GendoIkari

  • Adventurer
  • ******
  • Offline Offline
  • Posts: 9756
  • Respect: +10839
    • View Profile
Re: Play Temporum online, single-player against AI!
« Reply #9 on: January 19, 2015, 01:43:04 pm »
+4

Well, that was quick. I'll try a game.

All bug reports will be fixed in 30 minutes or less, or your game is free.
Logged
Check out my F.DS extension for Chrome! Card links; Dominion icons, and maybe more! http://forum.dominionstrategy.com/index.php?topic=13363.0

Thread for Firefox version:
http://forum.dominionstrategy.com/index.php?topic=16305.0

Awaclus

  • Adventurer
  • ******
  • Offline Offline
  • Posts: 11851
  • Shuffle iT Username: Awaclus
  • (´。• ω •。`)
  • Respect: +12941
    • View Profile
    • Birds of Necama
Re: Play Temporum online, single-player against AI!
« Reply #10 on: January 19, 2015, 01:46:20 pm »
+7

So Andrew is there, like, 24/7 and I can play against him any time?
Logged
Bomb, Cannon, and many of the Gunpowder cards can strongly effect gameplay, particularly in a destructive way

The YouTube channel where I make musicDownload my band's Creative Commons albums for free

GendoIkari

  • Adventurer
  • ******
  • Offline Offline
  • Posts: 9756
  • Respect: +10839
    • View Profile
Re: Play Temporum online, single-player against AI!
« Reply #11 on: January 19, 2015, 01:49:09 pm »
0

So Andrew is there, like, 24/7 and I can play against him any time?

First I was like "so you're saying Andrew is so good at Temporum that he's a computer?" Then I was like "But wait, these AI are really bad at the game, so you're saying that Andrew is bad at Temporum?" Then finally I figured it out.
Logged
Check out my F.DS extension for Chrome! Card links; Dominion icons, and maybe more! http://forum.dominionstrategy.com/index.php?topic=13363.0

Thread for Firefox version:
http://forum.dominionstrategy.com/index.php?topic=16305.0

GendoIkari

  • Adventurer
  • ******
  • Offline Offline
  • Posts: 9756
  • Respect: +10839
    • View Profile
Re: Play Temporum online, single-player against AI!
« Reply #12 on: January 19, 2015, 01:50:03 pm »
+1

So "AI only" mode just has all players be AI; the game will end almost immediately, then you can see who won and use the log to see what they did. I ran 100 5-player games this way to see if there was any turn-order advantage. The results:

Player 5: 26 wins
Player 2: 20 wins
Player 3: 20 wins
Player 1: 18 wins
Player 4: 16 wins

Of course this tells us very little about any possible turn-order advantage in a real game, because the AI definitely doesn't take advantage of any possible turn-order advantage. But still interesting to note.

Optimized or no, I'm all but certain even without running the numbers that those are indistinguishable from random for n=100.

No way, probability states that each player should have exactly 20 wins if that were the case. Right?  ;D
Logged
Check out my F.DS extension for Chrome! Card links; Dominion icons, and maybe more! http://forum.dominionstrategy.com/index.php?topic=13363.0

Thread for Firefox version:
http://forum.dominionstrategy.com/index.php?topic=16305.0

pacovf

  • Cartographer
  • *****
  • Offline Offline
  • Posts: 3502
  • Multiediting poster
  • Respect: +3844
    • View Profile
Re: Play Temporum online, single-player against AI!
« Reply #13 on: January 19, 2015, 01:53:32 pm »
+4

So "AI only" mode just has all players be AI; the game will end almost immediately, then you can see who won and use the log to see what they did. I ran 100 5-player games this way to see if there was any turn-order advantage. The results:

Player 5: 26 wins
Player 2: 20 wins
Player 3: 20 wins
Player 1: 18 wins
Player 4: 16 wins

Of course this tells us very little about any possible turn-order advantage in a real game, because the AI definitely doesn't take advantage of any possible turn-order advantage. But still interesting to note.

Optimized or no, I'm all but certain even without running the numbers that those are indistinguishable from random for n=100.

No way, probability states that each player should have exactly 20 wins if that were the case. Right?  ;D

Probabilities also prevent you from running a number of simulations that isn't divisible by 5.
Logged
pacovf has a neopets account.  It has 999 hours logged.  All his neopets are named "Jessica".  I guess that must be his ex.

GendoIkari

  • Adventurer
  • ******
  • Offline Offline
  • Posts: 9756
  • Respect: +10839
    • View Profile
Re: Play Temporum online, single-player against AI!
« Reply #14 on: January 19, 2015, 01:58:03 pm »
+5

So "AI only" mode just has all players be AI; the game will end almost immediately, then you can see who won and use the log to see what they did. I ran 100 5-player games this way to see if there was any turn-order advantage. The results:

Player 5: 26 wins
Player 2: 20 wins
Player 3: 20 wins
Player 1: 18 wins
Player 4: 16 wins

Of course this tells us very little about any possible turn-order advantage in a real game, because the AI definitely doesn't take advantage of any possible turn-order advantage. But still interesting to note.

Optimized or no, I'm all but certain even without running the numbers that those are indistinguishable from random for n=100.

No way, probability states that each player should have exactly 20 wins if that were the case. Right?  ;D

Probabilities also prevent you from running a number of simulations that isn't divisible by 5.

That's if we start with the assumption that there isn't any turn-order advantage. I ran a single 3-player simulation game, and now I'm convinced that the game is poorly designed because player 1 wins every time.
Logged
Check out my F.DS extension for Chrome! Card links; Dominion icons, and maybe more! http://forum.dominionstrategy.com/index.php?topic=13363.0

Thread for Firefox version:
http://forum.dominionstrategy.com/index.php?topic=16305.0

LastFootnote

  • Adventurer
  • ******
  • Offline Offline
  • Posts: 7497
  • Shuffle iT Username: LastFootnote
  • Respect: +10740
    • View Profile
Re: Play Temporum online, single-player against AI!
« Reply #15 on: January 19, 2015, 02:30:45 pm »
+2

Thanks again for this, GendoIkari!

I found a game-crashing bug. An AI player played an Invenstments, then I think he tried to discard it on the same turn and it resulted in an unexpected "undefined" value for either player or card.

Code: [Select]
Uncaught TypeError: Cannot read property 'name' of undefined
It's on line 55:

Code: [Select]
LogDiscard: function (player, card) {
var entry = $('<p>');
if (player === GameController.HumanPlayer) {
entry.addClass('human');
entry.append('You discard ' + card.name);
}
else {
entry.append(player.name + ' discards ' + card.name);    <-------- This line right here
}
$('#Log').append(entry);
$('#Log').scrollTop($('#Log').prop('scrollHeight'));
},
Logged

GendoIkari

  • Adventurer
  • ******
  • Offline Offline
  • Posts: 9756
  • Respect: +10839
    • View Profile
Re: Play Temporum online, single-player against AI!
« Reply #16 on: January 19, 2015, 02:45:33 pm »
+2

Thanks again for this, GendoIkari!

I found a game-crashing bug. An AI player played an Invenstments, then I think he tried to discard it on the same turn and it resulted in an unexpected "undefined" value for either player or card.

Code: [Select]
Uncaught TypeError: Cannot read property 'name' of undefined
It's on line 55:

Code: [Select]
LogDiscard: function (player, card) {
var entry = $('<p>');
if (player === GameController.HumanPlayer) {
entry.addClass('human');
entry.append('You discard ' + card.name);
}
else {
entry.append(player.name + ' discards ' + card.name);    <-------- This line right here
}
$('#Log').append(entry);
$('#Log').scrollTop($('#Log').prop('scrollHeight'));
},

Thanks! Should be fixed now. LogDiscard is a new method added in a hurry today to improve logging. Interestingly, it looked like AI discarding Investments was already broken, but in such a way that you wouldn't notice until the discarded Investment was shuffled back in and re-drawn. The updated Logging made the error happen immediately.

A few times I've seen a card with the name "Undefined" show up in my hand. When this happens, it means that a card didn't get discarded properly.
« Last Edit: January 19, 2015, 02:48:00 pm by GendoIkari »
Logged
Check out my F.DS extension for Chrome! Card links; Dominion icons, and maybe more! http://forum.dominionstrategy.com/index.php?topic=13363.0

Thread for Firefox version:
http://forum.dominionstrategy.com/index.php?topic=16305.0

liopoil

  • Margrave
  • *****
  • Offline Offline
  • Posts: 2587
  • Respect: +2479
    • View Profile
Re: Play Temporum online, single-player against AI!
« Reply #17 on: January 19, 2015, 03:20:45 pm »
+1

Awesome!

It's nice to have a better idea of how long games take. Just won a game in 12 turns. I wasn't counting very carefully, but a few times I felt like it let me score more crowns than I should have. The AI doesn't seem to be very good though :(
Logged

GendoIkari

  • Adventurer
  • ******
  • Offline Offline
  • Posts: 9756
  • Respect: +10839
    • View Profile
Re: Play Temporum online, single-player against AI!
« Reply #18 on: January 19, 2015, 03:25:14 pm »
0

Awesome!

It's nice to have a better idea of how long games take. Just won a game in 12 turns. I wasn't counting very carefully, but a few times I felt like it let me score more crowns than I should have. The AI doesn't seem to be very good though :(

Thanks!

There's a couple reasons why you may score more than you would might think you should at first glance:

You have Conspiracy in play (+1 score when you score)
You are visiting a zone that has a score tacked on on top of what you do there (Plutocracy, etc)

Yeah, I believe the AI will get much better over time. At the moment it's following an extremely basic set of rules. It wins in about 12 turns on average, though I've seen anywhere from 10 to 19 turns!
« Last Edit: January 19, 2015, 03:26:27 pm by GendoIkari »
Logged
Check out my F.DS extension for Chrome! Card links; Dominion icons, and maybe more! http://forum.dominionstrategy.com/index.php?topic=13363.0

Thread for Firefox version:
http://forum.dominionstrategy.com/index.php?topic=16305.0

liopoil

  • Margrave
  • *****
  • Offline Offline
  • Posts: 2587
  • Respect: +2479
    • View Profile
Re: Play Temporum online, single-player against AI!
« Reply #19 on: January 19, 2015, 03:32:16 pm »
0

Awesome!

It's nice to have a better idea of how long games take. Just won a game in 12 turns. I wasn't counting very carefully, but a few times I felt like it let me score more crowns than I should have. The AI doesn't seem to be very good though :(

Thanks!

There's a couple reasons why you may score more than you would might think you should at first glance:

You have Conspiracy in play (+1 score when you score)
You are visiting a zone that has a score tacked on on top of what you do there (Plutocracy, etc)

Yeah, I believe the AI will get much better over time. At the moment it's following an extremely basic set of rules. It wins in about 12 turns on average, though I've seen anywhere from 10 to 19 turns!
Oh wow, my bad. Now I remember I played a conspiracy near the beginning and promptly forgot about it. Does the AI ever change time?

EDIT: oh, I played a couple attack cards that game too, so that slowed the game down a bit.
« Last Edit: January 19, 2015, 03:33:39 pm by liopoil »
Logged

GendoIkari

  • Adventurer
  • ******
  • Offline Offline
  • Posts: 9756
  • Respect: +10839
    • View Profile
Re: Play Temporum online, single-player against AI!
« Reply #20 on: January 19, 2015, 03:36:59 pm »
0

Awesome!

It's nice to have a better idea of how long games take. Just won a game in 12 turns. I wasn't counting very carefully, but a few times I felt like it let me score more crowns than I should have. The AI doesn't seem to be very good though :(

Thanks!

There's a couple reasons why you may score more than you would might think you should at first glance:

You have Conspiracy in play (+1 score when you score)
You are visiting a zone that has a score tacked on on top of what you do there (Plutocracy, etc)

Yeah, I believe the AI will get much better over time. At the moment it's following an extremely basic set of rules. It wins in about 12 turns on average, though I've seen anywhere from 10 to 19 turns!
Oh wow, my bad. Now I remember I played a conspiracy near the beginning and promptly forgot about it. Does the AI ever change time?

EDIT: oh, I played a couple attack cards that game too, so that slowed the game down a bit.

The AI flips a coin at the start of each turn; 50/50 chance of changing history before moving. Real intelligent, right? The basic idea for improvement will be to have it test-visit the zones it can and see what it has after each one; then pick the best move.
Logged
Check out my F.DS extension for Chrome! Card links; Dominion icons, and maybe more! http://forum.dominionstrategy.com/index.php?topic=13363.0

Thread for Firefox version:
http://forum.dominionstrategy.com/index.php?topic=16305.0

Jorbles

  • Saboteur
  • *****
  • Offline Offline
  • Posts: 1468
  • Respect: +532
    • View Profile
Re: Play Temporum online, single-player against AI!
« Reply #21 on: January 19, 2015, 03:37:34 pm »
+1

Found another bug, if you play papal tiara, but don't have money to score a card the game hangs waiting for you to pick one to score. Probably pretty easy to fix.
Logged

GendoIkari

  • Adventurer
  • ******
  • Offline Offline
  • Posts: 9756
  • Respect: +10839
    • View Profile
Re: Play Temporum online, single-player against AI!
« Reply #22 on: January 19, 2015, 03:48:25 pm »
+2

Found another bug, if you play papal tiara, but don't have money to score a card the game hangs waiting for you to pick one to score. Probably pretty easy to fix.

Thanks, fixed! It was actually any time you tried to score a card but couldn't afford to. Worked fine yesterday, I broke it when improving logging today.
Logged
Check out my F.DS extension for Chrome! Card links; Dominion icons, and maybe more! http://forum.dominionstrategy.com/index.php?topic=13363.0

Thread for Firefox version:
http://forum.dominionstrategy.com/index.php?topic=16305.0

GendoIkari

  • Adventurer
  • ******
  • Offline Offline
  • Posts: 9756
  • Respect: +10839
    • View Profile
Re: Play Temporum online, single-player against AI!
« Reply #23 on: January 19, 2015, 03:56:27 pm »
0

Awesome!

It's nice to have a better idea of how long games take. Just won a game in 12 turns. I wasn't counting very carefully, but a few times I felt like it let me score more crowns than I should have. The AI doesn't seem to be very good though :(

Lol, if Roman Empire and Great Depression are active; the computer will take over 30 turns to win!!
Logged
Check out my F.DS extension for Chrome! Card links; Dominion icons, and maybe more! http://forum.dominionstrategy.com/index.php?topic=13363.0

Thread for Firefox version:
http://forum.dominionstrategy.com/index.php?topic=16305.0

eHalcyon

  • Adventurer
  • ******
  • Offline Offline
  • Posts: 8689
  • Respect: +9192
    • View Profile
Re: Play Temporum online, single-player against AI!
« Reply #24 on: January 19, 2015, 07:15:34 pm »
0

Yay, I won my first game of Temporum!

This game is inducing AP in me like no other.  Does that go away as you become familiar with everything?

Edit: I've decided that I like this game, even though I have some severe AP with it.  Had a lot of fun using Communist Utopia to play multiple cards that let me draw more cards when I play cards, scoring big cards when I got too rich, and eventually ending the game with Barbarian Horde and discarding a hand of 7. 

Trying to get a handle on how long a game takes.  This one was 11 turns, and I think that is about what I am averaging.  It's probably going to take more when there are other players who are actually trying to change the timeline to their own advantage.  And I haven't lost to the crappy AI yet, which is a good sign.

The game doesn't feel thematic to me at all (maybe having the art would help) but I think it's OK.  It's still more thematic than Dominion. :P
« Last Edit: January 19, 2015, 10:22:46 pm by eHalcyon »
Logged
Pages: [1] 2 3 ... 7  All
 

Page created in 0.059 seconds with 20 queries.