This is a demonstration of seven weapons from a top down shooter I am currently working on in Unity. Below are descriptions of each one.
~ Assault Rifle: A standard rapid-fire weapon. As I demonstrate the Assault Rifle, you'll notice that the cursor snaps to the plane on which the player is standing, allowing him to fire up or down slopes. This applies for all weapons.
~ Dual Pistols: A pair of dual-wielded handguns (or magnums, TBD). As demonstrated in the video, the player's character will alternate firing hands so that ammo consumption appears consistent in relevant game modes.
~ Shotgun: Fires pellets at random vectors in a narrow arc. The vectors in this demo are blue for most of their lengths and yellow at the ends. Damage is constant if an enemy is hit along blue, but it falls off linearly from the end of blue to the tip of yellow. I'm not sure if I'm satisfied with this method of simulating spread, but there have been multiple iterations already and this is the best so far.
~ Beam Rifle: Halo fans can think of this as a Spartan Laser with an additional, uncharged firing mode. This mode boasts a faster refire rate but inflicts less damage. A charged shot is capable of penetration, killing multiple enemies until it hits an obstacle or the shot's full damage is expended. Players can release the fire button before the Beam Rifle is finished charging, and damage will scale depending on total charge time.
~ Minigun: A heavy weapon that slows the user's movement speed. It requires a brief moment to spin up and spin down (indicated by the small text label hovering above the player's head), but unleashes a hail of bullets.
~ Rocket Launcher: This weapon inflicts splash damage in a large radius, but damage falls off from the center of the blast to a minimum amount at its edge. The rockets used to accelerate briefly after launch, but this made hitting distant targets near-impossible to predict.
The explosion graphic is from a free package called Detonator, which provides templates for many kinds of explosive effects.
~ Grenade Launcher: The Grenade Launcher fires explosives in a high arc using a unique cursor that designates the impact site. Like the Rocket Launcher, this weapon's munitions have a large blast radius, but damage scales down away from the center of the explosion. The cursor turns red if not over valid terrain, indicating that the weapon cannot fire.
The arc is simulated by measuring the length of the vector from the player's position to the impact site and the grenade's progress along this line segment. The percentage of distance traveled is remapped as the x-coordinate input for a parabola function, and the grenade is bumped up according to the y output.
~~~
There is a great deal of balancing to do as I flesh out and refine the enemy behavior, but all base functionality seen in this video has been in place for at least a month. I am currently integrating Alex Kring's SimplePath into my project for enemy pathfinding and working on the wave and other match mechanics.
I have not demonstrated any here, but the player will also have an arsenal of spells at his disposal. I've developed rudimentary backstory explaining the existence of both magic and technology, though I won't go into detail here. Adding to the player's selection of spells is another area currently occupying my attention.
Great video man, keep it up. Can you share your code for your grenade launcher? How it shoots to the mouse's target is cool.
wynqwertyuiop 5 months ago
@wynqwertyuiop Thank you, I appreciate the encouragement. :)
And sure, I'd be happy to share my code. I don't have time at the moment, but I'll put together something soon. I may want to make a blog post to explain the Grenade Launcher in proper detail, in which case I'll be back with a link to my blog.
Halcyon2518 5 months ago