Camera Rotation

22/03/2020

I apply two way to control the camera view by mouse position.

1. Camera rotate when mouse is not located at centre

Camera will rotate according to mouse movement.

2. Camera rotate based on mouse position

Camera will rotate when mouse is near the screen side.

After the review from tester, we decided to use method 1 to control the camera view.

Highlight Material

16/03/2020

The current highlight function will record the textures of the pervious object. It will cause the following bug.

Fish tank with wrong texture

Then I realise the code has some problem on setting material texture. The pervious texture haven’t reset completely.

Original code

Therefore I adjust the code as following in order to set the most updated texture to the material.

Adjusted code
Fish tank with correct texture

Fungus: Free Dialogue System Asset

12/03/2020

Since each NPC may have more than one set of dialogue and the dialogue will be changed according to the story process, dialogue system is too complicated for current dialogue system.

I find out there is a free and open source asset called “Fungus" which help solving this problem.

To navigate the dialogue, just simply add a flow chart object under the object or add a flow chart script inside the object which I prefer the former.

add a flow chart object under the object
add a flow chart script inside the desired object

Then, open the flowchart window and edit the dialogue. All dialogues of this flow chart will be visualised clearly which is convenient to modify the dialogue.

visualised dialogue
Fungus dialogue in game

It is much more convenient than the old dialogue system. The old dialogue system can almost be replaced by this asset. I just want to express my thanks to Fungus developers!

3D Game Development

11/03/2020

I make our game based on this tutorial series E01-E03.

From the tutorial, the character can only be controlled by mouse for movement, interact and camera control. I modify the code to enable keyboard to control the character. However, user can only choose one of them on setting page.

There is some difficulties I faced on adding keyboard control:

1. Character moving direction will not update with camera facing

Character move according to its direction, not related to camera

Player input “W"/"Up arrow" after camera rotated

Solution:

Multiple the rotation of y-axis on character movement

Player input “W"/"Up arrow" after camera rotated

2. Player cannot interact with the object

Solution:

3. Character no response after interact with the object

Actually, it is bring from the solution of difficulty 2.

Solution:

Don’t call the playerController SetFocus function.

4. Player hard to select the object that they want to interact with

Solution:

Use a list to store the triggered object > Add object into the list if player is around the interactable object/Remove object from the list if player leave the interactable object > Compare the distance between the player and the triggered object > Highlight the object that near the player

Other problems:

1. Character model go away from the parent object when animated

character go away from the cylinder

Solution:

Export animation from Mixamo with “In-place" is ticked.

HDRP vs LWRP

08/03/2020

Since the time is rush for us to finish the whole project, I have to chase the progress of what I did before. I set a target that is to convert the game project into 3D video game in one week.

First, I change the rendering principle from LWRP to HDRP (High Definition Render Pipeline) which is more suitable for PC game and provide more detail of the model.

Therefore, I spend a day to reset all material and shader graph to suit the need of HDRP.

in-process

Here is the different between LWRP(left) and HDRP(right).

.undefined undefined

3D Game Development Decision

07/03/2020

Reason of Changing Game

After the presentation yesterday, we realise the game story may be too complex and abstract for player to understand. Therefore, we decided to change our story setting and the game content after struggling.

We only keep the core element of our story (e.g. food crisis, Oxin). The rest setting is unnecessary and make the game too complex. Since the real world doesn’t exist Oxin, player may hard to understand what Oxin is. So, we tell a story that start with the existence of Oxin.

Story

The story become our main character live in 2021 which having food crisis at that time. He travelled to one year ago accidentally. Therefore, he started finding the way to solve this food crisis by participating the development of Oxin, a cheap food replacement with high nutrition.

Gameplay

The game will change into 3D video game. Since it is boring and such as waste of the 3D models if it is a 2.5D platform game. Also, 3D game can help player more engaged in the game world.

Game Layout

  • Resident area (Owen’s Apartment)
    • use for game start
    • explain the game background here
  • Entertainment area (VR center)
    • not yet confirmed
  • Industry area (Oxin Factory)
    • not yet confirmed
  • Game world
    • use for scene transition
    • show how’s ppl live in the future
    • player need to get hints from NPC to open next area
area of game world (top-left: entertainment, top-right: resident, bottom-left: industry, bottom-right: undefined)

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

Game Content Design 5

24/02/2020

Intro Video

Owen and his father go back to home by train(pass by the rich and poor area, and many Oxin advertisement on the background building). When they are finishing the verification and ready to get in the door, his father received a message. His father told Owen to wait him back at home then he leave. (Screen fade out)

A.I. come Owen home and the tell him his father is dead. Then, it ask Owen to bear the duty of his father to develop new flavour of Oxin.

Chinese version:

兩父子手拎食材,一齊搭車,搭車傾計show佢地好親近(溫馨氣氛)(沿途經過D建築,貧富分左兩個地方,同埋show下D Oxin banner)
返到屋企門口,face id左準備入去(呢度show下個驗證,登錄既user有3個:爸、媽、囝)
呢個時候,呀爸既裝置(類似藍芽耳機)閃下閃下,收到message
叫呀囝返去先,佢有D事要處理,跟手比左佢袋食材比個囝
呀囝返入屋->畫面變黑
第二日,AI拍門,佢確定個囝係佢要搵既人之後話佢老豆死左,希望佢繼承佢老豆遺願,幫手研發Oxin新口味

Owen’s Apartment

I provide some furniture idea to our modelling creator which hope it can make the home more futuristic.