Made in 2016

Cleptomaniac

. Project LinkGithub

The Game

Cleptomaniac is a game where you play as a robber. In the game you will have to steal items and sell them to win. You have five days to get to get the amount of money you need to get. This amount differentiates depending on the difficulty. While doing this you will have to watch out that no one is looking at you. You can be spotted by pedestrians cameras and cops. When seen while stealing the caps will run after you forcing you to use donuts to distract them temporally or you can get top the dealer. The dealer is where you can sell your goods for that day. different items are worth differently. In the shop you can buy things like speedBoost, jumpBoost, more stamina and donuts. After the five days if you don't have enough money you lose.

My Contribution

This project was made in the last quarter of the first school year. It was made by two programmers and one artist. I was responsible for one character one building and the AI, car AI and camera's. The character that I made was the cop. The building that I made was the bank and the pickups in the safe. The building is modular and we chose for solid colors. For the AI I used the unity navmesh. The AI will follow a path set by waypoint. The cops will leave this path when the player steals something. They will run straight at the player and arrest him unless he uses a donut. The cars also drive a set path and when colliding with the player the player loses for that day. To check if people or the camera is looking at you I used a raycast. I first check if the player is in front of the person and then using transform.lookat I shoot a raycast at the player if it hits I check if it falls within the angle that the player can look.

What would I do different?

What I would do differently: I would not use the navmesh system to make the AI walk A predetermined path because it's a waste of resources. I would also make it so there is more than one raycast so when your behind a small object you can still be spotted. Most of all I would clean up all my scripts since when I made this I didn't do that very well. As for modeling I would make the bank so the pieces fit together better.

PedestrianAI

This is from the PedestrianAI Class currently all Ai related things are in the Update. At the time of making this I wasn't very good at cleaning up my scripts. void Update() { if(aim.looking == true) { StealNoticeVoid(); } if(Physics.Raycast(transform.position,transform.forward,out rayHit,10) && rayHit.collider.gameObject.tag == doorTag || Physics.Raycast(transform.position,transform.forward,out rayHit,2) && rayHit.collider.gameObject.tag == carTag) { if(rayHit.collider.gameObject.tag == doorTag) { rayHit.collider.GetComponent<Interactable>().Interacting(); } } else if(stationary == false && standStil == false) { characterAnimation.SetBool("Walking",true); navigator.SetDestination(checkPoints[currentCheckPoint].transform.position); if(myTransform.position.z == checkPoints[currentCheckPoint].transform.position.z && myTransform.position.x == checkPoints[currentCheckPoint].transform.position.x) { if(currentCheckPoint == checkPoints.Count - 1) { timer = stilStandingTime; standStil = true; characterAnimation.SetBool("Walking",false); } else { currentCheckPoint++; } } } else if(standStil == true) { if(timer <= 0) { standStil = false; currentCheckPoint = 0; } else { timer -= Time.deltaTime; } } }

CarAI

This is from the CarAI Class this also uses the unity navmesh to move. void Update() { navigator.SetDestination(checkPoints[currentCheckPoint].transform.position); Physics.Raycast(transform.position,transform.forward,out rayHit,raydistance); if(Physics.Raycast(transform.position,transform.forward,out rayHit,raydistance) && rayHit.collider.tag == carTag){ } else { if(myTransform.position.z >= checkPoints[currentCheckPoint].transform.position.z - missingAmount && myTransform.position.z <= checkPoints[currentCheckPoint].transform.position.z + missingAmount && myTransform.position.x >= checkPoints[currentCheckPoint].transform.position.x - missingAmount && myTransform.position.x <= checkPoints[currentCheckPoint].transform.position.x + missingAmount) { if(currentCheckPoint == checkPoints.Count - 1) { currentCheckPoint = 0; } else { currentCheckPoint++; } navigator.SetDestination(checkPoints[currentCheckPoint].transform.position); } } }

Guard

This is part of the Guard class this class is used to move the guards and used to make the guards attack you when you steal. void Update() { if(aim.looking == true) { StealNoticeVoid(); } if(Physics.Raycast(transform.position,transform.forward,out rayHit,10) && rayHit.collider.gameObject.tag == doorTag || Physics.Raycast(transform.position,transform.forward,out rayHit,2) && rayHit.collider.gameObject.tag == carTag) { rayHit.collider.GetComponent<Interactable>().Interacting(); } else if(AIManager.wantedState == false) { if(stationary == false) { securityAnimator.SetBool("Walking",true); securityAnimator.SetBool("Wanted",false); navigator.speed = walkingSpeed; navigator.SetDestination(checkPoints[currentCheckPoint].transform.position); if(myTransform.position.z == checkPoints[currentCheckPoint].transform.position.z && myTransform.position.x == checkPoints[currentCheckPoint].transform.position.x) { if(currentCheckPoint == checkPoints.Count - 1) { currentCheckPoint = 0; } else { currentCheckPoint++; } } } else { transform.rotation = startingPosition.rotation; transform.position = startingPosition.position; securityAnimator.SetBool("Walking",false); securityAnimator.SetBool("Wanted",false); if(Random.Range(1,100) == 2) { securityAnimator.SetBool("Tip That Hat",true); securityAnimator.SetBool("Tip That Hat",false); } } } else { if(donut != null) { navigator.SetDestination(donut.transform.position); if(myTransform.position.z == donut.transform.position.z && myTransform.position.x == donut.transform.position.x) { securityAnimator.SetBool("Walking",false); securityAnimator.SetBool("Wanted",false); } } else { navigator.speed = runningSpeed; securityAnimator.SetBool("Wanted",true); navigator.SetDestination(player.position); } } }

. Project LinkGithub

s