Dominion Strategy Forum

Dominion => Dominion Online at Shuffle iT => Dominion General Discussion => Goko Dominion Online => Topic started by: Titandrake on January 22, 2015, 02:22:37 am

Title: Dominion replay system alpha is live
Post by: Titandrake on January 22, 2015, 02:22:37 am
itshappening.jpg

Since I'm too lazy to do all the web hosting properly, for now it's running through Heroku. URL is http://goko-replay.herokuapp.com/, enter the plain text log url, not the prettifier log url. I'm using the free plan of one dyno - this translates into "please don't make tons of requests and kill the server".

Very minimalist, it's very much still proof of concept, but I think it's sharable.

Click the line in the text log to display game state on that line.

If you run into a bug, first check it's none of the below:

If it's none of those, then please give the log url, turn/line that shows the bug, and describe what's going on. Generally, a player having extra cards is a lower priority bug than a player not having the right card.

The biggest feature to add is showing how many cards you have left in your draw pile and how many actions/buys/money you have. With school starting I can't guarantee I'll be able to implement those promptly, but I do mean to get that working.

Comments/suggestions?
Title: Re: Dominion replay system alpha is live
Post by: qmech on January 22, 2015, 04:29:29 am
Very nice!

The difference between this and the existing prettifier is that you can see cards in play as well as deck contents, right?

Suggestions: I'd like to be able to look through games using the arrow keys as in the Prismata viewer, right/left for forward/back one step and shifted versions to step by turn instead.  It would also be great to see deck and discard separately so that we can judge decisions that might have depended on deck tracking.
Title: Re: Dominion replay system alpha is live
Post by: sudgy on January 22, 2015, 02:56:59 pm
http://archive-dominionlogs.goko.com/20141113/log.5145ea87e4b0bef57ec871af.1415920394431.txt

Here's a random game where I went for an engine (without +buy?) and later on you can't see all of the cards in your hand or in play because I have too many cards there.  It would be nice to have them go on a new line or something.  It happens on several turns, but just looking for one my turn 21 works.

Also, I don't see any action cards in the supply.

I also second the notion for making your deck and discard separate (maybe having full deck contents somewhere, then draw pile somewhere else, and discard pile somewhere else).

Still, very nice!
Title: Re: Dominion replay system alpha is live
Post by: Titandrake on January 23, 2015, 01:32:27 am
Okay, so I did the HTML in a non-awful way. The cards in play should wrap onto a new line now.

Could you explain what you mean by not seeing any action cards in the supply? Are they not showing up at all, or are they cut off? You may need to click on the hand/play/supply area before scrolling if it doesn't all fit on your screen, since the log and the game state display are tied to different scrollbars.
Title: Re: Dominion replay system alpha is live
Post by: sudgy on January 23, 2015, 01:36:12 am
They're not showing up at all...
Title: Re: Dominion replay system alpha is live
Post by: Titandrake on January 23, 2015, 01:40:24 am
Screenshot/browser? I'm able to see them on the newest version of Firefox.
Title: Re: Dominion replay system alpha is live
Post by: qmech on January 23, 2015, 04:52:20 am
Screenshot/browser? I'm able to see them on the newest version of Firefox.

I see Kingdom cards in Firefox but not in Chrome (which explains why I didn't see that very useful new feature before!).  There's just a blank space under the basic cards where the Kingdom cards should be.
Title: Re: Dominion replay system alpha is live
Post by: amalloy on January 23, 2015, 02:29:17 pm
itshappening.jpg

Since I'm too lazy to do all the web hosting properly, for now it's running through Heroku. URL is http://goko-replay.herokuapp.com/, enter the plain text log url, not the prettifier log url. I'm using the free plan of one dyno - this translates into "please don't make tons of requests and kill the server".

Very minimalist, it's very much still proof of concept, but I think it's sharable.

Click the line in the text log to display game state on that line.

If you run into a bug, first check it's none of the below:
  • It involves Throne Room, King's Court, Procession, or Counterfeit. They're currently not supported. Golem is kind of supported but I'm sure that's buggy too.
  • A card isn't removed from play when it should be.
  • The player bought nothing, then topdecked Alchemist, Scheme, Treasury, etc. during cleanup.

If it's none of those, then please give the log url, turn/line that shows the bug, and describe what's going on. Generally, a player having extra cards is a lower priority bug than a player not having the right card.

The biggest feature to add is showing how many cards you have left in your draw pile and how many actions/buys/money you have. With school starting I can't guarantee I'll be able to implement those promptly, but I do mean to get that working.

Comments/suggestions?

Pillage is shown as in-play even after it's trashed itself. Feast, I imagine, does the same thing. See http://goko-replay.herokuapp.com/replay/?log_url=http%3A%2F%2Fdominionlogs.goko.com%2F20141215%2Flog.516d31dbe4b082c74d7b3391.1418715862074.txt for an example: I play my first Pillage on turn 6, and it's still "in play" until the cleanup phase. This could matter eventually for things like Horn of Plenty.

In Chrome, I also don't see any action cards in the supply. The reason is not hard to see, though. The javascript console shows the error
Code: [Select]
Uncaught TypeError: Constructor Set requires 'new' on line 643, which reads
Code: [Select]
var done = Set(kingdomVictory.concat(kingdomTreasure)); So you want to change that to
Code: [Select]
new Set(...)
Title: Re: Dominion replay system alpha is live
Post by: Titandrake on January 23, 2015, 05:20:10 pm
Yeah, the Pillage/Feast/Embargo/Hermit trash-from-play thing is known. Basically, it was a case I didn't want to deal with, so I pretend all cards that come into play stay there until end of turn (this also means Duration cards don't stay in play for next turn)

