May 2014 blog archive

This page contains all the blog posts from may 2014. To read the most recent blog posts, click here.

25/05 - temporary effects

Temporary effects were introduced in HDx, but only a few cards made use of them. These effects (in the game's code, they're called buffs) used to have a fairly simple system, which limited their use. In HDx, there was no real need to have a more complex system as these buffs saw so little use. Basically, they would give or remove stats or abilities from cards at a specific point in time.

For HD3, the plan is to have a system in place that's a lot more flexible, to allow for more variation in the kinds of abilities that can be supported. A buff is basically 4 things : first there's the timing, which determines when this buff triggers (start of a turn, start of combat, end of turn, etc), then there's a description of what this buff must do (remove an ability, add attack or defense, etc) then there are two values that are tied to the description : if an ability needs to be added, there has to be an ability identifier (which tells what ability needs to be added) as well as a value that determines the strength of this ability, if attack or defense needs to be added or removed, there must be a value to tell the game how much needs to be added or removed.

I'm currently working on the Human ship cards, which features two cards that require buffs.

First there's Karasu, which can become unblockable for one turn. When this acti ability is activated, the ship gains the 'unblockable' passive and at the same time it also receives a buff, which tells the game that this passive needs to be removed again at the start of the next turn. This buff triggers right before this card is checked for auto abilities, which is a bit different from how it worked in HDx, where all buffs across all cards where checked at the same time. In the end, there will be little difference between the two setups, but since a buff will primarily target the card with the buff itself, it makes more sense that it triggers or resolves at the same time that auto abilities do.

The other card is Siege Engine, which has been slightly changed compared to HDx. It has received a new passive called 'Siege X', which causes this ship to deal X damage straight to the opposing base during each combat phase, if this ship doesn't participate in that combat phase (this passive doesn't trigger in the first turn this ship is in play). Another passive on this ship is 'Immobile', which makes it so this ship can't attack, not even when other cards enable it to attack - as long as this ability is present on the card, it won't participate in combat phases. HDx had some problems with similar abilities, especially when other cards were interfering. It was partially solved by introducing the capability of players and ships to skip attacks (ie no combat phases were to be had at all), that system has been removed again in HD3 in favor of attack counters : ships and players can have zero or more attack counters. If a player has X attack counters, he will have that many combat phases that turn (attack counters reset to 1 every turn), if ships have X attack counters, they'll attack X times every combat phase.
By default, Siege Engine can't attack due to 'Immobile', but it will damage the opposing base thanks to its 'Siege' passive. Siege is subject to the attack counter of the owner, so it will trigger every combat phase, but it's not subject to the ship's attack counter (since the ship isn't actually attacking in a normal fashion, due to its 'Immobile' passive). Siege Engine has an acti that allows it to destroy a structure so it can attack for one turn. This acti removes the 'Immobile' passive and gives the ship a buff, which will add this passive to the card again, at the start of the next turn. So for one turn, this ship can attack normally (and thus 'Siege' will not trigger).

Siege Engine is a nice example of passives and buffs working together to create interesting cards with unique abilities.

18/05 - target modes

I'm still working on the remaining Human ship cards, which contain a few tricky abilities, including some with the new targetmodes from HDx.
All activatable and action abilities have a targetmode, which determines what kind of things they can target. The part of the game that generates the list of targets, when you want to play an action or activate a card in play, looks at the targetmode to see which targets it should make clickable. Technically the targetlist can be created by looking at the ability and a targetmode isn't really needed, but the game has a few 100 abilities that need targets and only a dozen or so different targetmodes, so it makes things a bit less complex to look at targetmodes rather than each individual ability.

Up to HDx, targetmodes could only target cards in play. This limited abilities to those that could target all ships, or only opposing or allied ships, and the same for structures. With the addition of carriers, empty slots in play could be targeted as well, but in the end there was very little difference between targeting a slot that contains a card and one that doesn't (since the game can already do this when you play a new card, which also uses the same targetlist generator to set up the correct targets).
HDx introduced a number of different targetmodes, those that could target cards in hand, in deck, scrap and even energy types. The current set of human ships has two such abilties. First, there's Kimiko, which has an acti that allows you to look at the top X cards of your deck and from those choose one that stays on top of your deck, while the others are moved to the bottom. Then there's Solar Engineer, which can generate energy of 4 different types and you choose the type of energy it needs to generate.
Neither cards in deck nor energy types are things you can target on the board. All other targetmodes simply allow you to click something on the board, so to have the same ease of use with these special targetmodes, the game will generate a popup dialog box, showing you the targets for these abilities. In case of Kimiko, you'll be shown the top X cards of your deck, and you can choose one of these or you can choose to keep all of them. In case of the Solar Engineer, the dialog box will show the icons of the energy types it can produce.

