Devlog #2: Weapon Boosting
In Kalimpong, you have a single weapon system which is responsible for both offense and defense.
Using your weapon to shoot or boost consumes energy, so you have to chain maneuvers together thoughtfully. You can easily end up in a compromised position, where you’re exposed to your opponent and you don’t have enough energy to dodge or counter their attack.
Initial experiments with weapon boosting required that the player do everything. For example, if you wanted to dodge left you had to aim the weapon to the right and fire a boost.
These moves felt good when you pulled them off, but you almost never did, and it led to a bad experience overall because you were constantly whipping your camera around in combat. That was disorienting and made it hard to focus on your target.
To address this, I introduced manual camera and weapon decoupling. You could hold down a key and move your weapon and the camera wouldn’t follow it until you released the key. This way, you could aim boosts in combat without having to look away from your target.
However, this introduced another problem: you couldn’t aim your boosts very well that way, so they didn’t help you much.
At this point we decided to simplify things, because what we really wanted was to just press a key and have the vehicle shoot the right boost. Now, boosting forward, left, or right are all just single key presses. For example, to boost forward, you tap shift. To sprint/burn, you hold shift. To dodge left or right, you hit right click. The boost direction is the opposite of whichever way your weapon is aiming, and random if you're aiming straight ahead.
When you boost, the weapon’s aim rotation is temporarily hijacked and auto-rotated to the right orientation. The problem here is that the camera wants to follow the weapon, which is unpleasant.
Preventing this is easy enough: tell the camera system to ask the weapon system if it’s auto rotating, and if it is, don’t follow it. Unfortunately I didn’t think that one through very much -- the camera still has to look somewhere while the weapon is auto-rotating.
The solution became obvious once we play-tested a bit. Something that happens a lot in Kalimpong is being chased because you have something that someone wants. You end up looking and shooting behind you and boosting to dodge incoming shots. When you boosted while looking backward, the camera would snap forward, blinding you momentarily.
A much better experience than hijacking the camera when the weapon is auto-rotating is to just continue to follow the player’s desired aim rotation, and to smoothly bring the weapon to that desired rotation when it’s not busy.
This means you get to keep looking at whatever you want to look at and the weapon joins you there as soon as it can.
The implementation of this is not too bad. I just had to shift my thinking about how the player’s input affects the weapon’s aim.
Rather than the look input rotating the weapon directly, the input updates the desired aim rotation.
The weapon depends on this aim rotation when it’s not busy, and the camera uses this aim rotation to look where you’re looking regardless of what the weapon is doing.
Switching to this model also made it easier to implement mid-air aiming and the ability to look around without a weapon, because I can use the input control rotation and send it to whatever system is currently active.
King of Kalimpong
Multiplayer vehicle combat
Status | In development |
Author | piinecone |
Genre | Action |
Tags | Cute, Driving, Low-poly, Physics, Third-Person Shooter, Twin Stick Shooter |
More posts
- Devlog #5: Level Design and UI ProgressOct 04, 2021
- Devlog #4: Auto Landing SystemSep 24, 2021
- Devlog #3: Roundhouse KicksSep 17, 2021
- Devlog #1: Speed, Level Design, and Camera BugsSep 09, 2021
Leave a comment
Log in with itch.io to leave a comment.