Bowmaster Winter Storm Beta Update 0.1.0.9

This week’s Bowmaster Winter Storm update includes Graphical updates, bug fixes, new “Elemental Blast Bomb” upgrades and new “pest” dragons which are faster, smaller, but weaker versions of dragons.

Updates:

Blast Bombs: To re-iterate, the blast bombs (which were introduced as a bonus earlier this week) are a counter to the “reactive objects” like fire and poison ooze. They are also useful at diffusing dragon fireballs before they reach you if you detonate the blasts in air by hitting “F”.
Pest Dragons: You wanted a good use for the Flak Bomb Arrow. Well now you got one. These little guys are small and fast but weak. A single arrow or a well placed Flak bomb explosion should take them down.

Increased the size of the background trees. Removed the snow from the trees (for now).

Significantly increased the hit points of the cottages and large tree.

Gold awards are given for all enemy kills (even kills caused by bombs or your allies).

Reduced the total number of elemental dragons that can be on the screen at once.

Allied units garrisoned in buildings no longer take friendly fire damage from hero projectiles. This means that if you’re hero is occupying a stonekeep along with archers, you may shoot at any angle without worrying about hitting them.

Friendly fire from hero projectiles now only occurs at medium to long range. Close shots will no longer hit nearby allies. This should help reduce friendly fire when shooting from ground level when there is no higher ground to occupy.

Fixes:

Fixed the pesky Victory Banner freeze bug (Thanks CarnageX for installing the flash debug player and helping me find the root cause of the bug)

Fixed issue that caused the game to hang if a bomb explosion did damage to units at the edge of the screen.

Automagically Optimized Flash Graphics Experiment

There have been some questions as to why some of the graphics in Bowmaster Winter Storm are more detailed than they need to be (see this forum post). This prompted me to share my findings on Flash’s automagical ability to optimize graphics.

I’ve done various graphics performance tests and experiments over the years but haven’t really shared my observations. One of the tests was to determine how much the Flash player optimizes graphics on its own without the use of developer code (e.g. cachAsBitmap) or graphical modifications (e.g. Modify >> Shape >> optimize).

In this demo the frames per second is displayed to indicate performance. The native flash fps setting published for this animation is 35 so the fps reading will never go above this number.

The animations displayed use both lines (red) and fills (black) and have lots of point data (more detail than you can see at the default zoom level). The animations use both shape and motion tweens. The motion tweens change the scale, rotation and color properties. No code or graphics techniques have been used to attempt to optimize these animations.

What this experiment will demonstrate is Flash’s ability to optimize graphical performance without the use of any additional developer tricks.

These experiments require that you perform the steps mentioned in order to see the expect results. Specific results will vary depending on your CPU speed but you should still be able to notice trends.

Get Adobe Flash player

Download Source

Experiment 0: Observer Animation As-Is
Expected Results: FPS should be below 35
Conclusion: The graphics are too much for the CPU to process at the optimal speed.

Experiment 1: Off Screen Performance
Steps: click-hold-drag animation off screen
Expected Results: The FPS should jump up to 35
Conclusion: Flash does not use up CPU to render graphics that are off screen.

Experiment 2: Scaling and Performance
Steps: Click “reset” button. Scroll the mouse wheel to change the size of the animations. Expected Results: When the animation is made really small the performance increases. When the animation is made really big, the performance my also increase as other animations no longer fit on the page (similar to Experiment 1) or decrease as more detail is visible for the animation that is still on the page.
Conclusion: Flash optimizes graphical processing according to the size of the graphics. Even if the graphics are highly detailed natively, if they are made really small then Flash is able to use less CPU.

Experiment 3: Adjusting the Built-In Quality Settings
Steps: Click “reset” button. Click on the quality toggle button labeled “high” by default.
Expected Results: The performance will increase significantly (without moving or scaling the animation) as the quality setting is decreased.
Conclusion: Flash is able to reduce the processing load of graphics by reducing the quality of the graphics. What is significant about this is that the quality settings can be changed on the fly with a simple line of code. In other words, it is very easy for a developer to make a global change to graphics to improve performance without having to manually change the native graphics (which can be a time consuming process).

Summary

We can see that Flash does a lot to optimize graphics on its own. Flash seems to perform some sort of culling to reduce CPU load by not rendering graphics that are off screen. Flash also seems to optimize graphics that are still on screen but have been scaled down in size. It’s as if the extra detail that exists in the native graphics that is too small to see is not being processed by the CPU. And finally, we see that by changing Flash’s built in quality settings we can drastically change both the performance and graphical quality of a Flash animation.

