Something Special for You

by Kyzrati on 20120609 , under

Just when I thought I'd jump into adding new content, more planning showed that a generic system to implement the chryssalid ability and a few others might as well be expanded into a powerful dynamic system.

Enter "special abilities."

The term is probably not as limited in scope as you might be thinking. Special abilities will enable objects to combine conditional triggers and effects to define unique behavior under the right circumstances, and will probably be applicable to races, entities, armor, items, and/or terrain. They'll make it possible for chryssalids to turn their victims into zombies, zombies to transform into chryssalids on death, silacoids to leaves trails of fire as they move, and many more effects that you didn't see in X-COM. They could enable:
  • An alien that absorbs or eats vegetation or objects it passes over/nearby, possibly regenerating itself as a result
  • An alien that emits smoke
  • An acid beast that corrodes adjacent metallic objects
  • Snakemen that lay eggs which can in turn spawn more snakemen (UFO TTS)
  • Volatile ammunition for some strange alien device that has a small chance of exploding when loaded
  • An alien man-eating plant that chomps on units that pass by it
  • A plant that rapidly grows and spreads over time, perhaps with additional side-effects of its own
  • etc. (<--very inclusive bullet point ;)
Of course some triggers and effects may not be compatible in all cases or with certain objects, but there will be a pretty wide variety of valid combinations, and new additions should be relatively easy once the system is in place (I'd be happy to add more in the future for modding purposes). All of the parameters will be defined in the text files.

Yesterday I started implementing the necessary data objects, and as a test merged unit death explosions into the system--so now the basic infrastructure is ready. I was considering merging grenade use and light emission (by units, items, and props), but they're already working nicely so I'll leave them alone for now, and maybe migrate those features later. Silacoid fire trails and chryssalid/zombie mechanics are next, and even the upcoming motion scanner, medi-kit, mind probe, and psi-amp functions will fit in nicely. For a single item with multiple manually-triggered abilities (as opposed to the passive kind), there will be a list to choose from when activating/using it (ex: psi-amp, which could then easily be later modified to support a broader spectrum of psionic abilities).

The way this will work:
Abilities specify an initial trigger, and all abilities with a given trigger are checked for whenever the trigger situation occurs. A sample list of possible triggers:
  • "Use" an item
  • Move
  • Attack
  • Hit by an attack
  • Fall
  • Death
  • New turn
Abilities may qualify their triggers using one or more conditions, for example:
  • Standing in or adjacent to burning/smoking terrain
  • Standing next to a unit
  • Holding a certain item
  • Some stat has a relative value
  • Random chance
Finally, once triggered there are a number of effects an ability could have, including:
  • Explode
  • Spawn an object (many variations)
  • Assimilate a unit (switch faction--could be for psi-amp mind control)
  • Panic unit (psi-amp effect)
  • Mutate one unit into another
  • Transmogrify an item

All of the above lists are just what I currently have enumerated in the code for eventual implementation. Many more will be added (ideas welcome).

As a part of the new system, objects will be able to list their traits (or properties, e.g., organic, sentient, metallic, etc.), where the list of possible traits also comes from an external script. So you could pretty easily add new traits and define abilities that may only (or cannot) affect objects which possess a given trait. I'm adding that feature now because it's better than hard-coding the restriction preventing chryssalids from zombifying tanks. Can't have tanks roaming around trying to bite your soldiers, now can we...
12 comments more...


  • Canageek

    Are you looking for ideas about special abilites? I can delve into my (far too extensive) knowledge of tabletop RPGs and think up some fun ones for you, if you want more ideas.

  • Kyzrati

    Yeah, mostly ideas that would work in / be appropriate for X-COM (or other tactical strategy games based on the same mechanics) that modders might want add in, so that I can make sure to append them to my list and make the necessary triggers/conditions/effects possible. So while I may not necessarily add those exact abilities myself, I want the framework to be able to support them. More can be added later, but I want to ensure the design will cover a majority of possible requests, so later on all I have to do is add features rather than refactor the system.

    I came up with a short list of my own before starting, but there could still be some that won't fit as nicely into the engine. I can think of plenty more, but I'm not at the creative stage right now--just putting the nuts and bolts together here...

    Simply put, I'd like to know what people want to see on that first list I posted up there, so that I can make sure the other lists include the components that would make it possible to script them.

  • Sambojin Bojin-Sam

    For the triggers of specials, here's a couple more I came up with that may be useful:

    * See enemy (possibly of a certain type/rank)
    *See a neutral (possibly of a certain type/rank)

    Basically vision based triggers, a seeing *foo* "thing" trigger. Could also include seeing an item or particular terrain type as a trigger (might be harder to code into the engine, enemies/neutrals should be easy, they're already logged), or even stance/facing triggers (can you see they are crouching? are they facing you?). Just basically vision triggers, but of many types (for section 1+2 joining).

  • Sambojin Bojin-Sam

    Although I can imagine it might get a little memory intensive. It depends how you implement it I guess. It would allow for many options though.

    Scary weapons, stab in the back kills (rather than just armour facings), surveillance missions, berserking-to-the-battle-line anti-crouch AI, save-the-peasants moral boosts, all kinds of things really. Even some weird things like medusa-style "do-not-look-at" effects, or SCP "jelly-bean-banana-men-don't-blink-or-you-die" type enemies or equipment.

    If you really don't mind bowing out the memory or computations you could have it go both ways as well. Can #you# see *foo* then "thingo" happens, as well as can #anyone-not-you# see *your-foo* then "thingo" happens.

    It might be a bugger to code though. Just sticking to a turn-based check on each entity's actions would probably be way easier. Active rather than reactive. In Xcom things tend to do things, no actually react to things (except morale). It would screw with the turn based, action-point style play.

  • Canageek

    From memory:
    There was a very annoying monster that would reflect any damage done to it at everything in 30 ft. This would be even worse in X@COM as it could rush into a group of civilians, you take it out...and drop everyone in the house.

    There are also a number of 'arua' type effects, that deal damage to everything nearby (possibly except for other creatures of the same type), increase the defence of allies or weaken attacks. Might make for interesting tactical situations.

    I'm sure as I read my RPG books I'll spot more, and I'll try to remember to post them up here.

  • Kyzrati

    @Sambojin: Yeah, vision triggers would be computationally more expensive, but probably not too bad since there aren't usually all that many units out there at once and I can filter and check the lists fairly quickly. Terrain spotting might be too slow, since the entire FOV would have to be scanned for relevant abilities on every facing change or movement. I'd have to test that one and see.

    I do agree on the active vs reactive bent being a bit more appropriate for an X-COM game. Even so, supporting some fun/appropriate passive abilities could potentially make some battles a lot more interesting, as long as they're not overused (they're also great since they don't require any/much extra AI work!).

    @Canageek: Damage reflection onto nearby units sounds like a fun effect! Might be appropriate for a slower alien (perhaps too deadly on a fast one).

    Passive aura abilities are among the effects I was thinking might work well in some cases (my hypothetical acid beast would be an example of that). Some of them could be a little harder for the AI to use properly, but I'll probably add them anyway, since at least their implementation is easy.

  • Sambojin Bojin-Sam

    I noticed there was a really simple one missing from section three of the list. Move, or more precisely, move with effect. Easy to code and can account for everything from knockback, to combat-teleporters, to rocket-jumping.

    Some ideas for move-to-with-effect style effects.
    *Come towards (think scorpion's sting from Mortal Kombat)
    *Vaccuum/cyclone. AoE draw towards.
    *Big blast. AoE knockbacks.
    *Jet packs/Wh40k Orc Stormboyz rocket packs.
    *Re-deploy squad/troop (heli's or skyrangers etc)
    *Rocket jumping (ala FPS games)
    *Combat tele-portation (both teleporting yourself and others).
    *Heaps of other stuff that I can't think of at 1:30am.

    The effects could be everything from a graphical, particle or sound effects, to in-game effects such as damage(type), status effectors, TU changers or morale modifiers. I'm sure it's on your list there somewhere, but you were sneakily not telling us about it. Lot's and lot's of items, enemies and attacks from one effect, and one that shouldn't be too hard to put into the game for once. :)

    Ps, sound-engine-wise, have you thought of doing a DoomRL'ish extreme stereo panning thing for detecting aliens by their sounds left or right of your soldiers? That could be pretty damn spooky in an Xcom style game.

  • Sambojin Bojin-Sam

    Actually, that gives me another idea.

    x,y based effects. Can be map based, soldier/enemy/item based or squad based (grab all soldier's x values, average them for "squad x value" and place effect "so many x's from there"). It could be a graphical or particle effect, a sound effect or an in-game effect. Just a few options off the top of my head for it.

    *Combat illusions/hologram decoys.
    *Will-o-wisps that you never really catch.
    *Spooky sounds always coming from the distance.
    *(Orbital) bombardments centered on your squad rather than specific troopers.
    *Confusion/insanity/madness effects.
    *Fire barriers.
    *Pre-generated or even randomized-map scripting effects.
    *Whacky clouds'o'death (ala DF terrifying terrain).

    Could be used as x, y, both, or a slightly randomized value off either. I'm not sure which section it fit's into, but basically a #you/group/item/map# *x,y* "effect" style thing, where it's basically using an x,y as the point source rather than a specific item or unit (even if that x,y is based off a specific item or unit or your entire squad). Good for atmospheric effects for maps, mission-type stuff, whole-squad interactions, weird stuff, illusions, and as a hold-all for scripting missions and where effects are based on x,y values rather than specific entities (although it can be linked to them).

    As said, it's basically not so much in any section as it is an integral part of what your coding anyway for all special types, but it's handy to look it as an x,y effector as a hold-all for other stuff you might want to plug in later.

    Like sound x value atmospherics and stuff.

    That's it, I'm going to bed now...........

  • Kyzrati

    I was just working on the ability system when your comment arrived (actually, what I was doing may be better described as wracking my brain trying to find my way around some landmines inherent in such a generic system).

    Move as an effect is definitely a good one I don't have on there yet.

    Just yesterday I was thinking of adding a jump action (again...), going over all the UI/AI/pathfinding issues it would cause. I'd really like to have it in there, but it would take a lot of work to get right. We'll have to wait and see on that one.

    The game does already have melee knockback, but that's a hard-coded (optional) feature that applies to all items and takes into account strength, mass, etc.

    Controlling AOE explosion knockbacks would probably beyond the scope of this system, though I have been wanting to hard code exactly that based on an explosion's force and several properties of surrounding objects (mass, how rooted they are, etc)--it's on my to-do list for the next release, but I'm not sure if it'll make it in that quickly.

    I did imagine teleportation as a neat effect, but forgot to list it. I already have teleportation coded into the pathfinding engine (and tested), but that's for the future map/terrain-based trigger-and-effect system, so I hadn't actually used it yet. I do see I have telekinesis on my list, which is similar :)

    I love the idea of a vacuum effect--I'm imagining some kind of alien black hole device that sucks houses inward, along with the occupants, crushing them into oblivion...

    And we definitely need an alien called the Scorpion that grabs soldiers and pulls them over (then rips their spine out Subzero-style :).

    All abilities can naturally be accompanied by particle effects and/or sounds (which can be controlled through particles, actually, since they generally go together).

    About sound, I could possibly do it with stereo panning; I've done that on a previous project, including volume control based on distance, and liked the effect, but that was for an RPG where you control a single unit. I considered it for X@COM some time ago, but I'm not so sure it would make as much sense with an entire square of soldiers spread out over an area.

  • Kyzrati

    Dude, I thought you were gone after the first comment! I put up my response only to find you're still cranking out ideas...

    Your second set of ideas seems to be drifting more towards the mission/environment end of things. Definitely good stuff, and as I mentioned in my previous comment there will be a separate system for that. It will also be based on triggers/conditions/effects, but with an emphasis on general map-related features and effects. Some of those features may end up in the object-centric system currently under development, but the majority will belong to the other one. I'm not going to be working on it until I do the mission and map design system, and haven't even drawn up my plans for that one (though I'm going to copy some of the fundamental code from an earlier project).

    Here I am replying to you after midnight myself :)

  • Chris Bean

    Lets not forget the ever wonderful phase beast. every time you shoot at it there is like a 33% chance that it is standing 3 ft to the left of where you shot.

  • Kyzrati

    A phase beast will definitely be possible, and soon. I've added the RANDOM condition, so all it would take is combining that with an ENT_ATTACKED trigger and TELEPORT effect. The latter two I have yet to code, but they'll be easy once I start to expand the list. Putting the finishing touches on the underlying framework today.

    That would be a pretty cool alien for X-COM, actually...

Post a Comment