Game Task Apply & TextMeshPro Missing Words

05/03/2020

Game Task

I apply two tasks on the game first to test if it is workable.

Task 1: Follow the NPC

It is the simplest on the game. Just following the NPC and then get the recipes. NPC will wait for player if player is not following her.

Task 2: Recover the destroyed data from digital rubbish bin

After player interact with the rubbish bin, player need to finish the task to restore the recipes.

Missing Words on TMP

When I use Chinese word on text, some words will missing.

I had tried few way to solve it but all’s fail. The solution is following:

1. Create a .txt file and paste all words that will be used for the game (or may be just the words that will use this font type)

2. Drag the .txt file created on step 1 into Unity project

3. Call the Font Asset Creator from tool bar: Window>TextMeshPro>Font Asset Creator

4. Set the “Source Font File" to the desired font (.otf/.ttf)

5. Set the “Character File" to .txt file that dragged into unity on step 2

6. Click “Generate Font Atlas"

7. Click Save/Save as…

8. Used the TMP font created on step 7

The problem is solved!

Dialogue System Update

29/02/2020

Improvement on NPC Dialogue

  1. Rotate player toward NPC
    • This function is applied on Object Dialogue System only, but now is applied on NPC Dialogue System too
  2. Rotate NPC toward player
    • When player collides with the NPC, NPC will always facing player
  3. Apply animation on NPC
    • NPC will having greeting action when they detect player
    • NPC will having talking action when player interact with them

Character Thought Dialogue

This function is made for trigger player’s thought by an invisible panel. When player collide with the panel, the bubble will show up.

invisible panel with thought bubble system
pop up character thought on game start

Bug Fixing

  • Wrong dialogue box show up
    • Problem: When object with dialogue script collides with player, the dialogue box of pervious object with dialogue script will show up if player interact to it
    • Solution: “GetComponent<NPC>().enabled = true;" need to put inside OnTriggerStay instead of OnTriggerEnter.
bug
before
after

Dialogue System Development

06/02/2020

I follow an Youtube tutorial to make the base of the dialogue function this week.

If player stay near with the NPC with dialogue (here I use an object to simulate NPC), a text will show up to tell player to interact with the NPC.

If player choose to interact with the NPC, the dialogue box will pop up on the top of the NPC. The dialogue box will keep tracing the NPC position if player still stay around the detection area (Detection area = collider area).

Object Dialogue

Since different object may tell player different hints when player interact with them, I use the NPC dialogue as a blueprint to make the object dialogue class. And I make a few change on my dialogue script.

1. Rotate player towards the object that interacting to

2. Can control if the dialogue will pop up automatically or not

3. Set the dialogue box position on the top of the object or on a fixed point on the screen

4. Highlight the object

*The highlighted effect is made by shader graph and C# script.

  1. Create a shader graph with exposed parameterundefined
  2. Create a material from the shader graph
  3. Create a C# script to get the object texture and then set the texture to the material
  4. Apply the material on the interacting object
  5. Reset the object material to its original one if player is not around it

Game Task: Sliding 2

22/01/2020

I have to give a big thanks to my groupmate’s friend. Actually, he raised the thought of using an array to do this sliding task instead of applying physical function like RigidBody.AddForce and Box Collider.

I use an array to create a virtual chessboard, and mark the place of all obstacles.

part of code

Once the game receives player input, it will check if object collides with obstacle or not. Then set the location and then move the object.

part of code

But it is not enough. If player input during the object moving, it turns out a fun picture.

input ‘up’ and then ‘left’

So, I have to add if statement to check if player is arrived the destination. If yes, check player input. Otherwise, player’s input(s) will be ignored.

Now, the object can move smoothly!

Game Task: Circuit

15/01/2020

I started implement second task of our game.

This task is aims to stop all electrons inside the electric board.

black rect: electrons, blue rect: electric board

It is much more easy for me to make it comparing to the last task. I set a random speed and initial position of electrons. And using Vector3.MoveTowards function to make them move.

random position

Although there were some bugs is discovered during the production of this task, those bugs are solved just now. It is a completed task at our game. (But the appearance haven’t finished.)

Game Task: Sliding

08/01/2020

I try to build the first playable task for our game.

The task is aims to moving the desired object to a specific location. Once the player move to a direction, the object will not stop moving until it hits an obstacle.

First, I put the cube as a chessboard.

circle: player/desired object, orange box: goal

And then, I add the code on the object we want to move. But the object will ignore the obstacle and keep moving after player input one movement.

To solve it, I add “Box Collider" to all obstacles. However, it caused a new problem. The object will stop in a weird place where is not supposed to stop the object.

object can not pass though

The problem probably is happened due to the collider size so I try to scale the box collider size. It seems work at first, but the same problem happens on other place.

I try to think if I am using wrong way to move the circle object. At first, I used RigidBody.AddFroce function to move the object. After I got this thought, I change it to Vector3.MoveTowards function. But it still can’t solve the problem.

Update Character Action & Game Menu & Game Sounds

28/11/2019

1. Character Action

Since our scene is too big, the character walking speed is too slow to pass though the whole scene. I add the running action to character animator, and also adjust the animator chart to make sure that player can have a smoothly swift between different state and running.

I also replace the tested character to our main character, Owen. And also, try to build the view of level 1.

2. Game Menu

I add the intro video before entering the menu. Player is not allowed to skip the video if they are first time to play the game. Player can enter the setting page to change the game volume.

3. Game Sounds

I add the sound effect when player is highlighting a button or selecting a button. Also, the background music will be played after player entering the game. The background music will be changed depends on the current game level.

Displacement Exploration

13/11/2019

In order to make the background building on level 1 more space-saving than building a 3D model. We try to find other ways to get the following result.

Our Goal

1. Render Pipeline

First, I try to do the displacement effect on Unity Render Pipeline. We knew that the old unity render pipeline can do the above results according to a youtube video; however, we are using a new pipeline called Lightweight Render Pipeline. The maximum value of the heigh map scaler is 0.08 which cannot make the object more 3D.

It seems 3D when we looking on half-side view. But it looks 2D on front view.

2. Terrain Function

Then, I try to do the displacement on terrain function. The result is excellent but it cannot rotate… Therefore, we cannot use it to reach our goal too.

3. Editing Shader Graph

I try to edit the shader of a plane. And I realise that I have to increase the number of mesh to get the results. It requires the same number of polycounts to do the results. On other words, it cannot save the space.

To conclude, it is unnecessary to do the displacement on Unity.