Chryssalids, Zombies, and Silacoids, oh my!

by Kyzrati on 20120618 , under ,

Okay, maybe not the silacoids. Who really cares about them? They're fun and all, but certainly not dangerous.

Chryssalids are of course a completely different story. These bad boys are now out there seeking panicking civilians to zombify. Then there's the zombie spawn out for some fresh soldier meat. You'll be up against the undead hordes in a new scenario planned for the next release (which is still quite a ways off, btw). Bring your Molotovs!

Here are some log excerpts from one of my tests. Louis spots a zombie shambling toward him and uses his quick soldier reflexes to try and mow it down before it can get in close. Unfortunately Igor decides to join in with his rocket launcher and while he does manage to blast the zombie, he also takes out his nearby squadmate in the process. Of course there's now a chryssalid on the lose. Good luck guys.

Then Paul shows up and, apparently having forgotten to prime his alien grenade, uses it instead to bash the chryssalid in the face. Not smart Paul.

You'll make a good zombie, Paul--they don't need brains.

Because we don't want the silacoid to feel lonely, here's a screenshot of the alien terror unit after giving someone a crappy lawn job (terrifying indeed!):

Note that because the silacoid ability is set to deal incendiary damage, as it moves it naturally sets flammable terrain on fire, instead of just burning that area of the ground. I can't recall whether they actually set fire to the ground in the original (I don't think they did), but it would be a simple change in the ability script to turn that off. I rather like it.

Speaking of the ability scripts, here's a shot of the new specialabilities.xt file as it appears in notepad++ (click for full size):

As for modifying the silacoid's abilities as mentioned above, all you'd have to do change the "IN" (incendiary) in the "DMG_TYPE=IN" effect data string to some other kind of damage that wouldn't cause fires, like "PL" (plasma).

The Unstable Compound ability on the list was something I was using to test volatile items. Now if only Paul had smashed the chryssalid with *that* he could've at least gone out like a man! (Volatile items explode pretty easily, including when smashed against something. Oh man this game's gonna be fun once I actually get to designing the content...)

The chryssalid zombify effect was somewhat annoying because it's not supposed to take effect immediately, only on the target's death or once the chryssalid stops attacking it, so it didn't fit very well into the system and ended up requiring a "special case" MUTATE_DELAYED effect. Makes sense from a gameplay perspective, though, since that would mean a group of armored troops would be less likely to fall as quickly to a chryssalid as unarmored troops would (especially since chryssalids zombify their target even if their melee attack *misses*, and the special effect completely disregards the defender's armor!).

About the implementation, I spent a lot of time hesitating over details, trying to design the system so that it's flexible yet not prone to errors and overcomplication, but complex systems have a natural tendency to defy being forced into a simple design...

After days of bouncing back and forth between a smaller and larger scope for the special abilities, I settled on a system somewhere in the middle. In hindsight, there really should've been a lot more planning and testing before putting it to code, but the lack of concrete progress started getting to me after a few days of nothing but brainstorming and taking notes. Besides, no matter how robust it may seem, I'm sure creative modders will be able to break it. I'll just have to resolve to fix issues as they pop up, since I'd probably drive myself insane before managing to account for all the emergent possibilities. The engine does perform a lot of data checks on startup to make sure the abilities don't include any combinations that don't fit internal parameter restrictions, so we can hope the number of problems should be minimal.

Now that it works, I'll continue expanding the number of supported keywords before moving on to special items like the motion scanner. Much later on there will still be some kind of separate map-centric trigger system for terrain- and mission-related scripting; this one was focused on the game's more dynamic objects, especially entities (units).
10 comments more...

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...


by Kyzrati on 20120603 , under ,

For you, not me, that is.

The game is starting to get rather complex, and that complexity will jump yet again in the near future with the addition of more special items and their UI elements, so I decided to go ahead and add context help before going any further.

The first time a new help topic is available (one that hasn't already been seen before), the game will pop up some text to give an overview of how to use a particular function or window. Here's what you'd see when opening the inventory window for the first time (click for full-size image):

The entire system is very dynamic and ready to simply drop in new text (it comes from an external file) and give it a target area or console. That said, the help I've got in there now is limited mostly to UI elements, not gameplay. Eventually there should be more tutorial-style help as well to help new players understand the X-COM mechanics, but for now the majority of players probably know what they're getting into, so I'm holding off on that.

Hitting F1 or '?' on any window will also bring up the list of commands associated with that window. Here's the command list for the map/HUD screen:

A command list screen did exist before, but it was a temporary solution hacked together for the first release as part of last year's ARRP. Now it's mouse accessible, is properly animated, and has been integrated into the primary UI control system. The inventory and log windows have their own command list, as will all future windows. (For now mouse access for the main command list is through a tiny button found near the bottom-right corner of the HUD, since the that part of the UI has yet to be designed.)

So with another good chunk of the [somewhat boring yet essential] internal stuff behind me, up next are probably special items and Chryssalids/spawning. As with the other mechanics, the latter will be implemented using a pretty dynamic overarching system that will enable creative modding while still being capable of modeling the original X-COM mechanics. Weapon attacks (e.g., Chryssalid bite) will become capable of special effects on the target, one of which will be to cause the target to die and spawn another unit (e.g., zombie) of a specified faction. A greater variety of spawning will also be possible, so instead of just spawning a single unit, you could have the effect be to spawn multiple units nearby (xenojelly/ooze?), or even have a unit that naturally spawns duplicates of itself, or some other specified unit, at certain intervals. Think of all the possibilities! (No, really, think of possibilities you might like to see and tell me about them, so I can make sure they'll be supported.)
4 comments more...