
Unit 7
Unity
Exporting from Maya to Unity
When exporting a lot of things can go wrong and can potentially ruin all your work if not backed-up. My first export I got the mesh of my rooftops but with no textures, this is because my "sourceimages" folder did not export properly, which was fixed by me having to manually transfer all the textures to the Unity project.
Now I had the mesh with its corresponding textures, Great! But when I added the first person camera the person was way too huge for the map. So the first thought that comes to mind is to shrink the character to the scene which would work, but it will also create a lot more problems for example the physics will be wrong and the character will have wrong speed/jump values as these did not scale with the character's size. The only way to fix this was to scale the map to the character which proved harder than it sounds. First grouping the whole map into one won't be ideal in the long run but it was essential to scale the map (scale each mesh bit by bit is not a good idea). The computer didn't like me scaling a large number of combined meshes and so it kept on freezing which added to the process being slower and painful. A small mouse movement will cause the map to either be too large or too small so I had to work with numbers with several decimals to get the perfect size. There was one more problem, the character would simply fall through the ground which is quickly fixed by selecting the whole export and physics and mesh colliders.
The character could now move freely on the map.
Tweaking the map
The map just as it was, was boring and too blank for the player to walk around, so I decided to change the time from an early foggy morning to the evening. This allowed me to add night rooftop lights which are a lot more appealing and bring life to the scene. I wanted to take advantage of the water that is provided so I took a bold move to delete one of the corners of the map and replace it with water, which will later be a harbour. I went back into maya, planned the layout, made the harbour, and added a small cargo ship. Textures for ships are hard to find so I ended up doing my own ones; take a picture of a ship and in photoshop repeat any parts of the ship I need and blur/smudge out the seams.
To further bring life to the map I added: several trash bags, washing line, trash on the floor and elevated positions. To get to these elevated positions I needed a ladder. Making the ladder work was harder than expected, I needed 3 empty objects to register the player's movements and alter the controls. 2 boxes were to change the player's controls, one at the bottom to initiate the climb, and one at the top to return to normal controls. The one in the middle was the actual ladder so that the player follows the trail. This was not the end as the character controller also had to have its own code to allow the boxes to alter the player's movements.
Rain is a great effect but comes with a significant performance hit, so my idea was to only spawn rain particles in the direction the player was looking at. So I created 3 rain emitters in front of the camera and made them all a child to the players perspective, this will make the emitters move the same way the player does which makes the emitter tail the player. Now even though it rains in only one spot, the player will always see rain and make the player think that it's raining everywhere on the map. This way I achieved the sense of rain and managed to keep the performance drop minimal.
You could see the mouse cursor when navigating the map so a quick code to the character controller was added to hide the mouse.
Conclusion
Unity is very much like Lego, it may sound stupid but you are just putting different bits of objects/code together to create a game which is not easy. More often the code/objects will not be compatible which makes you do a lot of digging and converting to make it work. Due to me having experience in programming this was not much of a challenge but for other students this was extremely hard. And well I learned that I'm more likely to be a 3D designer rather than a game designer.
Timeleap
Viking era
For this project I decided to go design a viking village as I wanted to take advanted of the water and cloth effects of unity. To take advantage of them I designed a seaside village which has some fishing boats.
When making an environment it's important to keep the poly count as low as possible since with still/animation in maya can take ages to render and it won't matter, but in a game, in a real-time environment you have to render at least 30 images per second otherwise the whole experience will be laggy and bring the whole project down.
![]() | ![]() | ![]() |
---|---|---|
![]() | ![]() | ![]() |
![]() | ![]() | ![]() |
![]() | ![]() | ![]() |
Building for Unity from Maya
With this project I took a different approach than y last one, this is because I can now see the pros and cons in what unity can add to my work. Unity accels is terrain generation therefore maya will only be used to make the models which will then be placed in unity. One of the major drawbacks of Unity is the render engine and that it's unable to use blinn materials, which restricts me to only using lambert and making metallic objects look flat and plastic. Water generation is another benefit of unity, so to take advantage of that I made viking ships and a harbor instead of a village in the middle of the land. In unity I tried programming and created interactive cloth with trees blowing in the wind. Surprisingly fire was a massive problem since the particles where large with a slow spawn rate, but to do a small flame you need small particels with an incredibally high spawn rate, this also is a problem since more particles cause a longer times to render frames so I had to find the balance between making the fre look unrealistic and the frames high enough.
Evaluation
For this part of the unit I focused more on the unity game design side rather than the maya modelling, this meant that the moodeling is going to be simple. My goal was to create as many particle systems and interactive objects as possible where I ended up with multiple types of fires, interactive cloth, and trees swaying of the wind. What caused the most issues was the fire particle system. It seems simple just to lower down the scale to make smaller fire, but by lowering the scale you only change the size of the emitter, so you will get a giant fire coming from a pixel, furthermore the smoke and light is uneffected by that change. To fix this I had to experiment a lot, I had to decrease the scale of the particle itself, increase its emition value, adjust its initial and final vielocity. All of this has to be perfect to make the fire look realistic. I found that the smaller your particle is the more emitions you need per second, to make the fire 50% its initial size I had to turn up the emitions to almost 100x its default value.