Every project is different and it is no trivial task balancing quality and performance. If the project is light on animation but heavy on graphics then performance can be sacrificed to improve graphical quality. But with game development users want both. Game developers must determine how to spend their time (a limited resource) and understanding Flash’s built in graphical optimization functionality is essential for determining how to prioritize application development efforts.

Bowmaster Winter Storm Beta Update 0.1.0.8.1

This update fixes some issues with previous Friday’s release along with adding cool new upgrades. One of the major issues with adding damage-over-time is that it is more challenging to balance than single instance damage. The developer must consider duration and frequency as well as magnitude of the effect per tick. The initial release had some major balance problems, namely if your character was hit with a poison glob it would it would mean certain (eventual) death. You could counter this with the Fairy Bomb but the game needed a better solution. Hence, the “Blast” series of elemental upgrades was developed. These are low powered elemental bomb-like arrows that cause elemental shockwaves. These are mostly to serve as defensive abilities since the damage-per-mana-cost should be prohibitive for attacking. Nevertheless they may be useful against groups of elementally weak units. However, the true advantage to these new skills is to clear away pesky reactive objects that are causing damage to you or your allies. So let’s say a Trebuchet landed a fire bomb right on top of the cottages you’re trying to protect. Now the cottages are on fire. What do you do? WHAT DO YOU DO!?!? Easy, just hit the homes with a Frost Blast arrow. Problem solved. Have an annoying glob of poisonous ooze stuck to your face? Have no fear. Just shoot a Cure Blast arrow at your feet and PoOF! – no more oozy face and your pours never looked so good. These blast bombs are the genuine article. Step right up, don’t be shy. Hurry while supplies last!

With your purchase includes (at no additional cost!) detonate-on-command-ability. Simply press ‘F’ while a blast bomb arrow is in air to detonate it. This technique is essential for demonstrating the blast bomb’s other important defensive trait: the ability to destroy incoming elemental projectiles. This is very useful against incoming fire, ice, and poison dragon ball attacks. If you collect all elemental blast bomb skills you’ll have the opportunity to purchase the Omni Blast skill which is infused with all magic of all elemental types and can be useful for defending against multiple types of elemental attacks at once.

As an added bonus, normal elemental arrows now also have the ability to cancel the effects of elemental entities. If there’s just a single flame threatening a single cottage and you have the Ice Arrow skill then just use that to put out the fire. You’ll need to experiment to see what’s more mana-cost effective, but at least now you have options.

Calling all Beta Testers

Bowmaster Winter Storm Beta is now playable if you haven’t noticed. The game is constantly evolving with new updates every Friday (so far so good). Due to the frequency of changes it is not always possible to fully test the game and sometimes new features cause new issues. It is because of play testers like you that report new issues (see contact form) we’re able to find and fix bugs before the game is fully released. For this LostVectors is truly grateful. However, if you want to be even more helpful here’s how.

Download and install the debug version of the Flash player for your preferred browser (warning: read on before installing):

http://www.adobe.com/support/flashplayer/downloads.html

This works similar to your normal player but in the event of an error a popup window will appear with detailed information about what caused the problem. You can then copy this message and send it with your bug report.

WARNING: If you choose to install this debug player your eyes will be opened to how often in general Flash content has errors. This means that you may see error popups when visiting other sites with Flash content. With the normal Flash browser plugin, any errors that occur are simply swept under the rug for no one to see. The application fails silently and in some cases the bug may not have a significant impact on overall functionality. These runtime errors can be the fault of the developer not handling error events such as loading errors, or it can be caused by traditional runtime bugs like null pointers.

If you choose to install the debug player you can always reinstall the normal flash player if you wish.

As always if you decide to report a bug then please be as specific about the situation when the bug occurred along with any instructions on how to demonstrate the bug.

Bowmaster Winter Storm Beta Update 0.1.0.8

This week’s Bowmaster Winterstorm update includes fun new weapons and tweaks to old ones that are made possible by new “reactive elements.” Watch out for dangerous poison ooze globs and blazing fires that are generally not fun to stand in as both you and your enemies will soon discover. Also in this update is a new tree to climb. See if you can figure out which one it is. Here’s a clue: it’s generally big and a little bushy.

www.lostvectors.com/winterstormbeta

Updates:

New reactive elements: Flame and Poison ooze. These are the initial steps towards creating reactive elements that not only affect game units and objects in specific ways but will also react to other kinds of reactive elements. For now these two elements just do damage to objects. In the future when other reactive elements are added like Ice then we’ll see elements react with each other. For example, Fire and Ice will have a canceling reaction effect. Other possible reactive elements include pitch (oil), cure dust, gun powder, water.

