June 2014 blog archive

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

29/06 - Environments & Deck mods

As with HDx, environments and deck mods will allow players to customize the duel against an AI in great detail. On top of the environments and mods already in HDx, a large number of new ones are planned for HD3.

For the first alpha, it's important to have the basic system in place, so that it can be tested. The alpha will likely come with only 3 environments and deck mods, but that's enough to test all related mechanics.

Environments are generally simple to implement, but deck mods vary greatly in how drastically they affect cards. There are roughly 4 types of deck mods :
1. deck mods that add cards to a deck (f.i. cards that are already in play at the start of a game)
2. deck mods that add abilities to cards of a certain type (f.i. all ships become unblockable)
3. deck mods that add abilities to cards during combat (f.i. at the start of a turn, a random structure gains 1 shield)
4. deck mods that affect the stats of the base (f.i. base has extra resistance)

Of these, the first type is generally the most complex, even though adding cards sounds simple. For the time being, no such deckmods are added to the alpha, as the system that allows to add extra cards depends on the flagship and mercenary mechanics, of which one needs to be tested properly first and the other hasn't been implemented yet. There are also some balance questions that need to be answered first, especially when it comes to whether or not these extra cards need to be subject to deck mods of the second type.

What makes adding cards so special, is that these cards sit on top of the deck. By default a deck can have up to 60 cards, but the decks in game actually have room for 74 cards (72 in HDx, 74 in HD3).
The game has (or will have) several 100 hardcoded cards. If you were to add these cards to a deck, and trough battle, one of these cards receives or loses an ability, the hardcoded card would be affected, permanently changing its stats until the next time you launch the game. To avoid this from happening, each card in the deck is a temporary copy of a hardcoded card (temporary since it only exists for the duration of the duel). This makes sure that the game can't change the stats of hardcoded cards. But there's still a problem : if a card is destroyed or forced to return to hand, it is supposed to be changed back to its default stats. So if you have a ship with 5 attack and you apply an action to it that gives it extra attack, that extra amount needs to be removed again if this card goes to scrap or returns to deck. Technically you could copy the stats of the hardcoded version of this card again, but if there was a deckmod present that gave all ships +1 defense, that bonus is now gone as well.
So here is what happens (and this setup is mainly important for the 2nd type of deck mods) :
1. go through all the cards in the deck and create a copy of the hardcoded version of that card (this is called the data master).
2. check if there are deckmods that need to be applied before the start of a duel (type 2 deckmods only), these changes are applied to the data master.
3. copy the data master into yet another card : the deck master.
So now there are two decks : data master and deck master. Deck master is the one that is allowed to be changed during a duel. If a card is dealt damage and it HP goes down, or it receives a new ability, the stats in the deck master version of this card will reflect these changes. If a card is destroyed or returned to hand, the stats in the data master version are copied over and replace the stats in the deck master version.
This system has been in place since HDs, even though there weren't any deck mods there (there was the challenges system instead).

