Wednesday 29 May 2013

Sound Recording

Today we were in the sound booth recording all the voice work that would be needed for the game. Due to his relative expertise in audio production, Pat would be working his magic with the sound equipment. Here's what we recorded:

- "JAGA" Splash screen
- Jaga Rally Theme Tune
- Voicing for menus
- Voicing for Driving Assistant

"JAGA" Splash screen

Simply put, we wanted to recreate this:


To do this all three of us, myself, Tim and Pat grouped around the microphone and with the help of a classmate and a guide tone we made the recording.

Jaga Rally Theme Tune

After this, and still with the three of us in-booth, we recorded our own version of the classic Sega Rally theme tune:




Overall i think Pat did a fantastic job with this.

Voicing for Menus and Driving Assistant

After this it was just me left in the sound booth as i had been elected to provide voice recordings for both the menus and the race assistant (The person in rally driving who reads track information to the driver.) I was asked to use a slightly gravelly enthusiastic american voice, you can hear one of the many lines i recorded in the link above, just before the music starts ("JAGA RALLY!".) You can listen to more of them below, I feel that I could have done better for some of them but over all i'm happy.


I greatly enjoyed the voice-acting/singing experience, I have even been commended by my teammates who went as far as saying i should 'look into doing some VA (voice acting) work", and while i think i have some improving to do, i have to say i'm tempted!

Thursday 23 May 2013

A Sharp Corner

So it seems everyone was right, we gave ourselves an impossible task.

At the start of this module we were advised that creating a racing game in 10 weeks would be very very difficult if not impossible, and despite a few cut corners on our part (ie. reducing modelling demands by buying a car model, using a premade tutorial as a base for the in-game driving, etc) it seems they were right.

With the workload needed for the three other modules we are currently involved in, we have had to have a major rethink on our aims for this module. We still have plenty we can hand in, but our aim of creating a fully featured racing game (albeit with only one car and one track) is not going to happen. Instead we are now aiming to make a trailer for our game, as well as a showreel of all the work we have made for the game so far, a much more manageable task that we can work around our other coursework.

It's sad that we won't be making an arcade cabinet with our game on it but our ambition can't be faulted (our foresight on the other hand...)

Wednesday 8 May 2013

Track and Terrain Creation

Work for the creation of our track began as soon as i had received the track concept from Tim and Pat, you can see it below, it has been colour-coded to reflect the parts of the track that were to be repeated:

I will start by saying that despite the planned method of creating the track by 'piecing together' various segments, time constraints meant that i decided to create it as a single mesh in 3DSMax, with the option to break it up if time allowed. Once finished i would simply import it into Unity along with a collision mesh.

So i decided the best way to create the track layout would be to take the concept into Max and use it as a template to effectively trace over it by extruding a plane.

It's my understanding that you can extrude along a path in some 3D modelling programs so i searched for a method to do just that. I discovered that there was a function to do just that.

I was required to create a spline in the shape of the track which i did by simply copying from the concept above:




After doing so, i proceeded to test out the 'extrude along spline' function. After encountering bizarre warping, extra geometry and various other problems i was able to reach the point where i had a cube extruded along the spline:


All that was left to do was remove the extra geometry (i only needed the flat surface to be taken into Unity) followed by the creation of the collision mesh, and finally, texturing.


Before and After of the 'trimming' of the track mesh.

Having done this i simply proceeded to duplicate the track mesh which was then altered (by a simple edge extrusion) to have vertical planes. These planes would make up the invisible wall of the track, and in it's complete form, this mesh would be the collision model for the track.



At this point i decided to export the mesh into Unity to test how well it transferred. The result: not very well, i found the scale to be far from what would be required (though admittedly this was expected), the normals appeared to be reversed and overall the models didn't seem to be rendering properly. Thankfully after attempting to correct these issues (namely modifying the normals of the meshes) and reimporting the meshes into unity i found everything worked perfectly!


After this i went back and altered the track mesh to better represent a sandy rally track, as well as adding some more varied terrain for the track itself, to keep it interesting.




Note: Having made the sloped hairpin manually i then discovered the 'Soft Selection Tool', which may well have helped me accomplish this task far, far more easily. Still, at least it came in handy when i had to go back and remove the tracks 'bumpiness', another feature I'd added manually but which wreaked havoc with the car in game.


After more time than i would like to admit spent adjusting the geometry i had reached a point i was happy with. Texturing the mesh in Unity was a very simple process as the mesh comes with a 'Texture' component pre-assigned, all i needed to do was import the image below and adjust its tiling to a satisfactory level.



The next step was to build the desert terrain around the track, and not having done it before i did of course check the Unity Documentation for a guide. After looking through that i began by creating a 3000x3000 unit terrain.

As i understand it, terrains are simply canvasses upon which you paint the hills, cliffs and even foliage that your environment needs. Given the desert setting of our track i simply began using the softest brush to create some smooth mounds around the track, my intention was to have the terrain overlap the track at the edges to blend the two together.




I feel i may have missed the mark on the scale of the track so far, but for now it will suffice. Next up: Texturing the terrain!

