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 objectadd 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 dialogueFungus 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!
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.
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).
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)
This function is applied on Object Dialogue System only, but now is applied on NPC Dialogue System too
Rotate NPC toward player
When player collides with the NPC, NPC will always facing player
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 systempop 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.
I created a C# script to display the current location on the game world. The following are the different animations I made from code. We decided to use the final one.
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.