Fire and Poison arrows have been enhanced to make use of these new reactive elements.

New Upgrade: Fire Bomb – explodes into a few fireballs that cause the areas they impact to catch on fire.

Poison Bomb enhanced to now explode with a few poison ooze globs in addition to the poison blast wave.

Added climbable tree that acts just like a tower but it only blocks shots that hit the tree’s main leafy areas (and not the base of the tree).

Improved structure death animation. Structures that are now destroyed are slightly darker.

Reintegrated and improved projectile streak visuals as seen with fire and poison arrows among other places.

Catapults and Trebuchets for both teams now have a chance of firing a fire bomb projectile that acts similar to the Fire Bomb arrow upgrade.

Poison Spitting Monsters now leave globs of ooze on impact with the ground or a unit.

New damage popup text for poison and fire reactive element damage.

Note: Several of these features are experimental and may need further testing and balancing. If you notice any problems or bugs then feel free to contact us.

Bowmaster Winter Storm Beta Update 0.1.0.7

This week’s update includes some cool new features. Enemy Mages and Pikemen are new and improved, the User Interface has some new enhancements, and in general the game is enhanced with some balancing and bug fixes. Enjoy!

Play Winter Storm Beta

Mages:

Mages now have magic shields. These shields essentially block projectiles from hitting the mage and also any ally within the radius of the shield. Shields are larger and have more hit points for higher rank mages.

Tip: Evil Army mage shields are generated by pure Dark magic. They are extremely weak to Light elemental attacks but they gain energy from Dark elemental attacks.

Two types of Mage behaviors are now randomly loaded for each mage:

Support Mage AI: Focuses on healing allies and conserves mana for only casting healing. Will start casting healing as soon as any ally has even just a scratch. Seeks out towers to gain cast distance bonuses but will leave a tower to move towards an injured ally that is out of range.

Attack Mage AI: Focuses on casting magic attack orbs that seek out enemy targets. Will only heal nearby allies if they conveniently in range and are in dire need of healing (hp below 25%).
For now mages have a 50/50 chance of being assigned either behavior upon creation. They will use this behavior for their entire lifetime. This design may change in the future.

Pikemen:

Pikemen helmets are now correctly loaded by rank (better helmets are loaded the higher the rank).

Helmets are now degradable. If you hit a helmet enough times it will eventually pop off the unit’s head leaving his critical hit area exposed. Higher tier helmets have more hit points but currently no pikeman helmet is indestructible as was the case before. At the time of this update, these helmets are highly resistant to all physical attacks (slice, pierce, blunt) but are neither strong nor weak against Elemental attacks. Tip: use any elemental arrow (e.g. Fire arrow) against helmets instead of the Basic, Pierce, Blunt, Slice or Fork arrow.

Other Updates:

New UI Feature: Newly purchased bow skills are automatically placed into available slots in your action bar so you no longer have to manually place the skills from skill book when in game. You still have the ability rearrange you action bar. If there are no empty slots then newly purchased skills will not be placed.

Tip: you have multiple action bars so if your active action bar is full then look to one of the other action bars for newly purchased skills by clicking on the up/down action bar buttons located to the right of the action bar or by scrolling with your mouse wheel.

Tip: A quick way to alternate between multiple bow skills is to place your desired skills in the first slot of each action bar row. Then all you have to do is scroll up or down with the mouse wheel to change to a new skill.

Tip: You probably already know that you can quickly access action bar skill buttons by pressing the corresponding number. You should also know that you can quickly access skill mods by pressing SHIFT and a number key that corresponds to the mod you want.

New UI Feature: Number of remaining enemy units is now displayed in the Evil Army health status bar at the top right.

The Evil Army size now grows in size more gradually each level.

The maximum Evil Army size is reached at a later level than before and has been reduced from 150 to 80 in order to prevent levels from lasting too long.

Added flak bomb explosion sound effects.

Fixed some animation issues with catapult, trebuchet, and shield grunt.

Fixed issue with Wacky Bomb and Chain Lightning costing very little mana.

localToGlobal, globalToLocal, locoToLoco

This week’s BMWS update is the result of some significant technical milestones both recent and past that enable the new Mage and Pikeman features. The new Mage magic shield and the Pikeman helmet features are brought to you by some nifty utility functions.

