November 2014 blog archive

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

30/11 - custom cards

Custom cards were introduced in HDx. They appeared occasionally in the campaigns, but there were settings that allowed entire decks to be made up out of such cards. Card generation in HDx was kept simple, which resulted in some of these cards being overpowered. Despite its simplicity, the generator could create vast amounts of completely different cards.
I want to keep some of that extreme variation in generated cards in HD3, but i also want to get rid of (some) of the crazy randomness and the overpowered cards.

The HD3 custom card generator is subject to a few requirements :
1. The generator must only do one thing : generate custom cards, one at a time. This may seem straight-forward, but it's actually quite important to make sure that this generator can be slotted into various other elements in the game. If the custom generator were to, for instance, generate an entire deck full of custom cards, it wouldn't be usable in game modes that don't use traditional decks (like unpredictable). If the generator only generates cards, it basically gets put after a piece of code that decides which cards are to be used, and the game already has several of those (the random deck generator, the card generator from unpredictable). That way, those elements of the game don't need to be updated and their output can be hooked onto the custom card generator easily.
2. The generator must support multiple generation modes. There's the balanced mode, which will be the default, and this mode makes sure that cards don't go crazy. There will be a mode specifically for unpredictable, which makes sure certain kinds of abilities that don't work in this game mode (like card draws), don't appear on cards. Finally, there will be a truly random mode, which mimics the HDx generator (after all, the crazy randomness was a lot of fun at times). There might be more modes in the future, should there be additional game modes that require their own generation rules.
3. The generated cards must have proper difficulty scaling. In HDx, difficulty mainly consisted out of changing the attack and defense on ships, but the new generator will also scale the values of abilities. At the same time, when cards receive overly powerful abilities, their other stats should be balanced accordingly.
4. The generated cards must be recognizable (except in random mode). When the generator creates a card that has the image of a vector, it will create a fighter class ship with suitable attack and defense stats and appropriate abilities. This vector won't have 50 defense and won't be capable of launching other ships. The point of custom cards is to provide a new kind of challenge, where one must deal with unpredictable cards, but having some way to easily see what a card's role is can make the game more enjoyable.

Where can the generator be used?
I already mentioned unpredictable, which will receive a setting that allows one to choose between using the regular cardset and custom generated cards.
HDx had deckmods and environments that used custom cards, but for HD3, this isn't decided yet. One option is make a deckmod that players can apply to their own deck (premade or generated) or to the AI's deck. Another option is an environment that affects both decks at the same time. The deckmod option does provide a bit more control and choice, so it sounds more interesting. Another idea for an environment could be one that changes the abilities of cards in play every other turn or so, and this can then still work with regular decks or decks that use the custom card deckmod.

23/11 - preparing stuff for v3.02

The main feature of v3.02 is the XY card set, but there are a couple other things i want to add as well. I'm currently preparing 3 elements, and this preparation is mainly to see if the game in its current state can support these new features, and to get an idea of how much work is involved. Not everything will make it in 3.02, as i still have to decide in what order things will get added.

1. Account system basics. Parts of HD3 will require players to be logged in, this ranges from savegame backups to pvp duels. A lot is planned, but for all of it, players will need an account. I'm looking into several ways of implementing this. Unlike the flash versions of the other HD games, it's not possible to automatically log players in, if they are also logged in on the NULLL website. Since the flash versions were hosted on the website, it was relatively easy for the site to share the login status of players with the game. For a standalone game, such a system won't work, so something else will need to be found. There are some security concerns that need to be taken into account, and i also want the entire system to be easy to use, both on desktops and on mobile devices.

2. Custom card generator. The HDx generator was simple, and as a result of that, it could create overpowered cards easily. HD3 will feature custom cards as well, but in what game modes, or how this will work, is still not entirely sure. What is sure, is that the game will need a piece of code that can generate (balanced) custom cards, and that can be easily inserted into other game modes.