Cards that are spawned by other cards aren't part of these master decks. There would be no point in doing that since there's no guarantee that these spawns will ever get used, and technically any hardcoded card can be spawned, so any card in the game would have to be added to both masters, making these huge. Instead, when a spawn is created, it gets added in one of 12 extra slots in the deck (5 for structs, 7 for ships), tied to the location on the board. This is why spawned ships don't have the bonus stats from type 2 deck mods, since these cards are created after the game started, and thus after the step where type 2 deck mods have been applied. This might change in the future - it's not so big a problem to apply deck mods to individual cards during a duel in progress.
If a type 1 deckmod is present, and the player starts out with f.i. 3 extra ships, these ships are placed in some of those extra 12 slots (this is important since these cards aren't part of the deck that the player created, and thus shouldn't be mixed with cards that are, but also this way these extra cards don't take up slots for the player, allowing one to still create a 60 card deck). But this happens before the game starts, so technically it would be possible to apply type 2 deck mods on these. I've never done this before mainly for balance reasons.

Flagship and mercenary cards also sit outside the normal deck, and thus add two more slots to a deck (hence a deck being 74 cards + 60 + 12 spawns + 2 flag/merc). Since both these types of cards are already relatively powerful, they're unlikely to be ever affected by type 2 deck mods.

22/06 - Deck generator

With the entire HU card set in the game (see this topic for changes compared to HD3), it's time to get started on the deck generator.

The deck generator (DG) is the part of the game that primarily produces decks for the AI, but it can also be used to generate decks for players as well. The DG in HD3 is based on the one in HDx, which in turn is an improved version of the one in HDs. In all 3 cases, though, the general workflow remains the same : the DG receives two races for which it needs to build a deck, (these can be identical in case of a single-color deck), then, for each color, the DG generates a minideck, which get then combined to create the final deck.

The minidecks differ in size, so that the major race of the deck takes up about 60% of the cards and the minor race 40%. The first thing the DG does is determine the number of cards in each of these minidecks, then calculates how many of these cards need to be actions, energy structures, non-energy structures and ships. The ratios of these different types of cards depend on the tactic of the deck (ship based, defensive, control or balanced).
Once these numbers have been decided, the DG starts creating a list of cards. In HDs, the DG had access to a large number of small cardpools (several per card type, per tactic and per race (and for all possible combos of 2 races), probably well over 500 pools in total) from which it could randomly select cards. These cardpools were all manually set up, which took a fair bit of work. The advantage of doing this manually is that i had more control over the cards that could be selected for a given tactic/race/cardtype, but at the same time it limited the number of different decks that could be created. A bigger problem was that i technically was supposed to update these cardpools everytime new cards were added to the game.
The HDx DG relied less on cardpools, except for the base set of ships and actions, tied to the tactic. Part of the card generation was tied to the stats of these cards (mainly their type and subtype). This DG had more control over the subtypes of cards compared to the HDs one, as tactics now not only controlled the number of ships, but basically the number of small, medium and large ships.
In HD3, i changed this system again : instead of handmade cardpools, the game would browse the entire set of hardcoded cards and select cards based on their subtype only, at the same time, the part of the DG that calculated the number of each cardtype was updated, so that it calculated the number of different ship subtypes, instead of only the total number of ships or just shipsizes. So instead of me making cardpools that contained more support and warfare ships for a control deck, i simply set the DG up so that it would try to generate an increased number of those ship classes, at the cost of other ship classes. The DG then scans the entire set of hardcoded cards and only looks for a single subtype of ships for a single race, limiting the number of ships it finds to those that would be most suitable to the deck's tactic. The big advantage here is that the DG can now work for any set of hardcoded cards, and there's also more variation in decks, but on the other hand, decks become less strict in their tactic (which isn't always a bad thing, else they'd be too predictable).

The HD3 DG has one other major difference compared to the HDx one : difficulty scaling (see below) and one minor difference : it no longer generates 3-color decks. The HDx DG could generate a 3rd minideck, but the end result was a deck that often had energy problems, even with the existence of triple energy structures and the set of engineer ship cards. The feature was never really used, and I don't plan to use it in HD3, so it has been removed.

Difficulty is a tricky thing, especially when you are stuck with fixed values on cards. If you take an RPG where you have monster opponents with a certain amount of hitpoints and a certain damage potential, an easy way of making these opponents more difficult is simply increasing those amounts. In HD, that's not an option, since players expect cards to always have the same stats and abilities.
Difficulty in HDs was mainly simulated by increasing the HP and stats (resist, energy generation) of the opponents base. In HDx, there were upgrade levels for cards, so mixing in more and more upgraded cards in the deck was a way of increasing a deck's difficulty, without only relying on base stats. In HD3, there will yet be another system of increasing difficulty. First, there's the base of the opponent : it will gain more HP and more base stats (and there are now more base stats than before : resist, repair, retaliation, mitigation, allowing for more variation in this system) and more energy generation as difficulty goes up. Second (to a lesser extend), the cards that the DG will choose for the deck will be more likely to be of a higher rarity. This is limited since not all rarity tiers are guaranteed to have suitable cards for a certain deck tactic. Players can also choose to add deckmods to the opponent's deck, which will be more varied compared to HDx and finally, players can use combat boosters (i previously referred to these a skills, more about this in a future devblog). In HDs, the AI also was part of the difficulty curve, as the AI had a higher chance of being bypassed for lower difficulty decks, resulting in more random behaviour of the opponent. Since HDx, and especially in HD3, the AI has grown so complex that this simply is not an option anymore. The AI is also too large for me to ever consider making it scalable across different difficulties.

15/06 - HU action set

Before i talk about the human action cards, there's a small update on the structure set.
The original idea was to give the triple energy structures a cost (right now, these structures have no cost to deploy them), as they are rather powerful. So i gave the human one (Crystal Antistar) a cost of 2 energy. While preparing the general workflow of the deckgenerator, i realized this was going to cause problems with some kinds of decks. Crystal Antistar generates solar, dark and nebular energy, making it equally useful in mono decks of all three these races (after all, having two extra energy per turn can still be used for cards with a random element in their cost). This structure is also very good to have in a HU/CA, HU/XY or XY/HU deck. But if this structure has a cost of two solar energy, it suddenly stops being interesting for mono CA, mono XY and dual CA/XY decks. On one hand, i'm convinced it needs a cost, but on the other hand, i like the idea of this class of triple energy structure also making it easier to create dual color decks. In the end the solution was simple : give these cards a random-only cost. The problem was that the game couldn't support this by default as there never have been non-AR cards that only had a random cost. The system was set up such that the game only looked whether or not a card had a secondary color cost if that card had a primary cost. Luckily it didn't take much work to add in support for this type of card. Technically i could have made these triple energy structures all artifact cards, but this is a better solutions as these cards are better off remaining tied to their primary race's cardsets. Non-AR cards with only a random cost do look a bit different : their costfield will show both the energy icons, even though the first one is preceded by a zero (as this card has no major energy cost, only a minor one). Cards with zero cost normally don't show that they have a cost at all. In this case, i decided it would be good to show the major color of this card in the cost as well, so it's clear these aren't AR cards.

So, by now the entire Human card set has been added through the game and has been put through a first round mechanic testing. I'll compile a list of all these cards later, so that it'll be easier to see how some of these have changed compared to HDx.

Defensive Formation : 'target ship you own and its neighbours each gain 6 defense but can't attack for one turn'. Unlike in HDx, it's now easier to seperately affect a card's ability to attack, use acti abilties and even use auto abilities. This ability use to stop cards from both attacking and using acti abilities (i.e. the cards would be disabled), but now, only their ability to attack is affected.

As mentioned in the blogpost about card rarity (click here to read it), unique cards will no longer exist. The unique human action 4th Moon of Xyth has been made elite and it's powerlevel has been lowered as this card was originally balanced around the fact that player could only get one copy of these uniques.
Another change is that the card goes back to the bottom of the deck, if there are no copies of this card left in the deck. Actions being able to return to deck is something i already wanted to do in HD1. The big problem has always been the fact that actions never enter play - they go straight from hand to scrap, after their ability has been resolved. With the addition of passive abilities as a seperate class, it's easier to make this work now, since actions can now have passive abilities as well.
So for the human action '4th moon of Xyth', the game checks if this card meets the condition for it to return to deck instead of going to scrap. In that case, the card will be given the passive ability 'Recover 2', which returns a card to the bottom of the deck if it were to leave play. When the action is resolved, the game will check if this passive is present to see where it needs to send the card.
Next to Recover, there's one other passive that works on actions as well : 'Assemble'. There might be more passives coming in the future that are compatible with actions.

08/06 - HU struct set

The human structure set was relatively simple. Part of the ability overhaul, which allowed multiple abilities of the same time on cards, was to break down complex abilities into multiple, simple abilities. Dual color structures often have play or auto abilities that allow them to generate two kinds of energy, and technically these dual energy abilities can be split into two single energy abilities. But as these abilities are very simple compared to some of the others that appear on cards, the actual gain here is very small. There is also a negative side to doing this : the amount of text on the card would grow larger. A dual energy ability will say 'Generates A X and B Y' where A and B are the amounts and X and Y are the energy type icons. A single energy ability says 'Generates A X' and writing this twice is longer than the text for the dual energy ability. It gets worse in case of triple energy abilities. So the planned changes on these cards have not been implemented. These would be mechanical changes only, so nothing changes to how these cards work.

This set also introduces the first aura, on the 'Shield Generator'. Auras can be split in two large groups : always-active effects and triggers. Shield Generator provides base resistance while it's in play, this is an effect that's active for as long as this card is in play. In HDx, this ability was labelled as an auto ability, even thoug it was already an always-active ability.

Another change is that most of these abilities have been adjusted so that they work on different cards. The dual energy abilities relied on the two races of the cards they were on, to make sure the ability generated the correct types of energy. The problem was that this ability thus can't work on a single color card. As an example, let's take an ability that says 'Generates 2 X and 1 Y', where X is the major race and Y the minor race of the card. In HD3, if this ability gets put on a single color card, it will say 'Generates 2 X and 1 random', where X is the color of the card. If this ability ends up on an artifact card, it will say 'Generate 3 random' (ie the sum of the two amounts).
This doesn't matter much for hardcoded cards, as those will always have the most optimal abilities, but it might be important for a planned custom card generator, as this one now becomes a lot less complex since it no longer needs to have different pools of abilities (for single color cards, for duals, for artifacts…).
Similarly, there are also abilities that only work on a certain card type. For instance 'The allied ship in front of this structure gains +X defense', which could never be placed on a ship. In HD3, if this ability does end up on a ship, it will change and will say 'If there's an allied struct behind this ship, this ship gains +X defense'.
This might not work for all abilities, but where possible, i'll try to make variations of these restricted abilities so that they work on more cards.

01/06 - HU ship set

By now, the Human ship cards have all been added to the game. Here is an overview of the changes compared to the HDx version of the game.

Aladayr's Phoenix : instead of being shuffled back into deck upon destruction, this card now has a 'Restore 1' passive, which restores it to its default stats the moment it would be destroyed. The name of this card has changed as well, part of the planned changes to Legendary cards in general. Aladayr is a character in the Xyth storyline - i'm not sure if i've talked about this person before or not, but more information will be revealed once i start putting the actual story online.

Troy : the change here is mechanical and has to do with how the type of ship that can be spawned is stored in the ability. This will mainly matter for randomly generated cards. If you have played games with custom cards in HDx, you likely have run into small ships that were capable of lauching battleship sized ships. The random card generator simply allowed any ship card to be selected for a carrier. I've changed this system so that only a number of handpicked cards will now be available, should there ever be such a random card generator in HD3. This list includes all fighter class ships, but also some of the smaller support ships.

Solar Engineer : the play ability (returns the top structure in owner's scrap to the top of owner's deck) has been removed. Instead, this ship repairs all allies for 1 HP for each structure its owner has. This is part of the plan to drastically reduce the number of cards that interact with the scrapyard.

Kimiko : the acti ability (look at the top card and choose to keep it or send it to the bottom) has been changed. Now, instead of looking only at the top card, this ability can support the top 2 to 4 cards (2 in case of Kimiko), and from these, you select one that you want to keep and all the others go to the bottom of the deck (there's also the option to keep all cards). This is a relatively complex ability, mechanically, hence the range of cards it can support being 2 to 4 (which is a slight boost for Kimiko as it originally only showed a single card).

Karasu : no changes here, except that this card uses the updated buffs system (see last week's blog).

Amiaru : the acti ability (the top ship card in scrap is placed at the bottom of the deck) has been replaced by a new acti (if the top card in scrap is a structure, gain 2 base HP). Again, part of the plan to reduce scrapyard interaction.

Siege Engine : the combination of abilities on this card caused some problems in HDx, especially when other cards were used to enable Siege Engine to attack. The actual changes to this card are purely mechanical, and have been explained in last week's blog