Special Weapons Part Two

In our last post, we gave an overview of the special weapons in Violet.  We were still working out the names of these as well as the functionality.  Over the last couple months, we’ve experimented, polished, tested, and then refined each weapon where we feel we are in a good place.  These weapons are unique, but still feel balanced with the rest of the game.  The weapons also don’t cause major game breaking bugs anymore, and fit with the rest of the item system we’ve previously built.  So without further ado, let’s get into it.

GMS Tasks / Draw Container

In a more technical post, we created two open source repositories for others building games with Game Maker Studio to use.  One problem we were frequently running into the last couple months is build times.  With many experiments and polishing of special weapons, even the slightest change would take 45 seconds to test.  This is frustrating if, for example, we wanted to see how changing the a weapon’s speed of 3 to 4 felt.  For our current project, rooms take 15 seconds of the build time.  And for most cases (especially testing special weapons), we don’t need to compile all the rooms.  Thus, we wrote a script to disable / enable rooms in GMS.  This has dropped our build times from 45 seconds to 30 seconds.  As we add more and more rooms, the time saved is going to be exponential.  We added this script in GMS Tasks, which can be learned more about it here.

We also patched a few issues in the Draw Container repository, as well as added a property to flow called stack.  We can read more about it here.

Refactoring / Collision System

It was that time again — refactoring.  Our TODO list was getting quite large.  The majority of the items in the list were revolving around the collision system with items we’ve previously built and the hacky implementation of the new special items.  Since the high level ideas of our special weapons were working, it was time to refine the system we had in place.  After a couple weekends of white boarding and implementing, the collision system was better than ever!

New Collision System
New Collision System

The system should be robust to handle any situation we dream up of now — assuming it follows the flow above.  Each weapon has three distinct special case functions that are allowed to alter the behavior of a collision and the result from it (for example, the direction to move, how fast to move, how long to be stunned, etc.).

There was quite a bit of other refactoring done as well.  Much of it was around the special weapons and their intricacies — which is a great segue into the meats and potatoes of this post.

Bomb Gloves

Bomb Gloves are used to create bombs from the earth.  Though we haven’t built a concept of from the earth (which means bombs can be created anywhere currently), we have updated how bombs are created and how they work after they are created.

First, bombs use the same structure now when trying to create weapons.  This means once we’ve started to create a bomb, we can’t also try to swing a sword.

Second, we decided to refactor weight in our game.  Before, light weight things had a weight of 1, the hero and the soldier type enemies had a weight of 3, and heavy things had a weight of 4.  This worked fine initially, but proved to be a problem for many reasons, which we won’t get into as that would be “getting into the weeds“.

When picking up objects in the game, the heavier the object, the longer the animation plays out for the hero to pick up the animation.  Since we don’t have an actual animation for creating bombs from the earth, we decided to simply use the picking up animation for now, but set the bomb’s weight to 333.33 (for comparison, the hero and most soldier enemies have a weight of 100 (roughly equal to 180 pounds)).  The bomb would use this weight to delay the animation for a long period of time to “fake” the idea we are creating bombs from the earth.  Once we have created the bomb, we set the weight back down to 50.  The speed at which objects being carried, as well as the damage dealt by being hit by a thrown object are based on the object’s weight.  Thus, we didn’t want a bomb dealing more damage being thrown than exploding, and we wanted the hero to move when holding the bomb. 😉

Third, which was the biggest change, bombs now can explode in the hero’s hands.  This took a lot of restructuring, as before, the game would swap the real object with a holdable object that resembled the real object.  The problem in this case with the bomb, is we wanted to have the bomb explode in our hands, but the object we were holding was not the actual bomb.  Thus, the animation timers would only run when we threw the bomb.  We would also reset the animation of the bomb if it got picked up again.

Bomb Still Ticking
Bomb Still Ticking

We decided on this change because we want to have puzzles where there was a wall in an area that doesn’t have earth.  Thus, the key to the puzzle is creating a bomb in earth in one area and transporting the bomb to the wall needing to be blown up, without the bomb going off.  We would never have had the solution of transporting, since the bomb would never go off the way it was built before.

Now holdable objects contain the reference object, which is still active and allowed to perform timers.  But the position of the reference object (aka, the real object) is relative to the holdable object, which makes it look like the holder is carrying the reference object.

Boomerang

If you remember from the previous post, the boomerang was a working name.  We spent weeks trying to come up with a unique name / weapon that followed the conventions that we previously built.  Guess what we settled on?  A boomerang!

Updated Boomerang
Updated Boomerang

As we were brainstorming, we stumbled upon this youtube video and this site that gave us the inspiration we were looking for.  See, we didn’t want a traditional “C” shaped boomerang, because the boomerang’s flight in Violet’s could be controlled.  So as we were brainstorming, we wanted a weapon that made “game sense”.  When we discovered that boomerang’s didn’t have to be “C” shaped, a light bulb went off.  “What if it was still a boomerang, but the design of the boomerang was unique, which is why the boomerang is able to be thrown so precisely?”  And the rest was history.  You’ll have to excuse the art for now, as it is something I drew up.  But the idea is that it has a double “C” shape, that sort of resembles a Violet leaf.

