Dominion Strategy Forum

Miscellaneous => Other Games => Topic started by: GendoIkari on January 19, 2015, 12:47:28 pm

Title: Play Temporum online, single-player against AI!
Post by: GendoIkari on January 19, 2015, 12:47:28 pm
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.
Title: Re: Play Temporum online, single-player against AI!
Post by: GendoIkari on January 19, 2015, 12:50:22 pm
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.
Title: Re: Play Temporum online, single-player against AI!
Post by: Kirian on January 19, 2015, 01:06:26 pm
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.
Title: Re: Play Temporum online, single-player against AI!
Post by: Watno on January 19, 2015, 01:10:52 pm
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.
Title: Re: Play Temporum online, single-player against AI!
Post by: jsh357 on January 19, 2015, 01:13:49 pm
I'm sure it will improve in time.  Thank you based GendoIkari.
Title: Re: Play Temporum online, single-player against AI!
Post by: GendoIkari on January 19, 2015, 01:20:57 pm
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.
Title: Re: Play Temporum online, single-player against AI!
Post by: GendoIkari on January 19, 2015, 01:25:34 pm
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!
Title: Re: Play Temporum online, single-player against AI!
Post by: Jorbles on January 19, 2015, 01:28:28 pm
This is awesome! Thanks so much for sharing this!
Title: Re: Play Temporum online, single-player against AI!
Post by: Watno on January 19, 2015, 01:37:53 pm
Well, that was quick. I'll try a game.
Title: Re: Play Temporum online, single-player against AI!
Post by: GendoIkari on January 19, 2015, 01:43:04 pm
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.
Title: Re: Play Temporum online, single-player against AI!
Post by: Awaclus on January 19, 2015, 01:46:20 pm
So Andrew is there, like, 24/7 and I can play against him any time?
Title: Re: Play Temporum online, single-player against AI!
Post by: GendoIkari on January 19, 2015, 01:49:09 pm
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.
Title: Re: Play Temporum online, single-player against AI!
Post by: GendoIkari on January 19, 2015, 01:50:03 pm
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
Title: Re: Play Temporum online, single-player against AI!
Post by: pacovf on January 19, 2015, 01:53:32 pm
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.
Title: Re: Play Temporum online, single-player against AI!
Post by: GendoIkari on January 19, 2015, 01:58:03 pm
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.
Title: Re: Play Temporum online, single-player against AI!
Post by: LastFootnote on January 19, 2015, 02:30:45 pm
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'));
},
Title: Re: Play Temporum online, single-player against AI!
Post by: GendoIkari on January 19, 2015, 02:45:33 pm
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.
Title: Re: Play Temporum online, single-player against AI!
Post by: liopoil on January 19, 2015, 03:20:45 pm
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 :(
Title: Re: Play Temporum online, single-player against AI!
Post by: GendoIkari on January 19, 2015, 03:25:14 pm
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!
Title: Re: Play Temporum online, single-player against AI!
Post by: liopoil on January 19, 2015, 03:32:16 pm
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.
Title: Re: Play Temporum online, single-player against AI!
Post by: GendoIkari on January 19, 2015, 03:36:59 pm
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.
Title: Re: Play Temporum online, single-player against AI!
Post by: Jorbles on January 19, 2015, 03:37:34 pm
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.
Title: Re: Play Temporum online, single-player against AI!
Post by: GendoIkari on January 19, 2015, 03:48:25 pm
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.
Title: Re: Play Temporum online, single-player against AI!
Post by: GendoIkari on January 19, 2015, 03:56:27 pm
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!!
Title: Re: Play Temporum online, single-player against AI!
Post by: eHalcyon on January 19, 2015, 07:15:34 pm
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
Title: Re: Play Temporum online, single-player against AI!
Post by: GendoIkari on January 19, 2015, 10:54:10 pm
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.
Title: Re: Play Temporum online, single-player against AI!
Post by: eHalcyon on January 19, 2015, 11:56:45 pm
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. :()
Title: Re: Play Temporum online, single-player against AI!
Post by: GendoIkari on January 20, 2015, 12:12:17 am
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.
Title: Re: Play Temporum online, single-player against AI!
Post by: LastFootnote on January 20, 2015, 12:15:10 am
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.
Title: Re: Play Temporum online, single-player against AI!
Post by: GendoIkari on January 20, 2015, 12:17:48 am
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).
Title: Re: Play Temporum online, single-player against AI!
Post by: eHalcyon on January 20, 2015, 12:27:17 am
There are probably some easy-ish improvements for the AI to make it choose how to advance crowns more intelligently.
Title: Re: Play Temporum online, single-player against AI!
Post by: Donald X. on January 20, 2015, 02:06:39 am
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).
Title: Re: Play Temporum online, single-player against AI!
Post by: qmech on January 20, 2015, 03:37:03 am
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!
Title: Re: Play Temporum online, single-player against AI!
Post by: GendoIkari on January 20, 2015, 09:50:20 am
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!
Title: Re: Play Temporum online, single-player against AI!
Post by: eHalcyon on January 20, 2015, 06:17:38 pm
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).
Title: Re: Play Temporum online, single-player against AI!
Post by: GendoIkari on January 20, 2015, 06:31:28 pm
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).
Title: Re: Play Temporum online, single-player against AI!
Post by: eHalcyon on January 20, 2015, 08:25:15 pm
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 (http://www.reddit.com/r/temporum/comments/2ojr3k/lists_of_all_current_zones_and_player_cards/)... 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)
Title: Re: Play Temporum online, single-player against AI!
Post by: GendoIkari on January 20, 2015, 10:26:45 pm
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 (http://www.reddit.com/r/temporum/comments/2ojr3k/lists_of_all_current_zones_and_player_cards/)... 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?
Title: Re: Play Temporum online, single-player against AI!
Post by: eHalcyon on January 20, 2015, 10:42:39 pm
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
Title: Re: Play Temporum online, single-player against AI!
Post by: Jorbles on January 21, 2015, 01:04:29 pm
Found a typo in game. Jurrasic should be Jurassic
Title: Re: Play Temporum online, single-player against AI!
Post by: GendoIkari on January 21, 2015, 01:07:28 pm
Found a typo in game. Jurrasic should be Jurassic

Thanks, fixed.
Title: Re: Play Temporum online, single-player against AI!
Post by: blueblimp on January 21, 2015, 05:19:57 pm
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
Title: Re: Play Temporum online, single-player against AI!
Post by: eHalcyon on January 21, 2015, 05:57:00 pm
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.
Title: Re: Play Temporum online, single-player against AI!
Post by: Voltaire on January 21, 2015, 06:10:23 pm
Does the log not show if the AI changed history? That would be nice to see.

Also, amazing. A+, even at this early stage.
Title: Re: Play Temporum online, single-player against AI!
Post by: liopoil on January 21, 2015, 06:14:56 pm
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.
Title: Re: Play Temporum online, single-player against AI!
Post by: eHalcyon on January 21, 2015, 06:17:21 pm
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.
Title: Re: Play Temporum online, single-player against AI!
Post by: GendoIkari on January 21, 2015, 06:38:26 pm
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.
Title: Re: Play Temporum online, single-player against AI!
Post by: GendoIkari on January 21, 2015, 06:52:40 pm
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!
Title: Re: Play Temporum online, single-player against AI!
Post by: Voltaire on January 21, 2015, 07:05:51 pm
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)
Title: Re: Play Temporum online, single-player against AI!
Post by: eHalcyon on January 21, 2015, 07:11:23 pm
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)?
Title: Re: Play Temporum online, single-player against AI!
Post by: GendoIkari on January 21, 2015, 07:38:22 pm
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)?

It does not. That would be a good thing to add.
Title: Re: Play Temporum online, single-player against AI!
Post by: eHalcyon on January 21, 2015, 07:42:57 pm
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)?

It does not. That would be a good thing to add.

It might also be good to log whenever you pay a cost.  You log some money losses (e.g. from Great Depression) but not others (most notably from scoring).
Title: Re: Play Temporum online, single-player against AI!
Post by: GendoIkari on January 21, 2015, 11:30:53 pm
Ok... Warm Globe is added! Pretty sure it works right.

Logging updated; payments and scores are now shown. Other things moved to past tense because some things were already past tense, and past tense is easier to do than present tense because you don't have different conjugation for 2nd vs 3rd person.

Diseased Rats and Plague code updated to match the new "each player does something" code that Warm Globe needed. This means that discarding now happens in the correct order now.
Title: Re: Play Temporum online, single-player against AI!
Post by: LastFootnote on January 21, 2015, 11:47:30 pm
Huh. I just played a Trinket, and then played a Gang of Pickpockets. Then I drew a card from the Gang of Pickpockets from playing the Trinket. I think that behavior is correct, since playing the Pickpockets was part of resolving Trinket. It surprised me, though.
Title: Re: Play Temporum online, single-player against AI!
Post by: GendoIkari on January 22, 2015, 12:01:03 am
Huh. I just played a Trinket, and then played a Gang of Pickpockets. Then I drew a card from the Gang of Pickpockets from playing the Trinket. I think that behavior is correct, since playing the Pickpockets was part of resolving Trinket. It surprised me, though.

