Print Page

Wednesday, August 20, 2014

Books, books, books

I have been reading several things lately, with reading mostly winning the time conflict with gaming prep and computer gaming:

 The new D&D PHB of course, which I am mostly liking so far. I wish they had gone with less subtle page numbering and larger type in the index, but at least they toned down the background texture this time around. Aging eyes and all that. I mostly like the art, aside from the giant-headed, tiny-footed mutant halflings. The remix of the rules is interesting and nowhere too deeply annoying so far, though I'm sure I'd fiddle with it a bit if I were to run it much. I've knocked together a sorcerer and a rogue so far in running through character generation to drive rules reading. Of the Hasbro/Wizards D&D versions, its the one I'd most likely want to run at this point. I'm happy playing Pathfinder when somebody else runs it, and also enjoy the Labyrinth Lord games I've played in on Roll20. I'm still a big fan of dragging out my tattered LBBs and ancillary stuff and riffing with impromptu variants.

 Just finished 1636: The Devil's Opera, yet another in the Eric Flint 1632 series. Good enough. If you like the series you'll like it, but it isn't the place to start.

  The Science of Discworld: reading more of the Pratchett interludes than the science bits, but both are pretty good.

 Still slowly reabsorbing EPT, as I grind out more dungeon contents and start to think about where to plunk the thing down on the map and what sort of cursory scenario to wrap the dungeon crawl in.

 Getting close to the end of Black Halo, Sam Sykes second of the Aeon's Gate series. I'd read the first, Tome of the Undergates, a couple years ago and rather enjoyed it. Black Halo gets a bit repetitive of some of the themes, but overall is a fun take on the D&D adventurers as misfit outsiders that society barely tolerates, and a bickering, dysfunctional party of PCs. It strikes me as more of a DCC than D&D setting, with characters afflicted by various curses and personality issues, nasty side effects for overtaxed wizards, and a world that leans towards the swords and sorcery end of the spectrum.

 The other night my daughter and I watched an Italian/Polish (TV?) movie about the siege of Vienna in 1683, which got me thinking to re-read Tim Powers's Drawing of the Dark a historical fantasy about the first siege in 1529. The book holds up well, at least for the first 40 pages or so, as much as I read tonight. It might make a good setting for Lamentations of the Flame Princess or Honor + Intrigue in its more fantastical guise, or maybe Savage Worlds/Solomon Kane.

 My copy of Honor + Intrigue turned back up yesterday in a bit of housecleaning, so I've been paging through it again. It's really quite a nice swashbuckling rules set based on the rules engine from Barbarians of Lemuria. Some friends and I have been batting back and forth the idea of running a game, not sure whose campaign idea will win out, probably whoever actually implements a starter scenario first.

 Lastly, over the weekend I was reading a rather dry history book with some serious possibilities as source material for use in either of those last two games or anything with a strong historical element from late medieval through at least the pike and shot period, A History of Greek Fire and Gunpowder, by J.R. Partington. Mine is an old, used, deaccessioned library copy, but you can buy the paperback reprint on Amazon and it is worth it if you want authentic pyrotechnic recipes and delivery devices for your alchemists, or details of historical manuscripts and period books on the topic. It's also been scanned by Google if you just want a taste of it.

 And while I haven't read more than the beginning of the G.R.R. Martin's first Song of Ice and Fire book, some years ago, I have been binge watching the Game of Thrones series in a few bouts of several episodes at a time, and plowed through another three episodes in season three about a week and a half ago. Good stuff.

Tuesday, August 12, 2014

Ruby on Rails: Ajax upload form loses form params - debugging post mortem

In a rails application I work on, I encountered a form that stopped submitting correctly after it had previously been working. It was a rarely used web form last used in production some months ago.

Fill in the form, submit, get back a validation error on a field that was filled in being blank.

Start investigating and find the params posted to the controller include the authentication token, but not any of the values filled in on the form.

The form is submitted via Ajax, using the Malsup jquery.form.js plugin to jQuery and includes a file input field.

The bug reproduces in both Firefox and Chrome. Looking at the post in Firebug and Chrome's Developer Tools shows a Request Payload of
[object FormData]&authenticity_token=our_auth_token_string

This I initially mistook as being an object that wasn't parsing in the tool for some reason, but when I added
puts "content_length: " + request.content_length.to_s puts "raw_post: " + request.raw_post.to_s
to the controller's create method I saw that it was literally receiving the form payload as the string "[object FormData]".

That is what cracked it open. I went to the old bit of JavaScript where we put the authenticity token in for Ajax requests:

  $(document).ajaxSend(function(event, request, settings) {
    if (settings.contentType === "application/json") return;
    if (typeof(AUTH_TOKEN) == "undefined") return; = || ""; += ( ? "&" : "") + "authenticity_token=" + encodeURIComponent(AUTH_TOKEN);

And sure enough, we were expecting a string there, to which the authenticity token argument could be concatenated. Since it is now a formData object after updating the jQuery version from 1.7.x to current recently, the concatenation was casting it to the object as a string form that you tend to see first when alerting variable contents in debugging and the variable happens to hold an object. Rails only kept the parseable portion as params.

So that function needs revision to only add the authenticity token to if it is a string and it needs one. Off to write the Karma Jasmine test that should catch this and then fix it...

Sunday, August 10, 2014

Empire of the Petal Throne dungeon take two getting traction

 That temple level was not shaking out as interesting enough the way I conceived it so it's going on the backburner for awhile, until it morphs into something more amusing. Another map IS in the works and today I got a third of the rooms detailed, before and after drawing up Shadowkarst, yay for progress!  Looking forward to running it and eventually posting it, fully keyed. This time, the map is staying rough until I write it up, and then the pens will come out for detailing, as carrot to drive the write up.

Anybody up for some old school EPT on Google Hangouts/Roll20 later this month?


Breaking out of a map drawing rut and posting hiatus, here is one I like enough to post.