Tam is back?

By Tam, in 1. AGoT General Discussion

Whoa. What the hell is he up to now?

lol. I don't know who you are, but I like your style.

Who's Tam?

:P

It would be great to have you back, old friend. Your work on Raven a few years ago - giving the community the first computer based interface for throens play defitneiyl earned you a spot in the GoT CCG community hall of fmae.

Welcome back, Tam!

I see that you are all playing GOT online with a cool new application. I'm looking forward to trying it out. It looks great. Certainly better than my Raven Evolved even though that was pretty cool.

So now I've undertaken what I'm calling Raven AI. Anyone interested in playing the new format against the computer?

I started working on it a couple of weeks ago in my limited spare time and in eight hours of programming I'm done with the setup phase.

When you start the game, you pick a deck for the computer and one for yourself. A coin is tossed and the winner chooses who the first player will be. If it's the computer, it will calculate the best card it can find and them. Then you your setup and click the done button. All the cards are revealed and the plot phase begins.

Most of the code I wrote for the will be re-usable for the Marshalling phase. I've got most of the critical mechanisms in place already, so I think it'll take me a few months to "complete the circle" so we can actually play a full game against the computer.

At this point I can't possibly say how good the computer will be. Right now the setup code is pretty good, I think. 8 out of 10 times the computer decides to exactly what I would drop, but then I'm not very good at this game.

You can be sure the computer won't miss an opportunity to claim power or take away some of yours. I hope to have something ready for you all in a few months. At the least it will be a great way to test a new deck idea.

Tam said:

I see that you are all playing GOT online with a cool new application. I'm looking forward to trying it out. It looks great. Certainly better than my Raven Evolved even though that was pretty cool.

So now I've undertaken what I'm calling Raven AI. Anyone interested in playing the new format against the computer?

I started working on it a couple of weeks ago in my limited spare time and in eight hours of programming I'm done with the setup phase.

When you start the game, you pick a deck for the computer and one for yourself. A coin is tossed and the winner chooses who the first player will be. If it's the computer, it will calculate the best card it can find and them. Then you your setup and click the done button. All the cards are revealed and the plot phase begins.

Most of the code I wrote for the will be re-usable for the Marshalling phase. I've got most of the critical mechanisms in place already, so I think it'll take me a few months to "complete the circle" so we can actually play a full game against the computer.

At this point I can't possibly say how good the computer will be. Right now the setup code is pretty good, I think. 8 out of 10 times the computer decides to exactly what I would drop, but then I'm not very good at this game.

You can be sure the computer won't miss an opportunity to claim power or take away some of yours. I hope to have something ready for you all in a few months. At the least it will be a great way to test a new deck idea.

Man, my post is FULL of typos. Something wrong with this message board? I re-read it before I posted and didn't see any of those errors.

It would be nice if its written in a programming language that isn't windows only.

I've been bashing my head into a wall trying to port octgn to mac.

Actually, Tam a lot of AI research is done in Lisp which can be embedded into any C/C++ program. (and its fun learning lisp).

Tam said:

So now I've undertaken what I'm calling Raven AI. Anyone interested in playing the new format against the computer?

It's impossible to "teach" computer how to play. Computer can only marshall cards and attack or defend. That's very limited game.

bloodycelt said:

I've been bashing my head into a wall trying to port octgn to mac.

Lots of italian people play OCTGN2 on Mac without problems... if you need something I can make you in contact with them...

Rogue30 said:

Tam said:

So now I've undertaken what I'm calling Raven AI. Anyone interested in playing the new format against the computer?

It's impossible to "teach" computer how to play. Computer can only marshall cards and attack or defend. That's very limited game.

Not exactly true. I have a mechanism that takes into account each card's unique abilities. It will marshall and attack or defend, but it will also use unique card abilities as it is able to do so. It will also calculate which opponent cards are more dangerous and will do what it can to eliminate them first, using its own already marshalled cards or events and attachments it has in its "hand".

Tam said:

Not exactly true.

Well, you will spend a lot of time to create database for each card ability and effect will not be sufficient. You will make A LOT of rules errors - it's unavoidable. You will have to implement exceptions - that would probably mean a lot of abilities computer will not trigger. BTW who will be responsible for passive effects? Human or comp? Moreover what will be the interface for the user to see what's goin on and communicate? Good luck, anyway.

If anyone can pull thsi off - I am confident Tam can.

Gualdo I use fusion for it like eric and other mac players.

But, I would rather be able to run a native program.

Also Stag, programming a basic AI is hard but not impossible.

For Agot Like chess one could use the Min-Max Algorithm, which basically based on cards in hand and in play the computer evaluates (for the turn) all possible moves... granted it cant evaluate what the player can play... but it could figure out what cards and their abilities do to the game state, and since power is a measure of being able to win, it can use that to evaluate which possible node is better.

Far from criticizing the only up to date and in use software to play online, but the .Net Framework?... meh, brothers and sisters, meh.

Passive ability, etc? .. I forget all, lose all game, no I don't even try. Been like this always, with Magic Workstation.

My .02? Start with simpler goals: (1) don't make it single player right away or if ever (2) cross-platform compatibility (I'm a huge fan of itsyourturn.com but I understand most people expect better, but anyway), (3) enforce rules and passive abilities, and break down the phases in the player turn flow... (4) less challenging maybe if you only do core decks or maybe just one core deck.