Hmmm... I'm guessing that's not correct actually; but I could see it either way. That's a question for Donald. I mean, I told you earlier that I had to do some special handling for Gang of Pickpockets, because of the whole "after you resolve that card" bit... the problem is, by the time you're done resolving that card, the game has no memory of which card it was that you just finished resolving... so now GoP is in play, so how does it know to not draw for itself? It just knows a card just finished resolving, it doesn't know which card. In real life there's no issue because you only need to remember which card you just finished playing for about 1 second. But for the program, that 1 second may as well be several turns later, it doesn't know or care.
Title: Re: Play Temporum online, single-player against AI!
Post by: GendoIkari on January 22, 2015, 12:50:05 am
Inquisition done.

Added a setting to slow down AI turns so you can see what's happening each turn. Hard to set the default, because it really depends on the number of players; for 2 player you probably want 0, but otherwise about 1-2 seems to be good.
Title: Re: Play Temporum online, single-player against AI!
Post by: GendoIkari on January 22, 2015, 01:53:47 am
Alien Contact done!

I updated the UI so that when you are selecting a card to score, it reflects bonuses that you have from Friends in Old Places and Conspiracy. If the normal scoring values have been altered, they will turn red to make note of that.

Also added a "new game" button when the game ends. Yes, all it does is refresh the page.
Title: Re: Play Temporum online, single-player against AI!
Post by: Donald X. on January 22, 2015, 01:53:57 am
Huh. I just played a Trinket, and then played a Gang of Pickpockets. Then I drew a card from the Gang of Pickpockets from playing the Trinket. I think that behavior is correct, since playing the Pickpockets was part of resolving Trinket. It surprised me, though.

Hmmm... I'm guessing that's not correct actually; but I could see it either way. That's a question for Donald. I mean, I told you earlier that I had to do some special handling for Gang of Pickpockets, because of the whole "after you resolve that card" bit... the problem is, by the time you're done resolving that card, the game has no memory of which card it was that you just finished resolving... so now GoP is in play, so how does it know to not draw for itself? It just knows a card just finished resolving, it doesn't know which card. In real life there's no issue because you only need to remember which card you just finished playing for about 1 second. But for the program, that 1 second may as well be several turns later, it doesn't know or care.
You draw a card for Trinket. Gang of Pickpockets triggers after resolving Trinket, and at that point you have a Gang of Pickpockets.

It could be that it triggered on playing a card, setting up a delayed effect that happens afterwards, but that seems like a more convoluted interpretation.

Usually I like this kind of thing to trigger for itself, because it's simpler; the two main reasons I don't do that, when I don't, are power level, and consistency within the game. Gang of Pickpockets should say something like "Each time you play a card other than this one;" I've seen someone think the ability only worked once ever. It's clear in the rulebook anyway.
Title: Re: Play Temporum online, single-player against AI!
Post by: GendoIkari on January 22, 2015, 02:30:33 am
Huh. I just played a Trinket, and then played a Gang of Pickpockets. Then I drew a card from the Gang of Pickpockets from playing the Trinket. I think that behavior is correct, since playing the Pickpockets was part of resolving Trinket. It surprised me, though.

Hmmm... I'm guessing that's not correct actually; but I could see it either way. That's a question for Donald. I mean, I told you earlier that I had to do some special handling for Gang of Pickpockets, because of the whole "after you resolve that card" bit... the problem is, by the time you're done resolving that card, the game has no memory of which card it was that you just finished resolving... so now GoP is in play, so how does it know to not draw for itself? It just knows a card just finished resolving, it doesn't know which card. In real life there's no issue because you only need to remember which card you just finished playing for about 1 second. But for the program, that 1 second may as well be several turns later, it doesn't know or care.
You draw a card for Trinket. Gang of Pickpockets triggers after resolving Trinket, and at that point you have a Gang of Pickpockets.

It could be that it triggered on playing a card, setting up a delayed effect that happens afterwards, but that seems like a more convoluted interpretation.

Usually I like this kind of thing to trigger for itself, because it's simpler; the two main reasons I don't do that, when I don't, are power level, and consistency within the game. Gang of Pickpockets should say something like "Each time you play a card other than this one;" I've seen someone think the ability only worked once ever. It's clear in the rulebook anyway.

Well cool, I programmed it right by accident even though I thought differently. I definitely thought it was the delayed trigger thing.

And related to exactly when cards are done being played, how exactly does Industrial Revolution work? Does the card ever go to the discard pile? By my reading of things, you first play the card completely, including putting it in the discard. Then you check to see if you rule, and if you do, you take it out of the discard into your hand. Of course, in real life the card will never physically make it to the discard to save time.

But if this is right, this causes problems. What if you have Gang of Pickpockets in play, and the draw deck is empty? The played card should be in the discard pile when GoP makes you shuffle to draw, shouldn't it? So then how do you get the card back in hand? This seems like the exact type of situation for which Dominion created the Lose Track rule. How does Industrial Revolution avoid "lose track"?
Title: Re: Play Temporum online, single-player against AI!
Post by: Donald X. on January 22, 2015, 03:25:11 am
And related to exactly when cards are done being played, how exactly does Industrial Revolution work? Does the card ever go to the discard pile? By my reading of things, you first play the card completely, including putting it in the discard. Then you check to see if you rule, and if you do, you take it out of the discard into your hand. Of course, in real life the card will never physically make it to the discard to save time.

But if this is right, this causes problems. What if you have Gang of Pickpockets in play, and the draw deck is empty? The played card should be in the discard pile when GoP makes you shuffle to draw, shouldn't it? So then how do you get the card back in hand? This seems like the exact type of situation for which Dominion created the Lose Track rule. How does Industrial Revolution avoid "lose track"?
Obv. you mean momentary cards; there's no issue here for perpetual cards.

Since Industrial Revolution doesn't have an ultra-confusing "instead" wording, yes, the card is put into the discard pile and then Industrial Revolution fetches it out. In practice the deck is unlikely to empty, ever, even with 5 players, let alone to be empty at the precise moment it matters here, though the players could obv. arrange for it to happen. Gang of Pickpockets would resolve first and Industrial Revolution would fail. The players who emptied the deck would be unlikely to play it that way, which is fine by me, that isn't spoiling the game for them. The intention was that Industrial Revolution was "instead," but again that kind of thing confuses people, so it's not great to do it to cover an exotic situation, and in this case it's extra messy since cards by default go to one of two places. I did cheat wording-wise with Nomad Camp, but I can't here, the rulebook specifically says to finish resolving the card, which includes putting it into the discard pile or into play.

If you Trinket a card in Industrial Revolution, you can get back the Trinket even though another card would be covering it up in the discard pile. The rulebook doesn't even address looking through the discard pile; in practice I allow it as long as someone isn't being a nuisance.
Title: Re: Play Temporum online, single-player against AI!
Post by: Donald X. on January 22, 2015, 03:27:15 am
Inquisition done.
It locks up when I'm supposed to get to pick what to lose; it happened, I started a new game with Inquisition, it happened again.
Title: Re: Play Temporum online, single-player against AI!
Post by: GendoIkari on January 22, 2015, 03:33:13 am
The other card would cover up trinket? Doesn't trinket go in the discard after its done everything, which would include playing the other card, thus putting trinket in the discard on top?

Will fix Inquisition tomorrow.
Title: Re: Play Temporum online, single-player against AI!
Post by: Donald X. on January 22, 2015, 04:01:47 am
The other card would cover up trinket? Doesn't trinket go in the discard after its done everything, which would include playing the other card, thus putting trinket in the discard on top?
Oh right, nm.
Title: Re: Play Temporum online, single-player against AI!
Post by: eHalcyon on January 22, 2015, 04:28:40 am
I updated the UI so that when you are selecting a card to score, it reflects bonuses that you have from Friends in Old Places and Conspiracy. If the normal scoring values have been altered, they will turn red to make note of that.

I had the power that makes cards cost $2 less to score (Friends in Old Places, I think?).  When I go to score, it accurately reflected the adjusted cost but the text was not highlighted in red.

However, the text is red when scoring with Time of Legends.
Title: Re: Play Temporum online, single-player against AI!
Post by: GendoIkari on January 22, 2015, 11:04:22 am
I updated the UI so that when you are selecting a card to score, it reflects bonuses that you have from Friends in Old Places and Conspiracy. If the normal scoring values have been altered, they will turn red to make note of that.

I had the power that makes cards cost $2 less to score (Friends in Old Places, I think?).  When I go to score, it accurately reflected the adjusted cost but the text was not highlighted in red.

