Saturday, March 22, 2014

The Cycle Begins Again #3: Hero Powers and Concept Art

Because it has been a little bit, I decided to do a quick update while I take a break from designing. Here's what I have been working on the last few weeks, TCBA-wise:

  • Creating a design document (all the details about the game)
  • Acquiring a personal copy of Adobe Flash
  • Sprite creation in Flash (had problems importing previous work, had to start over)
  • Sprite animation in Flash
  • Collaborating with Tyler about art
I've had quite a bit going on, especially between this project, my other classes, and the increased hours and new location at work. To be honest, I should be working on Trigonometry or Java programming right now, buuuut... nope : ).
First, I want to debut some of Tyler's work on the background so far, because it is coming along very well. Tyler and I have a pretty good history together and he has some way of knowing exactly what I want even when I'm constantly shifting ideas around. His work on TCBA is no different than before- he nailed was I was looking for! Because of the size of the picture (I think its width is 6000px?), I am going to upload a small piece on this blog. The full picture can be found here. (NOTE: This is not a finished work, just a concept design we've got. This could change drastically by May.)
So, let's talk momentarily about the art style I am looking for in this game. I want a clear distinction between the foreground and the background, both for the contrast it adds to the game and to help the player know what areas are pathable and what areas are not. The left side of the gap is an older version of the art. The hill is pixelated on the edges and the grid on the grass increases the blocky look. The right side is much more of what I am looking for. The foreground where the player walks is very clear- the green, single-color grass line is the pathable area the player can walk on. The hill in the background has the sharp blades of grass and some blurring on it, which gives it a nice smooth look compared to the simple foreground. To be clear, just about everything in the foreground will be pixelated- enemies, the Player Character, pathable blocks, etc...

To give this post a little more meat, I am going to copy and paste some information from the design document I mentioned earlier that details the hero's combat ability (and again, please note that this information can still change before the completion of the project.) In the near future I should have the player walking and stabbing. By that point, I should have enough knowledge to begin the coding of the game.


Section 2: Combat
Second only to the story, combat will be a major focus of the game. The player will have two different fighting styles: melee and magic, which acts as a ranged attack. Both styles have different strengths over the others.

Section 2.1: Melee Combat

Melee combat will bring the player up close and personal with his enemies. The risk of this style of combat is obvious- being so close to the enemy means that the player is more likely to be hit and take damage. The player is awarded for choosing melee combat as their focus for battle with increased damage per hit. Melee damage will be determined based on the base attack value multiplied by the Strength Level Bonus percentage detailed in the Experience and Leveling section. Melee combat will primarily be focused on heavy damage versus a single opponent, making it ideal for boss battles. The player will be less effective vs mobs of enemies, but will be given multiple options to assist them vs large numbers of enemies. It is important to note that by leveling Strength, and thus the melee capabilities of the player, the player is also increasing his characters' movement speed.
Melee attacks is performed by pressing “H” on the keyboard. This is a basic attack, and is equal to the base attack value multiplied by the Strength Level Bonus. As the player progresses his Strength level (not his overall character level), he will gain additional abilities to aid him in melee combat. The first will be Shield Block, which will make the player invulnerable for a short period of time, allowing him to escape from a mob at the sacrifice of not being able to attack for a short time. Shield Block is activated by pressing “J” on the keyboard. The second ability gained by leveling Strength is Bash, which will knock enemies in front of the player away from the player. Bash is mapped to “K” on the keyboard. The final ability the player will gain will be his mob-clearing ability, Whirlwind. Whirlwind will damage enemies on both sides of the player. Whirlwind is mapped to “L” on the keyboard. The three special melee abilities are designed to potentially worked in tandem. An example of a possible combination would be the player using Shield Block to charge into a mob of enemies, Whirlwind to damage all the enemies around him, and then Bash to push back one side of enemies to allow the player room to maneuver. All melee special abilities will be cooldown based (e.g. 3 seconds) as opposed to mana based.

Section 2.2: Magic Combat

A basic magic attack will allow the player to attack from a short- to medium-range. Because the player will be further away from his opponent, and syllogistically further from danger, a basic magic attack will do less damage than a basic melee attack. Damage for magic attacks will be scaled in the same manner as melee attacks- base attack value multiplied by Magic Level Bonus. The Magic Level Bonus will scale at a smaller amount per Magic level than the Strength Level Bonus will per Strength level. Magic combat is based around the spells the player will gain by adding points to his Magic level. Spells will give the player the player a balance between mob-clearing abilities and single-target damage. In addition to increasing the damage of the basic magic attack and giving the player more powerful spells, adding points to the Magic level will also increase the player's maximum mana pool, allowing them to cast more spells before waiting for the mana regeneration to kick into effect.
A magic attack is performed by pressing “Y” on the keyboard. This is a basic magic attack whose damage is equal to the Magic Base Value multiplied by the Magic Level Bonus. A basic magic attack takes no mana, and can be fired at a medium range. As the player progresses in Magic levels, he will gain spells that will ramp up his abilities, trading off the lower damage of magic attacks vs melee attacks for the ability to do burst damage. The first spell the player will gain is Blink, performed by pressing “U” on the keyboard. Blink will allow the player to teleport away from a situation that may otherwise kill him. Blink is a low mana and short range spell. The second spell the player will gain is a combination of two spells, Firebolt and Fire Blast, performed by pressing “I” on the keyboard. For bolt will be cast is the player is moving left of right when pressing “I”. Fire Blast will be cast if the player is stationary when pressing “I”. Firebolt is a single-target ability, ideal for doing a consistent amount of damage to a single enemy. Firebolt will deal damage equal to the Magic Base Value multiplied by 2.5 times the Magic Level Bonus. Fire Blast is an Area-of-effect ability, dealing damage to all enemies within a short radius around the player equal to the Magic Base Value. The third spell the player will gain is Lightning Bolt, performed by pressing “O” on the keyboard. Lightning Bolt will deal a random amount of damage between the Magic Base Value (the lower range) and Magic Base Value multiplied by the Magic level. This means Lightning bolt can do very little damage, or an extreme amount of damage. The final spell the player will learn is Ice Lance, performed by pressing “P” on the keyboard. Ice Lance adds the “frozen” status to enemies it hits, slowing their movement by 25% for a short time. Ice Lance also does Magic Base Value damage multiplied by the Magic Level Bonus, and pierces through enemies, dealing its damage and effects to at most three enemies.

Section 2.3: Defensive capabilities

The player will have a few different defensive options to increase his survivability against his enemies. By adding points to strength, the player's movement speed is increased a small amount. Speed will be stored as a floating value to allow for miniscule manipulation of the movement speed every level. As detailed above, Shield Block will render the player invulnerable for a short time, and is gained by adding points into the strength category. Blink is obtained by putting points into the Magic ability, and allows the player to teleport short distances around their opponents. Lastly, the player will have the ability to attempt to block their opponents' attacks. To perform a block action, press “S” on the keyboard. Block is not a guaranteed save- it is a percentage chance to block the incoming attack. If the player successfully blocks the attack, only 25% of the damage will be sustained (as opposed to Shield Block, which renders the player invulnerable and blocks 100% of the time.) If the player fails to block the attack, normal damage is taken. While pressing the block button, the player will be unable to attack his opponents. To increase the chance to block an opponent's attack, the player may add points to the Armor ability.

Friday, March 7, 2014

The Cycle Begins Again #2: Character Leveling

Despite not making an entry since the beginning of the project, I've made a large amount of progress! To start, I have finished the basic player sprites, and have moved on to the rough draft of the enemy sprites. In other great news, I got in contact with Tyler, who will be doing a good chunk of my graphics for the game (which I am really excited about- he's great with taking concepts and fleshing them out into pictures!) We talked for a couple of hours the other day, got a lot of details ironed out about gameplay, game style, character movement, the artwork... But much of what we talked about will come in another blog entry after he finishes a draft of some of his work, which will allow me to give better information on it.
I didn't mean to move into character leveling so soon, but I was bored in class one day and didn't have access to my laptop.Keep in mind- these ideas are preliminary, and only beginning to flesh out. If you have input, let me know!

