Showing posts with label ai. Show all posts
Showing posts with label ai. Show all posts

Tuesday, 6 May 2008

I live!

State of the Snut

Eh, long hiatus there. I'm trying to keep this more up to date than previous efforts, but... well, I'm easily distracted.


I'm still working on the Roguelike, but I'm marginally stumped as to the direction of the AI now. Although the planning prototype worked after a fashion, as soon as the number of planning actions started creeping higher the complexity and space requirements of the planner became silly, even without allowing for such simple things as predicted enemy moves or group interactions.

One option would be to severly limit the maximum plan length, to maybe four or five steps. This is adequate for most simple action chains, such as move to and pick up ammunition, reload weapon, fire at enemy. As the number of actions grows, the plan length could be a limiting factor, and we still have on the order of 5N plans to consider.

Limiting the number of actions available to a given enemy would be very helpful. In some cases, this would make perfect sense. Less intelligent enemies will have a smaller set of actions available fairly naturally. For more seemingly intelligent AI, something artificial must be introduced... perhaps a core set of essential abilities, plus a random subset of all the advanced options would work.


There are some other issues with the design and implementation, of course. I need some motivation or inspiration. I think adding some pretties might help get me out of the code slump, although it's not useful in the grand scheme of things.





Current distractions

Recently I've been playing a load of Dungeons & Dragons Online. It's a strange game. It's nice being able to create varied characters, and develop them in strange and not necessarily optimal ways, whilst having some idea of how the mechanics and system work. I like D&D well enough that I can overlook the Eberron setting, which is merely broken. There are some hard choices that were made to adapt the game to realtime, online play, and on the whole I agree with a lot of them. On the other hand, Turbine have made massive strides to completely break certain aspects... the equipment is vastly out of whack with what 'should' crop up in a D&D game at equivalent levels, and the entirely synthesised-for-DDO enhancement system has some scary issues. Skills are vastly less useful in general, and there are few of them implemented. Prestige classes don't exist except as a few scattered enhancement tack-ons, which only works for a few PrCs anyway - namely those without interesting class features. All told, classes are far more pigeonholed, twinking is quite destructive and rampant, and monsters end up with vastly inflated health, saves and AC to try to keep up. At level 16 (the current cap) the average monster has on the order of 450 hitpoints, going up to a thousand or so on Elite. Very silly. And yet I keep coming back to it; possibly this is simply down to the lack of decent MMOs out there. Other than DDO, the only one that's held me for more than a few weeks have been WoW and Guild Wars. The latter because of overall superlative design and the former because... um... I don't know. I doubt anyone knows. I'm thankfully over that particular addiction though, for now at least. I'm not sure what GW would have to add to lure me back into regular play, but I'll be keeping one eye on it


Gothic 3 Has also been tempting me recently. The learning curvecliff is brutal, as is much else in the game. In particular, the combat has me thinking about some of its oddities. For those blissfully unschooled in the pain of close combat in Gothic 3, the most effective technique I've found so far is a kind of relentless assault. The main reason this is so effective is quite simple - whenever you take damage in combat, your attack is interrupted. The length of the interruption is approximately the same as the time between swings for most melee weapons. Essentially, if you get hit even once in close combat, it's frequently Game Over... but if you keep battering your opponenent, you force him (<aside>there are a dearth of females in the Gothic universe, especially this installment, and most especially female combatants are notable by their complete absence</aside>) perpetually off balance and are pretty much assured victory. Against intelligent foes with weapons, it's possible to mix up the attacks with defense and some marginally complex attacking, but against most animals the only way to not die is to keep hacking and not allow them time to recover. This death spiral effect means that:


  • Multiple opponents are to be feared. Although as part of your attack you actually force your opponent back (and move forward yourself), it's quite possible for an enemy to sneak behind the arc of your swings and hit you from behind. Once knocked off kilter, everything moves in from the kill and it's time to reload. Three goblins can be a lot more scary than a single elite orc warrior, even way past the time such creatures become 'trash' to be steamrollered in most games.

  • Forcing opponents into corners/against walls is valuable. Especially animals that have no method of blocking, and so dodge backwards to try to evade blows. Being cornered is deadly.

  • A group containing even a single archer is many times more effective. Arrows will mess up your attacks just as surely as a sword, and are very hard to avoid whilst in melee.


