Tingmao: Integrating a new avatar

Screenshot of new avatar

After some searching I decided to use this free anime character.

Fortunately, face-tracking scripts run on a separate entity, and I just had to attach the player.cs script onto the new avatar entity, and rotation will work for the new avatar.

As for lip-sync, the new avatar supports several different mouth shapes, but they are not grouped into IPA-syllables, and there is also no way to make the avatar properly close their teeth or control the tongue for sounds like ð or ʃ, so I did my best to make it look convincing without involving additional modelling work.

Kaloyan: Detecting rooms on a floor plan

This week I discovered a major bug in my algorithm. A single room could be detected as 2 rooms if it has a heart-like shape, like this:

(This picture is for example purposes only)

In a room like the one shown, the algorithm will detect firstly the green part and then the blue one, but won’t know that they are the same room. Upon reaching the red part of the room, the algorithm will assign it to the room of the first white pixel in the room on the previous line - in this case, the green part. So, we will end up with two rooms, one consisting of both the green and red parts and one consisting of only the blue part.

To solve this, after the initial algorithm is finished, I added a loop that iterates through all the rooms and fixes these problems. If 2 rooms contain lines that are next to each other and the ranges of white pixels have at least one pixel in common the 2 rooms are combined into 1. The loop continues until it iterates consecutively through all the remaining rooms without having to combine any 2 of them.