Controller Calibration, Rowing Mechanic v1.5 and Spline Tool

Controller Calibration

While programming the rowing mechanic, I set up and tested everything with my Xbox Controller. But each team member owns different controller types, e.g. PlayStation Controller or other third party devices. As every manufacturer has its own way of mapping the controller’s axes, we had to reassign the axis mapping in unity’s input manager by hand and every time I commit my changes to the Git repository, I also overwrote their setup. This process was very unhandy and it took a lot of time considering which of the available 28 axes would be the correct ones for every possible controller. Unity offers a controller calibration, but only as part of a final build. So it was up to me to program a calibration system on my own.

At first, I had to replace the “hardcoded” axis mapping of the rowing mechanic with variable ones. The next steps were a system that can assign axes to those variables and a system that prompts the player to move different parts of their controller. The algorithm right now is checking if there is a valid controller mapping. If there is a valid setup, there is no need for calibration and the system will be skipped. If there is no valid setup, the system asks the player to move the left thumbstick up, waits for the requested input (any axis is valid), assign it to the mapping variable, waits for the player to release the thumbstick again, asks him to move the same thumbstick to the right and so on until every axis needed is set up accordingly.

This calibration system is tested and works as intended. But it isn’t polished in its current state. For example, there is no way to save these setups in a profile and the visual representation is just functional and not appealing.

Rowing Mechanic v1.5

We had a clear vision of how the player should use the controller to row in the game. The player had to move the thumbstick straight upwards and move it in a circle (180°) to the bottom and release it than to refresh his stamina. It was a strict system that simulates real-life rowing, but it wasn’t intuitive at all. At every playtest session the players were very confused about what they should do to move the boat and it was even hard for them to maneuver the boat after a brief instruction and demonstration. They had problems to remember what “straight upwards” actually is, in which direction they have to circle and what the meaning of the stamina is.

We talked a lot about it and came up with a different system that alters itself to the player dynamically. In this system, “straight upwards” is the direction the player pushes to thumbstick to, even downwards is valid right now which is still in discussion. The 180° arc is calculated from that position and the direction of rotation determines if the player is rowing forward or backward. There isn’t a restricting dead zone anymore and the player is only limited by the amount of stamina left.

This system feels much easier to use but it loses some of its simulating character. It also could cause some problems to get the information needed to animate the characters while rowing.

Spline Tool for creating the River

Researching for water movement, especially of a river, costs me a large number of hours. There are dozens examples of water animations but they all have one thing in common, they don’t fit our needs. The water has to follow the river’s course, it has to simulate the experience of speed, dynamic and nature, and it has to have smooth transitions from one water plane to another because of our level generator.

At some point, I found a Unity training video about procedural mesh generation with cubic Bézier curves: https://youtu.be/o9RK6O2kOKo?t=39m38s

This looked like a solution and gladly I found a free tool in the asset store: “SplineMesh” https://assetstore.unity.com/packages/tools/modeling/splinemesh-104989

It took me a while to get comfortable with it and it looked very promising. With the help of this tool, I could create the river’s course and all that was left to me was a script that generates the actual mesh and adds it to the curve. This was a more or less straightforward task.

But the tool misses some features we need to have, primarily the possibility to change the width at every single spline node. Programming a Unity Tool was a completely different experience. I managed to include the functionality roughly, but I am far away from a productive tool.

While working on that tool, I talked a lot with David and he suggested to use a similar tool part of Blender. After considering the time needed to get the tool to a working state, I decided to stop working on it.