Table of Contents
December 2013 blog archive
This page contains all the blog posts from december 2013. To read the most recent blog posts, click here.
29/12 - Combat screen
This is what the combat screen currently looks like (click here).
Note that a fair bit of stuff still needs to be implemented, so things might still change. There are also a number of planned mechanics that might affect the combat screen, such as the flagship, allies and skills. Also note that card images are still using the placeholder Vector image and icons for acti abilities all use the same 'blue arrow' placeholder image for now.
There are no big changes compared to how this screen looked in HDx. One thing that's new are the name labels. My original idea was to show these only for games that have more than two players, as these labels would help identify which players are currently visible on-screen. For such games, there will be arrow buttons next to these labels that allow you to scroll to the board setup of other players. The details for games that have more than 2 players are still not final, however, so the way this works might still change. The reason the game will show these labels for regular duels, is that they can be used to target that player. In HDx and older versions of HD, if you had an ability that could target both ships and bases, all valid ship targets would receive a glow and the HP bar of valid base targets would also receive a glow. The HP bar is not that large and it sits in the corner of the screen, so having a larger label nearby the other valid targets seems like a better solution overall. Whether or not the labels will always be visible for 2-player games is not sure yet - i could set up the game such that it hides these labels unless you actually need to target a base.
There are some minor changes in how the UI works as well. To see the energy generation rate of players, you now have to click or tap the energy panel, causing it to switch into energy generation mode. Tap or click it again to bring it back into the default energy stock mode.
I'll probably add something for the turn progress panel (the small panel between the two energy panels) as well. It could provide an overview of the battle, showing for each player the number of ships and structures in play. This will be more interesting for games that have more than two players obviously.
Bases can have resistance, retaliation and repair (previously known as regen), as was the case in HDx, for HD3 i'm also adding 'mitigation'. Mitigation is also a passive that will be available to ship cards. Mitigation triggers after resistance and caps incoming damage to a certain amount. If a ship or base has mitigation 4, all incoming damage (after it has been adjusted due to resistances, if any), will be capped to maximum 4. So if your base has mitigate 4 and two ships (with 6 and 3 damage) attack the base, they'll deal 4 and 3 damage. If your base now has 1 resist and mitigate 4, the damage values first get reduced to 5 and 2, then mitigate is checked and your base ends up taking 4 and 2 damage.
These base stats will appear to the left of a base (if a base has them), and the plan is to make them clickable so that they can bring up a small info panel (similar to the detailed info panel for cards) that explains in more detail what these stats do.
Interaction with cards in general will change as well, and this is probably the biggest change to the combat screen. In previous versions of HD, you only had to mouse over a card to see its card popup - this is no longer possible anywhere in the game. Cards now have to be clicked to bring up their popups. It gives me more control over when card popups should be available to the player, but it also makes the input code a fair bit more complex. This setup helps with accidental miss-clicks as you'll no longer be able to instantly play actions from your hand or activate cards in play. To play or activate cards, you first have to click them to bring up the popup - the popup then has an extra button which can be used to play or activate this card.
This setup is required for the game to work on devices with touch input as those can't have mouseovers. It does require more clicks on PC, but i hope players will see the advantages of the system. I got used to this setup fairly quick, and the additional confirmation is good to have - on top of that the game isn't always generating popups when i simply move the mouse around and accidentally move over some cards.
As i said, this setup is more complex, so i'm still in the process of figuring out when popups should be available and when not - this is something i need to see while playing games, so i might have to wait until there's at least a basic AI in the game. Related to this, the game will most likely be able to support of a form of pausing. Since HD is a turn-based game, i never added in a proper pause option, but with the new card popup setup, it might be interesting to keep the AI from playing new cards while you have a card popup open.
As the screenshot shows, some basic mechanics are already implemented : it's possible to play ships and structures from hand and the basics for targetless and targeted actions are in, cards in play can be activated and if their acti ability requires a target, targets can be chosen. The entire phase structure of a turn is complete and tested for human players. For the AI, the main and discard phases are skipped for now since there's no AI code yet. Combat works and a number of played, auto and acti abilities have already been implemented.
What this means is that most of the core mechanics of duelling in HD have been implemented. Some of the smaller details here and there still need to be added, then i'll work on adding in code for all the remaining abilities for the current (tiny) cardset the game supports. After that i'll look into setting up the basic framework for the AI code, without any actual AI decision-making code - so the outline only, which can support future AI code. And once that is in, i'll add some very basic AI code - enough so that the AI can play random ships in random slots - just to test a proper 1 v 1 duel.
22/12 - HD3 duel mechanics
Work on the combat screen continues - since most of the graphics and the layout of the combat screen depend on the state of the game, many of the combat mechanics need to be added in alongside setting up the layout of the screen. For the time being, for most of these mechanics, only the outline is being added.
Since the combat screen and the code that controls the phases during combat is so complex and large, it's simply not possible to start working on phase 1 for instance and add in everything that's needed there, then start on the next phase, and so on. Instead, i make the most basic version of all phases, then i add details to them, layer by layer. Example : it's now possible to play ships and structures, but none of the abilities they have that should trigger when these cards enter play can actually be triggered. While i do know at what point this should happen, for now there's simply no code there to do so - it will be added in later, when i start working on ability-related mechanics. To test if ships and structures can be played however, their abilities are not important.
Most of the general mechanics are still the same as in HD1. Over the course of HDs and HDx, there have been small changes to optimize things or to support new abilities or deckmods and environments, but in general, things are pretty much the same. As with HDs and HDx, HD3 will also introduce some optimizations and minor changes.
One of the first bugs i remember encountering when setting up the system for HD1 was related to cards entering play and being destroyed instantly. For instance : you launch a Thogrom Bomber and your opponent has a Spark in play. The ability of the Bomber (dealing damage to a random opposing ship) ends up hitting the Spark and the Bomber is the destroyed due to the Spark its ability. When a ship enters play, it sits in a short animation phase that allows it to fade in, as this looks nicer than the ship simply popping up in play out of nowhere. When a ship dies, the opposite happens : it fades out (while at the same time, an explosion animation plays). So the Bomber enters play and starts fading in, its played ability triggers instantly, then the Bomber is destroyed and it has to fade out. So the card is both fading in and out at the same time and the game crashes. My solution at the time (and still present in HDx) was to ignore the ship destruction during a fade in, but remember it and when the fade in was complete, the game would check if the card should be destroyed - if this was the case, the card starts its fade out and explosion animation. In the end, it's a minor thing, but it's one of those things that cause certain mechanics to work different in rare cases (i.e. when a ship is destroyed it sits in play for a few moments before starting its explosion animation, instead of doing so instantly).
In HD3, things are currently set up in such a way that this will no longer happen. The card entry animation now completes before the card is allowed to trigger any played abilities it might have. In the example of the Bomber and the Spark above, the Bomber would enter play and complete its entry animation, then its played ability will be triggered. If that ability were to hit the Spark, the Bomber can start its exit/destruction animation right away as the card is no longer in any active animation.
The bug and solution above are not the reason why this was changed, it's a matter of clarity instead. With the addition of auras (abilities that trigger when something external happens, like another card entering play), there might in the future be plenty of abilities that might go off when a card enters play - and these will all trigger at the same time and possibly produce visual effects as a result. It's good to have some time between one type of action (ship entry + animation) and another type (ship played ability + trigger abilities) and not trigger both types at the same time.
Another change has to do with card draws at the start of the turn. Since the game is set up such that players draw one card per turn, the most simple implementation of the card draw phase is to check if the player should have a card draw at all (maybe the deck is empty, or that player's hand is full, or an ability from the opponent is keeping the player from drawing) and then draw that card and start the main phase. Then the Data Cube card was added (back then, it allowed all players to draw an extra card), but the game couldn't support this ability. The solution back then was to update the draw phase so it could deal with no card draws, one card draw or a double-draw. This was done so that there was a clear distinction between which draw was the one-per-turn draw and which one was the bonus draw from the Data Cube's ability. This was needed due to the existance of actions that could keep your opponent from drawing a card - if your opponent played such a card, you would skip drawing the one-per-turn card, but not the Data Cube's draw.
In the end this level of detail wasn't really needed, and on top of that, this draw system caused many problems in HDs with other draw-related abilities. In HDx, there were no double-draw abilities, so the entire mechanics related to it was simply left out, causing the draw phase to be made much simpler again.
For HD3, i'm testing yet a different setup. During the draw phase, it doesn't really matter from where the player was granted draws or what caused a player to have no draws. Now the game keeps track not of whether or not a player has a draw (i.e. draw one card or draw no cards), but instead it keeps track of how many draws the player has (any number in other words). The draw phase will simply repeat until the player is out of card draws or until something happens that blocks all draws (deck is empty or hand is full).
For the current card set, none of this really matters, so i don't have to set things up like this - i could still use the HDx way of doing things. But, i'm thinking about future possible cards or environments. With this new system the following action is possible : 'all players discard their hand and draw that many cards next turn' - no other version of HD can support this action. HD3 can now also support an environment that allows players to draw enough cards until their hands are full, every turn.
Another mechanic that i'm currently looking into is the skip-combat status. This was added in HDx and when this status is active for a player, that player will skip their combat phase. Before HDx, when an action was played that caused the opponent to skip their combat phase, all opposing ships were simply disabled - it has the same effect, but the wording is wrong : the combat phase still happens for that player, but since all their ships are disabled, no ships get to attack. This also means that all those ships can't use abilities (as that's what disable does), on top of that, if that player has a way to enable their ships to attack, they still get to attack after all, since there's still a combat phase (even though it was supposed to be skipped).
The solution was to add in this 'skip-combat' status : the ships are not affected in any way, the player simply completely skips their combat phase. Now that player needs an ability that allows him to un-skip (is that a word?) this phase, or to have more than one combat phase, of which only one gets skipped. The implementation of this system in HDx, wasn't complete… the game is actually using a cheat : the player enters his combat phase, even if he is supposed to skip it, but the moment he does so, all ships are disabled, so none of them attack. Since the combat phase happens at the end of a turn, there's no harm in doing it this way as the player won't be able to activate cards in play after combat phase anyway, so it doesn't matter if those cards are disabled or not. The reason for this setup, is that it allowed a player to react to this status and play an action that granted one extra attack phase - that way a player who was about to skip their combat phase, ends up skipping one combat phase but still gets a proper one after the skipped one.
Again this is a problem of the way things are worded. There is a difference between 'player gets another combat phase' and 'player their ships attack twice'. Right now, the game is capable of only supporting one of these things at once - i would like the game to support both as there are some interesting things that can happen. If a player is granted a another combat phase, the entire combat phase is simply repeated - if that player's opponent caused them to skip a combat phase, there's still one left. If a player's ships attack twice, this is currently handled by the combat phase repeating : all ships attack from left to right, then they all attack once again - but this is actually not a correct solution : it would be much nicer if all those ships, one by one, simply attacked twice in a row. The difference here is : there's only one combat phase - so if a player's ships are set to attack twice, but that player has no combat phase, there won't be any attacking at all. On the other hand, if a player's ships are set to attack twice and that player has two combat phases, all ships will end up attacking 4 times.
Ships currently aren't capable of doing multiple attacks per combat phase, but if they were, it would open up a whole new category of abilities that the game could support - how about a passive ability on a ship that allows it to attack twice every combat phase? Or a crazy action that disables all but one of your ships and then gives that one ship additional attacks?
Sounds like fun and it would make the game more consistent when it comes to how these kinds of abilities are handled, but it's a complex matter to implement especially seeing how the combat phase in itself is already the most complex phase in the game. I haven't found a solution yet, but i might do something similar as explained with the drawphase above : simply make it so that the game can support any number of combat phases in a turn. Players then always start with one phase per turn - if their opponent plays an ability that forces them to skip a combat phase, that number goes down by one. If a player has a way to receive an extra combat phase, that number simply goes up by 1. Again, this setup would allow for an environment that gives two or three (or more) extra combat phases each turn (then imagine combining this with a deck mod that grants all ships in a deck a passive ability that allows them to attack twice each attack phase!). Or an action like this : 'skip a combat phase this turn, to receive one extra combat phase next turn'… lot's of exciting stuff will be possible once this is in.
Discuss this blog post in this topic on the NULLL forums.
15/12 - Drafting in HD3
As part of the core list of features for HD3, there's the 'Draft' game mode. It being a core feature means it has a very high chance of being part of the first release of HD3 (which will most likely be a beta at that point). It's also one of the new things since HDx that i'm most excited about. The ideas i have for competitive events will build upon the many different draft modifiers that are planned.
The general idea with drafting is that players are given a random (or semi-random) set of cards large enough to build a deck from. Players will only be able to use this set of cards for their deck and not any of the cards they've collected before, and this for a number of games versus one or more opponents. This is a gamemode where having good deckbuilding (or improvisation) skills is important, as players will have make the best of the set of cards they're given.
The current setup for playing a (non-draft) duel versus an AI controlled opponent is to first make a deck, then set up the game mode and various details/settings, then to accept and opening hand and the battle can begin. For drafts, players won't be able to use their premade decks, so they'll set up the draft game mode settings, then they are presented with a set of cards from which they can build a deck and then comes the opening hand and the battle begins. Seeing as there's a fair bit more involved before a battle can start, the default setup for draft games is marathon rather than a single duel. This allows players to refine the deck they've made between battles, instead of having to build a entirely new deck for every single duel. The length of the marathon (i.e. the number of duels) can be set, and i'll probably add a setting that determines how quickly the opponents grow in strength. Another advantage of a marathon style setup, is that the original pool of cards from which players build their decks, can change over the course of a marathon - example : every time a duel is won, a few random cards could be added to this pool, giving the player more options to improve their deck, or even build a completely new one.
Randomness will play a big role in a setup like this, so the initial pool will likely be generated semi-randomly. Starting with races, similar to how players can choose two races for a generated deck, i might offer players to choose two races for the draft card pool as well. The first race could then make up 30% of the pool, then second race 20%. Cardtypes need to be carefully generated as well - in a fully random setup, you might end up with plenty of ships and actions, but no energy structures. To deal with this, a card pool could always generate a minimum amount of ships, structures and actions.
Before draft can be implemented, the game needs to be capable of running default duels first. Now that the opening hand screen and related mechanics have been implemented, work has already started on the layout and rendering of the combat screen. Once that part is done, i can start on actual combat related code (the different combat phases, playing or activating cards, ship vs ship combat, abilities, and AI).
08/12 - HD3 battle setup
The battle setup screen in HD3 is where players can set up a single duel against the AI - similar to the quick fight screen in HDx. In general, what this screen allows players to do, isn't too different from what could be done in HDx : there will be plenty of game modes, deck mods and environments to choose from.
The final list of game modes, deckmods and environments isn't ready yet - i have some ideas for new entries for all 3 categories, but all of these things have to wait until the game is at least capable of handling a single default duel.
While the battle setup screen is complete, right now, it's nothing more than an UI. It has some placeholder game mode, deckmod and environment names, just so i could test the UI and make sure it's capable of handling anything that might be added to the game in the future. The main reason why i wanted this screen in the game at this point is because it is the logical step between creating or editing decks on one hand and playing a duel on the other hand.
The layout of this screen is a bit different compared to HDx. In the alpha phase of HDx, players pointed out that the screen was quite complex and possibly overwhelming for new players, so a 'simple mode' was added, which removed most of the detailed options. This 'simple mode' was the default and players could opt to switch to 'pro mode' to have access to plenty of battle options and settings.
For the time being the battle screen only has one mode, i'm hoping the new layout will make it easier to use compared to the HDx version.
Here are some screenshots of the screen in its current state (there will be placeholder text in various locations).
screenshot 1 - screenshot 2 - screenshot 3
At the top there are 5 buttons, which are placed in the most logical order for setting up a new game. Each of these buttons brings up a new panel in the center of the screen where settings will appear related to the chosen section. This panel comes with a relatively large info label providing details and help messages for the selections players make (for now it's empty as the details of the various game modes and such haven't been implemented yet. Under the top bar with the 5 buttons there's yet another infobox, this time providing some general info on the selected section. At the bottom of the screen, players will be shown a summary of their setup, most likely to include droprates and such. For now this box contains placeholder info for most screens.
First comes the game mode choice (screenshot 1), then deck selection for the player. Deck selection comes second since it might be affected by gamemode - there are a couple gamemodes that are planned that don't use a deck (draft for instance). Deck selection itself is straightforward - either pick a deck you made before or let the game generate a deck for you. Next, players get to do the same thing for the opponent(s). The plan is still to support up to 4 players, so there could be up to 3 opponents (or 2 opponents and an ally). For each of these, the races and difficulty of a generated deck can be chosen (screenshot 2). Deck mods (screenshot 3, with placeholders, obviously) and environments function similar as in HDx : each player can have up to 3 different deckmods and the battle as a whole can be subject of up to 3 environments.
As with HDx, your favorite setups can be saved into a preset, so it may be recalled at a later time.
Since this screen is mostly an UI without actual content right now, it didn't take that long to implement. The next step i'm working on currently, is the opening hand. Before the opening hand can be implemented however, all the preparations for an actual battle need to be taken - this is where the game generates decks for players, applies deckmods and difficulty settings.
A lot of stuff has to be prepared the moment the 'play' button is clicked in the battle screen, to make sure the opening hand screen can be shown and a battle can take place.
01/12 - HD3 ability system
Hydranought has been released on Kongregate and Newgrounds. The game needed a small patch with some typo and graphical fixes, but plenty of work has been done for HD3 as well.
As explained in previous blog posts, HD3 will have a new ability system and while most of this is technical and behind-the-scenes stuff, it has some effects visible to players, too.
In previous versions of the game, cards could have max 3 abilities and there was room for only one of each of the 3 ability types : played, automatic and activated abilities. This setup worked for most cards, but it could not support a proper 'passive' ability system - the 3 main ability types are all abilities that trigger at a specific point (when a card enters, at the start of a turn, or when the card's owner activated the card). Passives are abilities that should be active at all times - older versions could mimic this behaviour but it wasn't very efficient.
In HD3, passive abilities become a proper seperate ability class, as well as 'auras', which are also always-active abilities, but they're relying on external triggers (for instance : whenever a ship is destroyed, or whenever a ship enters play, etc).
The limit of one ability per type per class was convenient as it made the data structure for cards simple : there were three values for abilities - if zero, the card simply didn't have an ability of this type, if not zero, the actual value would point to the ability the card has. In HD3, only activated abilities are limited to one per card, all others can appear multiple times. This requires a more complex way of storing an unknown amount of abilities of multiple ability types. I have a system in place now that is working well thus far for the card popup and the detailed card info panel. It will take until the actual combat is implement before i know for sure if the system is good enough in its entirety.
While i don't have any plans to drastically change the current card set and start giving these multiple abilities, there will be cards with two auto abilities without these being different from how they work in HDx. Have a look at the 'Flare Spire' card, a Human structure (wiki page here). Its auto ability causes it to generate 1 solar energy each turn and deal one damage to the opposing base. In HDx, there are also cards that only generate 1 solar energy as their auto ability and there are cards that only deal damage to opposing base as their auto ability. While HDx does re-use some of the code to handle the latter two when the first ability needs to be handled, these are in essence 3 different abilities.
It's clear that the first ability is basically the same as the two other abilities combined. In HD3, Flare Spire has two auto abilities : one that generates energy and one that deals damage. The card still functions the same and the card popup is near identical to the one in HDx - but, if you look at the detailed card info panel, it becomes clear that there are two auto abilities (see the screenshots below - ignore the placeholder vector image in the card popup).
For the player nothing much changes in this example. For the code that processes abilities, this card is a tiny bit more complex, but there's one less ability the game needs to be able to process. At the start of a turn, when all auto abilities trigger, the game will simply run through all auto abilities on this card and process them one by one.
There will be more cards that can benefit from this system. In the end, the game will require less code to process abilities as there will be less abilities, the same goes for the AI, who will need less code as well.
And, also very important : it's a lot easier now to create cards that need combinations of auto abilities. In HDx, i had to make a new ability, even if the two auto abilities it was made of, already existed in the game. Now, i just need to give the card these two seperate auto abilities.
Next, i'll get started on the layout of the 'battle' screen, which is the HD3 equivalent of the quick fight screen in HDx. I have some sketches ready to be implemented in the game already.