Monday, April 18, 2011

Q&A: In What Ways Is A Valley Without Wind Randomized?

Question from leekster: I was just curios how much of the game is procedurally generated? Is it in the vein of Dwarf Fortress, where all of it is random? I understand monsters can't be random due to all the animations and textures. But are spells randomly generated? Thanks for your help.

Answer from Chris: Well, this is a really good question, but also a really complicated one to answer.  I could answer you with a lot of technical details, or I could try to answer the spirit of your question.  I suppose I'll try to do a bit of both.

Dwarf Fortress As Your Example
First, to clarify, though: Dwarf Fortress is not nearly "completely random" as you imply.  This isn't a criticism of that game, but I think that if I'm going to be able to answer you we have to define our terms a bit here.  I've only played a little bit of DF, but for the most part I find that it has lots of pieces, but and high randomization with how those pieces fit together, but the overall algorithms are anything but random.

For instance, in DF all the various ground types are predefined -- Sandy Clay, layers with Aquifers, and dozens of others.  So far as I know, all the enemy and dwarf types are also predefined -- but boy are there are a lot of them.  In terms of the world map regions, those are also defined by the designer, but plentiful.  They are "random," but not truly so -- you get clumpings of regions, you get islands, you get rivers, etc.  This is randomized algorithmic, not pure random.  You don't get things like a water tile next to a lava tile next to a grassy tile next to a snow tile; things are randomized only in the bounds where they make some kind of sense.

So in a lot of senses, DF is not very random at all -- I would argue that 80% of the game isn't random at all.  This is also true of AI War, which is also known for being pretty random, if not so plentiful in its pieces as DF.  But that other 20% that IS randomized is what makes the game feel "completely random."  That's a really important distinction.

AVWW Is Mostly Like That
Now, to answer the spirit of your question: from what I have seen of DF, I would say that AVWW will have a similar degree of randomization overall.  AVWW will also have a similar or greater degree of randomization to AI War.  The tricky thing about this sort of algorithmic randomization, though, is that it requires a ton of input in order to generate a lot of randomized output.  AI War has had about two and a half years to build up, and DF has had... I want to say seven years, but I'm not positive.  Maybe as little as three.

At any rate, earlier in their life cycles, both DF and AI War felt "less random," even though they were just as random, because they had less content.  If you have three things to choose from at random, that doesn't seem very random even if it is.  If you have three million things, it would seem very random to choose between such items even if it's not random at all, or only partly random.

AVWW, of course, won't ship with three of anything -- nor with three million.  My hope is to have dozens or hundreds of each type of thing in the game at 1.0, though, so that there's a high degree of "this feels random" that we can then continue to build on with free DLC and paid expansions as we have with AI War in the two years since it came out.  My expectation is that AVWW will feel considerably more random and content-ful at 1.0 than most games on the market, but that it will truly start becoming crazy post-release, assuming players are interested in that.

Specific Examples
So, that was all pretty general and vague, but hopefully it answers the spirit of your question, which I think is important to do.  Now to a few specific examples:

Monsters of course aren't random because that wouldn't have much meaning.  How do you create a random monster?  The closest thing I can think of is spore, and I think we can all agree that even after years of a large company pouring in resources to creating "random" creatures, the result was underwhelming.  This is a case where I think that human creativity trumps randomness, and if you have enough monsters that are interesting then you wind up with something that feels varied and interesting, which is the point.

That said, the way that monsters are seeded into the world is hugely random, although there are various "population patterns" that we use to make sure that things don't fall out of bounds -- this is akin to making sure there's no lava or tropics in the arctic zones of DF world maps.  Algorithmic randomness is a big pattern in all the games mentioned here.

Spells are pretty much the same sort of story.  They aren't random because I'm not sure what that would really mean.  In the closest example to "random" for spells, Magicka, most of those spell combinations that players "discover" were actually anticipated by the developers and programmed in.  Those art effects and the way the spells work has to come from somewhere.  Don't get me wrong, their approach was brilliant and fun, but it also wasn't very random in the case of most of what players encountered -- it only felt random.

