Week 8 Development

Monday

On Monday afternoon I started work on fixing the quest log. New quests were not being added as the StartQuest function in the Quest Manager didn’t do anything.

I added the remaining code from the tutorial I was following and this now properly instantiates the first quest step and sets the current quest state to IN_PROGRESS.

Now the quests properly show up when they are started in the quest log.

Tuesday

On the next day I worked along with my teammate Chen who had added a trigger to allow the cake to be pushed off the table by the rat for the quest. On top of this I added a new Quest Info object that can be activated when the player enters the trigger for the dialogue.

I wanted to take my mind off of coding for the time being, so I decided to create a 3D model for the strawberry that would go on top of the cake. I wanted to keep it extremely low-poly as the strawberry would be small, so this was simple to model based off of a stock photo:

On top of this I painted some pixelated textures with some vibrant colours. I also added some planes with a transparent texture to represent the leaves.

The strawberry worked perfectly when importing it into Unity and creating materials, but the transparent background for the leaves were not working with the CelShadeLit shader I was using for all the existing objects. Unity’s built-in Unlit shader worked wth transparency, however, so I used that for the strawberry’s leaves material and it looked perfectly fine.

All I had to do now is make a duplicate of the existing Screw grabbable object prefab and replace the model with the strawberry, and it works perfectly!

Thursday

On Thursday following our group meeting [TODO: Make post for group meeting] I resumed work on tweaking the cake quest. Chen had made a trigger for the strawberries that allows them to attach to the cake and then start the quest completed dialogue. However, this resulted in them still being able to be grabbed off of the cake again, and the cake could still be pushed when the berries were on the cake. We discussed a possible fix and we came up with the idea to move the script to the cake.

This new cake script detects when a strawberry enters it, destroys the grabbable strawberry and activates one of three child objects consisting of strawberry models on the cake.

Now the grabbable strawberries disappear and are replaced with static models when dropped on the cake.

Maybe in the future I will check that the strawberries are not currently being grabbed for this to occur in order to avoid bugs but this seems to work for now. I also increased the size of the collision boxes for both the cake quest’s trigger as well as the strawberries themselves.

I also worked with Chen to remove some of the Narrator dialogue as discussed in the meeting, but left it to him to rework the dialogue in his own time.

During this time, Ross also offered to help us add a feature that would make implementing an ingame tutorial much easier. This was a new script that added functions to Yarn Spinner’s dialogue runner, that would allow the regex code to replace input bindings with sprites to be done to dialogue. This was previously only possible on UI objects so this was a big help.

I also assisted Hugo with importing the Elder Rat model into the Unity scene and with adding new cel-shaded materials for it.

Friday

On this day I had the objective of improving the Quest Log as well as starting to simplify the quest system. The tutorial I have followed so far is a good basis for quests with mutiple steps, however it follows a very classic RPG style wherein you must return to a Quest Point to complete the quest and gain the rewards. Our quests are much more automatic, similar to a constantly updating “to-do list” of possibilities for the player a la Untitled Goose Game.

The Quest Log in the example I followed was also much more complex and involved the quests being selectable to see more information about them. This was not necessary for the current iteration of our quest system so they needed to be simplified into text entries.

To do this I had to change a lot of the pre-existing code to use the TMP_Text object type instead of the “button” object type. This also meant I didn’t need to deal with the Unity Actions that are fired when they are selected. The quests in the log were previously stored as a button with QuestLogButton script which were changed to QuestLogEntry.

These changes required a lot more changes to be done to the rest of the UI code to accomodate for this, so it was a lot of work.

Quests in our system also did not need requirements (creating most of the systems for that were skipped entirely), or the need to go back to a quest giver to complete the quest, to fulfill them being “automatic” as described before. This required several changes.

Firstly, any quest in the game should always be created with the state of CAN_START instead of REQUIREMENTS_NOT_MET. Removing this second quest state makes things much simpler.

The entire system could probably be tweaked further for our needs but it fortunately works fine as-is. However, this UI definitely needs more polish which I will need to work on more.

Leave a Reply

Your email address will not be published. Required fields are marked *