Just pushed a fix for the Chrome bug.
Title: Re: Dominion replay system alpha is live
Post by: sudgy on January 24, 2015, 01:13:12 am
Screenshot/browser? I'm able to see them on the newest version of Firefox.

I see Kingdom cards in Firefox but not in Chrome (which explains why I didn't see that very useful new feature before!).  There's just a blank space under the basic cards where the Kingdom cards should be.

Yeah, I'm using Chrome.  That's probably it.
Title: Re: Dominion replay system alpha is live
Post by: Seprix on January 27, 2015, 02:03:21 am
Cards for Chrome support would be neat.

Things to add would likely be some sort of interface where you can skip between turns and see what is in your hand and opponent's hand using the log as a guide, though that would likely be pretty annoying to do. :/
Title: Re: Dominion replay system alpha is live
Post by: Titandrake on January 27, 2015, 02:52:22 am
Cards for Chrome support would be neat.

Things to add would likely be some sort of interface where you can skip between turns and see what is in your hand and opponent's hand using the log as a guide, though that would likely be pretty annoying to do. :/

Could you clarify?

The supply card issue should be fixed in Chrome. It works on the most recent version of Chrome on Windows for me, but it may be broken for other OSes/other versions.

I'm also not sure what you mean by interface where you can skip between turns. Right now, if you click on a line in the log, it should show highlight that line and show what's in each player's hand at that time. Something like a play/FF/rewind interface would be nice to have though.
Title: Re: Dominion replay system alpha is live
Post by: TheExpressicist on January 27, 2015, 10:29:35 am
Cards for Chrome support would be neat.

Things to add would likely be some sort of interface where you can skip between turns and see what is in your hand and opponent's hand using the log as a guide, though that would likely be pretty annoying to do. :/

Could you clarify?

The supply card issue should be fixed in Chrome. It works on the most recent version of Chrome on Windows for me, but it may be broken for other OSes/other versions.

I'm also not sure what you mean by interface where you can skip between turns. Right now, if you click on a line in the log, it should show highlight that line and show what's in each player's hand at that time. Something like a play/FF/rewind interface would be nice to have though.

Suggestion: use visual images of the cards instead of placeholders. I created the following object which (I think) follows the same format as your script that has a link to each card's image.

http://jsfiddle.net/Lqpmvkee/

Then you could implement by updating createCard:

 function createCard(cardname) {
                var sp = document.createElement("span");
                if (types.hasOwnProperty(cardname)) {
                    sp.className = types[cardname];
                }
                sp.innerHTML = "<img src='"+cardLinkURLs[cardname]+"' width='50'>";
                return sp;
            }
Title: Re: Dominion replay system alpha is live
Post by: flies on January 27, 2015, 10:43:25 am
http://goko-replay.herokuapp.com/replay/?log_url=http%3A%2F%2Fdominionlogs.goko.com%2F20150126%2Flog.5075b25251c30da02a09b898.1422312253831.txt

Quote
An exception was raised when attempting to construct game states

on chrome and IE for my windows 7 laptop
Title: Re: Dominion replay system alpha is live
Post by: Titandrake on January 27, 2015, 06:47:28 pm
http://goko-replay.herokuapp.com/replay/?log_url=http%3A%2F%2Fdominionlogs.goko.com%2F20150126%2Flog.5075b25251c30da02a09b898.1422312253831.txt

Quote
An exception was raised when attempting to construct game states

on chrome and IE for my windows 7 laptop

...ah. Okay, so what's happening here is that I got super sick of trying to get Counterfeit/Procession to work and skipped them to get the alpha online. Except, that means there's no code handling them at all so it makes everything break. I thought I made the backend more redundant in the case where it created the wrong game state, but it looks like I forgot that case.
Title: Re: Dominion replay system alpha is live
Post by: Titandrake on February 07, 2015, 02:07:41 am
Just deployed an update. I'm hitting a wall in getting the parser to track all cards in draw and discard correctly, but I don't think I'll have much more free time in the upcoming future, so I wanted to send out the partial work I have now.

The game state you see is based on how much the backend code was able to parse. If it was able to figure out the draw and discard, it'll display them. If it wasn't, it'll track total cards and cards in hand. If it can't do that, then you're out of luck.
 
Sample game from me played today: http://goko-replay.herokuapp.com/replay/?log_url=http%3A%2F%2Fdominionlogs.goko.com%2F20150206%2Flog.516d4e77e4b082c74d7b91f6.1423271683581.txt

Sample game from the Haggler cage match: http://goko-replay.herokuapp.com/replay/?log_url=http%3A%2F%2Fdominionlogs.goko.com%2F20150205%2Flog.51201cbee4b04e88c8da4f9a.1423183803427.txt
Title: Re: Dominion replay system alpha is live
Post by: Davio on February 07, 2015, 02:37:33 am
Great work, Titan, I know this is very difficult, so I applaud you for coming this far.
Title: Re: Dominion replay system alpha is live
Post by: pubby on February 10, 2015, 10:20:22 pm
Is it possible to see how much money and actions you have at a given moment?
Title: Re: Dominion replay system alpha is live
Post by: Titandrake on February 22, 2015, 03:10:36 am
Is it possible to see how much money and actions you have at a given moment?

Had some free time today, so I added this, + VP chip and coin token tracking.

Again, this is only for logs that don't have weird edge cases.