Labels

Tuesday, 12 November 2013

Scripting and Unity

Toon Shading

After my last post there has been significant progress made to the toon shader. Previously I had encountered a problem with the shaders bands of shadowing and real time shadows creating strange graphical artifacts.

The problem was resolved by disabling the receive shadows property on objects experiencing the artifacts. Also previously the shadowing bands used by the shader were completely procedural and created by the shader code. As this in some cases made the normals of models appear grainy, I created an alternative shader that implemented a ramp texture to be used to create the shadow bands instead, which also allowed me to create smoother shadow transitions.

Both shaders are still in use in the game as we felt as a group that some objects looked better with each type of shadow banding than others.

In the example below, the character on the left has the procedural shadow banded shader applied while the platform in the background and the rock to the right use the ramp texture shader. There is a clear visual difference and we hope to incorporate both to create a good aesthetic for our game.


Character Movement Continued and our Unity Demo Scene

I have been continuing to script the character controller to improve the feel of its movement. As it stands the difference between the new version and the older are quite minimal in appearance. Most of what has been done to change it has simply been re-writing the already existing code that allows me to incorporate sliding, momentum and acceleration far easier. I have also recently scripted in the support for moving platforms as our demo scene has moving platforms implemented in it and without the support for it the character controller would simply fall through the platform.

Modelling

Below is a screen shot of the basic models that I created in 3DS Max to give some sort of visual representation as to how the final game may look. The models are fairly low poly and are acting as simple place holders for the time being. Eventually they will be replaced with the final models, textured and unwrapped.



The Unity Demo Scene

For our pitch I have constructed a basic scene in unity comprised of the above modes. The purpose of this scene is to give a visual representation of roughly how the game may look and also to house some basic mechanics that will be implemented into the final game. The screen shot below shows the scene with all of the models set up before any mechanics have been implemented.


Once all of the models have been correctly positioned I moved on to begin scripting mechanics that demonstrate what sort of mechanics we will be having in our final game, these are however still just basic examples and may be subject to change.

The first was the wind system, this allows the player to jump into a "gust of wind" being generated by some sort of in game object that will slowly push the player upwards giving the appearance that they are being blown from underneath. Also included is an example of how I could possibly use physics materials and rigidbodies to design some puzzles for the ice level.

In the demo scene I have simply applied a physics material to one of the "ice" platforms that represents the properties that a frozen platform may have; very hard and very slippery. To also demonstrate this there is a cube with a rigidbody attached that the player must push along the ice to jump on to to reach the next platform. As this rigidbody is sitting on an object with the ice physics material applied it will carry on sliding after the player has stopped pushing it, to make it appear that the "icy" floors are slippery.

The last level mechanic to be implemented was the moving platforms and rising lava level of the volcanic themed section. Also incorporated in this section is a concept that may potentially make it into our final game. The idea behind this concept is that some objects may break into the foreground and as the player approaches the section that obstructs the foreground and the players view will fade away, allowing the player to clearly see what they are doing. In the demo scene this is represented by a mini volcano that has been split in half. The front half is is hidden once the character approaches it and the re appears when they are further away again. The screenshot below shows the final demo scene set up with all of these mechanics in place.

Also I have implemented a simple death and respawn system to make the demo scene feel like more of a simple game demo.




No comments:

Post a Comment