I've been working on the roads in-game for the past three days straight.
It's been a hellish, tedious process if I have to be honest - building and placing bland models with precision and repeatedly testing it is not quick work. Additionally, some glaring issues in the track design have become apparent - ones that should have been identified much earlier in the project (which probably would have happened if so much time wasn't used up by trying to get vehicles working in the UDK engine).
So, the level is going to have to be stripped down and built almost from scratch. I'd have no problem with this but time is a real factor now and i've lost so much of it already to trying to solve functionality issues - something I made quite clear at the initial project proposal in October that I would not focus on. This means no days off for the forseeable future.
I had devised a way of building the track in the level, using static meshes created in 3D. The track would be constructed in sections, and assembled in the game engine, much like a Scalextric track or toy train set. This proved to be relatively simple, but came with its own set of issues.
Collision of complex mesh objects (in this case, the sections of track) is hit and miss in the UDK engine - every collision mesh that surrounds the visible mesh has very specific (and limiting) criteria that must be followed in order for the collision to be accurate. If not, this happens:
This is not an issue with overly simple objects and props, but the track HAS to be perfect. This is the course that people will need to use to play the game and it will become glaringly obvious if any errors are present. So after hours of experimentation and trial and error I think i've cracked it, with a little help from the forums and constant game testing.
Collision meshes need to be as simple as possible but can consist of more than one mesh. This means that instead of one complex collision mesh surrounding the model, many simpler ones can do the job. this does use more memory but it's a price i'm willing to pay for the game to be playable. Additionally, collision meshes need to be made of convex angles otherwise the collision information can be incorrect, resulting in the problem shown in the first image of this post. Thankfully, after a lot of backtracking and alternative methods (I was considering making the roads again from a really simple flat surface which looks and feels like an old PS1 game) I think i've managed to solve the problem.
What remains to be done is to test the more complex sections of track such as the banked corners and junctions, make note of any collision errors, and break down the collision meshes one by one until the car stays on top of the road instead of sinking through it.
This should hopefully be done by tomorrow because I still have a list of things as long as my arm to complete before the holidays are over.