Monday, 11 March 2013

Enemy AI

As part of the scripting in this project, I was responsible for getting our enemy wolf to perform different behaviours and react to stimulus within its environment.


Raycasting.

Following prior research (found in a previous post) I decided to use Raycasting as the "sight" for the wolf. This raycast would constantly be projected from the front of the character model and make the character react accordingly depending on what it hit (or not).

State based behaviour.

This refers to the three basic functions that the enemy will perform depending on what it "see's";

Natural State - Where in the wolf will patrol predefined way points, just going about its business.

Baited State - Triggered by raycast if it hits a game object tagged as "bait". The wolf will then deviate from its patrol route and investigate the game object before returning to the natural state.

Hostile State - This is where the wolf has detected our player and will proceed to move toward and kill them via interacting with the Health variable set on the player.

Initially the above states were their own separate Boolean Variables which would need to be set from true to false at regular intervals through out the script.
However, under advisement of a more experienced programmer this was later changed to a String variable, significantly reducing the lines of code required.

Rigidbody vs Character Controller -When first setting up the patrol system in the "Natural State" the wolf had a Rigidbody attached to it, the idea being to propel the character along and move it that way.
However this caused several problems when implemented. First and foremost being that because the rigidbody is constantly effected by gravity, the wolf would drag along the surface of the world and severely reduced the speed of the wolf.
As well as this the physics had the potential to cause the model to fly up into the hair at random intervals.
Upon further research (and a lot of rewriting of script) the wolf now has a Character Controller to direct its movement.

Lesson learned - Rigidbody for bullets.

(DS 11/03/12)

Saturday, 2 March 2013

Raycasting in Unity



During the game play of the Red Riding project we want the player to be able to be detected, or to distract enemies.
To do this we will need the enemies to be able to react to stimulus to control its behaviour.
In order to do this I intend to give the enemy characters a "sight" in the form of Raycasting.

Below are a couple of videos of uses of Raycasting in Unity.




Essentially raycasting is drawing a simple line in a predefined direction (can vary depending on use) and detecting its collision with other objects.
This can be used for sight, detecting the height of an object or firing weapons.


(Raycasting is used commonly in modern FPS's, mainly because it is easier to do and is cheaper for game engines to carry out.)


Unfortunately the Ray cast is very small, and does not cover a true area of sight, something I will have to look into in order to improve the system.

DS (02/03/13)

Wednesday, 16 January 2013

Cloth in Unity

I have looked at putting different varieties of cloth into unity and there are three possible ways to do this.


Firstly we could use Ncloth which is Maya's cloth animator, This is really good but we have massively struggled to get it imported into unity. However we found it easy to use in maya
A video example is



Then I went to research the cloth that 3Ds Max uses, This works perfectly however it would possibly mean modelling in 3Ds which is something i have not learnt in huge detail. and I would have to create idle animations and Walking animations and jumping animations for it in 3Ds.

This video above is an example of the 3Ds max cloth which i personally think looks really quite nice.


The 3rd Choice is to use the Shroud Studio Package to help make our game as it is unbelievably realistic and looks very nice. I have tried installing it but so far it is not working. I have contacted the admin of shroud to find help with my issue of crashing.
Here is an example of the cloth in it.


(WP) (16/01/2013)

After trying for a while to get the cloth to work without any glitches, we have decided that it is not worth the hastle that it was causing and concentration could be used elsewhere on the game.

We have changed the aesthetics of Ruby to reduce technical issues and move forward with other work.

WP (26th March)

Map Layout

Coming Soon...

The Map layout so far.




Above is the first area of the game, all ready to have the additional Assets added and finished off for the BEAT version of the game. (Missing Grannies house and Roses Assets.)


Second area of the game currently in finalization of being completed, this is the hub area which will offer the first challenge in the game, it is also the second main Terrain to the character and will be more void of sensibility of Safety, It is only missing the 'Wolf Assets' and the back of 'Grannies House asset'.

Hopefully this will offer the first exciting development of fear in the game. With the open landscape, sneaking by and encountering the first Enemy.


First shot of the 'Grannies interior' Level this is where you see the shocking development in the story.
A house and windows will be Built in this area, so you can see the surrounding landscape whilst going slowly through the house.

That's all for now, but more will be introduced later on!

Audio Requirements

Using numerous sound files, we will create the atmosphere of the game to be many things at different times, for instance small audio clips to add tension, or even moments to make the player jump, longer audio files to fill in time with walking or creeping so things don’t seem as dull, many different audio files will be included to supply the best appeal to both the game and it’s playability quality.

(MM 15/01/2012)

Title and Information Screens


Story book style opening to main page, there will be no scoring, the Death page will display the message ‘…and so our story ends…’.

Information and instruction will be among many other subsections of the menu, Other subtitles will include ‘Instructions’, ‘The making of ‘A trip to grannies’’, ‘Concept Art’.

These menu’s included should help the game become more enjoyable.

(MM 15/01/2012)

We have created the Main menu screen using a camera inside our world, this gives the player a chance to view the game from a different perspective when starting off.  



The Logo at the top of the screen is a logo i made using photoshop, starting with a typeface called Northwood High. There are lots of different ways that i tried to make the logos (below) and this was the one that looked the best in the actual game.



The one below is a frosted version of my Logo design. 


WP (26th March) 

Game Play


The player consists of running, walking, and sneaking around the map, using the mechanics of hiding in certain areas, and a mechanic allows the usage of food being thrown to distract many things. The player must survive the journey to safety from the Grandma’s House evading Traps, puzzles and the enemy, using stealth and intelligence, whilst also trying to remain unnerved from the horror in the surrounding landscape.

The ability to hide makes being detected by enemies a lot more harder, and makes your character and yourself feel safe, use this to your advantage by jumping spot to spot to remain unseen for longer periods of time and make it onto the next area.

Using third person you can jump run, and walk to keep on going on your journey, and see what is around you, this will keep you aware to an extent, but also increase the fear from atmosphere.
We are also going to attempt to implement the usage of a Wired Xbox controller for our game.


(MM, 15/01/2012)

(Updated! MM, 12/03/2013)


The player consists of running, walking, and sneaking around the map, using the mechanics of hiding in certain areas, and a mechanic allows the usage of food being thrown to distract many things. The player must survive the journey to safety from the Grandma’s House evading  the enemy, using stealth and intelligence, whilst also trying to remain unnerved from the horror in the surrounding landscape.

The ability to hide makes being detected by enemies a lot harder, and makes your character and yourself feel safe, use this to your advantage by moving from point to point to remain undetected throughout the game.
Using third person you can run, and walk to keep on going on your journey, and see what is around you, this will keep you aware to an extent, but also increase the fear from atmosphere.


Controls For Game: 

We are going to stick with the standard controls for movement in our game. 
W = Forward
S = Backwards
A = Left
D = Right
We also had to add a crouch control into our game to help Ruby hide from the enemies. This was obiously set to

C = crouch

The next stage was to throw the fruit for distraction. We decided that the best controls for these would be 
1 = select apples
2 = select berries
G = Throw

The Final decision was to add a sprint into the game as this would be needed for the final scene in which the chase is situated.

SHIFT = Sprint

WP (26th March)