The boomerang is now considered a weapon, which follows the collision system above, as well as the player not being able to use other weapons when the boomerang is pitched, drawn, thrown and caught.  We also added animations for throwing and catching the boomerang.

When drawing the path, we made it harder to draw lines that turn 180 degrees.  Essentially, there is always a bit of a curve when changing directions rapidly.  Boomerang’s at the end of their path will also not immediately turn back to the hero (unless the path drawn was turning towards the hero), but will arch around like a traditional boomerang would.  When collided with the boomerang, enemies will take 20 damage each time they get hit, as well as being stunned for some time.  If skilled, the boomerang can become a mighty weapon to keep enemies at bay, as well as a useful stun tool.

We refactored the camera as well for panning purposes.  We already had a hacky solution of the camera being able to follow the line, and then pan back to the hero.  But now, we’ve added the ability to easily pan to whatever object we want in the game, for however long we want the pan to take.

We believe the polishes we have added will make it a great weapon in combat, as well as serve as a great key in solving puzzles with non straight lined distant switches.

Grappling Hook

The grappling hook was among the first things to get refined after our last post.  Like the other two special weapons, the grappling hook follows the collision structure we refactored, as well as being used as weapon which follows the structure for other weapons (i.e. the player not being able to use other weapons during use of the grappling hook).

The main concepts have pretty much stayed the same for the grappling hook, with the exception of adding longer ending lag (cool down) when the grappling hook reaches the hero.  We also made it so the grappling hook can’t hook enemies at shorter distances — therefore, making it a little less overpowered to repeatedly and instantly stun the enemy.  We also increased the damage output to 30.  And finally, we made it so the player can’t hook an enemy holding a shield (but this might change to let certain kind of shields be hookable).

Grappling Hook Cool Down
Grappling Hook Cool Down

Otherwise, much of what we discussed earlier with the refactoring also applied to the grappling hook.  The biggest being the weight issue.  We wanted the hero to move towards heavy, hookable objects.  But there was no concept of weight for anything but living objects, and it was poorly implemented.  Now, all interactable objects have weight‘s, which let’s us seamlessly execute code for hooking to a interactable and hookable object.  For example, a tree is interactable and hookable with a weight of 6000, which is much greater than the hero’s weight of 100, thus, the hero will be projected towards the tree.

The grappling hook is a great offensive weapon with its ability to stun and bring enemies towards the player.  Its combo into melee weapons will make it a great utility for players.  But the grappling hook’s lag makes it not great against a group of enemies.

Orb Shooter

The Orb Shooter has caused us much pain in the month of September.  In fact, we were planning on writing a blog post much sooner in September, but we went back to the drawing board on the Orb Shooter, and we really wanted this post to be titled: Special Weapons Part Two and not Special Weapons Part Two Minus the Orb Shooter.  However, we finally feel like we have something that functions the way we imagined, as well as not being too overpowered or underpowered.

If you remember from the previous post, the Orb Shooter is very unique in that it doesn’t deal damage, but creates a force field of orbs that acts as a defensive mechanism for the hero.  Before, the orbs orbiting the hero that collided with enemies would also do something.  At one point the orbiting orbs would stun.  At another point the orbiting orbs would do damage.  Another point it did both.  At another point, the orbiting orbs would stun if so many hit an enemy in a row.  And on and on it went.  We finally made orbiting orbs simply do nothing.  Astonishing, I know!  The thing that we were getting hung up over was that these orbiting orbs needed to do something offensively.  However, in the state of orbiting, orbs should just be the force field around the hero that act defensively.  We also played around with the orbiting orbs pushing enemies, but that didn’t seem right either.  Orbs orbiting the player simply protect the player from damage.

Orbiting Orbs
Orbiting Orbs

However, the Orb Shooter does play some offense (well defense).  As before, if the Y button is pressed, an orb will be shot towards the target, or in the direction the hero is facing.  Each orb acts as 1 stun point towards an enemy.  Each enemy, NPC, and the hero have unique stun points (SP).  The more SP, the more hits that can be withstood before being stunned.  If we shoot 4 orbs at an enemy with 4 SP, they will be stunned.  Orbs still don’t deal any damage, but with it’s recharging capabilities, this makes the Orb Shooter a great utility to fire orbs at your enemy as a “stun gun” — stunning your enemy for a short period of time.

Most of the time though, we want to use the Orb Shooter as a protective utility.  Holding down the Y button will continue to spawn the orbs to orbit around the hero.  When the Y button is released, a blast of orbs will be shot in one of two ways:

  1. If the player is targeting an enemy, the orbs will be shot in the enemy’s general direction.
  2. If the player is not targeting an enemy, the orbs will be shot in a direction away from the player.
Orbs Scattering
Orbs Scattering

In either scenario, the number of orbs shot will be the number of SP they have.  So in the above picture, each orb as roughly 26 SP — enough to stun any enemy in the game currently.  Orbs will pierce, making orbs hit enemies behind enemies.  This makes the Orb Shooter a great utility to stun surrounding enemies all at once.  However, tougher enemies will not be stunned for very long.  And shields can block orbs.

The Orb Shooter may get more polishing as we see players use the weapon.  But for now, the high level attributes are bound to stay.  And we’re happy to say, it’s a ton of fun to play with — and will be interesting to see players master the Orb Shooter, as well as all the unique special weapons we’ve created!

Leave a Reply