Skip to content

pootiney/Game-Design-face-emotion-recognition-autism

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

93 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Game-Design-face-emotion-recognition-autism

This application is a game developed in Unity 2020.3.18f1 and it's goal is to train facial emotion recognition to Autistic Children.

I'm using different softwares in developing this Game:

  • Unity 2020.3.18f1
  • Visual Studio 2017
  • Adobe Photoshop 2021
  • Adobe Illustrator 2020
  • JetBrainsRider 2022.2.2
  • LeoMoon ParsiNegar 2.1.7

Installation:

  • Installation tutorial (This tutorial is in Persian)

  • Run VPN

  • Download Unity Hub

  • Install Unity Hub

  • Execute Unity Hub (tick the run unity hub and then finish installation)

  • It wants a license, so exit Unity Hub (even end task in taskmanager to be sure you exit completely)

  • Copy file app.asar (extract app.rar file) in this address "C:\Program Files\Unity Hub\resources"

  • Run as administer Unity Hub

  • Choose installs tab

  • Click on add

  • Choose desired version of unity

  • Next

  • Choose desired modules of unity

  • Choose android build support (includes SDK,NDKand JDK tools) to have andriod out put of your game

  • When its completely installed exit the Unity Hub Completely

  • Again Run as administer

  • Click on the 3 dots on top of the installed versionof unity

  • Choose patch pro

  • Choose patch License

  • Now the pro version of unity is activated On your laptop

About the Game

It has 5 Levels and Menue:

I'll explain each level in it's part completely

But about generall features of software:

when you run the software:(this part is not complete yet)

  • You will see 5 Icons for 5 different levels that only first level is unlocked.
  • When user finished first level the second level will be unlocked and respectively each higher level will be unlocked after finishing each lower level.
  • Software will continue the game from the start point of where the player had left.
  • Software will notify to play each day.(??????)

Questions arised in designing these features of the game.(write each question arises while designing the application, NOT COMPLETE)

  1. How I can choose an option by clicking on it?
  2. Application must have a realy small size, but how?
  3. How lock and Unlock the levels?
  4. How will the game continue from the start of the part which it was closed last time?
  5. How will the game notify to play every day?(????????)

Menue:

In menue we have 5 Buttons to choose corresponding level.

Two Other smaller buttons one to turn the sound on and off and the other to exit the game.

The game remember wher the player exit playing.

The game remeber the last time we turn the sound off or on.

Questions That arises:

  1. How does exit button works?
  2. How the game remember our latest choice for sound (on or of) when we enter it the next time.
  3. How lock and unlock the levels?
  4. How the game remember in which part we exit it?

Gestalt Level:(not comlete)

In this level user drag different parts of the face and drop them in correct part of face

for this level I just tore apart the original image.

faces are in 3 different emotions happy, sad and angry. I'll upload code sources after their finished

Questions That arises:

  1. How I organize pieces to be chosen?
  2. How I determine that each piece of puzzle is located in correct place?
  3. How does the game go to the next face when the previous one is solved?

Puzzle Level(not complete)

I must explain morein this part.... I'll upload code sources after their finished

Questions That arises:

  1. How I determine that each piece of puzzle is located in correct place?
  2. How I organize pieces to be chosen?
  3. How does the game cheer the player for each correct choice?
  4. How does the game collect the scores?

Which Emotion Level(not complete)

This level has 2 parts: I will explain more about this part later

Questions that arises: 1.

Which Emotion Different Level(not complete)

  1. Emotion Express Competetion:

I'll Explain later about this part.

Questions that arised: 1.

Emotion in the situation picture Level(not complete)

I'll Explain later about this part.

Questions that arised: 1.

Procedure

Designing Menue:

Designing Gestalt Level:(notcomplete)

  • I made faces graphically ready: I've needed faces with same size so I cropped them in photoshop.