Of course, they did have some genuine randomness built in to the areas that they didn't specifically code, and some of those devolved into some balance-breaking superspells that they had to deal with.  Not unexpected, and not even tragic, just the cost of doing business when you have any random component.

At any rate, spells in AVWW aren't planned to be random or combinatorial, although we do have a pretty interesting slots system that we'll be unveiling soon.  Basically letting you customize and combine various types of items and equipment to get some more unique, if not random, results.

More to the point, which spells you get at any given time will be pretty random.  You have to find the right pieces to make these spells, and as you level up you'll want to also craft higher-level spells.  So if you get a Fireball I gem, you won't just use that for the rest of the game because it's your favorite spell.  You'll eventually craft Fireball II and maybe even Fireball XIV if you play that long (that's like 140 hours in one world to get a level 14 spell, we estimate).  So your equipment loadout is going to be heavily random as well as changing on an ongoing basis as you explore around and craft new stuff.

Terrain is another good example of where algorithmic randomization comes into play.  When you look at the DF world map, for example, all the worlds are different in their details, but their very broad outline is always the same, right?  Cold arctic and antarctic at the north and south, a realistic temperature spectrum between them, and water in realistic bodies with one or more land masses in between them.  When you generate a new world in DF, it looks like a reasonable facsimile of a world, not like some cut-up messy soup of a world.

Through my work on AI War, what I've really found is that it's important to have multiple layers of randomization.  If you just have one layer, even a really good layer, it doesn't feel that random.  If you have ten layers each with some hand-crafted parts and some random parts, you get multiplicative complexity that feels very random -- and yet still also makes sense.  This is something you can also see evidence of in the DF maps -- you have regions and subregions and types of ground layers and hostiles and so on, all nested within the overall world creation algorithm.

Terrain generation in AVWW works in much the same way, in that there are some broad not-that-random-but-still-somewhat-random algorithms in play, and then nested within that are many layers of randomness.  So far we're only partly through actually getting those layers all up and running, but as each layer comes online it makes the game leap forward in terms of how varied it is.  Hopefully by our next video I'll be able to show off the next major outdoor layer, which I'm quite excited about finally getting to.

Characters are another good example of randomization.  Sure, we only have x number of sprites (right now 2, but hopefully about 60+ by the time we launch 1.0), but there's a ton more to a character than just their visual look.  In terms of names, there are literally a few million possible combinations of first and last names per sprite.  In terms of actual stats, we have a system of stats (physical attack, magic defense, etc) that get randomly rolled per character out of a pool of points.  This is pretty familiar to any western RPG, really, but we don't let you re-roll.  You choose from the characters you meet, which has a pretty interesting element to it on its own.

So that's a few examples of our philosophy of algorithmic randomization, anyway.

Randomization Vs Customization

I should also note that when it comes to "random" spells or weapons, perhaps the question was if they would have randomly-rolled stats.  That's something that equipment in games like Diablo and Borderlands has.  To me, that's a system that has really been done a lot elsewhere, and we're going a different way -- customization over randomization when it comes to equipment.

In AVWW, you never just find a spell or a sword lying around -- you find the components you need to craft such things lying around.  That's an important distinction, because each component has more than just a single use.  If you find a Shotgun of Scoped Awesomeness in Borderlands, but you hate shotguns, you have nothing you can do with that weapon but give it to an ally or to sell it.  Or use it despite the fact that you hate it.

When you're finding components instead of finished goods, there is still randomization in what you're finding, but it's less random and more directed-by-you in terms of what your final goods are.  If you hate gatling guns, you never have to built one.  You can build swords and shields and other medieval weapons instead -- and then jack them up with magic so that they rival the power of this modern weaponry you're forgoing.  Or you can jack up the gatling gun with a fire gem, if you want to go a completely different way.

What we are not doing is is having fire gems that have variable stats.  To me, that just really devalues what a fire gem even is, and ultimately makes all weapons and spells pretty similar except for their visual look.  Instead we have, for instance, longswords, broadswords, short swords, and rapiers, all of which have differing base stats, and of which you can craft different levels.  So a Level 10 Longsword would crush a Level 5 Rapier in a fight, of course, but if you prefer the stabbing action of rapiers to the slashing ability of some of the others, you can overall craft more Rapiers with varying custom modifiers and abilities as you play the game.  For a while maybe you have a rapier with a strength crest, and later it's a fire gem, and even later after you get to the point of having two slots maybe it's two things.

In Closing
This is a huge topic, and it's something I've been meaning to write about for this game for a while -- thanks to leekster for asking the question!  I didn't cover nearly everything here, but it should give you a pretty solid idea of the general approach we're going with.  It's a good mix of hand-crafted, random, and customizable aspects, which we think players will find unique and rewarding.  And suitably vast, in terms of creating a pseudo-infinite world, of course!

Thursday, April 14, 2011

AVWW Pre-Alpha #9 Video -- Bats, Espers, Burowers, New HUD, and Weather

It was just three days ago that I wrote the #9 preview for A Valley Without Wind, and mostly that's still the best source for the goods on what all is new this  time around.  However, the big thing we were missing last time was a video, because of a few technical difficulties with the first version of the video.

This video has been worth the wait, however, as our PR guy Erik is now doing them, and so the artistry in the video itself has jumped way upwards.  Without further ado:

What's New?
For the most part the video shows off exactly what I was telling you about in that #9 preview (linking again to it for those who skipped down), but there are a few things that have actually changed in the last three days.  So we've not only put up yet more new screenshots, but I have a few new things to add to our prior list:

Revamped HUD
Perhaps the most immediately noticeable new thing is the new visual look for the game's HUD and GUI in general.  Gone are the AI War-like dark buttons and such, and in are a new, higher-quality fantasy-looking style based on the Necromancer GUI for Unity.

It makes a huge difference in the feeling of polish for the game, from the loading screens to the main menu on down to the actual in-game HUD itself.  Note that the character select screen hasn't been fully updated yet, so it looks a bit off still.  I'm particularly fond of how much nicer the minimap looks, along with the ability bar slots at the bottom of the screen.

Lots More Sound Work
As always, Pablo is hard at work on the sound and music for the game, but the last week or so he's been working on sound effects in particular.  Mostly we don't include those in videos of this sort, but towards the end of the video you can here one of the wind sound effects, which is pretty cool.

New Ground Graphics
One thing that is shown in some parts of the video, but not others, is the new ground graphics that are now in use.  I had only managed to update some of them before Erik was taking the video, but you can see the difference in the outdoor grasslands areas, in the small town areas, and in the lava area.

We previously had maybe 5 ground layers, but now we have a whopping 29 of them.  There are five different kinds of lava alone, five different kinds of full snow, two different kinds of thawing snow, new pine needles and rocky grounds, and so on.

Between this and the HUD, the difference in the latest versions is pretty dramatic when you're actually playing.  You'll be seeing more of these in future videos of course, but this week's has a first taste.  The big change is that these grounds are higher quality and more interesting, which really brings the scenes together better.

Revamped Damage And Melee Models
Now when players or monsters take damage from enemies, they flash red for a brief second or so, and are invincible during this brief window.  This prevents a lot of things, such as enemies swarming players and insta-killing them, or players overkilling enemies with area damage that was "cooking" the enemies over time rather than just hitting them with one damaging blast.

In the video the only real evidence of this is the flashing red on occasion as the bats hit the characters or the character hits the enemies, but in actual gameplay this feels much better for close combat.  In general Keith actually redid the entire melee model, as the other one felt a bit clunky and that was part of the reason I haven't wanted to show it yet.  Now swords are actually a worthwhile thing and a viable way to take out espers or whatever else.  I still have work to do on the visual effect for the sword before we show it, but gameplay-wise it's now ready to go, which is a big step.

New Weapon: Gatling Gun
For our first gun, I wanted to pick a particularly challenging case to inflict on Keith, so the gatling gun was it.  This required a ton of new gameplay subsystems that we'll be able to use for various other weapons in the future, so it was a nice test case (despite some things that are unique to the gatling gun, of course).

The gatling gun has a spinup time while you hold down its fire button, then starts spraying bullets in a line, going faster and faster the longer you hold it down, until it overheats and has to go through a lengthy cooldown.  Or you can let go before it overheats, and the cooldown is correspondingly less.

The gatling gun also makes it so that you can't turn, but you can still move around -- so you wind up spraying bullets in the direction you were facing when you started using it, which can be phenomenally useful against, say, swarms of bats.  Even better than the energy lance.  You can see the ability icon for this next to the sword icon throughout the video, but I still have some visual work to do on this before we show the gun proper.

Until Next Time!
There were actually other internal things we also did in the last three days like the addition of tilesets for outdoor areas, and some first work on some very cool crafting stuff, but I'll wait to share those things with you when they're a bit further along.  Suffice it to say, we're very pleased with how things are coming along!

Monday, April 11, 2011

AVWW #9 Preview: Characters, Monsters, and Weather (Video Coming Later)

We're transitioning the video creation duties from myself to Erik, and in the process of that we're having a few technical difficulties that are requiring some updates to his machine and so forth.  So that's delayed the video for our progress report #9, but I wanted to go ahead and do a written update (and we have new screenshots) in the meantime.

Ideally we'll have the video ready sometime later this week, but no promises as yet.  So what's new?  Let's hit some of the cool new technical stuff -- skip down if you're not into that sort of thing.

Sprite Dictionaries
Previously, the game used individual images in sequence for animations, instead of sprite dictionaries (with texture offsets into a single image, in other words).  This is consistent with AI War and Tidalis, and it has the advantage of being easy to update and easy to code to (and with SlimDX's wrapper of ISprite3DX, it was the only way to do sprites).

However, it has two disadvantages: first, being slower to load off disk, and second being more wasteful of VRAM and RAM, and thus minorly hurting performance if you have a lot of animations on different frames all onscreen at the same time.  Now we're using sprite dictionaries, which I'm creating using a handy GDI+ helper program that I've been working on to let me manipulate AVWW-specific PNGs in various formats.

Proper Character Animation Offsets
This is another Big Deal thing that I did with the GDI+ helper program I'm talking about.  The problem is a bit tough to explain, but bear with me.  I'm rendering characters such as Darrell in Poser, and using three different cameras to do so; one for front, one for back, and one for the side (which gets mirrored in-game).

Each camera is at an arbitrary distance from the character, but showing the whole character, and the characters are rendered very large, at 400+ pixels instead of 128px like they are shown in-game.  Then I have to shrink each frame down to 128px in another program, and then I've got my animation frames.  In the past, I had been doing a simple Trim operation in a Photoshop script, and then scaling them down to 128px by height.

Problem?  That makes every frame of the animation exactly centered, and exactly 128px high from the bottom of the character's feet to the top of their head.  But your feet rise and fall as you run, and your head bobs up and down.  For that matter, your weight shifts from left to right, and thus the overall sprite is not perfectly centered in each frame (if any of them).

That's what should have been happening, and what I was exporting from Poser, but my Photoshop script was normalizing it all out so that the animations looked subtly wrong in-game.  Using my GDI+ program, I've now got an automated way of analyzing an entire batch of frames from one camera for one character and using the resulting data to fit the character in 128px square roughly centered and with the proper head bobbing, feet rising, and weight shifting.  The difference is dramatic.  I look forward to showing you that in the video when we get that out.

More Character Animation Frames, And Animated Shadows
Previously we only had 12 frames per side on each character, which was still a total of 39 frames per character (including the three standing poses).  And we only had one static shadow image.  Why?  Because it took long enough to export 39 frames from Poser, and because I was worried about RAM usage and disk loading times in AI War, when all those images were separate.

By adding the capability to have sprite dictionaries, this also let me feel comfortable with upping it from 12 to 30 frames per side per character (so 93 frames in all per character), as well as adding in animated and directional shadows (so another 93 frames for the shadows, too).

The result is that not only do the characters now look correct (see above), they also look wonderfully fluid in their movement, as do their shadows.  At a full 60fps or higher, it really looks particularly nice.  I also figured out that I can just render a "movie" in Poser to a series of PNGs, which saves me from (d'oh) exporting each frame one by one to the Queue Manager.  Poser is new to me, but I'm getting a much better handle on it lately now that I'm really sitting down with it more.

In-Game Shadow Skewing
Know how the shadows in the game come out of the back of things and skew off to the upper left?  Previously, that was just a flat prerendered image.  That had two major disadvantages: first of all, it takes up an absolutely enormous amount of image space, and thus uses way too much RAM.  Secondly, because of the way I was handling that via yet another automated Photoshop script, it didn't always look as good as it could (big and small objects tended to fade differently over distance, for example).

Now I've re-rendered all the shadow images in the game using the same Photoshop script of mine, but not bent to the side.  The AVWW engine now has the capability to skew sprites, which is new to our engine, and it uses that for the shadows to get an effect that is very similar to what we had before, but way more friendly to RAM, nicer looking, and compatible with even older cards that don't support textures larger than 1024 in size (no guarantees on performance on a card that old, but it will at least work).

The other cool thing I did with these new shadow images was that I shrunk them all by 60% in their base images, so that they fit inside the same size image as their original source -- so if Darrell is 128px square, his shadow will fit inside that now, too.  Previously, his shadow was in a 512px square, which is why there was no way I was going to try animating that -- too much RAM!  The game scales the shadows back up so that they look normal, and there's no quality loss at all because of the fact that... it's a shadow!  It's supposed to look diffuse and fuzzy at the edges.  The fuzzier the better, actually, given the style of shadows we're showing here.

New Character: Dawn
So we finally have a new character in addition to Darrell and the Neutral Skelebot!  She's the first woman in the game, but there will be tons more character sprites for players to choose from, and to encounter as NPCs.

My private goal from a while back had been 60 such sprites, but I was iffy if I could hit that because Darrell took me about 6 hours to create (when I was still learning so much about Poser).  Now, with all the various process improvements I've made in the last two weeks, and the automation tools I've added via my GDI+ helper program, I estimate that each character will only take about 30 minutes from start to finish.  So 60 character sprites is looking quite feasible, and maybe I can even exceed that; that would be nice!

Re-Rendered Characters
Because of the need to have full 30 frames on all the other characters and monsters, all of the existing ones have been re-rendered.  I also improved their visual look quite a bit when it comes to the skelebots in particular.  Now they have one arm and leg larger than the other, for instance, so that you can actually track them visually while they are moving.

Before it looked like their animation was half the length it was, because having their left or right legs forward looked far too much the same!  Now they look a bit more stylized, as well as just much higher quality animated in general; you'll like the video.

The game now has a lot of different kinds of weather.  In non-windstorm times, we have: sunny (well, we always had that), light snow (in the snow areas, mainly), light rain (the junkyards are a great place to find that, but also other places have a small chance of having it), and blowing sand (in the desert, but not always).

During windstorms (every four tiles as you move, see the counter in the upper right of the world map), you get the following kinds of weather: snowstorm (in any of the snow areas), rainstorm (in most sunny or light rain areas), sandstorm (always the desert), and firestorm (always the lava flats).

Windstorms are such a huge part of the game, but now is the first time we've had an actual visual component to them.  Plus just having calmer weather at other random times is a favorite thing of mine to do, anyway.  We obviously don't have any weather in space in AI War, but that was something we did a lot of in Tidalis.

Main Menu Visual Improvements
Until now, we've only had a basic main menu that was just a rip from AI War with slightly different graphics.  That was always to be temporary, but it's surprising how much more polished the game suddenly feels by having a proper main menu (including story scroll).  That scrolling story from the main menu is now included in the main AVWW page, by the way.

The main menu shows as a background a randomly-created chunk of world, which is pretty cool to see the variety right even in the main menu every time you load up the game.

Related to this, we also now have the ability to create and load multiple worlds via the interface, which is quite nice.  There's no limit on the number of worlds you can create, but it will show 10 per page.

New Objects, New Hands On Deck
We've also got a ton of new objects in the game, although most of them aren't being seeded in yet.  I think 9 miscellaneous objects are in, then we have 9 flower sprites of various sorts, and we have something like 33 new vehicles, including some futuristic ones from the ice age time period.  All broken, of course.

Erik, our PR guy, is also now helping out with some of the actual game development work, and so that's helping me out in a major way to be able to do more art faster, and then having him "wire them up" to have proper collision boxes and other metadata through a handy in-game tool we created for that purpose.  So that's been a big help for our creation process, although we're just getting started with that.

Six New Enemies!
We are finally getting into adding more enemies, and we added a ton of them: bat, fire bat, ice bat, sniper skelebot, esper, and desert burrower.

Bat, Fire Bat, and Ice Bat
These all have the same basic movement characteristics: they fly, they swoop and dodge, and tend to flock about you in swarms.  Fighting them is a completely different experience from fighting the skelebots.

The regular bats are bad enough, but the fire bats set you on fire for about five seconds (which does damage over time -- and stacks from each bat that hits you), and the ice bats freeze you for about five seconds (which slows you down slightly -- and again stacks from each bat that hits you, which can all but immobilize you, though you can still fight).

An Aside: Region Level Gating
The bats also brings up the fact that we have level gating for various "population patterns" of enemies.  Each chunk that is generated is assigned a population pattern which includes one or more enemy types in various concentrations and in various numbers relative to the size of the chunk.  Some of these are demonstrably harder to deal with, no matter what your level is versus the other enemies.

So, the game introduces things to you gradually -- everything, really.  The harder population patterns, the more complex crafting materials, and so on, aren't available in the lower-level regions.  Every few levels you go up, more and more stuff is appearing around you.  Of course, you can strike out into higher-level regions while you are still low-level, that's just pretty hard.

Skelebot Sniper
The regular skelebot is fast and a melee fighter, as anyone following this game knows (tired of skelebots much?  Not more than me), but the sniper variant is slower and doesn't chase you at all.  Instead of you kiting it, it kites you, intentionally keeping its distance and firing fireballs at you.

Sure, it's just a recolor, but the behavior is completely different and running into yellow and red skelebots at once is pretty interesting.  In general, my goal with this game is to have a ton of variety by having a lot of base concepts (bats, skelebots, etc) as well as a good number of variants of each thing.  People who are familiar with AI War and how crazy huge it is will know just what I mean.

The esper is a magical being that hardly moves at all, and which fires quite strong lightning attacks at you.  Your own magic attacks are extremely weak against it, so you'll need to resort to melee weapons, firearms, or other physical types of attacks to take these out.

In motion, these look particularly cool.  Both these and the fire bats also act as light sources, which makes battles with them in the dark forest particularly exciting-looking!

Desert Burrower
These were just added today, so we don't have any screenshots of them yet, but they are nearly-invincible enemies that live only in the desert and which roam around at high speeds underground.  They don't chase you at all, but if you come too close to them they will strike out at you for substantial damage.  The desert really is a dangerous place!

Magic is ineffective against these as well but you can strike at them with melee attacks and kill them if you dare to get close enough.

New Name Dictionaries!
We now have new sets of names for Darrell, Dawn, and the Neutral Skelebot.  There are literally a few million possible combinations of first and last names each.

And that's only with three characters; by the time we have 60-some sprites, we'll have north of 50 million possible unique character names, I think -- that's enough that you'll likely never have two characters named the same thing for as long as you play!

Lots More Coming Up!
We're in progress on melee attacks, on a new and awesome-looking HUD graphics set (based on the Necromancer GUI skin for Unity), and we've got some very cool things up our sleeves for ground-level regions and underground regions.  After that we'll be hitting a lot more crafting materials, weapons, etc, and then I'll finally be circling back around to more interiors.

It's exciting times -- things really are flying now.  Keith has been sick and busy with his other job, which has slowed him down, and all the work with redoing all the shadows and all the characters and enemies in the game really slowed me down on the new content, but even so this has been a huge number of leaps forward in the last two weeks.  I also finally sat down and learned how to do rigging in Poser, and the bat animation (only part of which is shown above) is the result.  I'm quite excited by the possibilities that this simple new skill opens up!

Anyway, stay tuned for our #9 video hopefully later this week or else definitely next week if we run late.  Enjoy!