Switching to smaller, re-usable components instead of long, bespoke scripts required a fair amount of work, but it was worth it. I was able to create two new variations of the static turret with ease as a result, and I can see it being incredibly useful in the future for quickly prototyping and iterating on new variations.
Addition #1 is the Pillbox; a machine-gun bunker that has a limited vision arc and field of fire. It’s vision and firing arc is entirely defined by the collision of the building it’s in, so I don’t need to fiddle with values if I change the building. It’s pretty future-proof. It has a new projectile type, and fires in bursts, with some hefty spread currently.
The Pillbox can’t currently hurt a tank, but the future plan is that when under machine-gun fire, you won’t be able to poke your head out of the tank, so will be restricted to the much more limited interior viewports. Pillboxes therefore serve more as a debuff than a threat, taking away your vision and potentially blinding you to greater threats.
Addition #2 is the Artillery gun. It’s very similar to the standard anti-tank gun, but has some noticable differences. It turns slowly, and is inaccurate, saturating the area around its target with deadly explosive shells. It is intended to force a player to keep moving to avoid the rain; punishing players who stay still, and encouraging them to rush the weapon in order to silence it.
Originally, I was going to implement some complicated parabolic arc calculations to get the weapon to properly align and “lob” shells, but in the end I decided against that. Instead, it spawns it’s projectile above the target, and rains it down on them. It still plays a fire animation, but for now, it’s not doing any expensive or complicated calculations.
I’ll need to figure out a good parabolic arc calculation for the AI tank, so I may return and rework this at that juncture. For now, I just wanted something working, and it’s effective.