3. Unpredictable mode updates. There are two major problems with this game mode right now. First, this game mode has its own card generator, which is the code that decides what cards players will draw next. Unlike the random deck generator, this card generator doesn't properly take into account card races on dual cards. If the random deck generator is told to create a mono CA deck, it will leave out CA/TM cards for instance, and in the future it may include the artifact energy action for CA as well. The unpredictable card generator can't do this yet. I'm looking into a way to fix this, and i can either make a new generator, or find a way to use the random deck generator. The second problem has to do with cards that don't really work in this game mode, or that might be too powerful. The current solution is to lower the chance of these cards appearing, or even keep them from getting drawn at all. A different approach is to use the custom card generator to replace such cards with random cards that are suitable for unpredictable. But i'm thinking about keeping this system as is, and instead adding an option to this game mode that simply uses only custom cards. This will solves these problems and at the same time add a new dimension to this game mode, since the cards themselves will now also be completely unpredictable.

16/11 - XY ability AI

The XY set has been added to the game, but before a new version of the alpha can be release, everything needs to be put through basic mechanic testing. This test is set up in two parts : test all the abilities to make sure they do what is expected of them, and test the AI to see if it can handle the new abilities.

The first test has already been completed. It's fairly easy to do, as it's a matter of creating a number of decks with the new cards and testing it in duels vs the AI. This way, every card can be put through some basic tests. The AI test is a bit more complex. While it's possible for me to give the AI decks with specific cards, there's still the randomness of the opening hand and the order of cards in the deck. On top of that, the AI is fairly complicated, so i can't really predict anymore what it will do when the AI has a certain set of cards and is presented by a certain boardstate.

Neither test can make sure everything is bug-free, either. The first test is generally more reliable since i can make sure that every card is played at least once, and has had its abilities triggered at least once, on different targets where needed. There can be many external factors (existing ones and those that might still be added in the future) that could still cause an ability to break in very specific situations. Testing the AI is different as there's more randomness involved that i don't have control over. If i make a deck that contains 40 cards, of which there are 5 cards with 4 copies each that still need to be tested, i can play defensively and make the duel last longer until those cards come along so i can play them. I can also set up certain board layouts so i can test cards in specific situations. The AI isn't going to do either of those things, as it always plays to win.

One of the tests i did involved the Spark. I placed it in front of AI ships to see if the Spark's ability really did cause ships that damage it to be destroyed. More so that in HDx, did the AI do whatever it could to avoid having its ships attack the Spark. It would gladly sacrifice Vectors and Solar Harvesters to take out the Spark so it could protect stronger ships. This is what one would expect of the AI, but Spark's ability has always been troublesome in HDx. This ability was treated as an automatic one, and every time the AI had an ability that could deal damage, or whenever the AI was about to play a ship, it had to check for the presence of Sparks. This meant that a large number of ability entries in the AI had an additional check. This was one of the reasons why the AI code grew so large in HDx. Due to how the AI worked in HDx (it used local simulations only), every damage ability had to basically manually check for the presence of Sparks amongst the possible targets. In HD3, this is entirely automatic, thanks to the new AI setup (it simulates the entire board, including triggers) and the fact that Spark's ability is now an aura. While auto abilities are expected to go off at a certain fixed time, auras can trigger at multiple, but also specific times, often after other things have happened. In case of Spark, the ability would have to be checked for, every time a ship deals damage to another ship. Checking whether or not a ship that has been damaged has this ability has been made a lot more efficient. Instead of the game having to check every ability on that ship, it simply checks the auras.
One thing the AI didn't do (and which is something players might do) is use abilities to disable their own ships, to avoid that ship attacking a Spark. Technically the AI is capable of doing this, but i've set up the AI such that it never checks allied targets for harmful abilities. Similar, the AI never even considers opposing targets for beneficial abilities, such as repair, even though opposing targets are perfectly valid targets for such abilities. There's no need to have these limitiations however, as the full board simulations will notice the effect of using repair on an opposing ship, for instance. But the main reason why i'm not letting the AI do this has to do with performance. The AI is already doing a lot of calculations. When there are a lot of cards on the board with activatable abilities, and the AI has plenty of cards still in hand, there can be a noticable slowdown and delay in the game while the AI is comparing all these abilities to see which would be most beneficial. Allowing the AI to check allied targets for harmful abilities (and opposing targets for beneficial abilties) can easily make the AI twice as slow.
Luckily i can make per-ability exceptions. So in case of the disable ability, i might actually let the AI consider using it on its own ships. I'll not enable this just yet, i want to make sure the AI is good enough (and bug-free) when it comes to what it's more likely to do 99% of the time : choosing opposing targets for harmful abilities.

