Dominion Strategy Forum

Please login or register.

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

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

0 Members and 1 Guest are viewing this topic.

GendoIkari

  • Adventurer
  • ******
  • Offline Offline
  • Posts: 9701
  • Respect: +10741
    • View Profile
Re: Play Temporum online, single-player against AI!
« Reply #25 on: January 19, 2015, 10:54:10 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

I feel like I don't take enough time for AP; so while I end up playing quickly as I'm familiar with everything, I know I'm not playing very well. I lose to the AI sometimes. I feel like you should be aiming for 10-11 turns on average; but I could be wrong.
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: +9187
    • View Profile
Re: Play Temporum online, single-player against AI!
« Reply #26 on: January 19, 2015, 11:56:45 pm »
+3

Suggestions:

- show the card name when you hover over your special powers.
- stack powers in columns according to their trigger, so it's easy to see all the things that happen when you score a card or play a card or whatever.
- a way to undo when advancing crowns.

Question:

- What does the AI do anyway?  (Update: I've lost once now. :()
« Last Edit: January 20, 2015, 12:00:19 am by eHalcyon »
Logged

GendoIkari

  • Adventurer
  • ******
  • Offline Offline
  • Posts: 9701
  • Respect: +10741
    • View Profile
Re: Play Temporum online, single-player against AI!
« Reply #27 on: January 20, 2015, 12:12:17 am »
+1

Thanks for the suggestions!

The AI:

Start of turn, take 50/50 random chance of changing history. Then:

If enough money to score any card in hand, go to Time 1. Score the last card in hand that it can afford to score. Otherwise:

If any cards in hand, go to whatever is Active in Time III. Play the first card in hand. Otherwise:

Go to whatever is Active in Time II. Draw 2 cards.

When it needs to make decisions beyond where to move... for zones that have "choose one:" with all 3 options, choose the option that was the reason you went to that Time in the first place. When it plays any "discard any number of cards" things; it will discard its entire hand for max benefit. Other various player cards and zone cards required specific choices to be made. Like it will always discard Investments as long as it is getting at least 2 money for it (which is always the same turn it was played right now, since Investments itself gives 8).

When it scores crowns, just move from the lowest Time where there are still crowns.


So yeah, this version was always intended just to be something that you could play against; not anything actually intelligent. Hopefully I can make vast improvements.
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: 7495
  • Shuffle iT Username: LastFootnote
  • Respect: +10721
    • View Profile
Re: Play Temporum online, single-player against AI!
« Reply #28 on: January 20, 2015, 12:15:10 am »
0

One easy way to get a leg up on the AI is to advance a single crown to Age IV quickly, then camp out in Icy Wasteland and make them lose $2 every turn. Of course, that only works when Icy Wasteland is available.
Logged

GendoIkari

  • Adventurer
  • ******
  • Offline Offline
  • Posts: 9701
  • Respect: +10741
    • View Profile
Re: Play Temporum online, single-player against AI!
« Reply #29 on: January 20, 2015, 12:17:48 am »
0

One easy way to get a leg up on the AI is to advance a single crown to Age IV quickly, then camp out in Icy Wasteland and make them lose $2 every turn. Of course, that only works when Icy Wasteland is available.

Yeah, almost all the Time IV cards are AI killers at the moment. Donald mentioned Communist Utopia, which obviously makes sense. Going there at the right time is just a free turn. It's also why I haven't added Police State yet, because the AI would actually break (if it can score, it will try to move to time I, but now it can't).
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: +9187
    • View Profile
Re: Play Temporum online, single-player against AI!
« Reply #30 on: January 20, 2015, 12:27:17 am »
0

There are probably some easy-ish improvements for the AI to make it choose how to advance crowns more intelligently.
Logged

Donald X.

  • Dominion Designer
  • *****
  • Offline Offline
  • Posts: 6357
  • Respect: +25671
    • View Profile
Re: Play Temporum online, single-player against AI!
« Reply #31 on: January 20, 2015, 02:06:39 am »
+2

Start of turn, take 50/50 random chance of changing history. Then:
Are you sure it does this? I am not seeing it ever change history, except when automatic (Late Jurassic).
Logged

qmech

  • Torturer
  • *****
  • Offline Offline
  • Posts: 1918
  • Shuffle iT Username: qmech
  • What year is it?
  • Respect: +2320
    • View Profile
Re: Play Temporum online, single-player against AI!
« Reply #32 on: January 20, 2015, 03:37:03 am »
+2

Start of turn, take 50/50 random chance of changing history. Then:
Are you sure it does this? I am not seeing it ever change history, except when automatic (Late Jurassic).


Yes, it looks like there's a bug:

Code: [Select]
ChangeArrow: function () {
return false;
if (GameController.ActivePlayer.location.time < 4) {
if (getRandomInt(0, 2) === 1) {
return true;
}
}

return false;
},

Thankfully the source is clear enough that I think I could learn js from it!
Logged

GendoIkari

  • Adventurer
  • ******
  • Offline Offline
  • Posts: 9701
  • Respect: +10741
    • View Profile
Re: Play Temporum online, single-player against AI!
« Reply #33 on: January 20, 2015, 09:50:20 am »
+3

Start of turn, take 50/50 random chance of changing history. Then:
Are you sure it does this? I am not seeing it ever change history, except when automatic (Late Jurassic).


Yes, it looks like there's a bug:

Code: [Select]
ChangeArrow: function () {
return false;
if (GameController.ActivePlayer.location.time < 4) {
if (getRandomInt(0, 2) === 1) {
return true;
}
}

return false;
},

Thankfully the source is clear enough that I think I could learn js from it!

Ha, oops! Not so much a "bug" as just some testing I forgot to remove. I wanted to test visiting a certain zone, while not in 1-player, so I temporarily stopped the AI from changing history on me. But then I forgot to undo that. So yeah, it was 50/50 until whenever I added that line of code... it's fixed now, thanks!
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: +9187
    • View Profile
Re: Play Temporum online, single-player against AI!
« Reply #34 on: January 20, 2015, 06:17:38 pm »
+1

Fastest game so far -- 9 turns.  I had Conspiracy and Investments in play.  Turn 8 I visited Summer of Love ($2) to play Crown Jewels ($11), discarding 2 cards ($8) for $21 total, discarding Investments for $10 more.  Turn 9 I went to Space Age and scored two more cards, advancing 17 crowns in one go.

I tried some 5 player games and lost most of them.  I think it's just harder to track what the others are doing (I don't want to go back and read 4 other players' turns).
Logged

GendoIkari

  • Adventurer
  • ******
  • Offline Offline
  • Posts: 9701
  • Respect: +10741
    • View Profile
Re: Play Temporum online, single-player against AI!
« Reply #35 on: January 20, 2015, 06:31:28 pm »
+1

Fastest game so far -- 9 turns.  I had Conspiracy and Investments in play.  Turn 8 I visited Summer of Love ($2) to play Crown Jewels ($11), discarding 2 cards ($8) for $21 total, discarding Investments for $10 more.  Turn 9 I went to Space Age and scored two more cards, advancing 17 crowns in one go.

I tried some 5 player games and lost most of them.  I think it's just harder to track what the others are doing (I don't want to go back and read 4 other players' turns).

Yes, I find it hard to win 5 player often... partly because one of the 4 players will get lucky enough to do well, and partly because of what you say; it's just much easier to play "solitaire" than it is to pay attention to the game as a whole in that case. It might be nice if I add some artificial slowdown, just so that there's a second between each computer's turn. (And it was easier when the AI's history-changing was broken too... now you can't just camp out on a good Time IV Zone).
« Last Edit: January 20, 2015, 06:32:31 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

eHalcyon

  • Adventurer
  • ******
  • Offline Offline
  • Posts: 8689
  • Respect: +9187
    • View Profile
Re: Play Temporum online, single-player against AI!
« Reply #36 on: January 20, 2015, 08:25:15 pm »
+1

So what things are yet to be implemented?  I just re-read the Temporum thread and there is talk of an Anubis Statuette I know nothing about.  Also, I don't think I've seen Information Age appear at all, and you already mentioned that you haven't implemented Police State because of what would happen with the AI.

A quick look through this list... I don't think I've seen:

- Age of Cults
- Age of Cybernetics
- Alien Contact (should be about as simple as Age of Toys?)
- Bureaucracy
- Industrial Revolution
- Information Age
- Inquisition
- Nuclear Wasteland
- Police State
- Warm Globe

- Anubis Statuette

Here's a suggestion for a simplistic AI tweak for when Police State is present:

- if on Police State
--- if want to play cards
------if an Age IV card below lets you play cards (Icy Wasteland, Communist Utopia if less than 12 coins), go there
------else visit Police State
--- else go to Age IV (random, but always avoid Mere Anarchy)
- else always change the timeline to make Police State unreal, if possible (optional, but may help if you have AI would get slowed down by it more than the human player)
« Last Edit: January 20, 2015, 08:26:53 pm by eHalcyon »
Logged

GendoIkari

  • Adventurer
  • ******
  • Offline Offline
  • Posts: 9701
  • Respect: +10741
    • View Profile
Re: Play Temporum online, single-player against AI!
« Reply #37 on: January 20, 2015, 10:26:45 pm »
+1

So what things are yet to be implemented?  I just re-read the Temporum thread and there is talk of an Anubis Statuette I know nothing about.  Also, I don't think I've seen Information Age appear at all, and you already mentioned that you haven't implemented Police State because of what would happen with the AI.

A quick look through this list... I don't think I've seen:

- Age of Cults
- Age of Cybernetics
- Alien Contact (should be about as simple as Age of Toys?)
- Bureaucracy
- Industrial Revolution
- Information Age
- Inquisition
- Nuclear Wasteland
- Police State
- Warm Globe

- Anubis Statuette

Here's a suggestion for a simplistic AI tweak for when Police State is present:

- if on Police State
--- if want to play cards
------if an Age IV card below lets you play cards (Icy Wasteland, Communist Utopia if less than 12 coins), go there
------else visit Police State
--- else go to Age IV (random, but always avoid Mere Anarchy)
- else always change the timeline to make Police State unreal, if possible (optional, but may help if you have AI would get slowed down by it more than the human player)

I believe you correctly got the full list there. Anubis Statuette is the only player card I haven't implemented yet. It's the most complicated, and quite possibly the most powerful, player card. It gives you $2 and then lets you visit any Zone that you haven't yet visited... real or unreal.

The only issue with Police State is that any Zone that offers any choice needs special AI rules. And I still have to add those special rules for ALL Time IV cards before I can ever allow the AI to visit Time IV.

Other zones:
Inquisition - pretty easy, should have it done this week. The AI can check if one of the attack options wouldn't hurt it; in which case it will do that one. Otherwise it will lose money.

Bureaucracy - 2 things don't currently exist that need to be created for this zone... the ability to retreat a crown instead of advancing it; and the ability for players to interact with the crowns when it isn't their turn. Definitely doable, though.

Information Age - Ugh, you can probably imagine why this is difficult. Both for this and Anubis Statuette, I need to start keeping a list of all visited zones each turn.

Age of Cybernetics - Need an interface for choosing both the card from your hand and the in-play card to copy. After that it's pretty easy to copy the effect (I can just change one card into another when it gets played that way)... but the hard part is if that card is Investments or Treasure Map... then when it's discarded, I need to know that it wasn't a "real" Investments or Treasure Map so that it can revert back to its own self in the discard pile.

Alien Contact - You're right, pretty easy. Should be done this week.

Warm Globe - The only tricky part is the ability for a player to do something when it isn't their turn. I already had to implement this for Rats and Plague, but that code is bad.. I mean really bad. I need to figure a better way to have each player do something one at a time.

Industrial Revolution - sounds easy, but has a tricky issue. When I play a card, that card's own "on play" instructions say what to do with that card when it's done.. usually to move to the discard pile. Well now that it's in the discard pile, the Lose Track rule applies! Industrial Revolution can't find that card to put it back into your hand, because it's already been played, and is either sitting in the discard, or in play if it was a perpetual, or even in your hand if it was a Bag of Loot. Will require some thought.

Age of Cults - this probably is actually a little easier than it sounds. Again the biggest issue is just like Warm Globe; a way for each player to do something before the game can move on.

Nuclear Wasteland... an easier version of Information Age. I basically need to go back to the "move" step, while making only the earlier Times active.


I'm curious what people would rather see first: More Zone cards; the ability to pick your Zones to play with; slightly better AI (much better AI would come later either way); or other things?
« Last Edit: January 20, 2015, 10:28:37 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

eHalcyon

  • Adventurer
  • ******
  • Offline Offline
  • Posts: 8689
  • Respect: +9187
    • View Profile
Re: Play Temporum online, single-player against AI!
« Reply #38 on: January 20, 2015, 10:42:39 pm »
+2

I'm for "more zones".  With a Dominion background, I'm cool with full random.

And if I want a more challenging game, I could probably just play with more players. :P
Logged

Jorbles

  • Saboteur
  • *****
  • Offline Offline
  • Posts: 1468
  • Respect: +531
    • View Profile
Re: Play Temporum online, single-player against AI!
« Reply #39 on: January 21, 2015, 01:04:29 pm »
+1

Found a typo in game. Jurrasic should be Jurassic
Logged

GendoIkari

  • Adventurer
  • ******
  • Offline Offline
  • Posts: 9701
  • Respect: +10741
    • View Profile
Re: Play Temporum online, single-player against AI!
« Reply #40 on: January 21, 2015, 01:07:28 pm »
+1

Found a typo in game. Jurrasic should be Jurassic

Thanks, fixed.
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

blueblimp

  • Margrave
  • *****
  • Offline Offline
  • Posts: 2849
  • Respect: +1559
    • View Profile
Re: Play Temporum online, single-player against AI!
« Reply #41 on: January 21, 2015, 05:19:57 pm »
+1

Just tried this. Nice job with the UI.

- a way to undo when advancing crowns.
Also would like this. It's a neat little UI problem. In real life play, the workflow we used was to move crowns up and down while keeping track of how many advancements you've used, making sure at each step that it would have been possible to also reach that crown state from the crown state you started with. Then just let the other players know once you're satisfied with the current arrangement.

This could be modelled in a UI by having up/down arrows next to each zone, with the arrows only enabled when it's legal to use them to move a crown in that direction. There would also be a number somewhere telling you how many advancements you have left, and a checkmark to click once you are done, which is enabled when you have no advancements remaining.

Happily, not much code is required to figure out when it's legal to move a crown up or down. The down arrow is enabled for a time i when i =/= 4 and you have at least once advancement remaining.

Here's greedy algorithm pseudocode to quickly & easily compute which up arrows should be enabled, and for sanity checking, whether the current crown state is possible given where the crowns started:
Code: [Select]
Inputs:
- a_i:  the initial number of crowns in each time i
- b_i:  the current number of crowns in each time i

Algorithm body:
- m <- 0  -- the number of crowns currently moving in the constructed solution
- For i from 1 to 4 inclusive:
  - If m > 0 and b_i > 0, enable the up arrow for time i
  - m <- m + b_i - a_i
  - assert m >= 0  -- otherwise it's impossible to get here by advancing crowns
- assert m == 0  -- shouldn't have lost or gained crowns
Logged

eHalcyon

  • Adventurer
  • ******
  • Offline Offline
  • Posts: 8689
  • Respect: +9187
    • View Profile
Re: Play Temporum online, single-player against AI!
« Reply #42 on: January 21, 2015, 05:57:00 pm »
+3

Found a bug! 

I had to advance 4 (or maybe 5) crowns to win.  I had excess coin so I decided to score a $4 for 4 twice via Age of Cats.  (My scored cards score an extra * which is why I'm not sure if it was 5 needed at the end.)

After I advanced my last crown, the cats gave me another 5 crowns to score.  I should have won already, but the game is waiting for me to complete my action.  All of my crowns are already in Age IV, so I have nothing to click.
Logged

Voltaire

  • Jester
  • *****
  • Offline Offline
  • Posts: 957
  • flavor text
  • Respect: +1097
    • View Profile
Re: Play Temporum online, single-player against AI!
« Reply #43 on: January 21, 2015, 06:10:23 pm »
+2

Does the log not show if the AI changed history? That would be nice to see.

Also, amazing. A+, even at this early stage.
Logged

liopoil

  • Margrave
  • *****
  • Offline Offline
  • Posts: 2587
  • Respect: +2479
    • View Profile
Re: Play Temporum online, single-player against AI!
« Reply #44 on: January 21, 2015, 06:14:56 pm »
+1

Found a bug! 

I had to advance 4 (or maybe 5) crowns to win.  I had excess coin so I decided to score a $4 for 4 twice via Age of Cats.  (My scored cards score an extra * which is why I'm not sure if it was 5 needed at the end.)

After I advanced my last crown, the cats gave me another 5 crowns to score.  I should have won already, but the game is waiting for me to complete my action.  All of my crowns are already in Age IV, so I have nothing to click.
Poor you.
Logged

eHalcyon

  • Adventurer
  • ******
  • Offline Offline
  • Posts: 8689
  • Respect: +9187
    • View Profile
Re: Play Temporum online, single-player against AI!
« Reply #45 on: January 21, 2015, 06:17:21 pm »
+1

Found a bug! 

I had to advance 4 (or maybe 5) crowns to win.  I had excess coin so I decided to score a $4 for 4 twice via Age of Cats.  (My scored cards score an extra * which is why I'm not sure if it was 5 needed at the end.)

After I advanced my last crown, the cats gave me another 5 crowns to score.  I should have won already, but the game is waiting for me to complete my action.  All of my crowns are already in Age IV, so I have nothing to click.
Poor you.

I know it doesn't matter at this stage, but it may matter for future implementations.
Logged

GendoIkari

  • Adventurer
  • ******
  • Offline Offline
  • Posts: 9701
  • Respect: +10741
    • View Profile
Re: Play Temporum online, single-player against AI!
« Reply #46 on: January 21, 2015, 06:38:26 pm »
+1

Does the log not show if the AI changed history? That would be nice to see.

Also, amazing. A+, even at this early stage.

Thanks! I'll add that to the log right now. I know there's a few other things that should be logged that aren't; so lemme know if any stand 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: 9701
  • Respect: +10741
    • View Profile
Re: Play Temporum online, single-player against AI!
« Reply #47 on: January 21, 2015, 06:52:40 pm »
0

Found a bug! 

I had to advance 4 (or maybe 5) crowns to win.  I had excess coin so I decided to score a $4 for 4 twice via Age of Cats.  (My scored cards score an extra * which is why I'm not sure if it was 5 needed at the end.)

After I advanced my last crown, the cats gave me another 5 crowns to score.  I should have won already, but the game is waiting for me to complete my action.  All of my crowns are already in Age IV, so I have nothing to click.

Thanks, fixed!
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

Voltaire

  • Jester
  • *****
  • Offline Offline
  • Posts: 957
  • flavor text
  • Respect: +1097
    • View Profile
Re: Play Temporum online, single-player against AI!
« Reply #48 on: January 21, 2015, 07:05:51 pm »
0

UI suggestion: hovering over card names in the log shows what they do (started a game, AI immediately plays Infected Rat, I have to discard one of my 2 starting cards, took me a moment to figure out what was going on)
Logged

eHalcyon

  • Adventurer
  • ******
  • Offline Offline
  • Posts: 8689
  • Respect: +9187
    • View Profile
Re: Play Temporum online, single-player against AI!
« Reply #49 on: January 21, 2015, 07:11:23 pm »
0

Does the log not show if the AI changed history? That would be nice to see.

Also, amazing. A+, even at this early stage.

Thanks! I'll add that to the log right now. I know there's a few other things that should be logged that aren't; so lemme know if any stand out.

Does it currently log when extra crowns are scored (from various locations, powers or cards)?
Logged
Pages: 1 [2] 3 4 ... 7  All
 

Page created in 0.071 seconds with 21 queries.