One of the significant challenges in flash games is being able to manage and use coordinate systems. Every MovieClip has its own relative coordinate space and may be a parent to any number of children MovieClips (each with their own coordinate spaces). To make maters more interesting, these MovieClips can be skewed, scaled and rotated independently meaning that their coordinate systems rarely lineup with the global coordinate system.

With respect to game objects represented by one or more MovieClips, it becomes tricky when you want to determine how to compare coordinate information from one game object to another. For example, the GameLevel MovieClip may contain a PikeUnit and within the Pikeman there are multiple body parts, one of which is a helmet. Let’s say that the Pikeman is in the middle of the GameLevel screen at position 1000 (out of a total width of 2000). The Pikeman’s helmet, however, exists in the Pikeman’s coordinate system and relative to the origin (where the feet are) the Helmet is at position -50,0.

The goal of this last BMWS update was to allow for armor parts to pop-off if the armor takes enough damage. The challenge is how do we take a helmet that is at position -50,0 and exists in the Pikeman MovieClip and place it in the GameLevel MovieClip as an independent object in a spot that is virtually the same spot but in a new coordinate system.

You can’t simply take the helmet and place it in GameLevel with “addChild” because the Helmet’s previous x/y coordinate values are preserved. So doing so will place the helmet at position -50,0 relative to the GameLevel’s origin which is at the top left portion of the screen and thus using GameLevel.addChild(Helmet) will place the helmet at the left edge and slightly below the top of the screen). We run into similar issues with respect to scale and rotation.

The key to solving this issue is understanding these MovieClip member functions:

1
2
localToGlobal(point:Point):Point
globalToLocal(point:Point):Point

The first function localToGlobal takes a point object that represents a point value relative to the local coordinate system of the “this” MovieClip and returns the same point as it relates to the global space (stage).

With our helmet example:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// instance reference names:
// gameLevel is a MovieClip with stage unit coordinates
// pikeUnit is a MovieClip child of gameLevel
// helmet is a MovieClip child of pikeUnit

var helmLocalPoint:Point;
var helmGlobalPoint:Point;
var helmet:MovieClip; // shorthand reference

// helmet is a child of pikeunit which is a child of gameLevel
helmet = pikeunit.helmet;

// local point relative to the pikeUnit coordinate system
helmLocalPoint = new Point(helmet.x, helmet.y);

trace(helmLocalPoint); // outputs (x=0, y=-50)

// global point relative to stage coordinate system
// (same coordinate system as gameLevel in this example)
helmGlobalPoint = gameUnit.localToGloba(helmLocalPoint);

// the helmGlobalPoint is virtually the same spot visually
// but the values are relative to the global coordinate system
trace(helmGlobalPoint); // outputs (x=1000, y=524)

If you were to draw a circle at helmGlobalPoint its center point will perfectly line up with the visual location of the helmet.

So using these functions enable me to make helmets pop off the heads of pikemen.

When the unit’s helmet has no more hit points:
Step 1: make existing helmet invisible
Step 2: store the helmet’s local position, scale, and rotation information
Step 3: load a copy of the same helmet and update its scale, rotation, and position using the stored pikeman’s helmet information and converting those values to relative values in the GameLevel (stage) space.
Step 4: add the helmet copy to the GameLevel (make it visible).

The new helmet should now exist in its new coordinate space but appear to be placed in the same exact location relative to the pikeman’s head.

This example shows how you would convert from localToGlobal, but you may want to go the other direction in which case you use globalToLocal. An example of this seen when a projectile hits a mage’s magic shield.

A projectile exists just like a pikeman in the GameLevel space. When a projectile hits a magic shield it causes an energy shockwave to be displayed in a masked MovieClip. This visual effect briefly exposes the magic shield. In order to achieve this effect we must perform something similar to the helmet example but going from global coordinates to local coordinates. We now want to take a projectile’s global position and place a shockwave in a child clip of an MagicShield movieclip. Think of MagicShield as you would a Pikeman MovieClip in that it exists as a child of GameLevel. Placing a shock wave inside the MagicShield is like placing a helmet inside a Pikeman.

Understanding localToGlobal and globalToLocal is an essential fundamental Flash development skill.

The above examples show how to go convert points between local and global coordinate systems but what if you want to convert points from a local position in one DisplayObject to another local position in a different DisplayObject. This is often the case in LostVectors games especially. For example, the Space Combat Simulation Training 001 uses this concept for overlaying HUD indicators like the current target highlight box or the current target pointer arrow. The Space Combat game was especially tricky because game view uses a scrolling camera that can be rotated and zoomed (scale change) rather than a fixed view that uses the stage’s global coordinate system which is what Bowmaster does.

