banner



Video Game That Lets You Design Weapons

The Way of the Gun: How Game Developers Design Weapons

Guns are ubiquitous in video games today, but how are they actually designed?

Jared McCarty

V ideo games and guns go together like peanut butter and jelly. From Contra to Wolfenstein, Doom to Goldeneye 007, all the way to Call of Duty and Overwatch, players have been given the opportunity to simulate the immensely destructive capabilities of some truly awesome armaments. The origin of boomsticks in gaming can be traced as far back as the 1920s, with carnivals and museums being filled with shooting galleries for kids and adults to enjoy. Jump ahead a few decades, and you have the Brown Box light gun on the Magnavox Odyssey, circa the late 1960s, putting a toy gun in players' hands to "shoot" at the screen.

From there, we see game developers the world over embrace with open arms the concept of riddling baddies with bullets. For nearly a hundred years human beings have been obsessed with simulating firearms, although the implementation of such ballistic marvels into our virtual worlds poses a few issues. Becoming an expert marksman is challenging, despite what media and movies may have established, and as such, balancing guns in gaming can be difficult.

One of the first gun peripherals, the NES Light Gun, AKA the Zapper. Source: Wikipedia.

There are tons of variables that affect the where and why of a bullet whizzing through the air. Air temperature, variability in muzzle velocity, caliber, wind, and even something as mundane as how you squeeze the trigger, all dictate whether or not a bullet will hit its intended target, and these factors only gain importance the longer distance a bullet has to travel. Due to this, developers are placed in a conundrum; which of these variables — if any — do you implement in your video game?

The dilemma can easily place developers in a spherical cow situation. And perhaps more importantly, how do you make it work while keeping the game fun and balanced? The answer is more complicated than the average gamer might realize. Like with most things in game development, the way a weapon operates comes down to something all of us deal with every moment of every day: physics.

There are a few ways that developers utilize physics in order to create the systems behind guns in video games, and their implementation can be quite clever. First up is what's known as "hitscan." Hitscan began as a mutated form of raycasting, which is the technique employed to render 3D environments onto your screen, emanating out from the player in a cone, which is comprised into 2D images. Raycasting was used to render a lot of older games, such as Wolfenstein 3D and Doom, as each area is made of the same sized orthogonal squares spaced out over a 2D grid.

Example of raycasting, from Scrumbleship. Source: Mod DB.

Using raycasting, computers didn't have to render genuine 3D environments, instead only burdening calculations for every vertical line present on the screen. This allowed very slow computers to run raycasted environments very smoothly, and is partially responsible for the whole "Doom can run on anything!" craze. Even though Doom's raycasting is more advanced than Wolfenstein 3D's, accounting for things like sloped walls and differing heights, it still allows the game's rendering to be very simple to compute. This allowed Doom to become a cut-and-paste poster boy for most raycast FPS games of the time. Eventually, developers realized that the ray could be cast from a single point in a straight line (like the muzzle of a gun) instead of out in the shape of a cone. Thus, the general idea of hitscan came to fruition.

The easiest way to understand hitscan is to think of it like a laser: The Moonraker Laser, the Spartan Laser, the Collector Particle Beam, take your pick. After it is determined how far the laser can go (or the distance a bullet can travel in-game) the engine will detect whether an object has broken the laser line and react accordingly. If the object in the way is an enemy player or an NPC, the engine can calculate where the laser was pointed to and how much damage to inflict because of it. If the object is something impenetrable, such as a brick wall, the engine will stop the laser from continuing. This allows for some seriously dynamic physics to come into play where penetration is involved.

How hitscan works. Source: Unity.

If a developer allows a ray to continue through the first object that breaks it, they can add in the idea of piercing rounds that can hit multiple enemies or bullets that can fly through walls. Call of Duty 4 is a perfect example of hitscan done well; when a bullet is sent through something thin or shear, like drywall, you're able to hit an enemy hiding on the other side. Variables like the thickness of the wall or the caliber of a weapon dictating penetration can be the developer's choice, changed by tweaking in-game variables and allowing for a huge range of variation to gameplay.

