Friday, August 20, 2010

A Couple of YA Novels

I like young adult novels because they tend to be short. There's been a discussion recently amongst independent game developers about how long people expect games to be relative to their price. One of the mistaken points I've seen made a few times is that it's only games consumers that judge their media by its length. I'm pretty sure there's a pressure in the adult fantasy/sci-fi genre for novels to be bloated, poorly edited messes. A book needs a map in the front, “Part One of the Demon Kingdoms Saga” on the back cover, and seven or eight hundred pages of typo-laden prose in between. Fortunately you can go to the young adult field and find tightly-plotted, well-characterized books that won't waste your time. Here are two:

Ship Breaker by Paolo Bacigalupi. An oil-less near future on the flooded Mississippi coast. Nailer, a child laborer (the eponymous ship breaker) falls in with a shipwrecked princess on the run. The characters are vividly drawn, the drama is intense, and the plot comes together well. Nailer's abusive father is a particularly strong villain. Not a cheery book but the atmosphere is thick and novel. Impossible to put down once started. Bacigalupi has also written a (much longer) adult novel in similar vein, The Windup Girl.

Leviathan by Scott Westerfeld. Westerfeld, already a prolific and accomplished YA writer, tries his hand at this newfangled steampunk thing. It works out pretty well, and has a sequel coming out in a couple of months. It's an alternate history version of World War I where the British have got genetic engineering down pat (with which they create the requisite steampunk dirigibles) and the Germans have gigantic walking fighting machines (because really, what universe should not have these?) Deryn, a young girl, hides her sex to enlist on a dirigible, shipwrecks and falls in with a prince on the run. Similarly un-put-downable.


Jotaf said...

Nice, a steampunk novel with lots of action! Just what I needed. Thank you for sharing :)

Concerning the previous post about framing nearby objectives, at my day job I'm used to replacing logic of the sort "nearest", which is a discrete choice and can be quite jumpy, by logic like kernel density estimation (in this context, weighted combinations of locations), which always yields a smooth estimate. (This is needed due to error-laden inputs.)

You can assign an objective at position (xo,yo) a weight that changes smoothly from 1 when it's over the player position (xp,yp), to 0 as it moves away infinitely. This is using an isotropic gaussian kernel, which is just the formula: weight = exp(-((xp-xo)^2+(yp-yo)^2) / (2*h)). h is the "bandwidth" and may need some tuning; make it the typical distance between 2 objectives or so.

So instead of discretely deciding which objective is "nearest" to the player, each one's weight tells its "degree of nearness" to the player (like fuzzy logic).

The smooth equivalent to the "nearest point" is just the weighted combination of all objectives. You can then make the camera include this point and the player.

In practice, when objectives are far away from each other, this interpolates smoothly between them as you travel from one to another. As a bonus, when some objectives are all bunched up together, the camera doesn't jump between them, their contributions are kinda "fused" together. :)

James McNeill said...

Thank you for the ideas! That is the sort of thing I've been trying to come up with.

I've been trying to think about how to merge together the camera management for the objectives with the camera management for secondary things like nearby terrain; it may be that using different bandwidth settings for the two would make it work out all right.

I tried out the other camera framing algorithm in that sample program in my lander game and it just wastes too much of the screen on uninteresting stuff.

At the moment I'm taking a break from camera management and working on fleshing out the little guys that are the landing objectives.

Jotaf said...

That's cool, camera management is more of a necessary evil than the actual fun part of a game :P I'm curious to see what the stranded astronauts are going to look like and act! About the camera, it may turn out that both bandwidths being the same may be ok, but it's good to have the flexibility.