Leveling - Experience
I decided to make the leveling system experience-based in addition to stage-based. Experience will be awarded through standard means- you kill baddies, you get the XP. Every level will start the PC at 0 XP. The reason I decided to reset the XP after every level was merely for coding purposes: if I am to code an experience bar, I will have to do fewer calculations to get everything to display properly. The amount of experience needed to level will be a decision I make later, but I will likely set it to a percentage of a base value, a trend you will see a lot in my leveling system as I explain the PC's stats. A code example labeled "Level Up Code Example" at the bottom of this entry will give the programmers here a better idea of where I'm going with this.
In addition to getting experience and levels from defeating enemies, the PC will also gain a level at the end of each stage (four stages in total, which will be detailed in just a little bit.) This level will not affect the XP of the PC- rather, it will just increment all of the stats talked about below and give the player a stat point to spend on one of the four categories. The reason I am giving levels at the end of the stage is so players who do now wish to kill every enemy will still gain some strength before moving on to harder levels.
Leveling - Character Stats
The other part of PC leveling that needs to be discussed are the stats: Strength, Magic, Dexterity, and Vitality. The way these stats (and their sub-stats) work is each will have a "base value" set to 1, because the PC starts out at level 1. When the PC gains a level, or when the PC completes a stage, the base value of every stat will increase by 1. Additionally, when the PC gains a level or completes a stage, the player will gain one skill point he may choose to spend in one of the four categories. As you read through the information below, keep in mind it would be possible to overload one stat and make, for instance, a character that kills everything in one hit. Conversely, that character will likely die very quickly as well.One other note I would like to make is that the stats, how they are affected by leveling, and the sub-stats contained by the four parent stats have been changed numerous times in the last couple days as I consider different ways to balance them. Input, as always, is appreciated.

  • Strength: Strength will affect the melee damage done by the player, as well as the armor rating of the player. 
    • Melee Attacks: Melee attacks will do more damage than basic ranged magic attacks because it is more dangerous being up close and personal. Melee damage will scale by a percentage based on the base attack value. When a point is put into Strength, the base value will increase by 1, and the bonus damage will be increased by a small amount, like 25%. So, if a level 3 player has put all his points in strength, he will have a base value of 6 (3 for being level 3, 1 point that is given as a freebie at the start of the game, and 2 for leveling up), and his damage will be 10 (6*175%, 25% for each point spent in Strength... notice I'm rounding down). If I have time at the end of the project, I would like to add in special abilities, namely an Area of Effect attack like Whirlwind or a knockback attack.
    • Speed: Speed determines how fast the character will move. Unlike melee attacks, speed will not be rounded, because in Action Script 3, the language I am coding in, changing a speed value by even 1 is a very noticeable difference. Like melee attacks, base speed will increase by a small amount every level, and when the player chooses to put a point in Strength, the character's overall speed will be increased by a small amount.
  • Magic: Magic has two forms of use- a basic magic attack that acts as a mid-range attack and a spell-casting component based on mana.
    • Magic Attacks: Magic attacks will allow the player to attack from a distance, at the sacrifice of a higher damage yielded from leveling strength. Like melee attacks, putting a point into magic attacks will increase the base value of its damage by 1 and scale the damage by a small percent. Magic will be rounded down to the nearest whole number.
    • Mana Pool: Putting a point into Magic will increase the maximum mana a player can pool, which is used to cast special spells. This will not be scaled by a percent. 1 point into magic may increase the mana pool by 5 or 10 per level.
    • Spells: By investing in magic, the player is sacrificing direct damage for ranged attacks and special abilities. Magic will allow the player to cast a few different spells that will draw mana from the mana pool. The spells category is probably the least fleshed out concept so far, as this is technically an optional addition to the game. The difficulty of this section is the addition of sprites I would need to create in the already limited amount of time I have. My plan is for every x number of points in the Magic stat, the player can choose a new spell to learn from a small selection.
  • Armor: Armor has two different components that reduce damage when leveled up.
    • Armor Class: Armor class will directly reduce incoming damage when the player is hit. This effect is passive- it always works, and it always on. Armor class is the only sub-stat that starts at a base value of 0 (meaning damage is not reduced when the player is hit), and only gains value when the player invests a skill point in it after leveling up. The way AC works is if the enemy hits the player for 8 damage vs the PC's AC of 3, the PC only takes 5 damage.
    • Chance to Block: The player will have a defensive option to block while in combat. Toggling the block feature activates the ability for a short time, rendering the PC unable to attack for a short time while he "focuses on defending" (probably a 1 - 2 seconds.) While toggled, the player will have a chance to block 100% of the damage from incoming attacks. The block feature is The Cycle Begins Again's escape function, kind of like a teleport. Chance to block will start out around 10%, and will probably increase by 5-10% / level (I may make it 10% at first, and between 50% and 75% make it a 5% increase / level, make a 75% chance to block the cap.) After a little research, it looks like AS3 provides multiple ways to produce random numbers... I'll have to do a little research and see if there are any differences between methods.
  • Vitality: Vitality will make the player live longer, and regenerate mana and HP faster.
    • Hit Points: Hit points, like any game, is the amount of damage the player can take before dying (and, as Tyler pointed out the other day during our planning session, I have no idea what I am doing for lives). I think I am going to keep hit points as a whole number, rather than play around with decimal places, just to keep it nice a clean (again, note that I am rounding the damage done). Hit points will have a base value and will increase by a constant rather than a percentage (this may change). If the player has 10 hit points and levels up, they would gain an additional 10 hit points for leveling, then another 10 for a total of 30 HP if they chose to put their skill point in Vitality.
    • HP Regeneration: HP regeneration will be the rate a player recovers HP after taking damage. I will probably put a timer on it so it takes 5 seconds to start regenerating after taking damage. HP regeneration will be a bit more tricky code-wise, so the compromise I have come up with involves a couple extra variables, and will involve research in timers for AS3. Until I have a little more solid idea of how I am going to do the coding for the HP Regen, I am going to hold off on details
    • Mana Regeneration: Mana regeneration is the rate the player recovers mana after casting a spell. Unlike HP regen, I probably will not link mana regen to a timer, so as soon as a player casts a spell his mana will begin regenerating. Mana regen follows the same coding concept as HP regen, so like I said before, I'm not going to get into it right now.

I've got a bit of a concept for the Char Stats screen as well, but that is pretty far off and a low priority right now. I found out I can rent the Adobe Flash software for $20 / month, so I will probably invest in that for at least a couple of months, which will buy me some extra time to work on the project from home, rather than only in-class time (which would simply not be enough for this project.)

Question from Anon:Interesting behind the scenes! Not sure the magic has a purpose yet. is it worth it or just a detour?
Answer:Let's do some pretend numbers here: If the screen size = 10 units, and melee attack let's you hit an enemy from no further than 1 unit away, a basic magic attack may allow you to attack your opponent from 5 units away, allowing the player to "kite" their opponents (aka shoot, run backwards, shoot, run, etc...)
The other thing the magic category will have is its spell selection, which will give the player some AoE capabilities, as well as stun, or DPS spells to fight bosses. So even though a basic magic attack has a lower dps value vs a melee attack, the idea is for it to make up a bit of the firepower through the use of spells.

Level Up Code Example
Unfinished code segment. This would likely be a method call as well, but this is the concept I'm going for! The language used below is ActionScript 3.0
final var BASEXP:int = 1000; (This is the base XP value, which doesn't change)
var levelUpXP:int = BASEXP; (levelUpXP is the value the player must hit to ding!)
var playerXP:int = 0; (The amount of XP the player currently has)
var levelIncrement:float = 1.00; (The percentage we will scale the levelUpXP by to make levels more difficult to attain)

So, to put some fake numbers in to give a better insight: 1) if our PC's experience exceeds the amount needed to level, then 2) set our PC's XP back to zero, 3) make the level XP cap 50% higher, and 4) set the value of the level XP cap to the proper amount.

1. if (playerXP >= levelUpXP) {
2.  playerXP = 0;
3.  levelIncrement += .5;
4.  levelUpXP = BASEXP * levelIncrement;

If the player was leveling from level 1 to level 2, then his XP would be set back to zero, levelIncrement would be 1.50, and levelUpXP = 1000(BASEXP) * 1.50 = 1500. The PC would need to get 1500 XP to go from level 2 to level 3, and would need an additional 500 XP every level under this code block.