This was an incredibly simple process, i took the sand texture i had used for the road into Photoshop and lightened it so it would be differentiable from the track, then to my surprise rather than having to paint the terrain as I'd expected, i simply had to assign the texture and it was on. The only qualm i had was that i couldn't scale the texture, but i found that it just made the track easier to differentiate and didn't affect the over all look.


Finally, whilst making some adjustments to the terrain i added a lake at the center of the banked hairpin or 'carousel' as it is called by us. I did this simply by maneuvering the water mesh (a remnant from the original Car Tutorial) in to place, i believe it will help keep the environment interesting.


At this point i simply had to obtain the models created by my teammates Pat and Tim. These models are as follows:
- Start/Finish line banner
- Checkpoint banner
- Billboard
- 7 Variations of individual crowd models
- Speaker
- Desert Grass
- Cactus
- Rock
- Palm Tree


Above you can see shots of all the models after they'd been successfully imported into Unity along with their textures, there was some rescaling that needed doing, as you can see from the second of the two images.

The first thing i did was create a nice start line scene:

How it looked before

Afterwards



Note in the second picture that i have added simple Unity planes as collision meshes for the tyre walls, as this brings me on to my next task.

Given that i didn't want to have a massive tyre wall construction akin to the start line at every checkpoint i decided i would simply place the mesh in the middle of the track and create collision meshes for the posts that support the banners.

Firstly, i created a Cube.

I scaled it to match the post.

Then i deleted the mesh rendering components, leaving just the collision component.

I duplicated the cube to the other side and (after rescaling the model) it was done!
The next step was to take this model and duplicate it for placement around the tracks course, not having had the checkpoint locations specified that placement was left up to me. Given the nature of the arcade racing game and it being all about making it to that next checkpoint, i decided to make them as sparse as reasonably possible, with long stretches between them.



From these pics you can see i ended up only having 3 checkpoints on the track, and even then i thought they might be a bit too close together... The fourth "checkpoint" you might be able to see in these images is actually the start/finish line.

Next up came placement of the environmental models, so the trees, cacti and the desert grass.

I started by focussing on the lake I'd placed in the center of the carousel, this area would be the only place in which the palm trees would be found. Now, I am aware of the ability for trees to be 'painted' on to a terrain in Unity, but i found that this was unsuitable for my needs as there was no variation in the rotation of said trees when i painted them on, if i even managed to do that. I decided it would be quicker to place the palm tree models myself.

Before.
After.
Close up of the desert grass as it has a short draw distance.

I did however use the tree paint function to place some desert grass around the edge of the lake as it wouldn't really be too noticeable, and there were far too many models that would need to be placed manually otherwise.

On top of this i created a small island scene in the center of the lake, a cliché tableau made comical by the fact that the spectator model in question is a coursemate of ours who is most definitely not a bikini wearing female!

To make decorating the track a little easier i decided to create prop model 'clusters' that i could duplicate around the track.

I started by creating some spectator clusters, each of which consist of the seven spectator models arranged in various orders and positions, i ended up with 6 in total.


Together with the tyre wall model, i created several different 'spectator spots' along the track, a couple of these required me to create extra collision meshes as i did with the start line setup.




After this i moved on to the creation of cacti clusters. I decided to leave the desert grass out as it looked most at home around the lake (and it would have taken a monumental amount of time even to cluster them.)

And here they are, only 3 of them, but i knew that would be enough.



I proceeded to take these clusters and dot them around the environment.

Having done this i found myself with nothing left to do. I had finished our track! Admittedly there was no game logic at this point but the track could be driven round and it looked great!!

I achieved a lot during this time such as learning to use the terrain tool in Unity, creating and importing a track mesh from scratch, and creating something in accordance with a vision set out by a group. Tim and Pat were both very pleased with the finished artifact, as was I.





Friday 3 May 2013

Car Model and Implementation into Unity Car Tutorial

In this post i will be discussing the model we have obtained to use in our racing game, and the process of porting it into the Unity Car tutorial which we will be using as the basis for the driving in our game.

The car model

You'll have noticed i used the word 'obtained' when mentioning the car model, and yes it means exactly what you think, we have purchased a pre made car model for use in our game. This is not entirely due to a lack of the skills needed to create one of our own, in fact it's quite possible one of us could have made it, however it would most likely have taken far too long to do so the decision was made to save ourselves that time.


Unfortunately we lost some of that time due to the lesson we apparently had to learn about buying models online... (You can skip this part if you like as i will be having a mini rant)


Look at the model above, it looks great right? We thought so too. Sadly and infuriatingly, we were wrong. I no longer have the images to show you but, this model has no bottom. There is literally NO geometry underneath the car which, on a model that has been created and advertised as 'low-poly', staggers and bewilders me. Surely a model made in low-poly is created purely for use in a game environment? Maybe not if this model is anything to go by, but then again it could just be a lazily, poorly made model, i say this because not only did it have no bottom, this model also had some of the worst texturing i have seen. Again i have no picture but this guy basically had about 50% white space in a 2048x2048 map, so so so unefficient it actually made me angry, and for the space that was actually texturing? There were just 3 bog standard photographs of a Subaru Impreza from the front, back and side, as well as two random colour blocks and a cutout of the wheel from the side-on picture floating even more randomly in the white space than the other images. I will admit that despite the awful texture map that when placed on the model it looks quite good, quite convincing, and it's there that we were deceived.

