Well the theme this month is Neon, and I really did use that as a starting point in the brainstorming, but while the end result does involve darkness and lights, there's no neon to be found. Oh well.
What I ended up playing with is the idea of a runner in a locked down city neighborhood, where curfew is partially enforced by shutting down all the residential power after dark. You know how to get the lights back on, and that will be your act of resistance - run through the night, with agility as your only advantage, and turn on the power all over the neighborhood. Light up the night. Maybe the people will be encouraged to resist by your example, maybe not, but that's the shot you're taking.
That hasn't entirely materialized, but I'm still happy to count this as the March project, because the most interesting part to me, and the part that was new to me, was the free running aspect. So what I have here is the FreeRunner Tech Demo.
To be specific, what I wanted to try to implement was the kind of system many action-adventure games have these days, where the player doesn't have to manually bunny-hop around over every ground level change. Instead, their character animates appropriately to represent the character vaulting, jumping, climbing, and so forth as needed.
I have no idea how this is typically done. I did zero research. I wanted to just dive in with my existing knowledge and see if I could get it working on my own. I am extremely happy that, overall, it's working pretty well. For what it's worth, here's the process I used.
- For a step, the run animation continues uninterrupted while the character's height is quickly lerped to the new target height. Properly calculated, this moves the character to the target height before collision and keeps them moving at a full run.
- For a vault, a similar process is used, but with a hurdler-style animation playing and a longer lead-in time. If a player runs straight into a vault obstacle, they will retain most or all of their speed. If they start too close, they will lose some speed, but that seemed like a happy coincidence since it also makes sense that a person not yet moving at full speed would not be able to vault over an obstacle as quickly.
- For a climb, the character is moved through two positions while a climbing animation plays. The first movement represents the bulk of the vertical movement, while the second moves the character up and forward to the landing position.
With all of that working, I got as far as implementing and testing trigger zones for automatic jumps when running off of a ledge before realizing I was wasting my time. By just adding an altitude check during grounding checks and storing the previous frame's grounding state, I could have the character automatically jump when running off of any ledge by testing for (!grounded && wasGrounded && altitude > autoJumpTreshold), Conversely, I could test for situations where the player becomes ungrounded at a very small altitude, such as when running down stairs, and immediately snap the character down to ground level. This prevents the character from quickly toggling between grounded and ungrounded when running down stairs, which could cause any number of side effects depending on how you're handling and reacting to grounded state.
So in the end, I have a simple character controller that sticks to the ground on small drops, automatically jumps when running off a ledge of sufficient height, runs up small steps without a hitch, vaults over waist-height obstacles, climbs up to platforms, grabs ledges and climbs up when missing a jump, all without the player doing anything but moving in whichever direction. With the generic animations and approximations it definitely wouldn't work for anything with a closer view of the character, but for a low-poly overhead view like this it's pretty smooth, so I'm calling that a win regardless of whatever else got done.
The other major project here was the neighborhood itself. This is a huge environment compared to anything I've built before, and while much of it is a variety of general-purpose assets reused dozens (or hundreds) of times, it was a major undertaking to get it all laid out, with traffic signals and street light poles and hydrants and whatnot. I believe it came out to something like ~132,000 square meters, or ~158,000 square yards, or around 32 acres.
The only interesting part there is I assembled a set of building components (base, layers, roof, optional components), then used a script that constructed the building dynamically from those components to a desired height. With that script executing in editor, that gave me buildings where I could slide a slider in the properties and have the building rebuild itself to any height in realtime. This was handy when populating the city, and would really come in handy in a larger project, since the same logic without modifiation could be used to construct arbitrary buildings from different sets of prototype components.
I started with an idea that would largely involve running across rooftops, and ended up with very little rooftop action. However, the cars and trucks of the neighborhood provide opportunities to test out the different movement options (car hoods and trunks are vault height from the ground, roofs are climb height from the ground or step height from the hood/trunk) and there's a set of specially-constructed stairs and stair-step obstructions in the park area for testing - the stairs in order from smallest to largest are step, vault, climb, jump-to-climb, and impassible.
This project, as with nearly everything I do, contains the auditory forgings of Ben Freund.
I may not have gotten the objectives and NPCs implemented as I'd planned to, but I'm still happy with this one. Having a player controller that smoothly runs, vaults, climbs, autojumps, and all the rest provides a very satisfying experience, and that's going to be useful stuff to know how to implement in the future. Although maybe now I should look into how other people accomplish things like this...
Note: the following builds are available for testing purposes but I don't have the ability to test them. These are Unity builds so I don't anticipate any serious issues, but I can't vouch for correctness or performance of these builds.