Creating Crash Force – Characters Part 1
Hello, everyone! Characters are one of the most important parts of the game. Although Unreal Engine has a variety of different configurations you can choose from (Humanoids, Vehicles etc.) nothing really fitted exactly as we wanted it to. What we decided to do is create our own using different templates as a base.
Playing with different configurations it suddenly struck us. Why use cars? Why not something more spectacular? Why not hovercraft? We all liked the idea of hovercraft as vehicles for our game, so we shifted our effort to that direction. We took the basic vehicle template that Unreal provides and we started playing around to make it hover instead of rolling.
At first, we created some basic line tracers from the center of the hovercraft that ray cast into the terrain applying an upward force to the vehicle to keep it floating. Then we reconfigured the input controls to apply directional forces instead of rotation torque. The vehicle was floating! Our small victory was short-lived since, with the slightest directional force input, the vehicle would lose balance and tip over.
The problem was that the line tracers began from the center of mass of the vehicle (it’s not a hovercraft yet :p) making it extremely difficult to balance, like a monocycle with a really long seat position. We repositioned the initial line tracer and added three more to cover all the edges of the vehicle and we tried again.
Here is the result:
That was way better. It still needed a lot more tweaking in order to gain the desired effect but we were on the right track. At the same time, we concluded that our hovercraft should have a weapon turret on it with its base rotating left and right. The turret should hold a number of barrels that could rotate up and down. With this structure in mind we created the skeleton of our hovercraft in a way that we could use the same bone structure for any other hovercraft there was to follow. The next step was to bind the rotation of these bones to the player input (mouse and controller) in order to make the turret/barrels rotate with mouse input. We were also creating a prototype hovercraft mesh to test these controls. Well, it didn't go as expected.
Here is how it looked:
The camera was completely disoriented because it was handled by two different occasions. We easily fixed this issue by attaching the camera to the back of the turret barrels. Wherever the turrets were pointing at, the camera would be pointing at. We had a good base for a hovercraft. What we needed now was to make it shoot its weapon as well. We took the Shooter game that Unreal gives as a base and we put our character in it. After tweaking for a while with different configurations we ended up with this:
We now had a hovercraft that could move, point its weapon, shoot and take damage. This was a solid base for us to move on. On the next part, we will see how this solid base evolved even further.