However, the text is red when scoring with Time of Legends.

Thanks, fixed. Inquisition is also fixed.
Title: Re: Play Temporum online, single-player against AI!
Post by: Voltaire on January 22, 2015, 11:19:20 am
The money gained from Prime Real Estate doesn't show up in the logs - that would def. be nice to have.
Title: Re: Play Temporum online, single-player against AI!
Post by: GendoIkari on January 22, 2015, 11:53:33 am
The money gained from Prime Real Estate doesn't show up in the logs - that would def. be nice to have.

Done, thanks. One thing I'd like to add soon is to tell you WHY you gained money instead of just "you gained $2". Especially for Zones that have you gain money after you play a card; it can be confusing.
Title: Re: Play Temporum online, single-player against AI!
Post by: Voltaire on January 22, 2015, 01:07:10 pm
Typo on Barbarian Horde: "Advance on of your..."
Title: Re: Play Temporum online, single-player against AI!
Post by: GendoIkari on January 22, 2015, 01:26:52 pm
Thanks!
Title: Re: Play Temporum online, single-player against AI!
Post by: Jorbles on January 22, 2015, 04:43:08 pm
I think Iron Age is buggy, it was giving me a $2 bonus on cost of scoring cards even when I ruled no zones. (Maybe it was considering empty Age IV as a tied ruling?) Maybe I misunderstand how Iron Age works though.
Title: Re: Play Temporum online, single-player against AI!
Post by: eHalcyon on January 22, 2015, 04:52:05 pm
I think Iron Age is buggy, it was giving me a $2 bonus on cost of scoring cards even when I ruled no zones. (Maybe it was considering empty Age IV as a tied ruling?) Maybe I misunderstand how Iron Age works though.

I haven't noticed it behaving incorrectly.  How many players did you have?  Did you have Friends in Old Places in play?
Title: Re: Play Temporum online, single-player against AI!
Post by: Jorbles on January 22, 2015, 04:57:31 pm
I think Iron Age is buggy, it was giving me a $2 bonus on cost of scoring cards even when I ruled no zones. (Maybe it was considering empty Age IV as a tied ruling?) Maybe I misunderstand how Iron Age works though.

I was playing with 4 or 5 players I think. Also, if I do rule in multiple places (say 3) and I score a card that costs $4 to score, it says that I have to pay $-2, and I think it gave me money for scoring.
Title: Re: Play Temporum online, single-player against AI!
Post by: Jorbles on January 22, 2015, 04:58:23 pm
I did not have friends in old places out.
Title: Re: Play Temporum online, single-player against AI!
Post by: Voltaire on January 22, 2015, 04:59:29 pm
I think Iron Age is buggy, it was giving me a $2 bonus on cost of scoring cards even when I ruled no zones. (Maybe it was considering empty Age IV as a tied ruling?) Maybe I misunderstand how Iron Age works though.

How many players? Top 2 rule Zones in 4 and 5 player games.
Title: Re: Play Temporum online, single-player against AI!
Post by: eHalcyon on January 22, 2015, 05:02:02 pm
I think Iron Age is buggy, it was giving me a $2 bonus on cost of scoring cards even when I ruled no zones. (Maybe it was considering empty Age IV as a tied ruling?) Maybe I misunderstand how Iron Age works though.

I was playing with 4 or 5 players I think. Also, if I do rule in multiple places (say 3) and I score a card that costs $4 to score, it says that I have to pay $-2, and I think it gave me money for scoring.

I'm pretty sure that with 4 or 5 players, each time is ruled by two players (edit: ninja'd).  I just tested Iron Age with only 2 players and it behaves as expected.

I don't think there's a way to get money by scoring... though there's a power that lets you draw a card when you score, and another that gives you money when you draw a card.

Edit: Oh, I get it.  You ruled 3 zones so you got a discount of -$6, which reduced it to -$2 and might have given you money.  I just got the opportunity to try this, and I confirm -- I gained $2 from it.  Presumably Iron Age should not give you money, but Donald will have to confirm.
Title: Re: Play Temporum online, single-player against AI!
Post by: Jorbles on January 22, 2015, 05:07:52 pm
I think Iron Age is buggy, it was giving me a $2 bonus on cost of scoring cards even when I ruled no zones. (Maybe it was considering empty Age IV as a tied ruling?) Maybe I misunderstand how Iron Age works though.

How many players? Top 2 rule Zones in 4 and 5 player games.

Okay that's working correctly than, I misunderstood how ruling was defined. It definitely says that you must pay $-2 to score if you control 3 ages and have a card that costs $4 to score though. I just replicated it. Not 100% sure if that's a visual bug or if it was giving me money to score or not though.
Title: Re: Play Temporum online, single-player against AI!
Post by: GendoIkari on January 22, 2015, 05:09:34 pm
I think Iron Age is buggy, it was giving me a $2 bonus on cost of scoring cards even when I ruled no zones. (Maybe it was considering empty Age IV as a tied ruling?) Maybe I misunderstand how Iron Age works though.

I was playing with 4 or 5 players I think. Also, if I do rule in multiple places (say 3) and I score a card that costs $4 to score, it says that I have to pay $-2, and I think it gave me money for scoring.

I'm pretty sure that with 4 or 5 players, each time is ruled by two players (edit: ninja'd).  I just tested Iron Age with only 2 players and it behaves as expected.

I don't think there's a way to get money by scoring... though there's a power that lets you draw a card when you score, and another that gives you money when you draw a card.

You can also get money from scoring through Prime Real Estate, when you move a crown to Time IV.

And yes, for 4 or 5 players, top 2 rule each Time. For 1 player, I decided that you only rule Times you have a crown in (though one could argue that you have the most crowns even in places that you have none).
Title: Re: Play Temporum online, single-player against AI!
Post by: GendoIkari on January 22, 2015, 05:10:58 pm
I think Iron Age is buggy, it was giving me a $2 bonus on cost of scoring cards even when I ruled no zones. (Maybe it was considering empty Age IV as a tied ruling?) Maybe I misunderstand how Iron Age works though.

I was playing with 4 or 5 players I think. Also, if I do rule in multiple places (say 3) and I score a card that costs $4 to score, it says that I have to pay $-2, and I think it gave me money for scoring.

I'm pretty sure that with 4 or 5 players, each time is ruled by two players (edit: ninja'd).  I just tested Iron Age with only 2 players and it behaves as expected.

I don't think there's a way to get money by scoring... though there's a power that lets you draw a card when you score, and another that gives you money when you draw a card.

Edit: Oh, I get it.  You ruled 3 zones so you got a discount of -$6, which reduced it to -$2 and might have given you money.  I just got the opportunity to try this, and I confirm -- I gained $2 from it.  Presumably Iron Age should not give you money, but Donald will have to confirm.

Good catch! Yeah, this is a bug, unless Donald surprises me with another ruling.
Title: Re: Play Temporum online, single-player against AI!
Post by: Donald X. on January 22, 2015, 05:13:40 pm
I think Iron Age is buggy, it was giving me a $2 bonus on cost of scoring cards even when I ruled no zones. (Maybe it was considering empty Age IV as a tied ruling?) Maybe I misunderstand how Iron Age works though.

I was playing with 4 or 5 players I think. Also, if I do rule in multiple places (say 3) and I score a card that costs $4 to score, it says that I have to pay $-2, and I think it gave me money for scoring.

I'm pretty sure that with 4 or 5 players, each time is ruled by two players (edit: ninja'd).  I just tested Iron Age with only 2 players and it behaves as expected.

I don't think there's a way to get money by scoring... though there's a power that lets you draw a card when you score, and another that gives you money when you draw a card.

Edit: Oh, I get it.  You ruled 3 zones so you got a discount of -$6, which reduced it to -$2 and might have given you money.  I just got the opportunity to try this, and I confirm -- I gained $2 from it.  Presumably Iron Age should not give you money, but Donald will have to confirm.

Good catch! Yeah, this is a bug, unless Donald surprises me with another ruling.
Making something cheaper does not give you $.
Title: Re: Play Temporum online, single-player against AI!
Post by: Voltaire on January 22, 2015, 05:39:43 pm
If I have no cards in hand and someone else visits Inquisition, I have to click "Discard a card" twice. After the first click, "You had no cards to discard" shows up in the log, but nothing else happens. If I chose that option again, the game continues as it should.
Title: Re: Play Temporum online, single-player against AI!
Post by: GendoIkari on January 22, 2015, 06:16:12 pm
If I have no cards in hand and someone else visits Inquisition, I have to click "Discard a card" twice. After the first click, "You had no cards to discard" shows up in the log, but nothing else happens. If I chose that option again, the game continues as it should.

