Posted September 13, 2020 by IvyppJK
Hi everyone, welcome to my second devlog about the building process of Blue In Town. In this post, I will summarise how I partly improved the movement's drawback mentioned in the previous post, some new points that I added to the game, and what I should do to fix problems happening so far.
In the last post, I showed you some simple movements of Blue. She would reach the cursor position in the game scene whenever the left mouse button was clicked by players. I also pointed out the downside that my Blue could not go to the destination when facing any obstacles.
To upgrade those movements to something smarter, I put some new C# scripts (borrowed from my teacher as the algorithm in it was somewhat challenging to a newbie like me) in the game. The scripts generate a 25x10 grid composed of nodes in the game scene, which allowed the character to move via connections between them.
At this time, the player movement is not perfect yet since the paths from Blue to her target are not the most effective ones (containing weird-looking zigzag turns). However, I am still at the stage looking for a solution for it. Further improvements and updates will be announced in the next post. Also, there are some other issues which are needed to be solved:
Firstly, my Blue approaches her target immediately after the game starts while she should be idle and should begin her movement when receiving triggers (the mouse clicks). Secondly, Blue continues moving even when being at the target position. One solution for both of these two problems I think can be used is setting the speed of her movement equal to zero at the beginning of the game level and when she is at the target. The speed will be greater than zero if players click the left mouse button on the game scene.
Finally, when touching some obstacles in the game scene, Blue is randomly stuck at either the edges or the corners. Therefore, I will putting connected nodes in the game scene manually, ensuring the distances between nodes and colliders are rational to avoid the possibility that my Blue will touch any furniture in her restaurant and stay still.
Reference