WeaponsUnity's Technical System
skip this part if you are not interested in technicalities.We approached weapons cautiously since they were the most critical part of the game.
Our main programmer made an excellent weapons system to support our needs. It has these settings:


As you can see, there is an area to add a modifier to a projectile. Basically, projectiles contain "LEGO pieces" we call modifiers which can be added to a projectile. For example, the revolver has bounce + DieOnSurface modifiers. Where plasma shots have those but also have a pierce modifier that applies only to players. So it bounces off walls but goes through flesh. (you can see how that works in mages)
There were many ways to approach this, but we used scriptable objects as our modifiers. However, some modifiers have data to be saved; as you may already know, scriptable objects are shared objects, and this data should be saved per bullet. The bounce modifier, for example, has a number for bounces. And it needs to be saved per shot. The scriptable object has a dictionary containing all the bullets (a list of bullets) to keep track of how many remaining bounces for each bullet.
This way is more efficient than having a mono behavior per modifier. It also led to a cleaner inspector since we have a small area where you can throw your LEGO pieces in; instead of having many scripts attached.
Here is a code for reference:
public abstract class ProjectileModifierWithData<T> : ProjectileModifier
{
private IDictionary<int, T> shotsData;
public void SaveData(Projectile projectile, T data)
{
shotsData ??= new Dictionary<int, T>();
shotsData[projectile.GetInstanceID()] = data;
}
protected T GetData(Projectile projectile)
{
if (shotsData != null && shotsData.ContainsKey(projectile.GetInstanceID()))
return shotsData[projectile.GetInstanceID()];
return default;
}
}
Weapons PhilosophyFor now, we have 11 weapons, and we do not plan to add more (for a long time). And even when we do, it will be weapons tied to unique mechanics. as this is a competitive game, we want the players to be very familiar with how to use each gun strategically.
While play testing, I found the
3 most fun strategies in this game.
1.
Play cowardly around covers, block entrances with plasma shots and mines.
2. Use
hit and run to get closer to your enemies and finish them with a high-damage short-range weapon.
3.
Suppress your enemies and blow up their covers while laughing like a psycho.
And we wanted to capitalize on that (while removing some of the not-fun) strategies that I might talk about later.
So I broke down my weapons into three main categories:
Assault: to support the suppression-aggressive types.
Safe: to support the tactical types.
Corner: to support the hit-and-run types.
Weapons Show CaseArt is not done yet.
So far, we have made these weapons:
Basic: Pistol
Assault: Machine Gun, Combat Shotgun, Sawed-off Shotgun, and Bazooka. We can also add the Wrench here.




Safe: Anti-Armor Gun, Energy Sniper

Corner: Revolver, Plasma Rifle, Mine Launcher


Charging ShotsI'll let the pics speak for themselves.



And by the way, I need an idea for charging the mine launcher. Maybe other weapons as well. Feel free to contribute.