Thanks, will look into tonight.
Title: Re: Play Temporum online, single-player against AI!
Post by: popsofctown on January 22, 2015, 10:15:47 pm
I like a lot of the flavor in this game if nothing else.  In mere anarchy, nothing will keep you from getting robbed the moment you set foot outside of the time machine, but the more sway you hold with gang members of the time the more money you'll be able to steal before you hop back in.

EDIT: damn, now my pedanticness is going to bite me though.  The butterfly card should represent 1 small change with a profound impact (like changing history in time zone 1, then everything else in the change being different from there anyway)

Instead it changes everything which is not really what the butterfly effect is, except in a more broad general sense.
Title: Re: Play Temporum online, single-player against AI!
Post by: eHalcyon on January 22, 2015, 10:50:34 pm
EDIT: damn, now my pedanticness is going to bite me though.  The butterfly card should represent 1 small change with a profound impact (like changing history in time zone 1, then everything else in the change being different from there anyway)

Instead it changes everything which is not really what the butterfly effect is, except in a more broad general sense.

That's incorporated into "Late Jurassic", which is the era that time travel stories usually use that have their one small change drastically impact all subsequent history.

The butterfly card is actually about a specific species, the Benjamin Button Butterfly, which lives backwards in time.  Stepping on such a butterfly has a huge impact both in the future and in the past!

