A few years ago after recently having joined Bioware I was asked by my lead gameplay designer about putting in swimming as a character movement style in the game. This was the week before our holiday break for the year and I knew that the engine we were using already had support for water volumes and adding another physics state to the character wasn’t a very complicated task.
Implementing features like these you want to do a quick proof of concept so that’s what I did, I used existing system queries. Created a test level with the existing tech support for volumes. Added some code for our custom state machine that detected when the character was in water. Supported simple things like walking in water, walking under water and then swimming.
The basic controls we used were the ones that you’ll see in many third person games where swimming is using the same third person controls as walking and you have specific buttons for going up and down in the water. This is a fine assumption in games where you are mostly traversing by running on ground. There were some issues like you would be swimming and then reach a walkable depth and the character would transition to walking but it was kinda cool to walk out of the water and start combat.
We were basically supporting this swimming feature as an exploration mode for the game so there was not much focus on it and it didn’t evolve past this basic implementation for a long time but we made sure that it was always working as the game evolved and we upgraded versions of the engine and changed physics simulation and state machine implementations.
The feature was there but we didn’t do much more than have it on life support. This is a period that is kinda hard in game development. You believe that the feature has a place but it isn’t a focus for anyone because there are so many other features in the game that are more important. So it is an easy thing to put on a chopping block but when there are people that stand up for the feature and believe in it you want to support it. Especially when it’s something your lead game designer wants to keep.
He was happy that we had it in and that we could do things with it to break up the gameplay a little bit. However it was very clunky. Especially since the game had such a flexible character movement style with sprinting, jumping and flying. Whenever you started swimming the movement slowed down and you just wanted to get out of the water. It worked well for wading in water to make the character physics feel like it had a bit more depth to it with that awareness but the swimming was just stopping your movement.
There was a time last year where we wanted to show the game off so there was a major incentive to improve some of the features that had been falling behind. Flying was one of them but swimming was on our minds as well.
Swimming was clunky and we had just revitalized flying with new physics code, new animations and new behaviours for controlling those animations. Me and the other player programmer had jokingly talked about making the swimming system reuse the flying animations and movement controls. But we had never convinced anyone to actually go for it.
I enjoy scuba diving (never have the time for it though) and I’m a fan of games like Katamari Damacy, Flower and Journey. Games that try to do something interesting with movement and presentation and a game that I had recently enjoyed was Abzû, an underwater adventure game where you are quite agile while moving in the water. This was a great tool in convincing people to try it out. So I changed the physics calculation, I made the movement controls steer the movement direction and I made the water act as drag on the character and I implemented transitions from flying to swimming. The focus for transitioning into water changed from walking into water to diving into water. We used a trigger button for propelling the character forwards, the same trigger used for boosting while flying. When I prototyped I reused the flying animations and I got something in quite quickly and then we had the animators go in and change everything to suit swimming with boosters. Also I removed the walking under water feature as it was such a clunky change in behaviour from the fast swimming.
We could reuse the same animation behaviour code for controlling the pitch and yaw of the animations so that as you were steering the character would bend naturally with the movement path. We only needed to add some additional steering support for when you didn’t move. The animations became so much more agile looking that it finally fit the Exo suit that our characters were wearing, wading water and swimming with your arms like a human never truly fit.
That was it, we had good jumping mechanics with hover, air control and so on. We had flying that transitioned nicely from the jump and that controlled much better than ever before and we had a version of swimming that truly worked with the rest of the character movement suite and that didn’t break the flow.
The moment when it all came together was great, I would record a video of me jumping off a cliff, starting to fly and gliding down over the water and going in and under the cliffs and then diving into the sea. I had a second example where I flew down and dove into the water and were boosting forwards just under the surface to launch up into the air when reaching a beach and start shooting. I recorded a video set to the Top Gun theme and added an introductory text to the video and put that up for a milestone presentation and I would love to share that video but I’m sure I wouldn’t be allowed to considering how much was work in progress at that time. By presenting this in an exciting way I think we also managed to make the team energized around the feature.
Swimming was one of the most rewarding systems that I worked on while I was at Bioware and I’m reminded of it now since it was just around this time of year that I started working on it some years ago at the request of Corey Gaspur.
Corey passed away last year and he was one of the most passionate game designers I’ve ever worked with.