Along with object and environment penetration, hitscan also allows for the implementation of projective deflection. Since hitscan is incredibly fast, the deflection of a projectile can't be easily dodged. This in turn allows the ability to perform the timing necessary to bounce the projectile back to be both satisfying and visceral, as the receiving end of the deflection will find it difficult to get out of the way. While this may sound complicated, it's relatively simple to design since there really isn't too much processing power needed to calculate the trajectory of something that's nearly instantaneous.

This leads to the second type of bullet rendering in gaming, known as "projectile ballistics." The meaning is relatively self-explanatory; ballistics is defined as the science or study of the motion of projectiles, such as bullets, shells, or bombs. Thus projectile ballistics refers to the science of the ambit trajectory behind those projectiles. The utilization of projectile ballistics within gaming revolves around each bullet, shell, rocket, or mortar being individually rendered in real-time, thus giving them mass. Due to this, every time a weapon is fired, the resulting projectile has its own hitbox and velocity. As with hitscan, the application of projectile ballistics provides a myriad of opportunities to tweak gameplay experiences.

One of the most pervasive examples of projectile ballistics is the fabled "bullet-time." For those who have perhaps stayed away from shooters for the last, oh, 15 years, bullet-time refers to the mechanic where time is slowed down or stopped completely in order to see, aim, dodge, and manipulate projectiles mid-air. The Max Payne series, the Sniper Elite series, Bulletstorm, the F.E.A.R series, Timeshift, John Woo's Stranglehold, and Super Hot are just a small taste of the games that employ bullet-time to add variety to their gameplay. Because each projectile is being rendered individually, each projectile can be seen, slowed down, and engineered to specific parameters.

Bullet-time in Max Payne 3. Source: HDQWalls.

Bullet-time is only one potential benefit from projectile ballistics, however, as adding hitboxes to individual projectiles allows for environmental influences to affect where ballistic objects will land. Things like distance, movement, and wind speed can be factored in and tailored to individual experiences. This allows for the modeling of real-world phenomena like bullet-drop (bullets falling more the further they travel, due to gravity) and neat things like the Halo franchise's Needler having avoidable bullets.

This seems like a computational nightmare, perhaps being a miracle of modern technology, but as Tristan Jung points out in his excellent Gamasutra article, games have been utilizing projectile ballistics — albeit in a rudimentary form — for decades. Classic arcade games like Space Invaders use small projectiles that are tracked throughout the entire process to dictate where shots are landing. These projectiles aren't using hitscan, as they can be followed and intercepted, but instead, use projectile ballistics.

Both hitscan and projectile ballistics have their implementation challenges. As such, most games use a hybrid of both systems to make dynamic and varied gameplay. It's astounding how far bullet simulation in games has gotten, with realistic weather conditions and ever-growing render distance allowing ballistics to feel weightier and more skill-based. Game developers have been utilizing trajectory for ballistics for decades, whether that be tracking a single pixel as it vaporizes alien ships, or destroying the opposition with Warzone's infamous Mac-10. Math, computation, and human ingenuity are behind every bullet.

So the next time you get taken out by a definitely-absolute-bull-and-lag-and-not-my-fault sniper shot, take some solace in knowing that the experience was thoughtfully — and purposefully — engineered.

It was still definitely the lag, though.

Source: id Software.

Hey guys! Thank you for reading! I've been playing a ton of shooters lately and find it fascinating how developers dictate the mechanics behind the guns. The Gamasutra article linked above has a great comprehensive analysis of how it all works, and I highly recommend reading it if you're interested!

Video Game That Lets You Design Weapons

Source: https://superjumpmagazine.com/the-way-of-the-gun-how-game-developers-design-weapons-8c9947524f3f

Posted by: wallacesweves.blogspot.com

0 Response to "Video Game That Lets You Design Weapons"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel