Dev Log #3: No Fooling

The first of April is a wild time in gaming and tech.  No announcement can be trusted, as companies get in on the spirit of April Fools' Day by posting tongue-in-cheek tomfoolery of all flavors.  Some posts - especially in gaming - even come with an actual event, where the community can get in on the joke.  

The GHPC team are no strangers to making special content for April 1; on this day in 2021 we released the M1IP tank along with a special mission where it was swarmed by a T-34-85 horde blasting the Soviet national anthem.  Still, for this year, we faced a dilemma.  With our planned Steam early access release rapidly approaching, we hardly had time to dedicate to joke content, but we would disappoint ourselves and our community if we simply did nothing!  As we discussed this problem, an idea began to take shape: what if we could have the best of both worlds by making joke content out of features we needed to add anyway?

It didn't take long for the plan to form after that - we were going to make a rally race, featuring the UAZ-469!  This wild departure from traditional tank combat missions would allow us to knock out a big set of outstanding tasks on our list:

  • Visible animated crew
  • Physics-based crew jostling
  • Physics-based damage
  • Crew gaze tracking with animated head direction
  • UAZ damage model and armor
  • UAZ model refresh
  • Improved steering response in wheeled vehicles
  • Improved tire grip in wheeled vehicles
  • Analog steering and throttle input for controllers
  • Visible headlights
  • Visible brake lights
  • Compass on HUD
  • Waypoint markers on compass
  • Waypoint markers in 3D space on HUD

With some quick organization work and an energetic response from our programmers, animators, and voice talent, various elements of the task quickly started taking shape.  

UAZ-469 models

The crew jostling, in particular, presented an interesting technical challenge.  We wanted to convey a realistic feeling of momentum and reaction from the crew members, but they also needed to anchor themselves on certain static points: the driver needed to keep both hands on the steering wheel, and the passenger had to keep an arm resting on the door sill.  A simple spring joint on the torso wouldn't be able to accomplish this without some kind of inverse kinematics (IK) solution, which is a lot of overhead for a small detail like crew jostling.  

Fortunately, we had already solved part of the problem with a previous feature: the hinged linkages on the "Luna" infrared searchlights of the T-55 and T-72.  

Luna linkage arms

These mechanical connections are responsible for physically aligning the lamp with the gun barrel as it elevates.  Our solution since early on has been simple and fairly elegant: rather than use IK, we simply load an animation clip that depicts the lamp and arms moving through the whole range of elevation, and "scrub" the timeline to aim the lamp and manipulate the arms.  The results are quite convincing: the lamp follows the gun and the linkage arms appear in the correct orientation at all times, without significant overhead.  Could we use a similar trick for crew jostling?  

Adapting the animation solution for dynamic crew body motion would require a bit of clever animation blending, as well as a custom physics detection system.  As we accomplished each phase of our prototype testing, we refined our methods, until we were satisfied.  The final system looks something like this:

Crew animation parameters

  • Forward/backward (Z) lean
  • Side-to-side (X) lean
  • Bouncing in seat (Y)

Physics system measurements

  • Linear acceleration in local forward (Z), side (X), and vertical (Y) directions
  • Angular acceleration on three local axes: pitch, yaw, and roll

The key to the system is how we connected the animation parameters to the physics ones.  Z lean animation is controlled by a weighted combination of Z acceleration and pitch acceleration.  Similarly, X lean animation is controlled by a weighted combination of X acceleration and roll acceleration.  The final piece, vertical bounce, works a bit differently: it's slightly randomized in speed and its intensity is tied to Y acceleration.  The result is, we think, quite convincing.

UAZ jostle

Once the holy grail of jostling physics was sorted out, the rest of the rally tasks fell into place in short order.  We made new lamp controls, a compass and waypoints on the HUD, and even a system for making the passenger complain and curse when the driving is too rough.  (Props to our Russian voice actor for that one!)

But meanwhile, there were other things brewing.  No sooner had we embarked on the quest for a rally race than we started dreaming bigger.  What if the rally race wasn't the only piece of the puzzle?  What if we made it way cooler by hiding a legitimate content drop in the update too?  

We'd been sitting on a nearly-completed M2 Bradley for many months at this point, and it seemed like the obvious candidate for a surprise content update - so much so that we'd even considered releasing it as the entire update, much the same as how the M1IP was released in 2021.  So we formed an even more ambitious plan: the rally race would be the first in a series of missions that would lead eventually to a full Bradley update!

This was, quite frankly, an absurd plan.  Not only did we need to invent mechanisms for concealing several missions and even an entire map from the Instant Action menu, we also needed to rush the Bradley to a completed state in a matter of weeks.  And all of this while working on the UAZ rally content, and with a tiny team of mostly part-timers!  But moderating our goals has never been our strong suit, so off we went.  

M2 Bradley

As cool as it is, the Bradley is a very weird vehicle, as we quickly discovered when trying to create a faithful depiction of it for GHPC.  Our research phase had uncovered several key points where the M2/M3 stood out from the crowd and would require special implementation solutions:

  • The autocannon has a dual feed system, allowing instant swapping between two ammo types, with the last loaded round needing to be fired before the switch actually happens.
  • The ammunition feeds for the two ammo types are different lengths.
  • Reloading is done from small boxes of belt segments, the amount of ammo in the box is not the same as the length of the ammo feeds, and the reload ammo is added to the existing ammo in the feeds.
  • The TOW launcher cannot remain deployed while the vehicle is moving, as excessive jostling can break it.
  • The TOW launcher follows the main gun's elevation, but only while deployed, and it must auto-level when folding.
  • The current weapon/ammo selection is displayed in the gunner's optic.
  • The current range is displayed in the gunner's optic, but clipped to two digits.
  • The TOW launcher's aim point is offset from the main gun's aim point.
  • The gunner's optic switches reticles based on weapon selection.
  • The TOW reticle in the day sight is etched in and remains visible at all times.
  • Depleting an ammo belt too far results in a much longer reload, as the end of the belt is no longer easily accessible and some disassembly is required to reach it.

With the exception of the last point, which was dropped for time, we ended up adapting our existing vehicle systems to support all of these quirks!  Several of them also apply to future vehicles we have in the pipeline, so it wasn't all just for the Bradley, but it was still a lot of work to handle at once with a hard deadline of April 1.  Fortunately, we were able to pull it off anyway.  The April 1 update introduced the Bradley in style, with the second April Fools' Day mission making it quite hard to miss.  

T-34-85 and Bradley IFVs

A few days later, we concluded the saga of the GHPC April 2022 update with a patch to fully un-hide the Bradley missions.  The vehicle is now readily playable by Patreon supporters using the unlocked demo.  

With early access release on the horizon, we continue to work tirelessly to make GHPC the best it can be.  See you soon with more news!  If you like what we're doing and want to support us, consider a subscription on Patreon.  

- Josh