Alpha [TOOL] Card Hunter Battle Replayer


The Laughing Rogue
Howdy, all. This might be about as niche as you get while still being kind of widespread-ish. (And some people wonder why I usually don't make my stuff open to the public.) This is a tool being created in GM, intended to let players of the (non-GM) award-winning indie game, Card Hunter by Blue Manchu, view battles from its console text logs. (Card Hunter is loads of fun, but it has a very tiny team, and we players have never had the ability to view finished battles other than individually video recording a match.)

So far, I have some basic window operations and some core data wrangling. Yaaay! Oh? What's that? I'm required to submit a screenshot? ~puts off starting this thread for several days, returns~ Okay, back, here ya go. It's uh a screenshot. Yeah.

Like I just now wrote on Twitter:
My first (semi-)serious #indiedev #GameMaker #screenshotsaturday. $¦^ J
I hope to have a screen-to-GIF maker next time. Goal is to post weekly.
That boring white text is an actual pasted and slightly processed 12kB CH log!
I'm actually keeping immediate track of this project via a public Trello board, but I'll try to summarize progress each week here, and I'll get a demo going once I have some core HTML5 functionality going and once I know what in the world is the deal with YYG's GMS EULA.

This week, my lovely Done list reads (in chronological order)...
  • perform metamancy on Trello ($:^ P ...just, y'know, getting the board set up and all)
  • basic window properties
  • design user's basic playthrough/workflow
  • basic custom error catcher-tracker
  • core log ingester
  • a touch more metamancy on Trello (because my first run at organizing my thoughts needed improvement)
...and In Progress (in loosely prioritized order)...
  • bring in CH button graphics (I kind of reverse-engineered CH's text button to work with any text label I wanted .. pretty nice, methinks!)
  • credits/legal info

Although this is pretty super niche, I figure if I also post my progress here, anyone who stumbles across it might see glaring issues to knock up against my head -- or might get interested enough to actually play CH, try out this tool, and give more specifically experienced feedback.

All righty, I'm tired, and this is not my most organized post ever. $F^ }
I believe I'll quit now while I can still pretend I'm ahead.

Brandon W. Horton
Last edited:


The Laughing Rogue
Frustrating. Spent all week working toward a very specific goal -- researching, working out preliminary and similarly prototypical functions, researching more, beating back a preventative SVN issue for a day or two, etc. -- only to find in the end, I seriously absolutely cannot do it. Cross-browser limitation by design -- not technical impotence. ~sigh~ Therefore, my day-late-dollar-short update (minus screenshot even) says...

...Done (in chronological order)...
  • bring in CH button graphics (fixed an edge case that broke text buttons)
  • fix SVN issue not allowing the latest commit! (BUG)
...and In Progress for the upcoming week (in loosely prioritized order)...
  • HTML5 fullscreen toggle (I finished all of its primary stuff this week (especially to prep the framework for getting the aforementioned functionality-which-failed) *except* for keyboard shortcuts, thus I might as well start with that to have something nice and easy to get my juices flowing again heheh)
  • accept logs in different ways (the good(?) news is the failed function just shortened my checklist by some four items (out of thirteen)...)
  • credits/legal info (still have to spend the time to recover my YYG Help Desk account in order to then to ask them if the EULA changed, if something's bugged, if I'm missing something, etc.)

Let's see if next week can be a happy update again, despite Thanksgiving and The Gratified GMC Jam #6. $F^ J
Last edited:


The Laughing Rogue
My day job siphons a lot of my free time away. Thanksgiving was a blur. I spent one day on a designed-to-be-short GMC Jam game and still dropped it (because busy the rest of the weekend). All that to say, I got very little done on the Card Hunter Battle Replayer tool this week -- but I did get stuff done.

  • HTML5 fullscreen toggle -- as it turns out, the medium limits expected keyboard shortcuts -- spent a lot of time learning I couldn't do anything with it (besides make unexpected shortcuts like "press F key" ha)
  • Accept pasted logs in HTML5! Edge only for some reason, witw.
In Progress:
  • I'd like to list "refactor" and "still gotta learn YYG's legal stuff," but I might have to spend all week just trying to figure out why in the world Chrome, Firefox, and Internet Exploder (I currently don't have Opera nor Safari) fall apart at the seams at my log ingestion... (Is it the prompt hackery? Is it the value passing? Is it the value ingesting? ~exhale~ Not like the HTML5 debugger does me much good in this situation.)
I spent 4-ish more hours than expected tonight trying to beat an extension bug into submission. (Who knew going through a JS extension changed GM's scope? No one merely reading the manual, that's for sure.) My point was to ensure I had a #screenshotsaturday to show for the hard work squeezed into this week -- and then ShareX would only crash on me while trying to record a 15 second GIF however many times I tried.

Anyway, progress, yay. ~nodnod~


The Laughing Rogue
Between day job, life errands, and reviewing GMC Jam games (at the time of posting, voting is still going! click the link in my signature for more info! go play stuff! heheh), I managed to get some nice things done.

I kind of messed up saving my screenshots, but they're on Twitter, yay.

According to my Trello list, Done (chrono order):
  • refactored some things, partly just better maintenance, but some crucial encapsulation for the extension I'm building for it
  • reported some HTML5 debugger issues to YYG - as I note on Trello, although it's satisfying seeing accomplishments sitting on a shelf together, in the future I'll use Habitica track my progress reporting IDE bugs (and indeed I reported several just the other day)
  • "slightly improve the title graphic, lol" $:^ P
  • improve HTML5 standards (speeding up final MSIE load time, supplying more informative fallback when no JS)
  • the big one! now exporting to EXE or HTML5 accepts pasting the battle log!
In Progress for next week:
  • BUG: unfortunately, Internet Exploder lives up to its epithet (or epitaph...) and crashes the tool on the new paste code
  • legal/credit stuff - I began the YYG EULA question process, (i.e. confirming my Help Desk account in some secondary browser,) thus I'll likely get on that this week
After that, (mainly ensuring IE can use this, too,) I'll get back to the log parser itself. That's the meat and potatoes after all. (I just want to make sure the user has a fork first. Lol.)

This month, I have a tournament to play, too. Considering I'm unprepared for having instead so far focused on Jam stuff and this project, I might not last long and thus will have more time for Jam stuff and this project. Lol. $;^ b We'll see what happens.


The Laughing Rogue
Had Internet issues this weekend. If my hardware could handle GIF-recording the screen, I could show a simple window with only a paste button, going through the paste process, only some static info from the log showing in the bottom corner (like map scenario, room name, etc.), and a "Replay Battle!" button appearing -- which upon pressing brings you to the new (albeit blank atm) battle screen. $:^ ]

Done (in chrono order) this past week:
  • refactor Javascript extension (encapsulated more, sped up input some, cleaned a little memory, etc.)
  • find a battle's start and end
  • parse a battle's core static data for further parsing (of more polish-y data and more moment-to-moment data)
  • quick Card Hunter API test (which unfortunately succeeded in telling me what I can't do, meh)
In Progress (in loose priority order) this coming week:
  • credits/legal info - I got my surprising answer from YYG (that the EULA changed, which seems to mean we're not required to mention them unless our stuff goes onto/through the YYG Platforms -- and in fact right now, I don't even recall it requiring us to give an EULA unless on a YYG Platform, but I'll have to reread), and I've pushed a little further here, but between losing the CH API and YYG's necessities in the EULA, this doesn't seem that big a deal anymore anyway
  • move from title to battle - as I mentioned in my intro paragraph, this is going all right so far - I mainly just need to confirm what data I need to move, and what data I do move already, and the core of this task might be done already $:^ P
Not sure how much I'll do this week. Internet problems might persist -- I'm surprised it's doing all right tonight even -- and I have a bunch of GMC Jam games to play and review, plus some some weighty offline stuff to handle this week. We'll see. $:^ J
It took me a bit to really understand what you were doing here... because I had never heard of Card Hunter. But, that said, the game looks really cool and I have to check it out! And although I don't know how the game works yet, I am going to guess that this is a great (much needed) add-on.

I am curious, how are you tapping into their game? Does it work on the Steam version of the game?


The Laughing Rogue
Thank you for the interest and the questions. $:^ J

It took me a bit to really understand what you were doing here... because I had never heard of Card Hunter. But, that said, the game looks really cool and I have to check it out!
Yeah, a D&D parody with serious strategy, a CCG so not pay-to-win that various players top the PvP charts without spending a dime and many players buy stuff just to support the devs... Very fun, and inviting, overall non-toxic community, too. $:^ ] It's the only online multiplayer game I even bother to play, ha ha ha. Also, the (incredibly small) dev team encourages our third-party tools and such, blanket licensing in advance, which is pretty awesome.

And although I don't know how the game works yet, I am going to guess that this is a great (much needed) add-on.
There is a spectating option for PvP, and a couple people stream or record their matches (campaign mode and/or PvP), but despite watching matches in general being a popular idea (for fun, for tournament refereeing, for match-review to improve one's own tactics or to help others, etc.), the only way to watch a match is live or with streaming/recording. I for one have tried recording to no avail. My hardware just can't handle it.

What's funny is this project uses GameMaker closer to its original purpose (as Prof. Mark Overmars' "Animo") -- a really advanced, slightly interactive, animation tool. Lol.

I am curious, how are you tapping into their game? Does it work on the Steam version of the game?
Blue Manchu makes it common knowledge on their forums that you can access the game's console log by pressing F1 (twice to read, or F2 to read,) and get some nice commands like partyanddecksbbcode to auto-copy-to-clipboard a nicely formatted list of your currently equipped characters and items (and thus cards) -- or you can do more involved stuff like go verbose, enter your Keep, and clip the contents for another player's third party Collection Analysis Utility.

My tool? The console logs every battle as it happens, which has been useful in many a bug report (and in some cases to prove interesting card interactions). A user would copy part or all of the console and either paste or upload the contents into my tool. I wanted to augment the logs with battle info from the REST API the devs have opened to us -- which one person used to unofficially create an entire guild system which the devs then officially started using to reward top players monthly! -- but alas, some of their API features can't handle their own server strain, including the features I tried to use. *tch* Nevertheless, yes, this tool will work if you play the game from their website, from Kongregate, or from Steam.

Last edited:


The Laughing Rogue
Hmmmm. Well, this is unfortunate.

I had Internet problems for awhile, making it hard for me to do my Trello + Habitica thing. Once the problem got solved, (bad modem which the company replaced for free, save shipping, yay,) I took awhile to catch up online everywhere...ish. (I haven't actually looked through my 12 alerts here yet.) So, a couple weeks ago, I finally get back into this project's saddle.

Last weekend, I didn't update here (because I wanted to catch up here first -- oh well, anyway), but I did get code into place to sift the battle log for a whitelist of valid lines, throwing away anything else (such as user commands, verbose mode stuff at least for now, etc.). Very nice. $:^ ]

This week, while trying to design a fully reliable method to extract all players' names (can be 2 to 6) from the log, knowing this would affect extracting characters' names and linking them to their correct players (with campaign minions in the back of my mind, too), I found it's going to be much harder than expected because 1. I utterly cannot connect the game's API to the game's log (~sigh~) and 2. to get this info, the log can't be very incomplete (defeating the idea of using to view moments, such as for bug reports or "highlight reels" ha), and it'll have to check the whole log in multiple ways to piece just this basic info together. $:^ [

I expect I'll keep working on it, but all these limitations (especially imposed on the end user) are killing my motivation, and that was highly unexpected. $:^ \ Meanwhile, I'm again asking the (very very small) dev team about the API issue, and I'll be slapping together a super quick tabletop game tool for an RPG I'm GMing in the next couple days, which isn't really related, but I know I can cannibalize at least some of its features afterward.[/spoiler]
Last edited:


The Laughing Rogue
Well, last week, I surprised myself and got it parsing a battle's team leaders. Then, this week, I ironed stuff out more than adding per se. I researched Campaign logs finally; it shouldn't be any problem to distinguish from other battles, and I already have basic ideas how to add them in the future, which will be more time-consuming than difficult, methinks (once multiplayer is in), although it still might not be pretty... I also researched, designed, and programmed re: custom matches against the Game Managers. Last but not least, I fixed a silly bug I hadn't noticed yet (forgot to clean up a memory map -- not just a benign leak, but an overflow crash, ha ha ha). I also started some frameworking for parsing characters -- and researched and designed a surprisingly reliable way to extract races (but not classes, unfortunately) in most MP matches -- but I'll get onto that next week.

Perhaps since it's past the point of "crash when you look at it" I'll put the alpha online for any curious lookyloos this week, too. We'll see!


The Laughing Rogue
Welp, good news and bad news this week.

  • I added character ingestion!
  • I currently ingest their names, players, races, and order of play.
  • I had some delays working on this because I got more into playing again this week, ha ha. (Got to my highest rank ever, too, yuss.)
  • This is in Windows only. For some reason, whereas HTML5 used to get players situated fine, now it goes undefined on me and never reaches character ingestion. Gotta fix this. Edge gives me a console error, but in typical Microsoft fashion, it's not a very helpful message. Chrome and Firefox give me no console error despite having the same problem, which surprised me. $:^ \
  • Unlike characters, players are currently not in proper order.
Therefore, the next thing I need to do is get HTML5 back into shape again, and then I'll see about improving the player ingestion for proper ordering like characters (and perhaps for teams, although I might postpone that a bit longer).


The Laughing Rogue
Good news: I fixed player ingestion! It turns out,
map_battle_players[? _index_player++] = _list_players[| _index_player];
compiles differently to Windows (C++) and browsers (Javascript+HTML5). I considered this safe because the variable increment straddles the = sign, but nope. The GML gets converted to a function, meaning all bets are off on keeping cross-platform compatibility. $:^ \ Anyway, the simple, obvious fix:
map_battle_players[? _index_player] = _list_players[| _index_player];
Bad news: The latest GMS1 beta update broke the drawing pipeline somewhere somehow (pics). Looks like the HTML5 alpha export (much more important than Windows export in this case) will have to wait a little longer.
Good news: (See posts below that link.) YAL/YYG already seeks more info on it. $¦^ J
Last edited: