PEDRO TORRES
  • Home
  • Portfolio
  • Resume

Prime Future

Unity 3D — PC
November 2020 - December 2020
September 2021 - October 2021
​Solo Project

Play In Browser
Project Source

A Sandbox For a Curious Nerd

Prime Future is a sandbox project that started as a school assignment and blossomed into a toy box for me to test, implement, and refine FPS mechanics and game feel. Over the years, I've clocked more hours in FPS games than any other genre. My love and experience in the space has given me many ideas for how I might tackle common mechanics and issues. In September 2021, I drudged up an old first-person project and overhauled it to serve as my new FPS sandbox. While most of the things I have been testing revolve around multiplayer, competitive shooters, many of these lessons can be translated into single-player and cooperative shooters.

Below, I have written up some deep-dive slices on how I went about designing this project. Allow me to share with you some of the (many) things I've learned from the experience.

Movement

As is often the case, the specific movement mechanics of a game drastically affect both the feel and flow of that game. After all, it is the main way that a player will interface with your game. In a genre like FPS, movement plays an integral part in how players aim, so it's worth carefully considering how decisions in implementation and design affect things like weapon design, balance, and of course level design.

Let's start at the start of mobility itself with: Acceleration.

Acceleration

The speed and manner in which characters accelerate in multiplayer shooters has a large impact in how engagements between players pan out. One of the first things FPS players learn after learning to shoot their opponents is how to avoid getting shot by their opponents. The easiest and most obvious tactic most players learn is to keep moving or to strafe back and forth. Naturally, the rate at which your character accelerates (and decelerates) in and out of those strafes plays a large role in how difficult it will be to hit a squirrely target.
A slower, more gradual acceleration makes targets easier to hit but might make getting around the map feel sluggish or unresponsive.
An instantly accelerating target is extremely difficult to hit, but it can also make movement feel artificial and less controllable.

Somewhere in the middle ground lies a balance of responsive yet reactable; fluid yet controllable. In my implementation, I made use of Unity's soon-to-be outdated legacy input system to create an easily tweakable player acceleration curve. Using the Input.GetAxis() method, I can turn binary button inputs into gradual speed values that interpolate between 0 and 1. This allows me to mimic desirable, physically based acceleration on the cheap. As a bonus, the input system also handles conflicting directional inputs for me (more on this later) and provides parameters to control the rate at which the return value interpolates to and from its neutral position.

Picture
Unity Legacy Input System GetAxis() Visualization (Source: Legacy Unity Tutorials)
In some games, movement might incur an accuracy penalty to your weapon. For games where this is the case, players generally prefer to shoot while stationary or as close to it as possible. In games like Counter Strike where movement inaccuracy is severe, engagement ranges can be long, and damage is high, moving while shooting is a death sentence. To avoid this, players must employ more advanced movement techniques that work around this limitation while exposing themselves to as little danger as possible. Techniques such as peek shooting accomplish this by decelerating to a dead stop just as you strafe out from cover, shooting, then returning to cover quickly.

Peek shooting (and its cousin, jiggle peeking) is a technique that makes use of movement systems where momentum can be canceled quickly, acceleration is snappy, and weapon inaccuracy is tied directly to movement speed. Its effectiveness is also amplified in games or with weapons with high lethality where being fully exposed presents a greater risk than in games with low lethality. The prevalence and effectiveness of techniques like this are the consequences of fundamental design decisions that should be made purposefully when creating a movement system in an FPS game. If I were designing a kid-friendly game like a-la Plants vs. Zombies: Garden Warfare, I might consider lessening the effectiveness of something like peek shooting to even the playing field among players of disparate skill levels.

In my case, I settled on a snappier character acceleration and a movement inaccuracy mechanic. To compensate, I chose to include a healthy amount of bloom (inaccuracy incurred from sustained fire) and no visual recoil. Moving around feels tight and responsive, but firefights play out like a Halo title without the need for incredible precision at medium to close ranges, especially when using automatic weapons. Adjustments can always be made to reward or disincentivize advanced movement (mechanics such as critical hits or high per-shot weapons), but as is, I'm working with just the basics.