I'm still not very far into the game, but these are the things I've noticed so far. Combat's fairly visceral and terribly unforgiving. Whilst this almost binary combat does feel a bit too random to be entirely comfortable, it's definitely a different approach and adds a lot to the feel of the Gothic series. Combined with the distressingly long load times, and combat isn't something to be trivialised here. Despite many awkward and clunky features, not to mention the occasional annoying bug, I'm still enjoying it hugely for these reasons and the general feel of the game.



BioShock doesn't really warrant commenting on at this stage. The theme is lovely, although the linearity is a bit galling after so long in more open games.


Heroes of Might and Magic V has some niceness. I think the 3D adds considerably to the charm of the game world, although the camera is a PITA in the world/adventure map it rarely needs to be fiddled with. Turn based combat is wonderous!

Monday, 10 March 2008

Belated title edit

This blog has languished of late. Between being ill (damn colds); looking for a flat; and my native bone-idleness taking over much of my time; it's fallen by the wayside.

I must confess, over the past weekend I've also been indulging in Dwarf Fortress and DDO. It's research, damnit!

The (still un-named) roguelike does ooze forward, however.

Setting

After a great deal of deliberation, the mesoamerican theme has won out. I've got some reference material, and there are so many shiny possibilities inherent that all the other setting concepts seemed quite underdeveloped in comparison.

The first race to be constructed will be based around the Maya, Olmec and Aztec kind of area in mundane history, jazzed up a little to be generic-fantasy-race (bee-lizards!) rather than boring ol' humans.

I'm very tempted to further abuse the setting, and pull it forward to steampunk level tech. This might be poorly suited to a Roguelike, however, so I'll probably put that on hold and go for an easier tech level: primitive but with medium/high magic. The first race will have little access to metals, for example. But who needs iron when you've got a magically hardened axe of green obsidian?


Theme

This needs more focus. The basic mechanics are shaping up relatively well, but I need to find more ways to support the main themes of the game. Not sure how this is going to work, yet. Due to the desire to have lots of combat kicking around, thematic stuff may be largely present as world flavour (especially magic) rather than in the core rules. This seems a bit of a wussy approach though.


Code

After a desperately needed refactor, the code base is a lot nicer to mess around in. I've been prowling unproductively around some rendering and world generation issues, but in the meantime the planning AI is shaping up well and the engine basics are looking a bit more coherent. Prototype modules such as the console and database wrapper are migrating into a game-worthy state. Hardly exciting stuff, but very useful.

Currently, I'm most excited about the planning module. It's quite general at the moment, manipulating any object that represents a world state. My test code uses a list of string-int tuples and has actions that do basic addition, subtraction, multiplication and division on the ints. You hand it a start state and a goal state, and it generates a list of actions that get you there (or in the case of a failed attempt, a list which get you as close as possible).

It's not admissible, and to make it more suitable for interesting responses it has a bit of random weighting, so it's not guaranteed to produce an optimal plan. But doing the optimum thing all the time's dull anyway. There are some big question marks still remaining over how the goal state is generated, but those bridges can be crossed later.


Random thoughts

I've seen a few people of late postulating that the goal of the AI should be to act out the role expected by the player, i.e. to do something interesting, fail, and die horribly. I've also heard it said that games which procedurally generate encounters will always be inferior to scripted fights because there's no designer in the background saying "Oh, what if the Foozle turned out to be the player's long-lost aunt? That'd be cool!" and pulling the strings.

Recently, I think I've decided that both these standpoints are bollocks, at least as far as my taste in games is concerned.

  • For the first, how devastatingly crap is it when the almighty villain makes schoolboy errors in executing their dastardly plan? Especially when they're supposed to be superhumanly intelligent masterminds! What is this, a Bond film? I want a nemesis who tries its damnedest to kill the player, using every last erg of its strength and every scrap of wiles I can throw at the AI. At least beating it will be a genuine achievement rather than some preordained thing. Good AI is certainly no panacea, but it seems a lot better than artificial amateur dramatics.
  • In the second case, it's more a question of taste, genre and the competence of the designer, but my main objection is that often these 'cool ideas' are forced upon the player. If in the first encounter with the Foozle you pull off an amazing feat of violence and completely slaughter it, there's little more annoying than the good old Cutscene and Badguy Escapes To Fight Again! because the designer didn't want you to kill his or her personal baby. Not yet, anyway. That wouldn't be cool enough. What's not cool about killing the Evil Overlord when you're level 2?