Tuesday, 14 May 2013

End Game

Here I will be describing the problems we had with our final instalment of vertical slice of our game Dionysus below you can see the first person controller facing outside the house pod. The added in the fog to hide the rendering of the trees as you can see where crossovers are this position of one of the parts and as you can see it is not their. This will be shown once the plant in front has been eaten also below you can see in the bottom right-hand corner. There is the mini map that Alistair made, which shows the position of the controller with red arrow.



below is a closer up image of previous few above, and their health by the top left-hand corner has also got smaller as decreases over time due to your hunger.


one of our main problems was that when you first eat one of the plants. The mini map will disappear forever and will not return. We looked into this and could not find a solution, even though the mini map was successful and worked well due to perhaps encoding it just disappears.and also, as you can see from the plants being eaten apart are described earlier, has now appeared.


below is the pause menu that cat made using the coding as shown on the blog . Unfortunately, due to the lock of the mouse and not coding the buttons to do their own functions. It doesn't work that this show that we were on the verge of finishing it and we needed more time to code


below is a video showing the character, leaving the part eating the plant, seeing the object to pick up and picks it up. This is just shows the basics and the core mechanic of our game.


Problems:
  • Getting the code to work for the health and death zones around Alistairs trees
  • to get the mini map to stay on the screen after plants being eaten
  • getting the pause menu to work
  • having an end game screen or reverting back to menu
Overview:

looking at the vertical slice. We believe that the core mechanic has been shown due to hallucinations from eating the plant to finding a part to the fix your ship. This is the core mechanic of Dionysus . We believe, for the first vertical slice. We have made. This is a great combination of all our knowledge and special skills and a unique talents from Alistair JJ, who mainly focused on 3-D and Alice and Cat who focused on coding and Rebecca, focusing on 2-D. The team had its ups and downs, but overall the vertical slice has come out to be a solid game yet you do not have a death screen and an endgame, but as I said above, the core mechanic of the game has been shown using this knowledge that we have learnt the game that we will make in the third year will be greater than this vertical size due to the knowledge lessons we have learned and all help us a lot in the future

Thanks for your help. Tanguay, Steve and Robin


AI Information code pontentially working

using UnityEngine;
using System.Collections;
public class Information : MonoBehaviour {
 // Use this for initialization
 void Start () {

 }

 // Update is called once per frame
 void Update () {

 }


// This function checks if the player has entered a trigger
 void OnTriggerEnter(Collider other)
 {
  // The switch statement checks what tag the other gameobject is, and reacts accordingly.
  switch(other.gameObject.tag)
  {
   case "FlowerInfo":
   hitObj.gameObject.BroadcastMessage("This plant seems to have healing capabilities");
   break;
  
      case "LeavingDoor":
   hitObj.gameObject.BroadcastMessage("Hello Comrade, you are missing parts for your distress beacon, search the canyon for this parts");
            break;
  
      case "DeathSpot":
      hitObj.gameObject.BroadcastMessage("Comrade, this area appears to be very damaging towards your health");
   break;
  
  
       }
 }
}

Pause Menu code

using UnityEngine;

using System.Collections;

public class PauseMenu1 : MonoBehaviour

{

public GUISkin myskin;

private Rect windowRect;

private bool paused = false, waited = true;



private void Start ()

{

windowRect =
new Rect(Screen.width /2 -100, Screen.height /2 -100, 200, 200);

}





private void Waiting()

{

waited =
true;

}



private void Update()

{

if(Input.GetKey (KeyCode.Escape) || Input.GetKey (KeyCode.P))

{

if (paused)

paused=false;

else

paused =true;



waited =
false;



Invoke(
"Waiting", 0.3f);

}



if(paused)



Time.timeScale = 0;



else



Time.timeScale = 1;





}









private void OnGUI()

{

if(paused)

windowRect = GUI.Window(0, windowRect, windowFunct, "Pause Menu");

}



private void windowFunct(int id)

{

if(GUILayout.Button("Resume"))

{

paused =
false;

}



if(GUILayout.Button("Options"))

{



}



if(GUILayout.Button ("Quit Game"))

{



}

}

}

Ship Parts

Given that, as said in the privius post of mine, there was an explotion on the shit, ive created tilable ship parts which should be useful to litter around the map.


This one is for the ships flooring, emergency lights are self powerd so even if the ship brakes up the light will still be on.


Part of the large Heat Sheld that the ship had


Part of the common flooring within the colony ship.

Health Damage and Health Bar Code


public class HealthBar : MonoBehaviour
{
 //  player's health and health bar
 public float curHP=100;
 public float maxHP=100;
 public float maxBAR=100;
 public float HealthBarLength;


 void OnGUI()
 {
  //  creates the health bar at the coordinates 10,10
  GUI.Box(new Rect(10,10,HealthBarLength,25), "");
  //  determines the length of the health bar
  HealthBarLength=curHP*maxBAR/maxHP;
 }

 void ChangeHP(float Change)
 {
  //  takes whatever value is passed to this function and add it to curHP.
  curHP+=Change;

  // This if statement ensures we don't go over the max health
  if(curHP>maxHP)
  {
   curHP=100;
  }

  // This if statement is to check if the player has died
  if(curHP<=0)
  {
   // Die
   Debug.Log("Player has died!");
  }
 }

