2008/12/12

Last Days and Long Trips

Today was my last day; I've had plenty of them. In an attempt to not answer the same questions more than I already have, I'll sum up:
  • I'm moving to the Boston area.
  • That's about 400 miles from here (Baltimore area).
  • I know it's cold there; I grew up where we put spiggots in the trees (bonus: the correct term is spile)
  • I'm driving up there on Sunday to look for an apartment then driving back here on Tuesday, weather permitting.
  • I'm in town for a couple days, then driving to Michigan for Christmas.
  • I'm driving back here before New Year's to pack and clean.
  • Movers come to pack dishware and CRTs on the 30th.
  • Movers come for my junk on the 31st.
  • I'm here in town sans stuff for a few more days till I can take possession of whatever apartment I find reasonable, then I'm heading back to Boston on as permanent a basis as anywhere I've lived.

    Seriously, I've answered those questions at least a dozen times just today.

    I figure I've got about three days of solid packing and two days of good cleaning before I'm done. Given that I'm lazy and likely to be inebriated during my time in town, I figure a week should be good for the packing plus a few days for the cleaning.

    My connectivity and sane-time will be at a premium this holiday, so in case I don't get a chance to say it at a more appropriate time, happy holidays to all.

    Bonus Edit!
    I've added an articles section for those who just want to see the tech stuff and not details from my boring life.
  • 2008/11/18

    A Wanderer Again

    I'll be leaving my current place of employ at the end of the year to seek greener pastures. In this case, figuratively, since the change in venue also comes with a significant raise in pay. So I'll be packing my crap up around Christmas to send it about a day's north east to the greater Boston area; hopefully for a good long time to come.

    If anyone knows of any good bars in the W/SW suburbs, lemme know.

    2008/11/09

    Games of The Past

    Let's take a trip in the Way Back Machine to the early 90s. I was starting my seven year quest to graduate (twice). The fastest machines you could buy were i386s of which I owned a VASTLY powerful specimen clocking in at 33MHz with 16MB of RAM and a staggering 4.2GB hard drive. Ah yes. The glory days.

    Games of those days were different. Machines were pretty limited by today's standards (then again, most everything was) so designers couldn't ride the coattails of super-ultra powerful graphics hardware and million poly models. In fact, the best 3D of the time? X-Wing and Doom! Duke3D is still three years away!

    Now, I don't know if there's any real truth to this or not, but I've always felt that games of yesteryear were better designed and written--especially those games around my college years. Maybe the hard walls of available computing power made the designers of the time exercise their imaginations a little harder. Maybe with smaller budgets they were able to explore the depths of the art more deeply than we can today. Perhaps in those days we just expected less realism and more fun. I dunno.

    One game which I've always regarded with a great deal of nostalgia is Star Control II; a game that I used to sadly say I never finished. I no longer have to say this! I've known of its existance for a while but never got around to playing it. Seems that the fine folks at Toys For Bob released the 3DO port source and the open source community did a port named The Ur-Quan Masters.

    This is one of the greatest games of all time. No, seriously, #17 in IGN's Top 100 and here again in GameSpot's Greatest Games of All Time. Let me splain how awesome this game is...no wait, there is too much, let me sum up:
    - The game is jam packed full of some of the best dialog I've ever seen, evar.
    - Every race has a unique background and motivation not to mention their own theme music!
    - The races are extremely unique.
    - There's a good amount of cause and effect.
    - The game has a good pace both in tactical combat and in the story line.
    - You get to save the Galaxy! Come on, how awesome is that?!

    I sincerely hope that my former employers (Activision; now Acti-Blizzard or Blizzivision or somesuch) a) choose to make a true follow up, b) hand it to Paul Reiche III and Fred Ford who did the original, and c) don't make it into something lame a la X-COM Enforcer. In any event, you owe it to yourself to play this game if you haven't already done so. It's by far the best game I've played this year.

    2008/10/14

    Food For Thought

    One of the blogs I read on a semi-regular basis is Seth Godin's. Agreeing or not aside he's linked a few times to Gaping Void, the site for the guy (Hugh MacLeod) who draws comics on the backs of business cards whose work I totally dig.

    Well, it's Tuesday and I'm supposed to be working but like so many other Tuesdays, I'm stuck in the middle of a very tedious and boring task--as is the fate of many-a Systems Programmer over the ages (Internet time here, people). I don't get out to Gaping Void nearly enough but reading through some stuff there, I ran across this nugget from his September 12th post titled "Good ideas have lonely childhoods":


    5. "I want to be part of something! Oh, wait, no I don't!" I've seen this before so many times, both first-hand and with other people. Your idea seems to be working, seems to be getting all sorts of traction, and all of a sudden you got all these swarms of people trying to join the team, wanting to get a piece of the action. And then as as soon as they get a foothold inside the inner circle, you soon realize they don't really understand your idea in the first place, they just want to be on the winning team. And the weirdest bit is, they don't seem to mind sabotaging the original idea that got them interested in the first place, in order to maintain their newfound social status. It's probably the most bizarre bit of human behavior I've ever witnessed first-hand in business, and it's AMAZINGLY common. [AFTERTHOUGHT: "People are not primarily governed by their own self-interest. People are primarily governed by their own self-delusion."]


    Rarely do I encounter something that expresses my own intuition as well as that.

    2008/09/30

    AoC: Final Thoughts

    Whereas I think that ultimately, AoC wanted to be a great game, it falls well short of the mark due to some designer shortsightedness, some very unfortunate bugs, and a posture that makes it fairly unapproachable by the masses. That said, I did quite enjoy a large part of it. Those of us who delve into this sphere of gaming all too often forget the parts that were good and fun when we get a' ranting and that's a shame. It is, after all, us, who largely determine its legacy.

    More importantly, I think that in this day of (very) derivative design, that Funcom took a very bold step in an interesting direction. I can't say that I wholely agree with that direction, but in an age of autoattacks and the lowest common denominator, they struck out into the largely unexplored wilderness of more hardcore design. I think that's great and hope that more games strike out unto the unknown.

    [edit: for some reason, this didn't post when I told it to. carry on.]

    2008/09/29

    AoC: The Bad

    Age of Conan is not without its problems. Most games are like this. Age of Conan, however, seems to have more than its fair share.

    System Requirements
    World of Warcraft, for everything everyone says that sucks about it, runs on just about every machine you'd possibly think would run it. I ran it on a variety of old laptops for crying out loud. Age of Conan has no such ability.

    My machine here is a 2.4GHz Core 2 Duo overclocked (most of the time) to 2.8GHz. It has 2GB of RAM, a 10K HDD and a 768MB GeForce 8800 graphics card. Age of Conan does not run fast on this machine. I have to turn stuff down. I don't think this is because the engine is particularly uber-awesome but I can't say for sure either. Normally I'd give a developer with a decent game the benefit of the doubt, but read on...

    Bugs, Bugs, Bugs (not the wabbit)
    All games have bugs. Anyone worth their salt who's worked on a shipping game can probably point at any of their products and point out at least one thing that's not quite right. Some may not be significant, but if a large portion of your client base is crashing every, say, 2 hours on an out of memory error, say, three months after release, I think I'm safe in saying that not everyone is going to be terribly understanding.

    ButThatsNotAll! Seemingly every patch they break something, often in the process of, um, fixing something else. As a for instance: something that irked me to no end, is that in the process of fixing something related to conrols being saved per windows user, they broke the ability to bind your keys. This remained broken (with a convoluted work around) for the better part of three weeks. This also broke the handy thing that displayed the key combo on the hotbar. I had more than 50 things hotkeyed; yes, that's just about every button in the interface and it was damned hard to remember what they all were without the handy display.

    So many bugs, so few words, so I will further share with you but one. The issue is that for crafting you need silk for mid/high level cloth gear. Silk of the normal type doesn't drop except for mid 50ish mobs. If you're higher than L50 (say, L80) you don't get crap for silk because drop rate is based on con level and, well, those L50 mobs are all super grey. Realizing the problem two months too late, Funcom decided to fix it. In the guild zones/crafting zones they added spawns of spiders. What do spiders weave? Spider silk! What do spiders drop? Cotton! Cotton is the lowest level cloth crafting drop. As it's been two weeks since I drafted this post,I'd like to check to see if it's been fixed but I can't since they've also broken the patcher and thus, I can't actually log in.

    Everyone Wears the Same Gear
    DAoC had the same problem but in DAoC's defense, the technology wasn't quite there for a huge amount of gear variation (circa 2001). Everyone pretty much wore the same shit, dyed it all black, and had the same spec until ToA which miserably broke the game. It's now 2008 and the game install for AoC on my disk right now is in excess of 26GB. They couldn't have found space to add a few more variations for player gear textures?

    Post the starting island, everyone will pretty much be wearing the same gear. As an added bonus, my level 21 armor looks exactly like my level 80 armor! No, seriously, it's exactly the same. This is not hyperbole, they're exactly same models and textures. I'd post screen shots but as mentioned before, I can't actually log in. They've demonstrated that they have some great artists, so what gives? It's even pretty much the same boring crap between genders! Mr. Yahtzee got this one spot on.

    Healing is Limited
    I was reticent to put this under bad; I think they've done a very cool thing design-wise, but before talking about why it's bad I gotta explain how it works. If you want to avoid a long and somewhat arduous meander through the AoC mechanics, feel free to skip to the next section. Really, it's long, and I won't be offended.

    There are three healer classes (Bear Shaman, Tempest of Set, Priest of Mitra). Each class has three basic heals: a large heal over time, a small heal over time, and a largeish aoe lump sum heal. The largeish lump sum heal has a 1 minute debuff that doesn't allow that same heal to affect the target. So two bear shaman can't stagger their big heals at all, though they do stack between the other healer classes. This is where it gets interesting: the big HoTs don't stack between classes, but the small ones do. It gets even more interesting for raid groups because the big heals are raid-wide while the HoTs are not. While there are other heals available, other than by potions, they're pretty small.

    This is brilliant on one hand and terrifying on the other. Healing for any given group is fixed. You can swap out healer types and the amount of healing you get is pretty much the same. Your healers in a single group stack exactly to three, but you get diminishing returns after the first one. You can't increase healing significantly through gear or talents and since the vast majority of it is in the form of HoTs, you sort of let them go and that's pretty much it. This leaves the healer classes to go off and do other things like make the current target dead--generally agreed upon to be more interesting than watching little hitpoint bars.

    What you can't do is deal with burst damage. I've called them "large heals" but they're about 1500 at L80 on a tank with probably 12K hitpoints. This is not a lot given that you can only fire it off every minute, i.e. maybe twice or three times per single-group boss. You can triple this by having three healers of different types but it's still not a lot. The long shot here is that you can calculate pretty easily and within some tolerance exactly how much healing is in an ideal group. Though I have doubts they did so consistently, you would think that it would be relatively easy to determine how much DPS an encounter could have. This seems ideal but is, in my opinion, quite flawed.

    My main issue is that it means that encounter designers can't increase incoming dps significantly without blowing out the encounter parameters such that no one could beat it without luck. Perhaps they intended for this to spur their designers into more interesting mechanics. Alternatively, they might intend for a more interesting tanking game; who's to say?! The end result is that the dynamic range of encounters at least DPS-wise is fairly small.

    A perhaps even more nefarious issue is that it fixes pretty significantly the make up of your groups in a way that not even the most ardent opponent of theorycrafting could ignore. In WoW, you could often get first kills by stacking heals, tanks, or DPS. This is good because you can keep making progress and picking up gear which will help you progress and keep morale up. Gear isn't that big a deal in AoC (largely anyway, by design) and you can't really vary the healing amount. So you're stuck with only one slider instead of two as a raid leader, and even if you bring down a new boss, it doesn't help your raid very much. I know that this topic was healing but its real effect doesn't really sink in until you consider it in context.

    Poor Quest Distribution
    Solo quests ran out for me at about L72 and I did a lot of grinding prior to that. You get some repeatable quests at L40 that you can repeat once a day until L80 but come on, that's boring as shit. There aren't even very many good places to grind beyond those so if you want L80 on your own terms, you don't even get many choices. City of Heroes had some of the same problem but there were at least a number of places you could grind. Even then, I'd like to think that the day of the pointless grind is long gone. Can we truly do no better in 2008?

    There are a number of group quests in the range which are pretty good, but they're generally way too difficult for a not good group to succeed. Grouping in AoC is a very different game, moreso than usual for these typese of games, due in large part to the extremely limited healing ability. This by itself is not an issue, until you have to chance the feared pick up group who are used to the extreme levels of healing in other games. Now, I like the grouping dynamic in AoC, but it's really not obvious how it works on initial inspection. On the one hand, it's got a good bit of depth, but on the other hand, you'll never be all that effective without delving pretty deep into the mechanics. It's sort of like Vanguard in this respect; something I really like about both games.

    The problem, as always, is it's not always convenient for people to group when playing and I really wish more designers would take that into consideration. AoC does a reasonably good job through most of the level range but the nearer you get to L80 the more spotty and less polished it becomes in this respect. I understand that work in this area has continued since I quit playing and that it's better than it was, but that's of little consolation for someone who had to grind eight of the most boring levels.

    PvP Mechanics Are Broken
    PvP mechanics in AoC are broken at a deep and fundamental level. Player hitpoints are too low and player damage is too high. They say they're fixing this in "the next big patch which is coming next week" which has been "coming next week" for more than half the time I've been playing. As a Bear Shaman (healer) with a good quality weapon and no damage gems, I crank out in excess of 2500 points of damage self-buffed with a single combo. For comparison, I have about 3800 hitpoints self-buffed. Bear Shaman is not a DPS class. Surely, that's not so bad, is it?!

    With some well designed player crafted gear (i.e., fully +damage gems) and an epic smacker, I'm doing in excess of 4500 points of damage self-buffed with a single combo. When fighting normal mobs, I often don't use my damage buff because one normal combo will kill them outright. Imagine what this does to players! Nobody likes getting one-shot and in AoC right now, this is the norm. This is further exacerbated by the fact that you can't reasonably increase your hit point total beyond what the designers intended. So even in super-tuned crafted gear, I'm at the same 3800 hitpoints.

    Everything in the Endgame Takes Lots of People
    For the sake of full disclosure, I'm a raider at heart. I love taking apart encounters and applying obscure class abilities at the appropriate times for loot and great justice. It's the same satisfaction I get from putting together very large Lego models and base busting in RTS games--it's a problem solving experience and I like those. What I don't like about raiding is the HUGE amount of coordination it takes to get any number of people >2 at the same place at the same time and moving in something resembling the same direction, not to mention the subsequent drama over the aforementioned loot should any actually be acquired. AoC takes this hassle and applies it to just about everything interesting in the post 70 game.

    For example: I've always crafted. I like crafting because I like making things, especially if I can make useful things. Crafting in AoC requires buildings in a guild city. You need 24 people to create a guild. You can get lots of alts so ok, that's not so bad. You also need a guild city. Hookay, the tier 1 guild city is a pain, but not too awful bad, probably a good 10-20 man hours or so if you know what you're doing. This gets you to L70 items. The next tier of craftable items is L75. This requires a T2 guild city. This costs you a good 50-60 man hours if you know what you're doing (don't even ask about the T3 city).

    If you're in a small guild, these requirements are heavy which is a problem, because no one wants to run around a resource zone gathering materials as a full time job. Forget making L80 stuff; I don't think anyone in the game has built a full T3 city yet. You can't be a solo crafter. This is unfortunate, because crafting has traditionally been a solo endeavor; something to do when all your pals are sleeping off a hangover (or whatever).

    Raiding really goes without saying, and compared to WoW's 40 (at least, when I played), 24 is way more attainable. But what if you're broke and want to make some coin so you can buy some new gear? Well, you're largely screwed because there's such a dearth of soloable content; doubly so because normal mobs drop so little coin. So your best bet is getting a group together and running through whatever instance pops into mind. You probably can't use the drops because for the most part, they pretty much all suck, but they at least vendor for pocket change.

    Ok, what about PvP? PvP has been a pretty good bet while solo for most of the games I've played. PvP in AoC has three basic categories: world PvP (just about any zone on a PvP server or frontier zones on PvE servers), mini-game PvP (FPS type scenarios like CTF for small teams), and large scale siege warfare (think: keep raids in DAoC but not relic raids--it doesn't get that big). I don't play on a PvP server so I can't talk about that but I suspect it's the same as most PvP servers--there when you don't want it, hard to find when you do. Mini-games are pretty much nonexistant on my server (Dagoth). Siege warfare, well, that's a whole new ball of wax and one that I didn't get to participate in so I won't even rant about it here. Suffice to say that you need a T3 keep and enough goods to build another keep in a contested zone. That seems a bit extreme.

    2008/08/30

    AoC: The Good

    I've been playing Age of Conan for the better part of three months now; most of you probably already know that. Some of you have probably already heard my rantings on such but in an effort for closure, I'm writing them up here. For the haters out there, yes, I got to 80, and yes, I did a fair share of PvP, but no, I didn't raid. As always, YMMV.

    Overlooking Conarch Village

    This write-up ended up being way more gigantically huge than I expected, so I'm breaking it up into parts. Stay tuned for the next exciting installment!

    The Storytelling
    LotRO, for everything I disliked about it, had some pretty good storytelling for the storyline quests at least (the rest of the quests were...uninspired). The storyline quests in that game featured some well-narrated voice overs and some truly epic-feeling instances that were woven in pretty well with the Middle Earth stories we all know and love. Time has robbed me of specific examples, but you generally spent a lot of time clearing the way for the Fellowship or blocking the way of the unrelenting evildoers. I never saw the end of the game (too boring, sorry), but the storyline was the one shining gem amidst a fairly mediocre and redundant game, IMO.

    Age of Conan seems to take this the next step--it pushes all the normal MMO mechanics we, um, "know and love" and weaves them into a story with all of the epic trappings befitting the Conan license. There's a great evil (check), it threatens all of existance (check), there needs to be a hero to deal with it (check), and that hero is you! (check) Ok, so we've got the basics covered; it doesn't really deviate at all from any epic fantasy plot. (cue writers)

    So why can you res when you die? They go to great pains to explain this! It's worked into the story! I know, nuts, isn't it? If you're such a badass, why are you getting worked by low level thugs? They explain that too! Inside the fictional framework they've put in place, it even makes sense in a fantasy-plot-logic kind of way. That's a ballsy move. They could have left all of that unsaid like every other MMO I've played to date, but they didn't. The only glaring hole they left that I noticed is that everyone's a hero but, ya know, they did so well with the rest of it that I'll spot 'em that one.

    The storyline quests were, in fact, the one part of the game that I really looked forward to. I was sad that post noobalicious island, there's only a handful of them and they're spaced pretty far apart.

    The Voiceovers
    I'm a sucker for voice overs; I don't know why. For the vast majority of games to date, they're awful. Some of my favorite games, in fact, have crappy voice overs (Spellforce was all over the map, the sequel was not much better, and many of Vanguard's voice overs were downright cringeworthy). It doesn't take much to come up with a list of games with crappy voice overs (don't even get me started on CivRev or EQ2) but coming up with the opposite list is way harder. Among the tops, IMO, are Mechwarrior IV: Mercenaries, Supreme Commander + expansion, and now, Age of Conan.

    The entirety of the dialog is voiced over for the intro island (1-20). All of the storyline quests are voiced over. While some of them are mediocre, some of them are quite excellent. In particular, Rhiderch, your spiritual guide through most of the early parts past the intro, is quite well played, in addition to Turoch, Laranga, and Cassilda in the intro. In fact, Rhiderch has a set of dialog after you finish the last part of the quest at 80 for no other reason than story. The kicker? This game is not made where English is a first language! I'd love to know how the other language versions of the voiceovers are.

    The Combat System
    Admittedly, the combo system isn't what I was expecting, but that's their fault for picking terminology from a different genre. You basically get three swings to start with (left, middle, right) and add two more at a later level (lower left, lower right). To go with that, there's a set of shields on your opponent signifying where their defense is. Hitting a heavily shielded direction means you do a heck of a lot less damage so you're rewarded for hitting places where your opponent's defense isn't. To that end, there's no auto-attack. None. Every strike your character does is more or less because you hit a button to create that action.

    A combo is just a starter with a string of attacks in a given sequence that, when uninterrupted, yields a multi-part hit at the end usually doing high damage and looking really cool. These start low (one move) and end very high (four moves). It's sometimes tricky landing a combo on a moving target especially when it's a four move job but it's not impossible. I'd expected a more freeform thing where you stick moves together and they speed up or slow down or have other bonuses/penalties but that's just my fighting game background shining through, I guess.

    The thing I like most about the combat system in AoC is that you can't phone it in. You have to be aware and awake and mashing away at the right buttons at the right time. If you're not, you're probably not going to survive anything more than the most trivial of encounters. It's even more important when grouping since no character has even footing with any of the epic level mobs (elites from WoW).

    The Art
    Old Tarantia
    The game looks really good. If you've got enough machine to do so, crank everything up as far as you can for the love of pixels. The environments are excellent. The character models are excellent. The weapon models are excellent. Normally I don't care terribly much about such things but this game looks really good. Just look at the screenshots.

    2008/08/08

    Wheels

    Seemingly forever ago, I was at the beginning of what would be my last winter in Illinois. My modus transportatus at the time was a 1987 Oldsmobile Cutlass Ciera which we regarded not-so-fondly as the "Gutless" because it had trouble moving its 2900lb bulk even with a 2.8L V6 when it wasn't stalling in the middle of the road. At this point in the not so distant past, I had already had the transmission rebuilt twice and it was in pretty bad need of some intensive care. I was not prepared to provide this care (Damnit Jim, I'm an engineer, not a mechanic!) so it was time to replace it.

    This is what I got:
    It looks just like it did when I drove it home the first time.

    This is the Saturn SL1, 2002 model. It was the last of its kind having been replaced by the not-critically-acclaimed Saturn Ion. As you may remember from my previous not-so-award-winning post on Fragmentation, it's mostly made of plastic. Thus, it weighs in at a comparatively svelte 2350lbs and is reasonably powered by a 1.9L 100hp inline 4. If that doesn't sound like a lot of power, it's because it isn't; but it was plenty enough to kick the crap out of the dying Gutless. It gets on average, 35mpg in city and 40mpg or more on the highway if there aren't a lot of hills (i.e., not PA). Yes, that's right, I get more than 40mpg on the highway most of the time (highest clocked in at 44mpg or so on a straight shot through Ohio).

    After purchasing the vehicle, I ended up leaving the state for Virginia soon thereafter only to move to Wisconsin in a couple years, and now Maryland a couple years after that. You wouldn't believe the pain in locating and then transferring my title. It's been through a lot in the roughly 6 years I've owned it and still is in pretty good working order. It's a great car, even if a bit low on power, and it's hard to beat the gas mileage. But as much as I love my SL1, it was time for something new and hot.

    Imagine my surprise when Saturn not only came through with a very sporty vehicle that I wouldn't have to haggle for, but also came through with one of the top vehicles in its class! I present to you, my brand new Saturn Sky Redline, 2009:
    It looks just like it did when I brought it home for the first time...last Tuesday.

    The Redline comes equipped with a 2.0L 260hp turbocharged inline 4 and has a curb weight of about 2900lbs. No amount of my picture taking can adequately capture its knuckle biting beauty. It is also not slow. No, sir, it is not. And if you compare it to just about any other vehicle in its class, it comes out ahead either in looks, power, or power/price ratio. Seriously. Go compare for yourself if you don't believe me. I'll wait.

    I don't think I've ever owned a nicer thing. I even learned to drive stick so that certain people (you know who you are!) wouldn't mock me for buying a slushbox. For a guy who's spent more time driving 10+ year old rust buckets than otherwise, it's a pretty big change of pace and a heck of a lot of fun.

    2008/07/10

    Safety Tip #948

    When one desires a piece of pie, avoid the urge to eat the pie in place (in the tin) even if you live alone.

    That is all.

    2008/05/21

    Fragmentation And You!

    In the continuing series of posts about Stuff They Never Tell You About Game Development, I'm going to rant a bit about fragmentation, why it's evil, and how you can stop its nefariousness.

    Fragmentation is basically where you've got a something that's X big but all the wee tiny bits where you can place your something are too small even though your something would totally fit if the space weren't partitioned so badly. Consider me trying to park in Fell's Point (this is near the water in Baltimore for those wondering):

    This happens ALL the time.

    If you try to park on the street in Fell's Point, you will rapidly learn that there are no lines on the street. This means that people with giant SUVs getting less than 10 mpg highway have NO IDEA where to park their environment destroyingly inefficient vehicles. I drive a tiny Saturn which is mostly made of plastic. It does not ever fit in the spaces left. If only (heaven forbid) I could rearrange these parking challenged bozos' vehicles, I would have plenty of room!

    Like you've never had this thought before.

    This, friends, is fragmentation at its ugliest. It also happens in your computer's memory (among other places).

    Backing Stores and Virtual Memory and Consoles, Oh My!
    Memory fragmentation is basically like the two images above: you've got X amount free but it's all broken up into tiny bits that you can't really use. It's a Bad Thing (TM). Occasionally you need to allocate something big and contiguous like an image or something and those tiny bits just aren't going to cut it even though it would totally fit if you could add up all the tiny bits. This requires another chunk of memory to be grabbed from the free store to satisfy your request.

    For a normal modern OS, this usually isn't a big deal because we have a) a backing store like a hard drive, and b) a good virtual memory system that can page things in and out if you get near the end of physical RAM a la your undergraduate OS course. The worst that usually happens is the program is a little more chuggy (or a lot more chuggy, depending on your system) and you get fragged more often because your framerate dips and you just can't dodge that guy's rail anymore (bastard).

    On a console or embedded device (like the iPhone) it's a whole lot more catastrophic. We may or may not have a backing store. We may or may not even have a basic virtual memory system. It probably doesn't use the backing store that we may or may not have to page RAM even if it has the hardware to do so. So we may or may not be screwed when trying to allocate a giant piece of memory for the screen grab of your most recent death because railboy is totally hacking. By "screwed" here I mean "crash" because that's usually what such devices do. And, sadly, in this situation, we're usually screwed.

    How It Be Happenin'
    Consider the following horribly-contrived-yet-so-close-to-actual-production-code-I've-seen-recently-that-it-makes-me-shiver-just-typing-it example:


    vector StuffToLoad;
    StuffToLoad.push_back( "some_prefs.xml" );
    StuffToLoad.push_back( "a_texture.dds" );
    StuffToLoad.push_back( "this_is_temp.dds" );
    StuffToLoad.push_back( "big_honkin_asset.stuff" );
    StuffToLoad.push_back( "another_asset.stuff" );
    for ( uint ii=0; ii<stufftoload.size(); i++ )
    {
    LoadAsset( StuffToLoad[ii] );
    }



    The basic idea is that it's trying to load a bunch of stuff. During the loading of those assets, it really needs the "this_is_temp.dds" texture prior to loading "big_honking_asset.stuff" but then gets rid of both of it and the prefs XML file. Those of you who have dealt with this issue are probably headpalming right now (just play along). For this exercise, we'll assume that LoadAsset allocates exactly once per asset. and UnloadAsset properly deallocates that one allocation. So how swiss-cheeseified does this snippet make your memory?

    Seems simple enough?

    That's the big blocks, certainly. What about the rest of it? The bad news is that depending on your particular compiler and the version of the Standard C++ Library you're using (otherwise known as the STL), it might be much, much worse. At the very least, the vector is going to allocate at least once but more likely two or three times. Each string pushed into the vector is probably going to allocate once for the string. If LoadAsset's prototype looks like this:


    BOOL LoadAsset( string AssetToLoad );


    it probably allocates once per function call for the pass by value (hooray for copy constructors!) as well. So by the time you get to allocating the one chunk for your optimzed LoadAsset, you've probably blown two tiny temporary allocations on strings! Load and unload a bunch of assets and you're nickling and diming your memory to screwedness!

    Closer!

    For people not used to thinking about this kind of optimization, this often comes as a complete shock. This kind of thing usually requires someone (typically me), to go through piles of code to root these things out of them because memory is prodigiously perforated and the game crashes if you play it a lot. This is both tedious and error prone and a better solution is to not write it like this in the first place.

    This is one way fragmentation happens and it's really, really painful to deal with after the fact. Such issues tend to not manifest themselves until the very end of the game which tends to only get played near the end of the project which is where disasters tend to collect leading to some very, very long work weeks. Don't ask how I know this. To make matters worse, it only takes one dood to sprinkle such gems throughout a significant portion of your codebase.

    If You Were Looking For an Easy Fix, You Will Be Disappointed
    WIthout going into a lot of gory details about How To Write A Memory Manager in C++, I'm going to have to gloss over some details (besides, that's for a different post). The basic gist of how to deal with fragmentation is to have a decent idea of how your program's memory is going to be used and be uber-careful with anything that might allocate.

    For the example above, we know that both string and vector are going to allocate at least some memory. We can provide an allocator to it or remove them completely since, at least in this example, we don't actually need most of what they do and our list is hardcoded anyway. We can further make this better by having a temporary heap that we know is going to be churning a bunch and pass that into the LoadAsset function so our two temporary assets don't fragment the main heap either. At that point, we can optimize the heap function for the temp heap to prevent fragmentation since we're going to hammer it (and believe me, once you have such a heap, you will hammer it). Here's a somewhat less fragmenty version:


    struct AssetLoadInfo
    {
    const char *mAssetName;
    uint mHeapIndex;
    };
    AssetLoadInfo *c_StuffToLoad[] =
    {
    { "some_prefs.xml", c_tempHeap },
    { "a_texture.dds", c_defaultHeap },
    { "this_is_temp.dds", c_tempHeap },
    { "big_honkin_asset.stuff", c_defaultHeap },
    { "another_asset.stuff", c_defaultHeap },
    { NULL, 0 }
    };

    BOOL LoadAsset( const AssetLoadInfo &rfAssetInfo );
    BOOL UnloadAsset( const char *AssetName );
    for ( uint ii=0; NULL != c_StuffToLoad[ii].mAssetName; ii++ )
    {
    LoadAsset( c_StuffToLoad[ii] );
    }
    UnloadAsset( "some_prefs.xml" );
    UnloadAsset( "this_is_temp.jpg" );


    We aren't talking rocket science here, but it does require programmers to carefully consider what they're doing. C++ makes it stupifyingly easy to make a mess of things and you just don't want to get yourself backed into a corner with fragmentation when your game is being released on a console. People don't like it when their games crash (believe me on this one).

    There's WAY more to it than just small optimizations like the one above. Having a proper memory strategy, making sure that you have a proper memory budget, and making your own memory allocation devices are all super important in memory limited situations and can save you an awful lot of painful debugging. See you next time for the next installment of "Stuff They Never Tell You About Game Development"!

    2008/05/09

    MIND THE GAP!

    Ever been on one of those projects where someone (usually the leadership) thinks it's going way better than it actually is? If you've spent a reasonable amount of time in software, you probably have. Here, then, is my sole addition to the software engineering lexicon. Feel free to use this whenever appropriate.

      The distance between the actual doneness of a project and the perception of doneness is hereby defined as the Reality Gap.


    So, assuming you had some magical way to determine precisely how far along on a project (or task, or whatever) you are, the distance between there and where you think you are is the Reality Gap. If the Reality Gap is large, then, well, your team may be tremendously optimistic or, sadly, in denial. Welcome to deathmarch.

    I mention this for no reason whatsoever. None.

    2008/05/08

    Switch?

    Over the last, I dunno, few years or so, I've been trying to justify buying a Mac. in fact, it's been long enough that this post has been in my drafts list for the better part of a year and a half. Let's face it, I'm a die hard PC guy and a gamer and Macs just don't stack up in many of the ways I care about.

    A brief historical interlude: way back in the day when OSX was first introduced, I remember having talks with one Jeff Kopmanis who at the time was the IT guy at the AI lab where I worked. I trust his opinion and he was Mac optimistic. Fast forward to my near-Chicago days and I had a bunch of friends who were also Mac optimistic, notably one Andy Carra whom you might recall is at least partially responsible for my tastes in laptops.

    Around the time I was first writing up this post I was tooling around on AnandTech where I tend to go for hardware news when I want such things and I found this article and this article. Ever since there's been a BEER, I've been toying with the idea of porting it to the mac because, well, I know nothing about programming for the mac and goshdarnit, that's something I'd like to know. I'm told by people in the indie biz that the mac has a pretty captive audience who are just dying to have some games to play on their spiffy machines.

    I now give you:
  • Exhibit A: the unbelievably slick design of these lovely slices of awesome
  • Exhibit B: the iPhone which I will own soon (very soon), and
  • Exhibit C: the iPhone SDK which will let me program for the thing

    So yeah. I have a problem with technology; I'm an addict. I have no problem with this. I now own an iMac.

    Oh man.
  • 2008/04/08

    My Fridge

    Sign #5,731 that you've been crunching too much:
    BEHOLD! My Fridge:
    This isn't a staged shot.
    Click to embiggen.

    2008/02/21

    Oh Man...

    I probably shouldn't have done it but I did anyway. In fact, I'd talked myself out of it for a few months but really, I didn't stand a chance. Behold!

    5000+ pieces of awesome

    2008/01/01

    Happy New Year

    I hope y'all had a good holiday and didn't have too many hangovers. Me? I ate entirely too much and spent way too much time in airports.

    I don't have any big release this year, not that GWA was a big release or anything, and I didn't even really do that much work over break aside from the work I get paid for. That's mostly due to a high level of burnout and the fact that at my parents' place in AZ, I don't have a quiet place to do work.

    In keeping with my (now) two year tradition, I'm not posting New Year's Resolutions here. To this statement, I'll make one concession today. The one not-quite-resolution is doing more work at home and releasing more stuff here. I'd like to write more technical stuff and release more code, even if it's not in game form.