To help convert between two DisplayObject coordinate systems I created the following utility function:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/***
 * @author Jason Reinsvold
 * Returns a point object that represents the x/y position of where pt is as a local point of
 * the toDomain. The fromDomain is where pt currently resides. The return newPt is the point
 * that exists relative to the toDomain but overlaps exactly with the pt with respect to the
 * global point coordinates.
 *
 * This function is useful for determining the equivalent point across different coordinate
 * systems. For example, if you have a UI window that is scaled and moved and you have a global
 * overlay highlighting system for drawing boxes over all objects. The overlay will draw boxes
 * relative to its own coordinate system but it needs to be able to determine what points are
 * equivalent to the UI window. This function helps with that conversion.
 */

public static function translatePoint(pt:Point, fromDomain:DisplayObject, toDomain:DisplayObject):Point
{
   var newPt:Point;
   newPt = pt.clone(); // clone point so that original point is not modified
   newPt = fromDomain.localToGlobal(newPt);
   newPt = toDomain.globalToLocal(newPt);
   return newPt;
}

This function first converts the input point relative to the “fromDomain” to a global point and then takes that new global point and converts it to a local point relative to the “toDomain”.

Also, this function is generalized such that it will act like localToGlobal or globalToLocal provided you pass the stage as either toDomain or fromDomain respectively (this is because one of the internal localToGlobal or globalToLocal calls returns the same point value, acting like a no op).

I also created similar functions to handle converting scaling and rotating but doing this was a bit more challenging because there are no built-in localToGlobalScale or localToGlobalRotation functions.

Bowmaster Winter Storm Bug Fix

An issue that caused some users to experience a dark black screen after purchasing upgrades has been fixed. Game on!

www.lostvectors.com/winterstormbeta

The issue was introduced in a recent update and had to do with the new “auto place skill into action bar after purchase” feature. This issue is fixed and the new feature works fine. Now when you purchase an upgrade that is a bow type skill (i.e. shoots a projectile) the skill is automatically placed in the next available slot in your action bar. So you no longer have to manually place it after you purchase it by clicking on the in-game skill book. You can still use the skill book and manually place skills, but this just eliminates any extra steps and makes it easier for new players to see and use skills they purchase.

Bowmaster Winter Storm Beta Update 0.1.0.6

This week’s update consists of a few game balances, some weapon tweaks, and a new user interface component.

Updates:

The long awaited ability to toggle ally units on/off is finally here, and the peasants rejoice. If you purchased the ability to summon units then you’ll see buttons in the bottom middle portion of the screen. If you want to only summon a specific type of unit you just need to turn off all other units by clicking their buttons. These are toggle buttons so just click them on and off like a checkbox. Unit loading order is still randomized between all enabled unit types, but if you want to micromanage the order in which units are built you can just disable all but one type, and then when the desired amount of units are reached then disable that button and enable the next unit type you want to load. For One versus One boss encounters the unit toggle user interface is invisible. The settings will be saved between levels but currently get reset when you close your browser. These settings may become saved to your profile in a future update.

Flak bombs can now once again do multiple damage to a single unit. So if you’re skilled enough to detonate the flak bomb close enough to an enemy (or hit the enemy directly) then you may cause massive damage. However, the damage per shrapnel shard has been decreased and the maximum number of shards that can damage a single unit has been capped.

If a flak bomb hits the ground then only half of the flak bits escape the blast. The blast shards are ejected away from the ground.

If a flak bomb is too close to the ground it’s damage potential is reduced. For maximum damage detonate the flak bomb a third of screen’s height from the ground.
Elemental and physical weakness multipliers have been increased. This means that overall units take more damage from elemental bonuses than before. This means that you should be able to see much greater impacts with the right elemental attack even at lower ranks. For example, a level 2 ice arrow giving 2 damage versus a fire dragon with max ice weakness (-10 to ice) will take a total of 20 damage (ten times the damage). Comparing this to a rank 10 basic arrow with 10 pierce damage against the fire dragon (0 weakness to pierce) equals a total of just 10 damage. So you see that with just a rank 3 ice arrow you will see twice the damage as a maxed rank basic arrow. (These numbers are hypothetical, and the damage multipliers and per-enemy weaknesses will likely continue to change throughout the beta).

Reported issue: Some users have reported that the Victory Banner that pops up sometimes stays there indefinitely. It would seem that the code I previously added to help prevent this issue did not solve the issue. If you notice this problem or any others please contact lostvectors.com using the contact form located here: http://www.lostvectors.com/blog/contact/contact-form/