Weapons

No matter how good it feels to move around a map, if your FPS game lacks satisfying gun play, you have failed before you have started. While refactoring this project from a prototype, I was primarily interested in keeping things flexible and iterable. I could spend loads of time increasing the feedback of firing weapons, but at the time of writing, I haven't gotten there yet.

I borrowed a method for creating weapon 'cards' using the Scriptable Object class in Unity from a previous project to make creating and modifying weapon statistics quick and simple. I built upon this system to include Borderlands inspired weapon inspection panels alongside a Halo style health and shields system.

When it came to weapons, I was most interested in creating a balance of weaponry whose strengths and weaknesses meshed well with the game's movement mechanics and created an interesting experience across a host of engagement ranges. Before I could do any of this, though, I needed to decide how I would be handling the specifics of dealing damage. More exactly, I needed a solution for ranged damage fall off.

Picture
Weapon Inspection Panel

Damage Fall Off

Damage fall off is a common mechanic wherein a weapons damage decreases the further away you are from your target. In a somewhat more sophisticated implementation, different weapon classes dictate how well a weapon retains its damage across a battlefield. This can include things like 'minimum range' inside of which a weapon deals maximum damage, a 'damage floor' that prevents damage fall off from reducing a weapon's damage to zero, different fall off 'curves' that determine how damage fall off applies to a weapon, and more.

For this prototype, I chose to design my damage fall off mechanic as such:
  • Minimum effective range (in meters) given by weapon's range stat.
  • Damage fall off resistance (hidden stat) on a per-gun basis
    • This parameter affects how gradually damage fall off affects weapon damage beyond its minimum range
  • Damage fall off steepness (hidden stat) on a per-gun basis
    • This parameter affects how quickly a weapon's damage tapers off beyond its minimum range
I created a helpful graph using Desmos to help visualize how these parameters affect weapon damage at a distance. In the graph, the D parameter represents a weapon's damage stat, r represents its fall off resistance, and s represents the steepness of its fall off curve. This graph models what a weapon's damage will be once it has gone beyond its minimum range in meters. The y coordinate of a point on that curve is the amount of damage a weapon will do at x range (in meters).
Picture
Example Falloff Graph

Weapon Feel

When designing weapons, I prefer to think about their feel in terms of video game analogs rather than the real thing. Many other developers have made the effort to translate the experience of a shotgun into video game form, and this collective effort provides me a range of techniques and results to play with when creating a weapon for my own game. It is still important to understand the real life weapon you are trying to emulate, but piggy-backing on existing gaming conventions gets me a lot of the way there without having to reinvent the wheel.

Below is my process for designing a shotgun using the method described above. I did this for all of the weapons in this prototype, but for the sake of brevity I'm only walking through my steps for one. I have included a stats summary of all the weapons and a discussion on weapon balance further below. I also go into greater detail about the design choices that went into making my Piety and Devotion shotgun with a greater focus on the 'competitive multiplayer' design lens.

Shotguns
Shotguns are one of the weapon archetypes that video games have experimented the most with. We have seen lots of wacky takes on spread-shot weapons, and they've become many players' comfort weapon. Their powerful close range damage and relative ease of use usually mean they become anchor points around which a weapon ecosystem is balanced.
Below is a table comparing shotguns across different games and how their standout properties affect gameplay. This is by no means an exhaustive list but is something I often do when designing weapons that I want to serve a certain purpose or fit a certain role within a game.

Game / Weapon Analog
Standout Attributes
Observations
Reaper's Hellfire Shotguns (Overwatch)
EVA 8 Auto (Apex Legends)
CQS48 Bulldog (Halo Infinite)
Type-52 Pistol (Halo 3)
  • High 'magazine' count
  • Short effective range, wide spread
  • Higher fire rate
  • Rarely a one-shot kill
  • Forgiving but niche weapon.
  • Emphasizes the 'closer the better' feel of video game shotguns.
  • Fire rate gives a more rhythmic feel.
  • Tracking targets is as viable as flicking to them.
  • Consistent, high average DPS rather than burst damage.
  • Great cleanup potential with quick a (but rarely fastest), 2-3 shot TTK.