![Screenshot (205)](https://user-images.githubusercontent.com/26525766/138113518-0f5223a6-4813-4556-bb9b-f111f40b1fdb.png)

![Screenshot (204)](https://user-images.githubusercontent.com/26525766/138113425-18e66981-eddb-45d3-99e8-6d349c6cfda4.png)
  • I needed faces to be without components so again I used photoshop to make the face ready.

Screenshot (251)

Screenshot (255)

Screenshot (252)

Screenshot (253)

Screenshot (254)

Screenshot (257)

Screenshot (260)

Screenshot (261)

Screenshot (256)

image

image

image

Screenshot (265)

  • In Gestalt scene I have a main camera , in main camera I haveGame objects which are images(background and frames for faces and their components) and so have spiriterenderer. I have another Gameobject face which has a variable spiriterenderer (faces images) and this gameobject itself has gameobjects g1, g2 and g3 which have spiriterenderers which change in each iteration of the game. image

  • I wrote "make_face.cs" to check if the components are located in true place or not? and to change the face when it's finished. This code is attached to gameobject face.

```C#
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class make_face : MonoBehaviour
{
   public int sprite_count; // this variable changes the number of sprite
   public GameObject eye_l; // this is the left eye game object (Base class for all entities in Unity Scenes.)
   public GameObject eye_r; // this is the right eye game object
   public GameObject mouth; // this is the mouth game object
   public Transform tr_1; //Every object in a Scene has a Transform. It's used to store and manipulate the position,
   
   //rotation and scale of the object.
   public Transform tr_2;
   public Transform tr_3;
   public Vector3 v; //a vector3 variable is Representation of 3D vectors and points.
   
   // This structure is used throughout Unity to pass 3D positions 
   
   // and directions around. It also contains functions for doing common vector operations.
   public Vector3 v1;
   public SpriteRenderer spriteRenderer; //Renders a Sprite for 2D graphics.
   public Sprite[] spriteArray; //Represents a Sprite object for use in 2D gameplay.
   
   // Sprites are 2D graphic objects used for characters, props, projectiles and other elments of 2D gameplay. 
   
   // The graphics are obtained from bitmap images - Texture2D. 
   
   // The Sprite class primarily identifies the section of the image that should be used for a specific sprite. 
   
   // This information can then be used by a SpriteRenderer 
   
   // component on a GameObject to actually display the graphic.
   
   // Start is called before the first frame update
   void Start() // this function will be run just in the beginning of the executation of the game.
   {
       sprite_count = 0; //it assigns 0 to the sprite counter at the beginning.
       tr_2 = eye_r.transform; // it assigns the transform variable tr_2 the transform of gameobject eye_r
       tr_3 = mouth.transform; // it assigns the transform variable tr_3 the transform of gameobject mouth
       v = new Vector3(1.5f, -1, 0.5497855f); //it assigns a variable vector3 v an 3d vector by definning it with
       
       //new Vector3(x value,y value,z value)
       v1= new Vector3(2, -2, 0.5497855f);
       spriteRenderer = gameObject.GetComponent<SpriteRenderer>(); //it assigns variable spriteRenderer the component SpriteRenderer of gameobject that this
       
       //script is attatched to it
       spriteRenderer.sprite = spriteArray[sprite_count];// it assigns the sprite of spriteRenderer one of the sprites in the spriteArray that its number
       
       //is equal to sprite_count

    }
 
    // Update is called once per frame
    void Update()//I'll change this part later
    {

        tr_1 = eye_l.transform;
        print(eye_l.transform.localPosition);
        if (tr_1.localPosition.x > v.x && tr_1.localPosition.x < v1.x && tr_1.localPosition.y < v.y && tr_1.localPosition.y > v1.y)
        {
            sprite_count += 1;
            print("yes");
            spriteRenderer.sprite = spriteArray[sprite_count];

        }
  
    }

} ```

  • I wrote "draganddrop.cs " to drag components. So this code is attached to gameobjects g1, g2 and g3. I need to define a box collider 2D for each gameobject g1, g2 and g3 unless the code won't work correctly. image
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class draganddrop : MonoBehaviour
{
 private bool isDragging;// this boolean variable is true when the mouse is down and is false when the mouse is up
 public void OnMouseDown() //this  function will be called when the mouse is down
 {
     isDragging = true;
  }
 public void OnMouseUp() //this  function will be called when the mouse is up
 {
     isDragging = false;
  }

  // Update is called once per frame
 void Update()
 {
  if(isDragging)//when the mouse is down
     {
         Vector2 mousePosition = Camera.main.ScreenToWorldPoint(Input.mousePosition) - transform.position;
         // "Input.mousePosition" reports the position of the mouse even when it is not inside the Game View.
         
         //Input.mousePosition is a Vector3 for compatibility with functions that have Vector3 arguments. 
         
         //The z component of the Vector3 is always 0.
         
         //Returns Vector3 The worldspace point created by converting the screen space point at the provided 
         
         //distance z from the camera plane.
         
         //Transforms a point from screen space into world space, where world space is defined as the coordinate system at
         
         //the very top of your game's hierarchy. World space coordinates can still be calculated even when provided as an 
         
         //off-screen coordinate, for example for instantiating an off-screen object near a specific corner of the screen. Screenspace
         
         //is defined in pixels. The bottom-left of the screen is (0,0); the right-top is (pixelWidth,pixelHeight). 
         
         //The z position is in world units from the camera.
         
          // " transform.position" The world space position of the Transform. The position property of a GameObject’s Transform, 
          
          //which is accessible in the Unity Editor and through scripts. Alter this value to move a GameObject. Get this value to 
          
          //locate the GameObject in 3D world space.It is a vector3.

         transform.Translate(mousePosition);
         
         //Moves the transform in the direction and distance of translation.
     }
  }
}

Designing Puzzle level

Designing Which Emotion Level

Designing Which Emotion Different Level

Designing Emotion in the Situation Level

Releases

No releases published

Packages

 
 
 

Languages