(Now be pedantic about how that's not what Benjamin Button is about.)
Title: Re: Play Temporum online, single-player against AI!
Post by: GendoIkari on January 22, 2015, 11:24:27 pm
Fixed Inquisition with no cards and scoring for negative costs.

Thematically, I think Age of Cats is the best. We have 4 cats so I should know... they're always trying to get me to score my cards twice.
Title: Re: Play Temporum online, single-player against AI!
Post by: Donald X. on January 23, 2015, 02:57:24 am
EDIT: damn, now my pedanticness is going to bite me though.  The butterfly card should represent 1 small change with a profound impact (like changing history in time zone 1, then everything else in the change being different from there anyway)

Instead it changes everything which is not really what the butterfly effect is, except in a more broad general sense.
It's not the butterfly effect, it's the Ray Bradbury story A Sound of Thunder (wikipedia then says that that's the butterfly effect, but they're 100% wrong - one is a butterfly flapping its wings and causing a hurricane, the other is a domino effect over history from stepping on a butterfly). http://www.scaryforkids.com/a-sound-of-thunder/

And it was supposed to be Late Cretaceous, the artist drew Jurassic dinosaurs and it was easiest to rename it (ditto Anubis Statuette which was once Anubis Figurine; however Pope Hat turned into Papal Tiara because her research indicated that in fact that's what you call it).
Title: Re: Play Temporum online, single-player against AI!
Post by: Donald X. on January 23, 2015, 03:08:12 am
I have $11 and Friends and Old Places. It shows that a $12 for 6 in my hand only costs $10, but won't let me pick it to score it.
Title: Re: Play Temporum online, single-player against AI!
Post by: GendoIkari on January 23, 2015, 09:50:38 am
I have $11 and Friends and Old Places. It shows that a $12 for 6 in my hand only costs $10, but won't let me pick it to score it.

Fixed.
Title: Re: Play Temporum online, single-player against AI!
Post by: Voltaire on January 23, 2015, 11:24:42 am
Found a bug, not entirely sure what's causing it - Engineer is showing as costing $NaN for 5. It was drawn with Alien Contact and I am being asked if I want to score it. My only ongoing is "When you play another card, gain an extra $2." No zones on the board make it cheaper to score. I was correctly charged $8 when I scored it.
Title: Re: Play Temporum online, single-player against AI!
Post by: Voltaire on January 23, 2015, 11:36:30 am
The bug is with Alien Contact. I just drew Infected Rat with it, which is showing $NaN for 6. It also charged me 12 correctly.
Title: Re: Play Temporum online, single-player against AI!
Post by: GendoIkari on January 23, 2015, 02:00:48 pm
The bug is with Alien Contact. I just drew Infected Rat with it, which is showing $NaN for 6. It also charged me 12 correctly.

Thanks a bunch, fixed!
Title: Re: Play Temporum online, single-player against AI!
Post by: popsofctown on January 23, 2015, 02:22:50 pm
EDIT: damn, now my pedanticness is going to bite me though.  The butterfly card should represent 1 small change with a profound impact (like changing history in time zone 1, then everything else in the change being different from there anyway)

Instead it changes everything which is not really what the butterfly effect is, except in a more broad general sense.
It's not the butterfly effect, it's the Ray Bradbury story A Sound of Thunder (wikipedia then says that that's the butterfly effect, but they're 100% wrong - one is a butterfly flapping its wings and causing a hurricane, the other is a domino effect over history from stepping on a butterfly). http://www.scaryforkids.com/a-sound-of-thunder/

And it was supposed to be Late Cretaceous, the artist drew Jurassic dinosaurs and it was easiest to rename it (ditto Anubis Statuette which was once Anubis Figurine; however Pope Hat turned into Papal Tiara because her research indicated that in fact that's what you call it).

Oh ok.  I didn't know about the other similar reference, so I figured Step on a Butterfly meant doing so in order to prevent it from performing a meteorological and historical butterfly effect.

I guess authors have a short supply of things that are really really small but still cute.  Although if you get close enough to a butterfly to look at its face I don't think those are cute either.
Title: Re: Play Temporum online, single-player against AI!
Post by: pacovf on January 23, 2015, 03:06:50 pm
Although if you get close enough to a butterfly to look at its face I don't think those are cute either.

QFT.

(http://2.bp.blogspot.com/_LLbcUTRlmgI/TGrxnv6n9YI/AAAAAAAAAC0/PdOqFbIETEs/s1600/butterfly.png)
Title: Re: Play Temporum online, single-player against AI!
Post by: GendoIkari on January 27, 2015, 08:15:11 pm
Ok, the AI now is actually smart when advancing crowns. It uses a heuristic provided by Donald himself; basically it will try to rule times that have zones that care about having crowns there, and it will try to prevent other people from ruling such times.
Title: Re: Play Temporum online, single-player against AI!
Post by: jaketheyak on January 27, 2015, 08:57:15 pm
My favourite card as far as theme goes is Tulip Stocks.
The GFC of the 17th Century.

(http://upload.wikimedia.org/wikipedia/commons/a/ac/Tulip_price_index1.svg)
Title: Re: Play Temporum online, single-player against AI!
Post by: Voltaire on January 28, 2015, 11:54:15 am
Ok, the AI now is actually smart when advancing crowns. It uses a heuristic provided by Donald himself; basically it will try to rule times that have zones that care about having crowns there, and it will try to prevent other people from ruling such times.

Wonderful! Many thanks to both of you.
Title: Re: Play Temporum online, single-player against AI!
Post by: LastFootnote on January 28, 2015, 03:39:35 pm
Ok, the AI now is actually smart when advancing crowns. It uses a heuristic provided by Donald himself; basically it will try to rule times that have zones that care about having crowns there, and it will try to prevent other people from ruling such times.

Dammit, man! Now I've lost my first game against the AI! My perfect record, NOOOOOOOOOO!!!!
Title: Re: Play Temporum online, single-player against AI!
Post by: Voltaire on February 03, 2015, 11:53:49 am
Do you have any plans to implement the remaining cards/zones?
Title: Re: Play Temporum online, single-player against AI!
Post by: GendoIkari on February 03, 2015, 01:02:04 pm
Do you have any plans to implement the remaining cards/zones?

Yes! Sorry I've been busy the last week or so. Mostly likely I'll be doing some more this weekend, along with a smarter algorithm for the AI deciding whether to change history that Donald suggested.
Title: Re: Play Temporum online, single-player against AI!
Post by: Voltaire on February 03, 2015, 05:34:53 pm
Do you have any plans to implement the remaining cards/zones?

Yes! Sorry I've been busy the last week or so. Mostly likely I'll be doing some more this weekend, along with a smarter algorithm for the AI deciding whether to change history that Donald suggested.

Oh no rush at all, I do not expect anything else - you've already done a ton. I just recently played again in-person and it reminded me "oh, right, there are more cards."
Title: Re: Play Temporum online, single-player against AI!
Post by: GendoIkari on February 07, 2015, 03:15:39 pm
Bureaucracy (Time III Zone) is implemented now! Sorry for the long wait since the last update. Hopefully will have a few more cards this weekend/week.
Title: Re: Play Temporum online, single-player against AI!
Post by: GendoIkari on February 08, 2015, 07:06:54 pm
Age of Cybernetics (Time IV Zone) is done!! I'm excited about this one; I haven't played it much in person yet, and it seems like it could lead to craziness. Also, I made a pretty fundamental change to the way cards as objects are handled, so there's a chance some stuff that used to work is buggy now. It seems to work fine, but I haven't tested every zone/card with the new code.

*Edit* Age of Cybernetics is now optional, as per the actual card text. Which makes me ask.. Donald, is there a particular reason that Age of Cybernetics, Cats, & Toys are "may"? As already discussed, there's rare edge cases where you would want to visit the zone and just do nothing at all that turn, but they are so very rare... it just seems like the cards would have been simpler to make those types of effects mandatory.

Another note... there's a known bug with Age of Cybernetics that should come up in a game basically never. If you copy Investments or Treasure Map, and then discard the copy for the effect, it doesn't revert back to the original card. So if you actually go through the whole deck after doing so, and re-draw the original card, you'll draw an additional Investments/Treasure Map instead. Not worth fixing at the moment since it's just so rare.
Title: Re: Play Temporum online, single-player against AI!
Post by: LastFootnote on February 08, 2015, 08:14:57 pm
Age of Cybernetics (Time IV Zone) is done!! I'm excited about this one; I haven't played it much in person yet, and it seems like it could lead to craziness.

Awesome work!
Title: Re: Play Temporum online, single-player against AI!
Post by: GendoIkari on February 08, 2015, 10:46:33 pm
Information Age (Time IV Zone) is done!

Minor known bug: say you have 4 crowns in I and III. You visit Information Age which sends you to III. If your action in III causes you to move a crown from I to II (so now you only have 3 crowns in I), you will still visit I, even though you shouldn't. Conversely, if your action in III causes you to move a 4th crown to II, you won't visit II. It's calculating which zones you should visit up-front, instead of after each zone is visited. Will fix later.
Title: Re: Play Temporum online, single-player against AI!
Post by: LastFootnote on February 08, 2015, 11:44:30 pm
There's an issue with Alien Contact. I visited it and drew Inventor, but when I tried to score it, I got:

Code: [Select]
You visited Alien Contact
You drew Inventor
You paid $NaN to score undefined
Title: Re: Play Temporum online, single-player against AI!
Post by: GendoIkari on February 09, 2015, 12:40:15 am
There's an issue with Alien Contact. I visited it and drew Inventor, but when I tried to score it, I got:

Code: [Select]
You visited Alien Contact
You drew Inventor
You paid $NaN to score undefined

Thanks. Must be related to the sweeping changes I made. Will fix tomorrow.
Title: Re: Play Temporum online, single-player against AI!
Post by: Donald X. on February 09, 2015, 07:00:58 am
There's an issue with Alien Contact. I visited it and drew Inventor, but when I tried to score it, I got:

Code: [Select]
You visited Alien Contact
You drew Inventor
You paid $NaN to score undefined
Age of Toys also crashes with NaN, regardless of the card played.
Title: Re: Play Temporum online, single-player against AI!
Post by: GendoIkari on February 09, 2015, 09:13:52 am
So because Predict the Future and Step on a Butterfly are both "At the end of this turn", I'm pretty sure there's no way to change history in the middle of a turn. But just so that the program handles that possible situation correctly; what should Age of Information do if your visit to Time III caused a different Time III to become real? A literal reading of the card would suggest that you now get to visit the new Time III Zone, because it is "a Zone you have not visited yet this turn", and you have 4 crowns there. But it also seems more likely that the intent was that you only get to visit each time at most once with Information Age.
Title: Re: Play Temporum online, single-player against AI!
Post by: GendoIkari on February 09, 2015, 11:28:33 am
Age of Toys, Alien Contact, and Information Age are all fixed now.

The coding of Information Age currently assumes that the literal wording on the card is correct, even though my guess is that the intent is that you can never visit the same time twice with it. Also, it never matters for now because no card allows History to be changed in the middle of a turn. But if you visited Time III as part of Information Age, and by doing so played a card that made a different Time III real, you would then visit the new Time III.
Title: Re: Play Temporum online, single-player against AI!
Post by: GendoIkari on February 09, 2015, 06:16:25 pm
Tired of being constrained to visiting realities that actually exist? Well look no further! Anubis Statuette is now implemented. Have fun visiting locations that don't even exist!

This means that all 30 player cards are done now! No longer can people accuse me of not playing with a full deck!
Title: Re: Play Temporum online, single-player against AI!
Post by: Ozle on February 09, 2015, 06:19:38 pm


I'm sorry, you are going to have to take this down.

Jay has just sold the online rights to an investment company who are going to turn it into a multi platform offering with Next Gen console support.

Please don't be too upset, it was to have it while it was free, and it will probably be better than the replacement.
Title: Re: Play Temporum online, single-player against AI!
Post by: liopoil on February 09, 2015, 06:49:03 pm


I'm sorry, you are going to have to take this down.

Jay has just sold the online rights to an investment company who are going to turn it into a multi platform offering with Next Gen console support.

Please don't be too upset, it was to have it while it was free, and it will probably be better than the replacement.
Stop it, that's not funny.
Title: Re: Play Temporum online, single-player against AI!
Post by: Donald X. on February 09, 2015, 07:20:56 pm
So because Predict the Future and Step on a Butterfly are both "At the end of this turn", I'm pretty sure there's no way to change history in the middle of a turn. But just so that the program handles that possible situation correctly; what should Age of Information do if your visit to Time III caused a different Time III to become real? A literal reading of the card would suggest that you now get to visit the new Time III Zone, because it is "a Zone you have not visited yet this turn", and you have 4 crowns there. But it also seems more likely that the intent was that you only get to visit each time at most once with Information Age.
I always change history after other stuff to avoid confusion, but yes as written Information Age would visit the new real Time III. That wasn't intended but it follows from the card text and doesn't matter.
Title: Re: Play Temporum online, single-player against AI!
Post by: Donald X. on February 09, 2015, 07:21:28 pm


I'm sorry, you are going to have to take this down.

Jay has just sold the online rights to an investment company who are going to turn it into a multi platform offering with Next Gen console support.

Please don't be too upset, it was to have it while it was free, and it will probably be better than the replacement.
Stop it, that's not funny.
Yeah, don't toy with my emotions by pretending that Temporum is a big hit.
Title: Re: Play Temporum online, single-player against AI!
Post by: Donald X. on February 09, 2015, 07:27:45 pm
Tired of being constrained to visiting realities that actually exist? Well look no further! Anubis Statuette is now implemented. Have fun visiting locations that don't even exist!

This means that all 30 player cards are done now! No longer can people accuse me of not playing with a full deck!
I went to Warm Globe. Another player played Anubis Statuette. After finishing Warm Globe, it had me pick where to go, and then I went there, not them.
Title: Re: Play Temporum online, single-player against AI!
Post by: GendoIkari on February 09, 2015, 10:32:56 pm
Tired of being constrained to visiting realities that actually exist? Well look no further! Anubis Statuette is now implemented. Have fun visiting locations that don't even exist!

This means that all 30 player cards are done now! No longer can people accuse me of not playing with a full deck!
I went to Warm Globe. Another player played Anubis Statuette. After finishing Warm Globe, it had me pick where to go, and then I went there, not them.

Oh right, the game needs to act different when it's an AI that played Anubis Statue. So it would have been broken however the computer played Anubis, not just from Warm Globe. That part is fixed.

The Warm Globe part, man that's a mess. So I'm guessing that if more than one player plays an Anubis during Warm Globe, then nothing will happen until Warm Globe is finished, at which point all Anubii will be resolved? Starting with the current player and going in order? Allowing Anubis to happen for the player whose turn it isn't will be a little tricky; allowing multiple to happen during the same end-of-zone timing will be ever trickier.
Title: Re: Play Temporum online, single-player against AI!
Post by: GendoIkari on February 09, 2015, 10:55:59 pm
Bah, this got me thinking; there's other rare-but-broken stuff. So it's not just Warm Globe. Communist Utopia and Information Age could allow the same player to play 2 Anubis Statuettes on the same turn. Currently you would only get the benefit from one. Also, you could play 2 Predict the Futures, or 2 Step on a Butterflies. Again, only 1 would actually take effect.
Title: Re: Play Temporum online, single-player against AI!
Post by: Donald X. on February 10, 2015, 12:39:54 am
So I'm guessing that if more than one player plays an Anubis during Warm Globe, then nothing will happen until Warm Globe is finished, at which point all Anubii will be resolved? Starting with the current player and going in order?
Yes, that's just what happens. And one of those players can go to Information Age or Warm Globe to pile on more stuff. The limit isn't two either, due to Industrial Revolution.
Title: Re: Play Temporum online, single-player against AI!
Post by: A Drowned Kernel on February 10, 2015, 06:20:11 pm
I just played a game where the AI changed history to put me in Robot Uprising when I was 1 crown away from winning. I was almost certainly going to win that turn anyway so maybe it was just spinning its wheels.
Title: Re: Play Temporum online, single-player against AI!
Post by: GendoIkari on February 10, 2015, 08:30:26 pm
I just played a game where the AI changed history to put me in Robot Uprising when I was 1 crown away from winning. I was almost certainly going to win that turn anyway so maybe it was just spinning its wheels.

Yeah intelligent History-changing is not implemented yet; it's just random. But that's coming soon.
Title: Re: Play Temporum online, single-player against AI!
Post by: eHalcyon on February 10, 2015, 08:39:55 pm
Hahaha, Age of Cybernetics is hilarious.  I draw 3 cards when I play a card and cards cost me $6 less to score.  My scored cards also score an extra *, but I did not duplicate that one.

It would be nice to know how much money I'd get for duplicating one of my perpetual cards though.
Title: Re: Play Temporum online, single-player against AI!
Post by: GendoIkari on February 10, 2015, 08:53:49 pm
Hahaha, Age of Cybernetics is hilarious.  I draw 3 cards when I play a card and cards cost me $6 less to score.  My scored cards also score an extra *, but I did not duplicate that one.

It would be nice to know how much money I'd get for duplicating one of my perpetual cards though.

Good point. I wonder if the interface would fit just fine if I simply draw out each "in play" card instead of just adding the descriptions.
Title: Re: Play Temporum online, single-player against AI!
Post by: eHalcyon on February 10, 2015, 09:01:09 pm
Hahaha, Age of Cybernetics is hilarious.  I draw 3 cards when I play a card and cards cost me $6 less to score.  My scored cards also score an extra *, but I did not duplicate that one.

It would be nice to know how much money I'd get for duplicating one of my perpetual cards though.

Good point. I wonder if the interface would fit just fine if I simply draw out each "in play" card instead of just adding the descriptions.

You could just put it in a tooltip, with the card name and money value.
Title: Re: Play Temporum online, single-player against AI!
Post by: GendoIkari on February 10, 2015, 09:06:30 pm
Hahaha, Age of Cybernetics is hilarious.  I draw 3 cards when I play a card and cards cost me $6 less to score.  My scored cards also score an extra *, but I did not duplicate that one.

It would be nice to know how much money I'd get for duplicating one of my perpetual cards though.

Good point. I wonder if the interface would fit just fine if I simply draw out each "in play" card instead of just adding the descriptions.

You could just put it in a tooltip, with the card name and money value.

Yes, that's the other option. If having the full card fits ok, that would be better. It's just hard to know what "fits" for most people, because I run 2 monitors at 2560x1440.

*Edit* The tooltip version is done; since that only took a minute.
Title: Re: Play Temporum online, single-player against AI!
Post by: GendoIkari on February 10, 2015, 09:29:52 pm
Nuclear Wasteland is there now! That's all the Time IV zones now. Only 3 Zones (and no player cards) remain:

Police State: Easy to implement, but if I implement it with the current AI, then you will be able to simply lock the AI down in the Police State since it doesn't know how to visit Time IV. To allow him to visit Time IV means both updating every Time IV zone that provides a choice to handle the AI being there, and also having the AI know when it's a good idea to go to Time IV in the first place.

Industrial Revolution: Sounds easy, doesn't it? But it's a programming nightmare. This card breaks the Lose Track rule. After you've played a card, who knows where it is. In the discard? In play? Back in your hand? Industrial Revolution simply can't find the card to return it to your hand; it doesn't know where the card is; it doesn't even know what card to look for. All it knows is that some card was played. I may have to update every single player card to handle what to do when it is played from Industrial Revolution.

Age of Cults: Probably not as hard as it sounds; I'll probably do this next, then move on to Donald's "smart History changing" AI heuristic.
Title: Re: Play Temporum online, single-player against AI!
Post by: A Drowned Kernel on February 10, 2015, 10:25:53 pm
Man, I didn't even notice that the AI was never going to Age IV. I'll probably learn really bad habits if I play against it knowing that...

EDIT: Oh, and you're incredibly amazing for putting this together.
Title: Re: Play Temporum online, single-player against AI!
Post by: Donald X. on February 11, 2015, 03:22:40 am
Police State: Easy to implement, but if I implement it with the current AI, then you will be able to simply lock the AI down in the Police State since it doesn't know how to visit Time IV. To allow him to visit Time IV means both updating every Time IV zone that provides a choice to handle the AI being there, and also having the AI know when it's a good idea to go to Time IV in the first place.
Obv. handling a visit to Time IV requires specific code for each Zone that has decisions.

To decide whether or not to go there, that's just the basic better algorithm for picking where to go - you make a copy of the game, simulate turns for each option, calculate numbers for the resulting board states, and pick the move that produced the best number. Time IV isn't an exception or anything here, it takes no extra code (beyond the code needed for handling visits to Time IV). This algorithm is pretty simple. The only tricky part is dealing with drawn cards that can't be known (since that would be an unfair advantage) but which are used as if known (such as due to Alien Contact and Age of Toys). Possibly you just define some new cards that are only used by the simulation and only in these cases (so, simulated Age of Toys always gives you a choice between +$12 and +$12).

Anyway I will type something up about the board state evaluation.

Industrial Revolution: Sounds easy, doesn't it? But it's a programming nightmare. This card breaks the Lose Track rule. After you've played a card, who knows where it is. In the discard? In play? Back in your hand? Industrial Revolution simply can't find the card to return it to your hand; it doesn't know where the card is; it doesn't even know what card to look for. All it knows is that some card was played. I may have to update every single player card to handle what to do when it is played from Industrial Revolution.
In almost all situations there are only three places the card can be (play, top of discard, hand). The only exception is if you force a shuffle after the card resolves but before the if-ruling part resolves, which could happen due to Gang of Pickpockets. I feel like, you can pass on faithfully simulating that situation. It's pretty rare.

In practice everyone is treating it as an "instead" - they obv. aren't moving the card to the discard pile and then picking it up. You could just treat it that way. A played card by default goes to discard or play; Bag of Loot goes to hand instead; and if played via Industrial Revolution's ability and they rule there at the moment we are considering this, they pick hand or not (not then meaning discard/play/hand as normal). So, you just track whether the play was via Industrial Revolution or not, and then use that information to help determine the card destination when ready to move it.

[Obv. Industrial Revolution has no effect on cards played there that aren't via its ability (such as via playing Trinket there).]

Age of Cults: Probably not as hard as it sounds; I'll probably do this next, then move on to Donald's "smart History changing" AI heuristic.
Here you just use the same decision algorithm as for discarding, only, put the cards into an array and then dole them back out, skipping the empty slots. Obv. for good play you want to avoid passing someone a game-winning scoring ratio late in the game, but that could be on a list for someday.
Title: Re: Play Temporum online, single-player against AI!
Post by: GendoIkari on February 11, 2015, 09:50:37 am
So, you just track whether the play was via Industrial Revolution or not, and then use that information to help determine the card destination when ready to move it.

[Obv. Industrial Revolution has no effect on cards played there that aren't via its ability (such as via playing Trinket there).]


The reason this is harder (maybe not harder, but at least annoying) than it sounds is that the "on play" code for each card is responsible for moving it to the right place after it's done being played. This means that all 30 cards need to be slightly updated to check and see if it was played from IR. Originally I had the general "play card" method just call the selected cards "on play" method and then discard it after it was done, (so that the code to discard a card when done was in only 1 place instead of part of every card), but that didn't work with Bag of Loot or blue cards.

So it can be done, it's just more work than it sounds like it should be.
Title: Re: Play Temporum online, single-player against AI!
Post by: Donald X. on February 11, 2015, 10:48:00 am
The reason this is harder (maybe not harder, but at least annoying) than it sounds is that the "on play" code for each card is responsible for moving it to the right place after it's done being played. This means that all 30 cards need to be slightly updated to check and see if it was played from IR. Originally I had the general "play card" method just call the selected cards "on play" method and then discard it after it was done, (so that the code to discard a card when done was in only 1 place instead of part of every card), but that didn't work with Bag of Loot or blue cards.
Well I don't know what the code looks like. If the card is an object, you can just have the base routine for momentary, override it for perpetual, and override it for Bag of Loot, for 3 routines. I mean uh obv. you wouldn't say what to do 30 times when there are 3 cases.
Title: Re: Play Temporum online, single-player against AI!
Post by: GendoIkari on February 11, 2015, 11:34:40 am
The reason this is harder (maybe not harder, but at least annoying) than it sounds is that the "on play" code for each card is responsible for moving it to the right place after it's done being played. This means that all 30 cards need to be slightly updated to check and see if it was played from IR. Originally I had the general "play card" method just call the selected cards "on play" method and then discard it after it was done, (so that the code to discard a card when done was in only 1 place instead of part of every card), but that didn't work with Bag of Loot or blue cards.
Well I don't know what the code looks like. If the card is an object, you can just have the base routine for momentary, override it for perpetual, and override it for Bag of Loot, for 3 routines. I mean uh obv. you wouldn't say what to do 30 times when there are 3 cases.

This gives me good ideas.

Did you Did you see my question about Age of Cats/Toys/Cybernetics? Is there a game-design reason why they have "You may"? It's two less words and one less almost-meaningless decision to make them mandatory, and the edge cases where it's a good idea to visit there without wanting to do the action are very rare.
Title: Re: Play Temporum online, single-player against AI!
Post by: Donald X. on February 11, 2015, 11:58:24 am
Did you Did you see my question about Age of Cats/Toys/Cybernetics? Is there a game-design reason why they have "You may"? It's two less words and one less almost-meaningless decision to make them mandatory, and the edge cases where it's a good idea to visit there without wanting to do the action are very rare.
I didn't I didn't see it, and still haven't, just this repeating of it.

In my experience, "You may pay $4. If you do..." is simpler than "Pay $4. If you do..." It makes the "if you do" make more sense; there's no, wait why does that say "if" when I'm forced to? So that covers Cats/Toys. And uh obv. for playing irl, that "you may" decision takes absolutely zero time; you decide to go to Age of Cats, you go there and pay your $10.

I am not sure what the reason is for Age of Cybernetics. Possibly no reason.
Title: Re: Play Temporum online, single-player against AI!
Post by: GendoIkari on February 11, 2015, 05:41:31 pm
Ok, cool. Industrial Revolution (Time III Zone) is done! Thanks to ideas given by Donald. So I did have to make a small change to each of the 30 cards, but only because I should have done it better in the first place.

Also fun; I visited Information Age with 4 Crowns in each II and III. When I went to III, I played Anubis Statuette. That interrupts Information Age and I visited a non-real Communist Utopia, where I played a total of 4 cards (because 2 of them were Trinkets). After which Information Age continued and jumped me up to II, where I drew 2 cards. And it all worked properly!

Code: [Select]
You visited Information Age
You visited Bureaucracy
You played Anubis Statuette
You gained $2
You visited Communist Utopia
You played Conspiracy
You gained $0
You played Trinket
You gained $4
You played Trinket
You gained $4
You played Explorer
You gained $6
You visited Pax Buddha
You drew Tulip Stocks
You gained $1
You drew Think Tank
You gained $1
You drew Black Market
You gained $1

So I think I need to fix the end-of-turn / end-of-zone effects now, because those are bugs that can actually happen. At first I was thinking that if you played both Step on a Butterfly and Predict the Future in the same turn that there would be no problem with Butterfly happening first always, but I realize now that you might want to Predict the Future first because it will change what Butterfly actually does. So I need to put in a more complex system for holding a list of events that need to happen at end of zone and end of turn, and then handle them one at a time in player order (and give the player a choice when the same player has more than one).
Title: Re: Play Temporum online, single-player against AI!
Post by: eHalcyon on February 11, 2015, 05:50:43 pm
I just played a game with it.  Seems to be working well.  I ruled 2 ages including Age III, and I used Industrial Revolution to play Gladiator's Gladius a few times.  I stopped with $50 and a big hand, then proceeded to score 3 cards in a row to win.  I wouldn't have had enough money, but Iron Ages helped out a bunch.
Title: Re: Play Temporum online, single-player against AI!
Post by: eHalcyon on February 14, 2015, 06:33:44 pm
Just ran into a bug, but it might be because you are currently updating.

I went to Communist Utopia with $8.  I played Anubis Statuette, which put me at $10, followed by Treasure Map, which took me to $16.  Now I choose to discard Treasure Map to draw 2 more cards.  The log shows that Treasure Map let me draw Crown Jewels and Gladiator's Gladius, but they have not appeared in my hand.  Instead, my hand remains the same and the choice for Treasure Map is still there.  The links only take me to the top of the page.

I also had a bunch of other permanent powers in play: Think Tank, Gang of Pickpockets, Prime Real Estate and Secret Society.

It's probably just because you were updating, but I thought I'd mention it anyway.
Title: Re: Play Temporum online, single-player against AI!
Post by: GendoIkari on February 14, 2015, 06:54:33 pm
Thanks, but yeah, anything that was wrong the last 30 minutes or so was due to reworking the way end of turn (end end of zone) events work.

But they work now! So Predict the Future and Step on a Butterfly are the only 2 end-of-turn events (Investments is still handled separately; happens after those others). If multiple players have an end-of-turn event waiting (due to Warm Globe), then each player will handle their events in turn order starting with the current player. If you have more than type of event (if you played both Predict & Butterfly), then you choose which one to resolve until only 1 remains, and then the last happens automatically.

Same thing pretty much for end-of-zone events. Anubis Statuette is currently the only End-of-Zone event. (I guess Treasure Map should be as well, but for now that happens after Anubis). If you play multiple Anubis, you get all of them. If multiple players play Anubis (Warm Globe), then they all get Anubis effect, in turn order.

So to test this out, I temporarily change the entire deck to be all Anubis Statuettes, and played a 5 player game and went to Warm Globe. The log:

You visited Warm Globe
You gained $8
You played Anubis Statuette
You gained $2
Player 4 played Anubis Statuette
Player 4 gained $2
Player 5 played Anubis Statuette
Player 5 gained $2
Player 1 played Anubis Statuette
Player 1 gained $2
Player 2 played Anubis Statuette
Player 2 gained $2
You visited American Civil War
You played Anubis Statuette
You gained $2
You gained $0
You visited Feudal Japan
You drew Anubis Statuette
You drew Anubis Statuette
Player 4 visited Bureaucracy
Player 4 played Anubis Statuette
Player 4 gained $2
Player 4 visited Feudal Japan
Player 4 drew 2 cards
Player 5 visited Bureaucracy
Player 5 played Anubis Statuette
Player 5 gained $2
Player 5 visited Feudal Japan
Player 5 drew 2 cards
Player 1 visited Bureaucracy
Player 1 played Anubis Statuette
Player 1 gained $2
Player 1 visited Feudal Japan
Player 1 drew 2 cards
Player 2 visited Bureaucracy
Player 2 played Anubis Statuette
Player 2 gained $2
Player 2 visited Feudal Japan
Player 2 drew 2 cards

So there you go!
Title: Re: Play Temporum online, single-player against AI!
Post by: Donald X. on February 16, 2015, 08:07:00 am
I used Anubis Statuette to go to an unreal Information Age. I had 4 cubes in times 3 and 1. First it sent me to both Prohibition Era and Plutocracy, despite them both being unreal (and not Age of Discovery, which is correct as I already was there this turn). Then to Primitive Paradise, no problem there.

You visited Age of Discovery
You played Anubis Statuette
You gained $2
You gained $2
You gained $4
You visited Information Age
You gained $2
You visited Prohibition Era
You played Secret Society
You gained $0
You gained $2
You gained $2
Player 1 gained $1
You visited Plutocracy
You gained $2
You played Kill Your Grandfather
You gained $5
You gained $2
You drew Infected Rat
You drew Barbarian Horde
You scored 1
You visited Primitive Paradise
You paid $16 to score Barbarian Horde
You scored 7
You drew Mayan Ritual Knife
Title: Re: Play Temporum online, single-player against AI!
Post by: GendoIkari on February 16, 2015, 10:52:54 am
Ah...  when you play Anubis Statuette, in order to let you pick from all the zones, it changes all non-visited zones to "real" until after Anubis is done. I guess it needs to change the real ones back sooner than it is. I'd tested using Information Age to play Anubis plenty, but not the other way around.

Fixed now.
Title: Re: Play Temporum online, single-player against AI!
Post by: Donald X. on February 18, 2015, 04:42:41 am
The AI played Shogun's Katana in Industrial Revolution, and ended up with "Gain $2 per time you rule" on its list of perpetual abilities.
Title: Re: Play Temporum online, single-player against AI!
Post by: GendoIkari on February 18, 2015, 10:26:19 am
The AI played Shogun's Katana in Industrial Revolution, and ended up with "Gain $2 per time you rule" on its list of perpetual abilities.

Oops. For the AI only, Industrial Revolution was moving the card to in-play instead of moving it to in-hand. Should be fixed now, though the AI always chooses to return to hand, even if it's blue and would be smarter to keep in in play. Will hopefully have time soon to implement your smarter AI anyway.
Title: Re: Play Temporum online, single-player against AI!
Post by: eHalcyon on February 20, 2015, 03:37:22 pm
I am P2 in a 2 player game.  P1 is in Stone Age, with timeline pointed to Inquisition (also where I am).  P1 changes timeline to Egyptian America and visits Age of Discovery.  P1 plays Anubis Statuette and then visits Inquisition, causing me to lose $2.  But at the end, P1 is still in Inquisition despite it being unreal.

Edit: this might just be a display bug.  P1's star shifted to Egyptian America right after I made my move (visiting Age of Discovery).
Title: Re: Play Temporum online, single-player against AI!
Post by: GendoIkari on February 20, 2015, 07:10:00 pm
I am P2 in a 2 player game.  P1 is in Stone Age, with timeline pointed to Inquisition (also where I am).  P1 changes timeline to Egyptian America and visits Age of Discovery.  P1 plays Anubis Statuette and then visits Inquisition, causing me to lose $2.  But at the end, P1 is still in Inquisition despite it being unreal.

Edit: this might just be a display bug.  P1's star shifted to Egyptian America right after I made my move (visiting Age of Discovery).

Thanks, fixed! And it wan't presentation only; he really was still in the unreal time until you took an action.

Found another bug that will be fixed later tonight... if the computer plays Investments in Industrial Revolution (while ruling there), the game will crash. If you play it; and choose to return it to hand, you will have the option of discarding Investments for the money at end of turn, but that option won't work.

*Edit* Investments / Industrial Revolution bug fixed now.
Title: Re: Play Temporum online, single-player against AI!
Post by: eHalcyon on March 01, 2015, 09:38:48 pm
Some sort of bug happened. 

Code: [Select]
Player 1 Turn 1
Player 1 visited Plutocracy
Player 1 gained $2
Player 1 played Secret Society
Player 1 gained $0

Player 2 Turn 1
You visited Plutocracy
You played Explorer
You gained $6
You scored 1

Player 1 Turn 2
Player 1 visited Plutocracy
Player 1 played Step on a Butterfly
Player 1 gained $12
Player 1 scored 1
History changes in all times

Player 2 Turn 2
...

The problem is that player 1 still has all of their crowns in Age I,even though they were supposed to have "scored 1" from Plutocracy.
Title: Re: Play Temporum online, single-player against AI!
Post by: GendoIkari on March 02, 2015, 09:41:54 am
Some sort of bug happened. 

Code: [Select]
Player 1 Turn 1
Player 1 visited Plutocracy
Player 1 gained $2
Player 1 played Secret Society
Player 1 gained $0

Player 2 Turn 1
You visited Plutocracy
You played Explorer
You gained $6
You scored 1

Player 1 Turn 2
Player 1 visited Plutocracy
Player 1 played Step on a Butterfly
Player 1 gained $12
Player 1 scored 1
History changes in all times

Player 2 Turn 2
...

The problem is that player 1 still has all of their crowns in Age I,even though they were supposed to have "scored 1" from Plutocracy.

I assume the Primitive Paradise was in play, which was why he got $2 when visiting Plutocracy on turn 1?

Failed to reproduce on my first attempt; anything else noteworthy in play?

Code: [Select]
Player 1 Turn 1
Player 1 visited Plutocracy
Player 1 played Papal Tiara
Player 1 gained $4
Player 1 could not afford to score a card

Player 2 Turn 1
You visited Plutocracy
You played Secret Society
You gained $0

Player 1 Turn 2
Player 1 visited Plutocracy
Player 1 played Prime Real Estate
Player 1 gained $7
Player 1 scored 1

Player 2 Turn 2
Title: Re: Play Temporum online, single-player against AI!
Post by: eHalcyon on March 02, 2015, 12:02:24 pm
I've forgotten, sorry!  Inquisition, maybe?

It might also have to do with Step On A Butterfly.  Note that it is listed correctly in the log that he scored 1, even though it didn't actually happen on the track.
Title: Re: Play Temporum online, single-player against AI!
Post by: LibraryAdventurer on May 24, 2015, 02:42:32 am
So I recently decided to try out Temporum by using your online implementation, and I found a bug: I'm playing a 3-player game and this happened:  (player 3 is a bot)
Quote
Player 3 visited Bureaucracy
Player 3 played Barbarian Horde
Player 3 gained $9
Player 3 discarded Friends in Old Places
Player 3 scored 1
Except all of Player 3's crowns were still on Time 1.
Title: Re: Play Temporum online, single-player against AI!
Post by: eHalcyon on May 24, 2015, 02:47:20 am
So I recently decided to try out Temporum by using your online implementation, and I found a bug: I'm playing a 3-player game and this happened:  (player 3 is a bot)
Quote
Player 3 visited Bureaucracy
Player 3 played Barbarian Horde
Player 3 gained $9
Player 3 discarded Friends in Old Places
Player 3 scored 1
Except all of Player 3's crowns were still on Time 1.

What's the bug?

Player 3 visits Bureaucracy, plays Barbarian Horde.  This gives him $9 and allows him to discard cards to advance crowns.  He discards 1 to advance 1.  The location of the crowns does not matter.

Edit: went to check it out, I see now.  You mean that even though the AI scored something, no crowns were advanced.  I am seeing this too.  It happened with Settlers.
Title: Re: Play Temporum online, single-player against AI!
Post by: GendoIkari on May 28, 2015, 05:32:00 pm
So I recently decided to try out Temporum by using your online implementation, and I found a bug: I'm playing a 3-player game and this happened:  (player 3 is a bot)
Quote
Player 3 visited Bureaucracy
Player 3 played Barbarian Horde
Player 3 gained $9
Player 3 discarded Friends in Old Places
Player 3 scored 1
Except all of Player 3's crowns were still on Time 1.

What's the bug?

Player 3 visits Bureaucracy, plays Barbarian Horde.  This gives him $9 and allows him to discard cards to advance crowns.  He discards 1 to advance 1.  The location of the crowns does not matter.

Edit: went to check it out, I see now.  You mean that even though the AI scored something, no crowns were advanced.  I am seeing this too.  It happened with Settlers.

Are you saying that with both Settlers and Barbarian Horde, when the AI plays it, he doesn't score anything?

Not seeing it:

Player 2 Turn 1
Player 2 visited Great Depression
Player 2 played Settlers
Player 2 gained $8
Player 2 scored 1
Player 1 lost $2
Player 2 lost $2

(Player 2 now has a single crown in Time II).


Could it be that the other player visited Bureaucracy right after, causing him to retreat the crown he'd scored?
Title: Re: Play Temporum online, single-player against AI!
Post by: eHalcyon on May 28, 2015, 05:49:03 pm
It showed up in the log, but it didn't actually advance.

Also, when I checked it out, it was with 2 players only, so Bureaucracy wouldn't have been a factor.

Edit: Just tried it again and it didn't happen.  Maybe it's a bug specific to Bureaucracy, e.g. AI visits the location, ends up with more than $12 and is forced to retreat a crown even though it should only apply to other characters.  I don't remember if it was Bureaucracy when I reproduced the issue before, but it could have been such a coincidence.
Title: Re: Play Temporum online, single-player against AI!
Post by: GendoIkari on May 28, 2015, 07:11:32 pm
Well I checked and Bureaucracy correctly only hurts other players, not the player who played there. Will keep checking; thanks for the input.
Title: Re: Play Temporum online, single-player against AI!
Post by: GendoIkari on May 28, 2015, 08:57:19 pm
Wow, just got an incredibly lucky happening... while trying to reproduce AI playing Settlers at Bureaucracy, resulting in him having $12 or more... Very first turn of the very first game I tried:

Player 2 Turn 1
Player 2 visited Bureaucracy
Player 2 played Settlers
Player 2 gained $8
Player 2 scored 1

So he had $12 total, and he correctly has a single crown moved after. Think I'm gonna have to chalk this one up to random rare occurrence that can't be repeated for now. If it happens again, hopefully that will result in more data.
Title: Re: Play Temporum online, single-player against AI!
Post by: GendoIkari on May 29, 2015, 11:10:14 am
Wow, just now realized that this is the same bug that you reported back in March, where it happened on Plutocracy. So it's not a Bureaucracy thing...
Title: Re: Play Temporum online, single-player against AI!
Post by: eHalcyon on May 29, 2015, 11:44:20 am
Wow, just now realized that this is the same bug that you reported back in March, where it happened on Plutocracy. So it's not a Bureaucracy thing...

Whoa, I had forgotten about that.
Title: Re: Play Temporum online, single-player against AI!
Post by: GendoIkari on June 16, 2017, 10:15:33 am
Looking for opinions... is there a market for this site? With Luciferous' client offering network play against other people, as well as a much more polished interface, I'm wondering if it's worth any effort to update mine, such as adding in the expansion. There's about 40 people playing it every month; enough that I'm certainly leaving it up. But not sure if I want to take the time to make updates.

Some people might prefer my slimmed-down look; kind of like how some people prefer the look of Isotropic. But playing against other users is pretty important. I don't know how Luciferous' AI compares to mine... mine is terrible, I know that. But it still works as sandbox against which to try to various strategies.

I was actually contacted by someone on BGG who has a couple small feature requests. I pointed him to Luciferous', and he said he actually prefers mine. But anyway.... for those who have played on Luciferous' client, do you think mine fulfills a different enough role that it makes sense to try to keep it updated? Or should I just leave it as is, and if I really feel like doing programming outside of work, I can contribute to Luciferous' on his repo?