Pump Shotgun (Doom)
'Realistic' video game shotgun EG: Back 4 Blood
  • High stopping power (aim punch / stagger)
  • Significant damage falloff resistance
  • Low pellet count, high per-pellet damage
  • Low 'magazine' capacity
  • Burst damage weapon that rewards center mass accuracy.
  • Reload speed becomes critical as magazine size can be very low.
  • The generic shotgun option.
  • High skill floor, low ceiling.
Super Shotgun (Doom)
High-Impact frame Shotguns (Destiny)
Mag-7 (CSGO)
Jakobs Shotguns (Borderlands)
  • Devastatingly high damage and recoil
  • Short effective range, wide spread
  • High pellet count
  • Very limited 'magazine' capacity (typically ≤5)
  • Limited by reload speed
  • The archetypal one-shot shotgun.
  • Usually a break-action or sawed-off, compact frame.
  • You're either within range or not; very strict.
  • The 'close range' gatekeeper: this defines close range in its ecosystem.
  • You better be faster or more lethal within its range or else.
Spread Gun (Contra)
Shotgun (Metal Slug)
Big Shotgun (Enter the Gungeon)
Arcade / SHMUP Shotgun
  • Bullets. Many, large, slow-moving bullets.
  • Large projectile size
  • Quite large spread
  • Just fill the screen with bullets
  • These are typically not FPS games, but that doesn't mean they're not worth researching!
  • Bullet size and speed make for more positional play.
  • Projectile readability is incredibly important.
  • Very fun. Very satisfying.
Real, non-specialized spread shotguns
  • WAY less spread than video games
  • Great at medium ranges (10+ meters)
  • Versatile ammo selection for different situations
  • Limited 'magazine' capacity
  • Barrel length and weight make for a poor extreme close range experience
  • High stopping power but low penetration
  • Be safe.
  • Shoot responsibly.
Shotgun Design Breakdown
The Piety and Devotion lands somewhere between your basic video game shotgun (row 2) and the more forgiving cleanup shotguns (row 1). A reliable, deadly, but limited weapon.

Given players' combined strength of fast, controllable aerial mobility and in-air accuracy I shied away from allowing this shotgun to one-shot from any distance. It features a medium pellet count but a tight spread making it formidable even at a distance of 10 meters. At its optimal range below 10 meters, two shots with minimal missed pellets will lock up a kill. This makes the Piety and Devotion the highest TTK weapon in the sandbox which is typical for most shotguns.

What is atypical, however, is the absence of that one-shot kill. At ranges beyond 9 meters, Piety and Devotion is not guaranteed a two-shot kill. It still gets them most of the time with perfect aim, but not always.

Picture
Piety and Devotion's Stat Card
Beyond 12.5 meters, you enter three-shot territory putting the gun's TTK behind both Due Process and Tolling Bell assuming you hit maximum pellets. While no longer the TTK king (TTKK to those who appreciate symmetry), Piety and Devotion's kill time is still within .15 seconds of both other weapons at these maximum ranges and commands respect from all but those with perfect aim. The final chain of restraint keeping it back, however, is its very shallow four-round capacity. While more forgiving than a non-spread weapon its tight spread, conservative pellet count, and strict range requirements mean Piety and Devotion offers a powerful package with a narrow margin of error; a healthy place for a shotgun to be.

Weapon Balance