The entire model just reeked of laziness and after spending an hour trying to obtain a refund we were granted one. So after making the note to never buy a model that doesn't show every angle in the screenshots again, we found a better, albeit slightly more expensive model.

The car model we will actually be using in our game

Here is the car model we will be using in our game, it has a bottom, has an efficient, well laid out texture map, and the slightly lower resolution of the texture map actually fits in with our retro, 90's rally racer theme. We were all very happy with this purchase.


Implementing the car model into the Unity Car Tutorial

I will be updating this section as i go along.

The first thing i noticed is that this model lacks collision meshes, it's made clear in the tutorial that these are required purely for performance reasons, but while perhaps not an issue with our low-poly car model, i thought it'd be best to make an even lower-poly, slightly blocky pair of collision meshes (one top, one bottom) that would perhaps emulate the collision detection available to those earlier games.




Another thing i noticed was that the wheels in this car were just wheels, whereas the Unity car has wheel meshes that are parented to disk brake models, as far as i understood it, however, the disk brakes were purely cosmetic and i would be able to just use the wheel meshes.

So i then took the model and all its components into Unity using the 'Import New Asset' function, and was immediately greeted by a slightly worrying list of mesh components, simply put all the individual parts of the model had been imported as individual parts, though they were grouped together. This was worrying because the Unity cars model was so much simpler by comparison and i was concerned that this would cause problems, still i went ahead with moving the car model into the scene as instructed by the tutorial and proceeded to set everything up as best i could.

After i was satisfied i had followed the instructions properly, i pressed play aaaaaaaand

Nope. No good.

It seemed the collisions for the body were fine, but for some reason the wheels were not being detected, they just clipped straight through the floor, though they were still attached. This meant the car was unable to move, so i had some bug fixing to do, it was my assumption that there were just some names that i had to match for the code to work properly. Either that or i needed to make some disk brake meshes!

Okay so i tried out adding the disc brake meshes from the default car to our car model and made the wheel meshes children of them. I pressed play aaand...


SUCCESS!...

...sort of. I can now drive the car! Though as you can see there are some teething problems for this setup, I will now make some adjustments to the cars model and re-import it to Unity. I'm simply planning to add my own disk brake meshes to the model and i may also adjust the wheel sizes a bit.

After doing just that (and taking the opportunity to improve the organisation of the model) I once again set everything up according to the tutorial. Unfortunately, despite this effort i had inadvertently taken myself a step backwards, i was once again working with a car whose wheels weren't being properly detected. On top of this, i noticed another problem, the rotations of all the wheels seemed to be off, and my attempts to manipulate them back into place (under the assumption this had something to do with the problem) caused some bizarre warping of the models.

After searching online for a solution to this problem I came across this thread on the Unity Forums that gave me the solution i needed. Apparently all i needed to do was go back to the model in 3DSMax and adjust the pivots so that the Y-axis was pointing upward, this is due to a disparity between the axes used by Unity and 3DSMax. I had some trouble with the disk brake models i had created when trying to adjust their pivots, namely some bizarre warping that was occurring. To fix this i simply had to convert said models into 'editable poly's'. Once again I exported the model and imported it into unity, with great results:


As you can see from above it appears the car is all but working perfectly! But sadly, there was one more small thing left to fix:


As you can see the rear wheels aren't quite aligned with their forward-positioned counterparts, though oddly their position resets when the car is off the ground.

After attempting to solve this alone without success, i took my problem to my classmates, and with the help of Dean Stone, found a solution. And my goodness was it a simple (if slightly inelegant) solution. It seemed i had been too lost in the assumption that the problem could be solved through manipulation of the code, i had located what i believed to be the culprit in the 'Car' script, but had no idea how to go about fixing it. So, after asking for the help of my classmate i was astounded to see that his suggestion of simply moving the wheel meshes proved successful. I hadn't considered that such a simple solution would work, and yet the proof is in the picture:


The wheels now aligned properly with the car, and while the wheels, when off the ground reverted to their slightly odd positions, though for the vast majority of playtime this is unnoticeable.

Despite not having fixed a lot of the problems with this car such as the floaty gravity, bizarre forward movement bug and the slightly buggy camera, i believe the car setup is now at a point where it is suitable for implementation!

A couple of final adjustments i make will be to the smoke effect from the tires, adjusting it to make it look like sand, in keeping with our desert track design.

Although i didn't delve into the world of coding during my time spent importing the car mesh, i am proud of what i have achieved here. Though importing was frustrating at times, it's incredibly gratifying to see your own model (albeit an outsourced one) moving around a game environment and behaving as you want it to, like a rally car. On top of this, my time spent here has only improved my respect for the simplicity that Unity provides.