Then you have pretty cool learning tool and probably a lot fun to play at the basic level.

bloodycelt said:

Also Stag, programming a basic AI is hard but not impossible.

For Agot Like chess one could use the Min-Max Algorithm

Impossible.

bloodycelt said:

Also Stag, programming a basic AI is hard but not impossible.

For Agot Like chess one could use the Min-Max Algorithm, which basically based on cards in hand and in play the computer evaluates (for the turn) all possible moves... granted it cant evaluate what the player can play... but it could figure out what cards and their abilities do to the game state, and since power is a measure of being able to win, it can use that to evaluate which possible node is better.

Exactly. I've got it all worked out already. Plot cards, too.

And, technically, the computer *can* evaluate what the player can play if I so choose to program it that way. During the Challenges phase the computer will evaluate every card it has on the table and in its hand against what the player has on the table. I could include the Player's hand array, too, and next few cards on top of the player's deck. But I don't plan to add that additional step. I will, of course, if something allows the computer to see the players hand or top few cards of the player's deck.

And yes, there will be specific code for each card with special abilities. Keywords are already taken care of in the database. Textual abilities will be programmed directly with a single function specific to that card. The computer will pass various variables to the function during its evaluation stage and set other variables for how it will decide which move to make next.

Right now I'm working with the Baratheon deck from the Core set. The computer can calculate the best setup flop scenarios already, after 8 hours of programming, and it's making pretty good decisions. Sometimes it makes what I consider a glaring mistake, but I've then gone back and added some additional code to help avoid that kind of stuff. It adheres to the Limited and Setup rules, of course.

Will the computer be able to make more strategic choices, such as when is the best time to play Game of Cyvasse/Red Vengeance, or which characters to burn first with a Targ burn deck (note, the order isn't always determined by what is the most threatening)?

I can definitely see how a computer would effectively play decks that are a bit more point-and-click. No offense to Wildlings players, but I can see how AI might work better for playing a Wildling deck or Bara rush then, say, control (or any Martell for that matter).

Twn2dn said:

Will the computer be able to make more strategic choices, such as when is the best time to play Game of Cyvasse/Red Vengeance, or which characters to burn first with a Targ burn deck (note, the order isn't always determined by what is the most threatening)?

I can definitely see how a computer would effectively play decks that are a bit more point-and-click. No offense to Wildlings players, but I can see how AI might work better for playing a Wildling deck or Bara rush then, say, control (or any Martell for that matter).

Those questions are yet to be determined. I'll do the best I can when I get to those specific cards.

Just curious- it seems like you're using the .NET framwork, but I don't think I ever saw you say explicitly so?

Regardless, I'd be interested to know how you're doing setup- the first thought that came to mind was assigning arbitrary quality values to your cards based on their setup "worth", and then choosing the most optimal setup, but that requires you to manually rate all cards. Something else that came to mind might be a some kind of learning system where you can specify some kind of "ideal setup" per deck and have it try for that. I'm sure whatever you're doing is a lot cleverer (I've only taken a few AI courses) but it's still really interesting to ponder :)

Man, could we try this marvel? or do you still work on it for further developments ?

If say it were in lisp then you would treat the game state (cards in play, number of cards in players hand, cards in your hand, discard, dead pile, etc) as a mutable object.

Each card would have some sort of function that changes the state.

A Game of Cyvasse:

1.) Go through each possibility of what the opponent would kneel, and what I could kneel.

2.) Assume the opponent will choose the best situation, at this point make nodes for each pair of knelt characters, then each of these nodes has a branch for each possible character returned to hand. At this point the function returns the list of possible outcomes.

3.) Then evaluate on that list all the other possible actions. Evenatually you exhaust all actions and get a list of end states. In each case assume the player will pick the branch that leads him closest to the end state (standing phase/taxation) closest to winning. So then try to pick the series of actions that pushes the end state to the ai's benefit (number of power on house for example). Which then evaluates whether playing A Game of Cyvasse is a good, and when is the best time.

Also Tam can you email me: bloodycelt AT gmail with those network codes for Raven if you are resurrecting it? I'd like to include it as a possible protocol in the mac port of OCTGN (which is taking forever since it seems the guy re-implemented SOAP, but not full SOAP).

I am programming this using .NET, yes.

I'm using the old Raven Evolved code since I've built all the functions necessary for power tokens, moving cards around on the table, all the various arrays for each "pile", hand cards, etc. I was able to get right to the meat of it. I have no intention of resurrecting Raven Evolved since you are all using a new application that looks pretty nice. I haven't had a chance to play around with it, yet.

As for the setup phase, here's one scenario I just ran against the computer. (I am only using the Baratheon Core Set deck right now)

Computer Cards in Hand at setup:

Aegon's Garden
Aegon's Garden
Crossroads
Distinct Mastery
Highgarden Honor Guard
Knight of Flowers
Melisandre

The computer chose to play:
Crossroads
Aegon's Garden
Knight of Flowers

I think that's exactly what I would have done.

The three cards the computer drew after setup were:

Brienne of Tarth
Renly's Courtier
Stormlands Fiefdoms

My process for setup is pretty simple. Check all 5 gold combinations possible and rate based on highest number of cards playable. It does avoid cards that can be played from your hand, like House Tyrell Guard. I don't think I'd want to play that one during setup unless I had no other choice after a mulligan. If there are no 5 gold combos, it does check all other combinations.