Time for the Internet's favorite FPS forum topic: Weapon Balance. The weapon ecosystem I'm working in is deliberately simplified so as to make mechanics testing and this discussion easier. While I would love to sit and write about how critical hits and snipers change the landscape of a game, my objective in creating this project is to test mechanics implementation and the illustration of the affects those mechanics have on gun play.
Weapon
Damage per Shot
Rate of Fire
Optimal Time to Kill
Effective Range
Due Process (Revolver)
40
140 RPM
1.7143 seconds
15 meters
Tolling Bell (Rifle)
11
600 RPM
1.8 seconds
20 meters (30 meter falloff)
Piety and Devotion (Shotgun)
120 (15 x 8 pellets)
65 RPM
0.9231 seconds
9 meters
My original design constraints for this system were the following:
  • Time to kill of non-close quarters weapons must be > 1.5 seconds.
  • When weapons miss their TTK window, their new optimal TTK scales closely with other weapons as they make similar mistakes.
  • The longest range weapon must suffer a loss of consistency before its damage falloff begins.
  • The medium range option must not be so forgiving that it dominates outside of shotgun range while within its damage falloff range.

The first of these constraints is simple enough, but managing a healthy balance when accounting for a missed shot or two was sometimes tricky. My intention in keeping keeping weapon TTK similar as they scale with mistakes was to ensure that similarly skilled players would still have close fights even if they're not being optimal. It is easy to get caught up at the upper bounds of weapon performance and forget that humans are not aim bots. The experience of less-than-perfect play is incredibly important for a healthy ecosystem. The last two constraints I imposed on myself describe the relationship between weapons more than it does numeric properties of the system. They describe how I want weapon combat to feel during gameplay which I think is an important and overlooked consideration in systems design.
Critical Ranges
At these values, there are a handful of ranges where weapons are just within or at the edge of their effective range where positioning and movement become important. It is with these incremental ranges in mind that level designers design spaces that not only look good but fit the ecosystem of weapons being used within them. These ranges work out to be 10 and 5 meters. Let's look at why that is.

Piety and Devotion
Within 10 meters, Piety and Devotion is capable of killing within its optimal TTK. It isn't guaranteed—remember, anything above 9 meters is at the mercy of pellet spread—but it is close enough to be a real threat. Just outside of that range, Piety and Devotion is within three-shot range and has a comparable TTK to both other weapons making it effective even as players move and jump and pellets miss their mark. It is strongly encouraged, but not exclusively limited, to staying within this larger range increment of 10 meters.

Due Process
At 15 meters, we hit the effective range of Due Process. At 1.5 critical range increments—or one large and one small range increment—we are in revolver territory. Thanks to the sharp, agile movement in this prototype, this gun is well suited for peek shooting at opponents who rely on sustained automatic fire to do lethal damage and back peddling against shotgunners who are closing in from just outside their desired range. Due Process was designed to be a great option for players who enjoy moving fast, flicking to targets. In return, it demands that you maneuver within a tight 5 meter margin between your opponents' optimal ranges or risk falling into a losing engagement. To keep true to my design restrictions, I decided to make Due Process a semi-automatic weapon that does damage in chunks. This makes the weapon much less forgiving than its counterparts if you don't hit your shots. While the weapon does have a goldilocks zone where it thrives, within 15 meters Tolling Bell's accuracy cone with maximum bloom can still fit completely inside a player's model and Piety and Devotion is teetering at the edge of three shot territory. This weapon is a glass cannon best suited to the daring and the accurate.

Tolling Bell
Lastly, we get to the 20 meter range; two large critical range increments. Unlike Due Process and Piety and Devotion's effective ranges, Tolling Bell's damage falloff doesn't begin for another 10 meters
. What gives? Well, it is at this distance that Tolling Bell's full-auto inaccuracy causes its spread to exceed the bounds of a player model with perfect aim. Typically, Tolling Bell enthusiasts would be best suited tracking their targets while holding down the trigger. Beyond 20 meters, this changes. Suddenly, burst and tap shooting become a necessary skill to eek out the weapon's maximum potential. At these distances, Due Process is still kicking at 38-35 damage per shot, but the damage falloff is enough to buy you an extra shot by the revolver. Unlike Due Process, however, if caught out of position, Tolling Bell's higher optimal TTK means it is less suited to dealing with shotguns as tracking becomes more difficult. Overall, Tolling Bell is positioned as your less efficient but more forgiving option. Shot timing is non-existent and the sheer volume of bullets it fires means missing a handful of shots barely impacts your lethality.

Email me

LinkedIn

Github

  • Home
  • Portfolio
  • Resume