Another card that's part of this set is Phoenix, which is a legendary card. I've talked about legend binding in a previous blog (basically the first player to play a legend in a duel gets that legend bound to his or her team, from then on, only that player can play this legend, as long as there isn't already a copy in play). This mechanic has been added to the game and the Phoenix card itself has been changed a bit as well. The damage abilities remain the same, but instead of being shuffled back into deck when destroyed, this card will be reverted to its default state instead of being destroyed (this can happen only once though). The card has been renamed to Aladayr's Phoenix, after one of the characters in the Xyth storyline.

11/05 - more cards

The next set of cards has been added to the game : Chimera, Shield Booster, Crusher, Wyvern, Chaos Moth, Dataminer, Hiroto, Delta Fighter.
The abilities on these cards are relatively simple - i split the remaining human ship cards in two sets, doing all the easier ones first as that would allow me to make sure the entire card adding process, that i've set up, is complete before i start with more tricky cards.

There are a few differences in these cards compared to HDx, but these are mostly mechanical changes.

Chimera has a play ability that boosts the attack of fighter class ships, but the type of ship it targets (fighters) had always been fixed. I've updated this ability so that it can target any ship subclass (or even all allied ships, regardless of subclass). Until now creatures had fewer subclasses than ships, which is also going to change in HD3. Some of the support subclasses have also been removed and are now simply labelled 'support'.
These are the subclasses for ships :
fighter - cruiser - destroyer - battleship - carrier - titan - support - industrial - science ship
And the matching versions for creatures :
fighter - soldier - warrior - commander - carrier - titan - support - industrial - scientist

Chaos Moth has a play ability that gives it an attack/defense bonus based on the presence of allies ships of a certain race. Similar to the ability of Chimera, the race itself used to be fixed (it was tied to the race of the card itself). This has been changed as well, and the ability can now target any race, or can even trigger on any ally, regardless of race.

As mentioned before, Delta Fighter is now a proper card that players can add to their decks instead of a card that can only be created by carriers.
The next set of cards does include Troy, so the actual mechanic related to bringing cards into play via abilities rather than from player's hands will be implemented then.

04/05 - adding cards

For the past two weeks, i've been adding new cards to HD3. This is a very slow process, evidenced by the fact that only 5 new cards have been added (8 more cards are almost done). However, over time this should go faster, for two reasons : firstly, i'll get used to the entire process and figure out the most efficient way of adding cards and second, as more cards are added, more and more abilities are in the game as well, if these appear on future cards, that's a big part of the work that doesn't need to be done anymore (this also includes support abilities, see below).

When i started with HD3, i added a small set of cards to the game, enough to test the basics of the mechanics i was about to add. Back then this took relatively little work, as the only thing the game had to do with the abilities on these cards was applying their effects on the board. Then i added the AI, and a few more things were needed : for most abilities both a static and active score setup had to be added, which allowed the AI to predict the outcome of the abilities on cards it wants to play or activate. After that, i added the flagship, which comes with an editor and ability-scoring mechanic, both which require abilities to have additional data (minimum and maximum ranges on the values or strengths of abilities, and functions that allow to calculate the score of an ability, based on that value).
So when new abilities are added to the game, all 3 these large steps need to be taken. I'm adding cards in small batches at a time, currently focusing on the Human ship cards. The first alpha should at least have most of the cards of one race, so that some form of deck generator for the AI can be added.

Adding cards is not always just a matter of adding their original abilities (as in HDx), sometimes there are some minor changes to the way abilities work and some abilities or mechanics need supporting abilities. I'm also already going to add in a few balance changes i had planned.
Deflector Field, one of the cards already in game, has an ability that triggers when it enters play : 'returns blocker to the top of its owner's deck'. In HDx, there's very little difference between a card that leaves play to go to the scrap or to go to the deck. Basically a card that is supposed to go to the deck goes through the same steps as a card that is to be removed from play, except that it doesn't have an explosion effect and doesn't go to the scrapyard. HD3 offers 3 ways for cards to go to the deck : to the top, to a random spot, or to the bottom. In HDx, whether or not a card goes to deck is a hidden element on the card (i.e. players don't see it), i've now turned this into a passive ability called 'recover'. When Deflector Field is launched, the ship it affects will be given this passive ability and will be removed from play. The process that removes a card from play will then check the card to see if it has the 'recover' passive so it knows if this card goes to scrap or to deck. When a card is removed from play, it is also returned to its default state, so a card affected by Deflector Field will lose the passive it has gained. For now, no cards actually have the 'recover' passive ability, so i had to add a passive that doesn't exist on any card in the game yet (same with 'assemble' on flagships).
Compared to HDx, this entire setup appears the same, but the code behind has been simplified. The card that ends up receiving this passive from Deflector Field leaves play right away, so players won't actually be able to see that card while it has that passive, as by the time it enters the deck, it loses that passive again. The main reason why i chose to set things up this way, is that the game now only needs to look at one passive ability on the card, which simplifies things. For instance, look at the current version of 'Phoenix', which has an auto ability that allows it to be shuffled into deck when destroyed. That ability can now be replaced by this passive. If you have an action that allows a card to be returned to deck when that card gets destroyed, all that action needs to do, is give the target card this passive (this is something that wasn't possible in HDx, while it's possible to immediately remove a card and have it return to deck, you can't give a ship the option to return to deck, whenever it is destroyed).
Regarding Phoenix, i'm considering removing that ability in favor of yet another new passive, called 'restore X' - this allows a ship, the moment it would be destroyed, to be reverted to its default state. The 'X' determines how many times this can happen, this number goes down every time this happens, and when it reaches zero, the ability is removed from the card.

Another minor change compared to HDx, is that the 'Delta Fighter' card is now a proper card that players can add to their deck. It's not a powerful card, but it makes more sense that it's available just like any other card. The ship spawning setup in HDx (Delta Fighter can only be brought into play from a 'Troy' carrier) will be changed so it's easier for a carrier to spawn any existing card (should it need to, for instace in custom cards or certain game modes) and not just a small selection of special cards that otherwise are not available to players. Troy itself is not part of current batch of cards being added, i've kept it aside as it's a more complex mechanic.