Search Unity

[WIP] The Horror Room

Discussion in 'Works In Progress - Archive' started by iamthwee, Dec 23, 2015.

  1. iamthwee

    iamthwee

    Joined:
    Nov 27, 2015
    Posts:
    2,149
    Thanks brah, how getting on with your game wth free assets?
     
  2. Whiteleaf

    Whiteleaf

    Joined:
    Jul 1, 2014
    Posts:
    728
    I stopped it. there wasn't enough for me to work with right now; in the future I'll probably remake it but with my own assets. I could've continued, but the character that had all the animations was too old for mechanim. So the animations couldn't be put onto other models. It's all good though, as I'm currently making another sci fi game...yet to be announced. ;)
     
    iamthwee likes this.
  3. iamthwee

    iamthwee

    Joined:
    Nov 27, 2015
    Posts:
    2,149
    @Whiteleaf that's a shame the game was looking pretty good, but yes you're right you have to be careful with animations, I've never worked with mechanim before and do all animations inside blender. I'm struggling a bit with retopo as it takes so freaking long even with blender's retopoflow addon, there's still a sh*t ton to master.

    The girl's character is about five separate meshes so I have to be careful with animation you can't just add a rig and then parent bones with automatic weights. I'll look into in the next few days. Maybe I need to weight paint it, maybe I need to retopo I don't know.

    I spent most of today away from the computer as my head was hurting, just with paper and pen sketching out some ideas for gameplay and examining how hollywood builds tension drama and suspense. So I've got myself a little story that will be revealed as you sink deeper into the story. It's pretty exciting.

    Still amazed by blender's all round potential, and got around to cutting and editing sound tracks, blending sound scores and hand picking suspense noises/sounds.

    I still have no idea how they can pack that much functionality into one app.
     
  4. iamthwee

    iamthwee

    Joined:
    Nov 27, 2015
    Posts:
    2,149
    OK boys another quickie, I've almost finished rigging her, essentially I have four separate meshes and I've rigged each mesh separately and then parented one rig to the other. Will do a quick sanity check to see how it imports into unity before any further adjustments, I don't want to create all my animations to find none work inside unity.
     
    Last edited: Mar 16, 2016
  5. iamthwee

    iamthwee

    Joined:
    Nov 27, 2015
    Posts:
    2,149
    First pose, removed the bag as it was causing a few issues, this is going to be fun :D

    Removed

    Bitch be like 'ima do some salsa moves' :D
     
    Last edited: Mar 16, 2016
    Whiteleaf likes this.
  6. iamthwee

    iamthwee

    Joined:
    Nov 27, 2015
    Posts:
    2,149
    And a title for my game...
     
    Last edited: Jan 28, 2017
  7. felixfors

    felixfors

    Joined:
    Aug 13, 2010
    Posts:
    178
    Do you have permission to use that character?
     
    Rombie and theANMATOR2b like this.
  8. iamthwee

    iamthwee

    Joined:
    Nov 27, 2015
    Posts:
    2,149
    Nope, the game isn't for sale, but I get your point, maybe I'll give her new clothes and augment some of her features. Busy with stuff today so may work on it tomorrow.

    I'd just like to mention, you can find a lot of useful information outside of game development. For example, I'm using the one point perspective employed by the movie masters (stanely kubrick) for great effect.

     
    Last edited: Apr 8, 2016
  9. iamthwee

    iamthwee

    Joined:
    Nov 27, 2015
    Posts:
    2,149
    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class Shoot : MonoBehaviour {
    5.  
    6.     public GameObject bullet;
    7.     public GameObject bulletHole;
    8.     public float delayTime = 0.5f;
    9.  
    10.  
    11.     private float counter = 0;
    12.  
    13.     public float moveSpeed = 10f;
    14.     public float turnSpeed = 50f;
    15.  
    16.  
    17.     void Update ()
    18.     {
    19.         /*if(Input.GetKey(KeyCode.UpArrow))
    20.             transform.Translate(Vector3.forward * moveSpeed * Time.deltaTime);
    21.      
    22.         if(Input.GetKey(KeyCode.DownArrow))
    23.             transform.Translate(-Vector3.forward * moveSpeed * Time.deltaTime);
    24.      
    25.         if(Input.GetKey(KeyCode.LeftArrow))
    26.             transform.Rotate(Vector3.up, -turnSpeed * Time.deltaTime);
    27.      
    28.         if(Input.GetKey(KeyCode.RightArrow))
    29.             transform.Rotate(Vector3.up, turnSpeed * Time.deltaTime);
    30.             */
    31.     }
    32.  
    33.  
    34.  
    35.     void FixedUpdate ()
    36.      {
    37.         if(Input.GetKey(KeyCode.Mouse0) && counter > delayTime)
    38.         {
    39.             Instantiate(bullet, transform.position, transform.rotation);
    40.             GetComponent<AudioSource>().Play();
    41.             counter = 0;
    42.          
    43.             RaycastHit hit;
    44.             Ray ray = new Ray(transform.position, transform.forward);
    45.  
    46.          
    47.             if(Physics.Raycast(ray, out hit, 100f))
    48.             {
    49.                 Instantiate(bulletHole, hit.point , Quaternion.FromToRotation(Vector3.up, hit.normal));
    50.             }
    51.         }
    52.         counter += Time.deltaTime;
    53.     }
    54. }
    55.  
    OK I managed to figure out how to shoot and add a bullet texture to the wall using a youtube video.

    I think the takeaway I learned was the bullet hole texture is actually two planes with the texture parented slightly above the other, this way you don't get weird clipping issues.

    bh.gif

    Can't decide what to do next, either IK rig my protagonist or animate and texture the gun or work on the health screen...
     
  10. Whiteleaf

    Whiteleaf

    Joined:
    Jul 1, 2014
    Posts:
    728
    There are more efficient ways to do shooting, but good job. I remember I was just moving a rocket when I clicked the left mouse when I started Unity, and the problem was that the rocket was parented to the player, so it always stayed with his rotation, haha.
     
    iamthwee likes this.
  11. iamthwee

    iamthwee

    Joined:
    Nov 27, 2015
    Posts:
    2,149
    Thanks brah, if there is a more efficient way to do it I'd be interested to know?

    Any idea how to make the prefab third person controller work properly with the mouse orbit script? The below successfully orbits the camera around the player, but ideally I'd like the player to hold forward and then turn depending on the mouse position. Eventually, I'm going to write my own thirdperson controller with my rigged character, but just looking for help.

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. [AddComponentMenu("Camera-Control/Mouse Orbit with zoom")]
    5. public class MouseOrbitImproved : MonoBehaviour {
    6.    
    7.     public Transform target;
    8.     public float distance = 5.0f;
    9.     public float xSpeed = 120.0f;
    10.     public float ySpeed = 120.0f;
    11.    
    12.     public float yMinLimit = -20f;
    13.     public float yMaxLimit = 80f;
    14.    
    15.     public float distanceMin = .5f;
    16.     public float distanceMax = 15f;
    17.    
    18.     private Rigidbody rigidbody;
    19.    
    20.     float x = 0.0f;
    21.     float y = 0.0f;
    22.    
    23.     // Use this for initialization
    24.     void Start ()
    25.     {
    26.         Vector3 angles = transform.eulerAngles;
    27.         x = angles.y;
    28.         y = angles.x;
    29.        
    30.         rigidbody = GetComponent<Rigidbody>();
    31.        
    32.         // Make the rigid body not change rotation
    33.         if (rigidbody != null)
    34.         {
    35.             rigidbody.freezeRotation = true;
    36.         }
    37.     }
    38.    
    39.     void LateUpdate ()
    40.     {
    41.         if (target)
    42.         {
    43.             x += Input.GetAxis("Mouse X") * xSpeed * distance * 0.02f;
    44.             y -= Input.GetAxis("Mouse Y") * ySpeed * 0.02f;
    45.            
    46.             y = ClampAngle(y, yMinLimit, yMaxLimit);
    47.            
    48.             Quaternion rotation = Quaternion.Euler(y, x, 0);
    49.            
    50.             distance = Mathf.Clamp(distance - Input.GetAxis("Mouse ScrollWheel")*5, distanceMin, distanceMax);
    51.            
    52.             RaycastHit hit;
    53.             if (Physics.Linecast (target.position, transform.position, out hit))
    54.             {
    55.                 distance -=  hit.distance;
    56.             }
    57.             Vector3 negDistance = new Vector3(0.0f, 0.0f, -distance);
    58.             Vector3 position = rotation * negDistance + target.position;
    59.            
    60.             transform.rotation = rotation;
    61.             transform.position = position;
    62.         }
    63.     }
    64.    
    65.     public static float ClampAngle(float angle, float min, float max)
    66.     {
    67.         if (angle < -360F)
    68.             angle += 360F;
    69.         if (angle > 360F)
    70.             angle -= 360F;
    71.         return Mathf.Clamp(angle, min, max);
    72.     }
    73. }
     
  12. Whiteleaf

    Whiteleaf

    Joined:
    Jul 1, 2014
    Posts:
    728

    Couldn't help you with the orbit script; I didn't even realize Unity had their own. I'll probably mess around with it.

    I made a script in notepad, not tested but I think it should work.

    Code (CSharp):
    1.  
    2. //Instead of hard-coding the range, why not make it show in the inspector for quick editing.
    3. public float rayRange = 100f;
    4.  
    5. //I find it easier to make 2 floats, 1 for firerate, and one for waiting. Seems easier to do.
    6. public float fireRate = 0.5f; //Time between each shot.
    7. private float nextFire = 0f; //This should always be 0 by default.
    8.  
    9. public GameObject bulletHole; //just the bullet hole.
    10. public float bulletHoleDistance = 0.05f; //The distance from the object the bullet hole should be at. The lower, the closer. Or the higher, I always forget.
    11.  
    12.  
    13. //here we create the ray and raycasthit variable, but this is only once, compared to creating it each time we shoot. If we were shooting 100000 bullets a second, you could see how intensive it might get. Of course, i don't think anyone would be shooting that much, but you never know.
    14. private Ray ray;
    15. private RaycastHit hit;
    16.  
    17.  
    18. void Start()
    19. {
    20.     //instead of using the transform, it'd probably be better to use the camera...that way it's shooting directly out from the center. But if you need to to shoot out of a certain spot, just ignore this.
    21.     cam = Camera.main.transform;
    22. }
    23.  
    24. void Update()
    25. {
    26.     //This isn't very efficient, as the script has to find the main camera every frame, so instead use the 'cam' variable we made earlier.
    27.     //rayPos = Camera.main.transform.TransformPoint(0, 0, 0.2f);
    28.     rayPos = cam.TransformPoint(0, 0, 0.2f);
    29.     ray.origin = rayPos;
    30.     ray.direction = cam.forward;
    31.  
    32.     if(Input.GetButton("Fire1") && Time.time > nextFire) //Time.time will almost always be higher than nextFire, since nextFire is 0 and Time.time is the slightiest bit greater.
    33.     {
    34.         nextFire = Time.time + fireRate; //this is setting out nextFire to Time.time, so if the game has been running for 30 seconds, nextFire will be 30.00f; but we're also adding the fireRate, so 0.5f. Now Time.time is less than nextFire, as it's 30.05f, so it has to wait 0.05                         //seconds to be able to shoot again.
    35.  
    36.         //Always better to call a function instead of writing it all in one part.
    37.         Shoot();  
    38.     }
    39. }
    40.  
    41. void Shoot()
    42. {
    43.     //Just wondering, what's the point of instantiating the bullet? In real life you really can't see bullets, as they travel too fast--plus they're pretty small. Unless you really need the bullet to do something, just do the raycast and maybe a muzzleflash.
    44.     if(Physics.Raycast(ray, out hit, rayRange))
    45.     {
    46.         //You can also do some checking here to see what material, or object the ray hit. This could allow you to create certain bullet holes based on materials/tags. Here's an example:
    47.         if(hit.transform.GetComponent<MaterialScript>().objectType == ObjectTypes.Wood)
    48.         {
    49.             //This will only happen if the ray hit a wood object, of course the "MaterialScript" doesn't exist.
    50.             Instantiate(bulletHole, hit.point + hit.normal - bulletHoleDistance), Quaternion.LookRotation(hit.normal, Vector3.up));
    51.         }
    52.     }
    53. }

    If you wanted to do a muzzleflash, you can ask. It's pretty basic. For the audio I'd make a public AudioClip and store the shooting sound in it. Then call PlayOneShot on and audiosource, and throw the shooting clip in.
     
    iamthwee likes this.
  13. iamthwee

    iamthwee

    Joined:
    Nov 27, 2015
    Posts:
    2,149
    I couldn't find one in the standard assets folder but found it here.

    http://wiki.unity3d.com/index.php?title=MouseOrbitImproved

    Thanks brah, can you explain where your script is more efficient I a bit confused and still noobish when it comes to coding :D
     
  14. Whiteleaf

    Whiteleaf

    Joined:
    Jul 1, 2014
    Posts:
    728
    Well, for one should try to assign variables once instead of every time you do something, especially since you're shooting every half a second. It might not matter too much in terms of performance, but in the long run it is a good habit to get into. Each time you do something with transform.position it has to search for the object the script is attached to's transform component. It's better to use something like creating a transform variable and assigning it once in Start or Awake that way it can find it immediately since it's already there. This can increase performance ever so slightly, but only makes a difference if you have a lot of transform action going on. It also is multi use so other parts of the script can use it instead of directly calling the transform component. Another thing I noticed in my script is that you could assign the ray and raycasthit variables each time you shoot, that would probably work just as well but wouldn't happen every frame.

    Those are pretty much the more efficient things, the other stuff like the firerate, and the rayRange variable are preference, I find it tedious and annoying if I hardcode something and have to go back to the script each time I need to change it. As I said above, instead of calling GetComponent<AudioSource>().Play(), it'd be easier to make an AudioSource variable and assign it in Start or Awake like the transform component. It's also easier to use PlayOneShot() that way you can use multiple clips without typing extra code to change the clip and then play it. PlayOneShot also plays it once to my knowledge.

    Unity has an entire page about beginner scripting, and I am guessing that they mention things like the assigning of variables. I never actually took them, I learned mostly from videos and the forums. http://docs.unity3d.com/Manual/ScriptingConcepts.html

    I've only been taking scripting seriously for around 1 3/4 years now, but I've learned a lot since I started. This might not be the best way, but it does get the job done. Using habits like making the variables once and using them there is good, without them it could lead to bad performance depending on what you do and when.
     
    iamthwee likes this.
  15. iamthwee

    iamthwee

    Joined:
    Nov 27, 2015
    Posts:
    2,149
    OK today Ive been racking my brain on getting a third person controller script working with mouse orbit. Managed to figure out how to track the character but the camera goes through walls and all the scripts online to fix this seem to be broken.

    As this is more of an aesthetic thing, I will have to leave it and come back to it later. In the meantime, I'm hoping to get a simple walk/run cycle ready, and attach a cross hair on the centre of the screen, also to try and get a animation to raise the gun and fire and if time permits a simple health screen.
     
  16. Whiteleaf

    Whiteleaf

    Joined:
    Jul 1, 2014
    Posts:
    728
    You could probably cast a raycast from the back of the camera and if it's hitting something you could place the camera there, if it's not then do nothing.
     
  17. iamthwee

    iamthwee

    Joined:
    Nov 27, 2015
    Posts:
    2,149
    I'll have to revisit raycasting whiteleaf, not sure what I'm doing to be fair. Trying to nail the animation with one rig and separate meshes although I've made numerous simple iterations from blender to unity and something appears to be funked.
     
  18. Whiteleaf

    Whiteleaf

    Joined:
    Jul 1, 2014
    Posts:
    728
    This is where I learned my raycasting at, if you're interested:
     
    iamthwee likes this.
  19. iamthwee

    iamthwee

    Joined:
    Nov 27, 2015
    Posts:
    2,149
    Thanks brah, that does look very useful, I'll look at it tomorrow, I guess I might have to change a few lines to get it ready for unity 5, I see the tutorial is dated in 2012.

    **Edit,

    Back to the drawing board, just realised you can parent multiple meshes to one rig which will be much easier to animate. Now to check out some walk/run cycle tutorials :)
     
    Last edited: Jan 27, 2016
    Whiteleaf likes this.
  20. iamthwee

    iamthwee

    Joined:
    Nov 27, 2015
    Posts:
    2,149
    OK boys I found a useful tutorial, some of it is unnecessary but the overall motion looks on point, will continue tomorrow.





    The plans for tomorrow are specifically
    -Re-rig character with one rig
    -Create animations for walk,run and idle
    -Bring into unity without texturing and play animations using code from thirdperson prefab
    -Get bullet hole script working with this setup, get cross hair working.
    -Get mouse look up and down working with camera orbit.
     
    Last edited: Feb 2, 2016
  21. iamthwee

    iamthwee

    Joined:
    Nov 27, 2015
    Posts:
    2,149
    OK I have some more time to work on this during weekend, from my animation experiments thus far the takeaways are:

    -Make sure all animations are the same number of frames long, you can speed up or slow down unity animations with code. Sounds obvious, but I made this mistake

    Code (CSharp):
    1. if (Input.GetKeyDown("e"))
    2. {
    3.      GetComponent<Animation>().Play("Default Take");
    4.      GetComponent<Animation>()["Default Take"].speed= 5.0f;
    5. }


    -Start SMALL, one mesh two bones, import using the blend file and NOT the fbx file and you should be fine.
    -Use one rig, even if you have multiple meshes, it still works but you must parent the bones separately.
    -Mechanim, not sure how good this is, I did import another full humanoid character and from what I saw it looked good, for example, the sliders easily curl your rig into a ball, for example opening and closing the fingers on the hand.
    -State machiines, can't comment, as I didn't use it, but I'm unsure how necessary it is, I'm doing fine with creating my animations in blender and then playing them on keyboard input controls.
    -Don't be afraid to add more bones, although not anatomically correct if it helps with mesh deformation, I added two extra bones in the leg to ensure the hips deform correctly without stretching, this is far better than weight painting, which I found works to some extend but not all the time.
    -Use the default third person controller as a start, you can hide 'ethan's' mesh renderer and add your own, parent it, and it walks around, jumps etc

    After I've finished my basic walk cycles ect I'll post up sample gifs
     
    Last edited: Jan 30, 2016
  22. iamthwee

    iamthwee

    Joined:
    Nov 27, 2015
    Posts:
    2,149
    Quarter of the way breakdown
    Being quarter of the way through and 2 months since I started to learn unity I've learned a bunch of things. Perhaps the most important is taking small steps to reach a goal, and breaking down big tasks into smaller ones. Second is animation, modeling and lighting, I feel like my skillset has come on leaps and bounds since I first picked up unity two months ago. Third is coding, I am now beginning to structure and restructure my scripts in organised fashions, so I can easily pick up a project and see what is going on. The gameplay for this is going to be my biggest hurrdle, but with so much inspiration out there on the net I'm only constrained to my own imagination.

    Keeping game coding guys!
     
    Last edited: Jan 30, 2016
    theANMATOR2b and Whiteleaf like this.
  23. iamthwee

    iamthwee

    Joined:
    Nov 27, 2015
    Posts:
    2,149
    Creating the Dialogue that will occur during the game with typewriter script:

    type.gif

    Code (CSharp):
    1. using UnityEngine;
    2. using UnityEngine.UI;
    3. using System.Collections;
    4.  
    5. public class GameController : MonoBehaviour {
    6.     public Text guiText;
    7.     public AudioClip mainSound1;
    8.    
    9.     string message;
    10.    
    11.  
    12.     AudioSource audio;
    13.     // Use this for initialization
    14.     void Start ()
    15.     {
    16.  
    17.         audio = GetComponent<AudioSource>();
    18.  
    19.         audio.clip = mainSound1;
    20.         audio.Play();
    21.  
    22.         message = guiText.text;
    23.         guiText.text = "";
    24.         StartCoroutine(TypeText());
    25.  
    26.         //guiText.CrossFadeAlpha(0.0f, 0.00f, false);
    27.        
    28.         //guiText.CrossFadeAlpha(1.0f, 37.00f, false);
    29.    
    30.     }
    31.    
    32.     // Update is called once per frame
    33.     void Update ()
    34.     {
    35.    
    36.     }
    37.  
    38.     IEnumerator TypeText ()
    39.     {
    40.         foreach (char letter in message.ToCharArray())
    41.         {
    42.             guiText.text += letter;
    43.             //if (sound)
    44.             //    audio.PlayOneShot (sound);
    45.             //    yield return 0;
    46.             yield return new WaitForSeconds (0.2f);
    47.         }    
    48.     }
    49. }
    50.  
     
    Whiteleaf likes this.
  24. iamthwee

    iamthwee

    Joined:
    Nov 27, 2015
    Posts:
    2,149
    Quick update:

    I tried adding my existing third person character controller with mouse orbit and it was just horrible to play. I might just give up on the gun and bullet holes as it's not even needed, and it is really tricky to shoot inside a narrow corridor which takes up 95% of the gameplay, it just didn't feel right.

    So tomorrow I'm going to scrap the above ideas and just work on getting the animations nailed and tidy up all my scripts into one or two neat game manager scripts and finish off the other level's gameplay. I'll probably work on the shooter for another game.
     
  25. Whiteleaf

    Whiteleaf

    Joined:
    Jul 1, 2014
    Posts:
    728
    You could also include a first person mode, that just places the camera in front of the player's head when you press a key. Vice versa for third person.
     
    iamthwee likes this.
  26. iamthwee

    iamthwee

    Joined:
    Nov 27, 2015
    Posts:
    2,149
    Yeah, I did think about going first person, which to be fair is what most of the type of game genres that my game use, but I just didn't feel I was learning anything, at least with third person I have a chance to bring in my own character rig and utilise.

    Things you don't realise would be an issue start becoming apparent. I never realised so much work is involved in making sure the camera doesn't go through walls and stuff (which I've yet to complete)
     
    Whiteleaf likes this.
  27. Rombie

    Rombie

    Joined:
    Feb 18, 2015
    Posts:
    282
  28. iamthwee

    iamthwee

    Joined:
    Nov 27, 2015
    Posts:
    2,149
    Thanks looks a bit too complicated for me to use at the mo, so opted for my own simple function.

    -Today was just tidying up, polishing the front screen, scribbling down gameplay. I've got my model perfectly rigged now so a full day will be spent on fine tuning the animation, the OCD side of me wants to get it just right including blending the animations from walk to run. The following tutorial pretty much nails it.




    The dialogue system is working well. Essentially I'm just using a massive string which cross fades into the screen at certain points in the game.

    -I need to model the props for the bedroom and find textures, unfortunately I can't give too much away.
     
  29. iamthwee

    iamthwee

    Joined:
    Nov 27, 2015
    Posts:
    2,149
    Just playing with animations, they're pretty bad so will have to spend some time tweaking them so they are just right... It really makes you think about how much effort is spent in getting all those AAA games looking just right.

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. public class DummyScript : MonoBehaviour {
    4.     private string anim = "walk";
    5.     //Usethisforinitialization
    6.     void Start ()
    7.     {
    8.  
    9.     }
    10.     //Updateiscalledonceperframe
    11.     void Update ()
    12.     {
    13.  
    14.          GetComponent<Animation>()[anim].speed = 1;
    15.         if (Input.GetKeyDown("e"))
    16.         {
    17.          
    18.             anim = "walk";
    19.         }
    20.  
    21.         else if (Input.GetKeyDown("f"))
    22.         {
    23.          
    24.             anim = "run";
    25.         }
    26.  
    27.         GetComponent<Animation>().CrossFade(anim);  
    28.     }
    29. }
     
    Last edited: Mar 16, 2016
  30. iamthwee

    iamthwee

    Joined:
    Nov 27, 2015
    Posts:
    2,149
    Quick update, animations now complete.

    The takeaway, it took me ages to get the walk cycle just right, the defining moment was realising I should have named the bones with .R and .L inside blender then I can use the xmirror pose, and the second video in my post #70 was the crowning glory at making it look real. There is also a slight up and down movement as the character falls onto the foot and rises up.

    What is still left to do, props and rendering for the final room, then attaching the final gameplay and it should be ready for release to a state I'm happy with. Although finding the sweet spot to end a project is always difficult for me being the perfectionist.

    I'm still toying with the idea of a health screen, rendering in 2D using unity's GUI canvas and gun, plus a pause and game menu.
     
  31. iamthwee

    iamthwee

    Joined:
    Nov 27, 2015
    Posts:
    2,149
    As it is the weekend tomorrow, I'm going to make a real effort to finish the game off. I'm happy enough with the animations it isn't by no means perfect but it will do.

    Tasks
    -Finish off the game menu/health screen

    -Add the assets for the final levels
    -Tidy up front screen add polish
    -Write up all the clues
    -Try to post up a video.
     
    Last edited: Feb 4, 2016
  32. iamthwee

    iamthwee

    Joined:
    Nov 27, 2015
    Posts:
    2,149
    Quick update, good day's progress...

    Learned how to make a menu, how to programatically add textures, add camera scripts and use setActive to disable top level parents. Learned to use Invoke to play a function after a set time.

    Tomorrow, consolidate all game manager scripts, more tidying up on animations, final clues and modeling final props.
     
  33. iamthwee

    iamthwee

    Joined:
    Nov 27, 2015
    Posts:
    2,149
    OK Menu system figured out and shader to pick up objects complete.

    Code (CSharp):
    1. Shader "Custom/victor_outline" {
    2.    Properties {
    3.         _MainColor ("Diffuse Color", Color) = (1,1,1,1)
    4.         _MainTex ("Base layer (RGB)", 2D) = "white" {}
    5.         _Dist ("Shift", Range(-1, 1)) = 0
    6.     }
    7.     SubShader {
    8.         /// first pass
    9.  
    10.         Tags { "IgnoreProjector"="True" "RenderType"="TransparentCutout"}
    11.         LOD 200
    12.         Blend SrcAlpha OneMinusSrcAlpha
    13.         Lighting On
    14.         ZWrite On
    15.         ZTest LEqual
    16.         cull Front
    17.         CGPROGRAM
    18.         #pragma surface surf StandardSpecular fullforwardshadows addshadow alphatest:_Cutoff vertex:vert
    19.         #pragma target 3.0
    20.         #include "UnityCG.cginc"
    21.         float4 _MainColor;
    22.         float _Dist;
    23.  
    24.         struct Input {
    25.             float2 uv_MainTex;
    26.         };
    27.  
    28.         void vert (inout appdata_full v) {
    29.             v.vertex.xyz += float3(v.normal.xyz)*_Dist;
    30.         }
    31.  
    32.         void surf (Input i, inout SurfaceOutputStandardSpecular o) {
    33.             o.Emission = _MainColor.rgb;  // main albedo color
    34.             o.Specular =0;
    35.             o.Smoothness = 0;
    36.             o.Alpha = 1;
    37.             ///////////////
    38.         }
    39.         ENDCG
    40.         //// end first pass
    41.  
    42.         /// second pass
    43.         Tags { "IgnoreProjector"="True" "RenderType"="Opaque"}
    44.         Blend SrcAlpha OneMinusSrcAlpha
    45.         Lighting On
    46.         ZWrite On
    47.         Cull Off
    48.         CGPROGRAM
    49.  
    50.         #pragma surface surf StandardSpecular fullforwardshadows addshadow alphatest:_Cutoff
    51.         #pragma target 3.0
    52.         #include "UnityCG.cginc"
    53.          sampler2D _MainTex;
    54.  
    55.         struct Input {
    56.             float2 uv_MainTex;
    57.             float3 norm :  TEXCOORD1;
    58.         };
    59.  
    60.         void surf (Input i, inout SurfaceOutputStandardSpecular o) {
    61.             // Main Albedo
    62.             fixed4 tex = tex2D (_MainTex, i.uv_MainTex);
    63.             o.Albedo = tex.rgb;  // main albedo
    64.             o.Specular = 0;
    65.             o.Smoothness = 0;
    66.             o.Alpha = tex.a;
    67.         }
    68.         ENDCG
    69.         // end first pass
    70.   } //subshader
    71. }//shader
     
    Last edited: Mar 29, 2016
  34. iamthwee

    iamthwee

    Joined:
    Nov 27, 2015
    Posts:
    2,149
    Worked a little more on the hair shader this time. It's fast approaching photorealism
     
    Last edited: Mar 16, 2016
  35. iamthwee

    iamthwee

    Joined:
    Nov 27, 2015
    Posts:
    2,149
    Just playing around with baked scenes and what a difference it makes. Plus I can reduce my image effects to improve framerate and performance for the cost of a slightly bigger exe file. Would love to get final gather working but it is just too tedious and still get black splotches.

    Also playing with programatic image effects.
    Code (CSharp):
    1. using UnityStandardAssets.ImageEffects;
    2.  
    3. //camera object
    4. public GameObject cam;
    5. private MotionBlur blurr;
    6.  
    7. blurr = cam.GetComponent<MotionBlur>();
    8. blurr.enabled = false;
     
    Last edited: Mar 13, 2016
  36. iamthwee

    iamthwee

    Joined:
    Nov 27, 2015
    Posts:
    2,149
    Hi Boys,

    Added a gun and soon to be inventory system.
     
    Last edited: Mar 29, 2016
  37. iamthwee

    iamthwee

    Joined:
    Nov 27, 2015
    Posts:
    2,149
    Close up of the gun, almost finished the animation :D

    gun.jpg
     
    Whiteleaf likes this.
  38. iamthwee

    iamthwee

    Joined:
    Nov 27, 2015
    Posts:
    2,149
    Howdy boys, long time no speak.

    After getting feedback on my quarter finished game, I've corrected the following

    -Getting gun to shot straight ahead
    -Remove decal after 5 secs for memory preservation
    -Added bullet casing, and smoke/glow when hits the wall(essentially customized the flare prefab)
    -Need to add a reload animation and gun ammo GUI (to do)
    -Need to completely overhaul the clue/story system/thinking of a notebook page system
    -Added a credit screen
    -Fixed mouselook lag, which was causing FPS issues, fixed gun sound
    -Added better door close sound
    -Added a bed to the room, I had an issue with generate lightmap uv, I found that using the decimate modifier in blender to reduce the tris/polys fixed it so I'm happy.
    -Need to add more animations of the antagonist, possibly a bed scene would be good
    -More clues and gameplay, at the moment there isn't enough to make the game relatable
    -To do add an 'L' shaped corridor, this gives much more suspense, no wonder it works so well in PT
    -Removed pegi 18 logo and replace with a generic one
    -Maybe consider an enemy AI but not sure yet.
     
    Last edited: Apr 5, 2016
  39. iamthwee

    iamthwee

    Joined:
    Nov 27, 2015
    Posts:
    2,149
    Small updates

    -Finished menu system with settings controls, and credits (easy being a one man band) :D
    Capture d’écran 2016-04-05 à 22.59.27.png
    -Added reload animation and sound effect
    -Added health and ammo screen as vector images.
    -Started working on wider corridors and an 'L' shaped design so should be more interesting
    -Added a better clue so they appear white text on black as opposed to subtitles (filling entire screen), this makes it less intrusive and you can't miss it, may consider a background notepad image.

    I also intend to use blender's curve modifier to create easy cornices that adorn the top of the ceiling and skirting boards.


    Other than that, I've just been playing 'limbo' another indie game but 2D, and studying how the clues and puzzles really make the game what it is, something mine has been lacking. Thanks to all who have played and given me invaluable feedback.

    To do
    -Start rigging more animation with the main characters, add more props, add more interactions with the levels.
     
  40. iamthwee

    iamthwee

    Joined:
    Nov 27, 2015
    Posts:
    2,149
    TonyLi likes this.
  41. iamthwee

    iamthwee

    Joined:
    Nov 27, 2015
    Posts:
    2,149
    Quick update

    -The L shaped hallway makes for a much more grim and sinister setting.
    -Added mouse sensitive controls for x and y movement, pretty simple just added this to the unity's FPS controller then selected the relevant functions on the sliders themselves.

    Code (CSharp):
    1.  
    2. public void SetXSensitive(float value)  // added for XSensitivity
    3. {
    4.      m_MouseLook.XSensitivity = value;
    5. }
    6.  
    7. //my custom function
    8. public void SetYSensitive(float value)  // added for XSensitivity
    9. {
    10.      m_MouseLook.YSensitivity = value;
    11. }
    Also quite happy with the ammo gun vector, and now have a new font 'SUNN'. The old typewriter is a bit old hat.

    Gonna start prototyping the gameplay tomorrow, got lots of ideas namely from limbo and the point and click fran brow game. This is getting exciting. It is gradually coming together much more nicely.
     
  42. iamthwee

    iamthwee

    Joined:
    Nov 27, 2015
    Posts:
    2,149
    Small update.
    Figured out how to do pickup but ATM I have no idea how this mechanic is going to help in my game puzzles.

    Code (CSharp):
    1. Collider[] hitColliders = Physics.OverlapSphere(Player.transform.position, 3);
    2.         int i = 0;
    3.         while (i < hitColliders.Length)
    4.         {
    5.             if(hitColliders[i].gameObject.CompareTag ("pickup"))
    6.             {
    7.                 if(Input.GetKeyDown("e"))
    8.                 {
    9.                     //test drop object
    10.                     if(pickedUp == 0)
    11.                     {
    12.                         Rigidbody rb  = hitColliders[i].gameObject.GetComponent<Rigidbody>();
    13.                         rb.isKinematic = false;
    14.                         hitColliders[i].gameObject.transform.parent = Player.transform;  
    15.                         pickedUp = 1;
    16.                     }
    17.                     else
    18.                     {
    19.                         Rigidbody rb  = hitColliders[i].gameObject.GetComponent<Rigidbody>();
    20.                         rb.isKinematic = false;
    21.                         hitColliders[i].gameObject.transform.parent = null;
    22.                         pickedUp = 0;
    23.                     }
    24.                  
    25.                  
    26.                 }
    27.  
    28.             }
    29.             i++;
    30.         }
    It leads me to believe physics based puzzles just don't work in 3D as well as 2D... look how tedious half life 2 was when moving boxes... back to the drawing board :(
     
  43. iamthwee

    iamthwee

    Joined:
    Nov 27, 2015
    Posts:
    2,149
    OK I had a moment of 'englightenment' pun intended. I was thinking why not have a combination of 3D and 2D, so after each level you go into a 2D highly stylized puzzle, which at the same time can reveal the story. The 2D part with be like the protagonist remembering what happened, like flashbacks in a dream. Genius and simple to do, like a child's crayon drawing or chalkboard.
     
    Last edited: Apr 10, 2016
  44. iamthwee

    iamthwee

    Joined:
    Nov 27, 2015
    Posts:
    2,149
    Okay I think I've decided on the style of my 2D game... it's pretty adventurous but hey, I like the style of Tim Burton's work so I'm going to go with this, also it quite different from the game so it will provide quite a good contrast impact.
    still7.png

    Now the hard slog of getting the mechanics working.
     
  45. virror

    virror

    Joined:
    Feb 3, 2012
    Posts:
    2,963
    Thats a freaking cool artstyle : D
    Really love Tim Burtons work.
     
  46. Rombie

    Rombie

    Joined:
    Feb 18, 2015
    Posts:
    282
    Sounds like a great direction to head this game towards.

    Is this artwork of yours; or Tim Burtons?
     
  47. iamthwee

    iamthwee

    Joined:
    Nov 27, 2015
    Posts:
    2,149
    It's Burton's but I'm gonna give it a shot in illustrator seems, doable,basically the protagonist wanders around an eerie dimly lit corridor for the 3D part but has flashbacks which will be comprised of 2D burtonesque style gameplay if I can pull it off it will be a masterpiece, here's a teaser of the 3D corridor but I don't wanna give too much away just yet :D
     
    Last edited: Apr 17, 2016
    Rombie likes this.
  48. iamthwee

    iamthwee

    Joined:
    Nov 27, 2015
    Posts:
    2,149
    OK just finished building the lightmap for the new larger corridor and started added some more props, here's a few teaser screenshots.

    Almost finished the 2D mechanics of the game, enjoyed working in illustrator -nothing beats illustrator and a wacom tablet. What I found was the landscape needs to be flat blocks to allow the mechanics to slide on the floor, then you just overlay a png with the grass/vegetation.

    1.jpg 2.jpg 3.jpg

    Comments and crits welcome.
     
    Last edited: Apr 17, 2016
  49. theANMATOR2b

    theANMATOR2b

    Joined:
    Jul 12, 2014
    Posts:
    7,790
    Looks like you have a solid handle on lighting - pretty well done.
    The level 3 screen shot above has some odd effect (to it). It almost looks like what you see when you watch a 3D movie without glasses on. On the floor and on the left part of the frame.
     
  50. iamthwee

    iamthwee

    Joined:
    Nov 27, 2015
    Posts:
    2,149
    Thank you, I think I've got lighting atmosphere and sounds down to a tee. These are my strengths, I know this, gameplay is my weakness so working on this is my biggest hurdle. In regards to level 3 I have a fish-eye effect which adds to the atmosphere, is it too strong? Maybe. There's also chromatic aberration which doesn't quite show on the screen grabs.

    Level 4 has a vortex effects, part of your sanity meter/metric. The lighting is perhaps a bit dark, but then it needs to be as your shifting through the dimly lit corridors, unaware of what lurks in the shadows ;)