09/11 - XY card set

The XY card set is being added to HD3. Compared to the HU and CA sets, there are more changes to the cards and their abilities. In a lot of cases the changes are purely mechanical, but there are a couple new things as well.

Spark's ability is now treated as an aura instead of an auto ability. Since it's a form of retaliation, it only triggers on damage received from opposing sources.
Chyriax has received a new play ability. When this legend enters play, all allies (including Chyriax) receive 1 shield.
Shimmering Xyloxi has an acti that gives it 1 shield, stacking with any other shields it might already have.
Crystal Wraith had an acti that cloaked the ship for one turn, now this acti gives it one shield, stacking with shields the ship might already have. This makes the ability a bit more powerful compared to the original version. Shield and cloak aren't too different, but the cloak wore off after one turn, while the shield will persist.
Wavebreaker has a new passive ability, called Multistrike 2, which lets this ship attack twice in a row every combat phase. This ship also has an aura that gives it +1/+1 whenever an opponent plays a structure.
Crystal Avatar has an aura that gives it +2 defense whenever a ship is destroyed.

Structures for the most part remain unchanged.

Crystal Shield no longer protects the base against all damage, but instead grants the base 5 resistance and 5 retaliation.
The previously unique action '2nd Moon of Xyth' has become an elite. It has roughly the same effect as before, but when there are no copies of this card left in owner's deck, this card will be shuffled back into scrap after its effect has resolved.

The code that applies the effects of abilities onto the board is being added right now, then follow the AI entries for each ability. Once everything has been tested, a new patch will be released.

02/11 - upcoming patches

All the things i wanted to add in the 3.01 version of the alpha have been added over the course of only larger two patches (one patch with the CA card set, and one patch with an extra game mode, some deck mods and environments), and a smaller 3rd patch, which was released a few days ago and contained some minor balance changes for the unpredictable game mode. As such, i've already begun preparations to add in the XY card set.

Releasing a new patch takes a bit of time. Three versions need to be made (a .jar, an .exe, and an .apk for android) and uploaded. Forum and wiki posts need to be updated, backups of my project need to be made. So i prefer to combine as much as possible in one single patch, unless there's a critical bug that needs to be fixed as fast as possible, or when some of the new content is very large. Having one patch every two weeks seems like a good rate, but it depends on the kind of stuff that gets added. It's not unlikely that i need more than 2 weeks to complete the XY card set for instance.
Regarding card sets, the more cards (and thus abilities) that have been added, the less work is needed to add additional card sets, as they often use abilities that already exist, or abilities whose code can be combined with code of already existing abilities. It's thus not unlikely that future major patches might actually contain two card sets instead of just one. Not so for the XY card set, which introduces 49 new abilities and requires updates on a couple existing ones, which will be a fair bit of work in total.

Alongside card sets, i also aim to add in other content in major patches : deck mods, environments, even entire game modes. For the major update that includes the XY patch, there likely won't be a new game mode. The existing ones from HDx all need some changes, and not everything has been decided or properly investigated yet. The remaining new game modes that i have planned are so large that they'll probably take as much time to add (if not more) than an entire card set. The most important thing in this phase of the alpha is adding the cards from HDx, thus i prefer to focus on smaller things that can be added inbetween cardset additions, instead of larger elements that could delay the completion of the card collection by weeks, if not, months.