 // This function checks if the player has entered a trigger
 void OnTriggerEnter(Collider other)
 {
  // The switch statement checks what tag the other gameobject is, and reacts accordingly.
  switch(other.gameObject.tag)
  {
  case "Heal":
   ChangeHP(5);
   break;
  case "Damage":
   ChangeHP(-25);
   break;
  }
  // Finally, this line destroys the gameObject the player collided with.
  Destroy(other.gameObject);
 }
}


Now we just need to add a timer which Alice is currently looking into :)

using UnityEngine;
using System.Collections;

public class HealthBar : MonoBehaviour
{
 //  player's health and health bar
 public float curHP=100;
 public float maxHP=100;
 public float maxBAR=100;
 public float HealthBarLength;
 private float updateDisplayTime = 0F;


 void Start()
 {
   updateDisplayTime = Time.time + 5F;
 }

 void Update()
 {

        if ( updateDisplayTime < Time.time )
     
   {
         curHP -= 3;
         updateDisplayTime = Time.time + 5F;
   }

    if ( curHP <= 0 )
      {
          this.enabled = false;
      }
 }
 void OnGUI()
 {
  //  creates the health bar at the coordinates 10,10
  GUI.Box(new Rect(10,10,HealthBarLength,25), "");
  //  determines the length of the health bar
  HealthBarLength=curHP*maxBAR/maxHP;
 }

 void ChangeHP(float Change)
 {
  //  takes whatever value is passed to this function and add it to curHP.
  curHP+=Change;

  // This if statement ensures we don't go over the max health
  if(curHP>maxHP)
  {
   curHP=100;
  }

  // This if statement is to check if the player has died
  if(curHP<=0)
  {
   // Die
   Debug.Log("Player has died!");
  }
 }

 // This function checks if the player has entered a trigger
 void OnTriggerEnter(Collider other)
 {
  // The switch statement checks what tag the other gameobject is, and reacts accordingly.
  switch(other.gameObject.tag)
  {

  case "Heal":
   ChangeHP(5);
   break;
  case "Damage":
   ChangeHP(-1);
   break;

   if ( updateDisplayTime < Time.time )
    
  {
        curHP -= 10;
        updateDisplayTime = Time.time + 5F;
  }

   if ( curHP <= 0 )
     {
         this.enabled = false;
     }

  }
  // Finally, this line destroys the gameObject the player collided with.
  Destroy(other.gameObject);
 }
}


The "private float updateDisplayTime = 0F;" we managed to find from one of Alisters lessons, so that there is a counter to how quickly the health decreases when you're near the trees.

Cargo

since we lacked geniral debri such as Cargo which would of been throwen out of the ship during the initial explition i desided to create a few boxes of various types depending on the cargo. was not hard to make, and it is easy to duplicate within Unity.

All of them are Normal Mapped, some of them are better than others since there was troble with "SSBump" and trying to get it to be smooth rather than Jagged, but the effect works well since they would of been bashed about.






Monday, 13 May 2013

Intro Screen

Here is the intro screen.
 
 
Here I was looking at using the rolling credits like in star wars and using the words "A Long Time Ago In A Galaxy Far, Far Away" what the planet dose at the end of the rolling credits is come up close as if your zooming into the planet to where you are.
 

 
 
Part 1

 
Part 2

 
Part 3

 
Part 4

 
Here is the planet zooming in.

Crosshair, Fog and Code

 
Using these codes below I got the mouse to stay in the center of the screen
 
These codes are Javer Script and there in yellow
 
Code 1:: function Update () {
    Screen.lockCursor = true;
    Screen.lockCursor = false;
}
 
Code 2:: Screen.showCursor = false;
 
 
Also to get the crosshair to show in the center of the screen I uead this code.
 
Crosshair Code:
 
Code 3: var crosshairTexture : Texture2D;
var position : Rect;
static var OriginalOn = true;
function Start()
 {
  position = Rect((Screen.width - crosshairTexture.width) / 2, (Screen.height -
  crosshairTexture.height) /2, crosshairTexture.width, crosshairTexture.height);
 
 }
function OnGUI()
 {
 if(OriginalOn == true)
 {
  GUI.DrawTexture(position, crosshairTexture);
 }
}

 
Below is the crosshair that I made in Photoshop and then added to unity.
 
 
 
Using the simple reder settings (see Below) we added fog so we could hide the trees when they redered. 
 
 

Friday, 10 May 2013

3D modle Assets

more assets have been added to the Pods intorior, decorative ones to make it more homely.

so far we have a transparent Glass, Tolet role and an Alarm Clock which is the essential stuff at the moment.

 
JJ Made the glass
 

Alistair Made the clock


JJ Made the toilet roll.

Update


Alistair has added a crosshair so that the mouse locks in at the centre of the screen and made assets

JJ has edited sound effects and made assets

Alice has added a health bar, but we are having problems trying to get it so the health gradually decreases, goes up on eating a fruit and goes down on being near the tree's dealing damage or in the water.

I have added extra lighting to the pod and other areas like the AI and cave. Edited the waterfall texture so its showing water falling instead of a spray effect. I found some more sounds and added them to the game however only the ones attached to the first person controller are currently working and we'll need to add the door and eating effects to the code. Added in the assets JJ and Alistair made. Added code for a pause menu but it doesn't completely work with our current code/properly.