Voting Time! Who's the Guilty Party?In the video above, Purple and Pink have been killed by Yellow and Red, respectively! However, Purple is first found by Orange who begins leading the Discussion for Purple's killer. The Crewmates then discuss what was the last time Purple was seen alive and who was in the murder room closest to the time of Purple's death. Orange obviously says that Yellow was seen leaving the room pretty close to the incident time, but Red also states they saw Green leaving the area around that time as well. In the end, even though it's a close voting session, Yellow is voted off as shown at the end with them having been turned into a ghost. Congrats to the team figuring out the Killer in this instance! Voting Screen UIMy main focus of the voting screen was to make the screen look similar to how it does in the original Among Us game. The voting screen UI consists of 10 panels, each holding a Crewmate's name and their portrait. These panels also hold lists that can be filled up with images of those who vote against said Crewmate on the panel. There is a "No Vote" option at the bottom left where Crewmates can decide to vote for nobody like in a real game of Among Us. Lastly, there's a button at the bottom right where I'm happing to have open UI which details each Suspect's "Suspicion" value. This button could also be used to display a menu with more information if I update the AI like info on why each Crewmate votes against each other. This picture's quite funny to me because the Killers both voted for an innocent while the rest of the crew correctly votes for Yellow. Calculating Suspicion and VotesI wanted to make it so that there wasn't only one "biggest suspect" that would get voted for during each voting scene since, in a real game of Among Us, there is indecisiveness and spread out votes amongst the multiple suspects to each murder. To accomplish this, I've created a system for calculating a "Suspicion" value (A float ranging from 0 to 1) to go with each suspect, and team members vote based on those values from their pool of suspects. To begin with, there is a timeframe before and after the last time the Victim was scene alive. Suspects who entered or exited the murder room can only be put forth if they did so from that time frame. Currently, said time frame is set to 15 seconds, so suspects who entered/exited the murder room between 15 seconds before and after are the only ones put forth in discussion. Next, the code calculates each suspect's initial "Suspicion" value as the time delta between the time they passed through the murder room and the last time the victim was seen alive. The value for the "No Vote" bar is calculated as: 1 - the Maximum Suspicion value calculated that round, and then it is added as a suspect to the list (if voted for, it counts as a Crewmate not voting for anyone). The suspicion values are then normalized to give each suspect a 0% - 100% chance of being voted for by each Crewmate. After that, each Crewmate votes at random with those "Suspicion" percentages influencing who they vote against. Smarter Discussions and VotingInitially, the AI for Discussions weren't the smartest. I made a couple of tweaks to the criteria of discussions and votes to make the Crewmates a bit smarter in what they say and who they vote for:
What's Next?Since the voting off of Crewmates now fully works in the fact that each Crewmate can vote, Crewmates die when voted off, and Victories can be achieved by either side based on who gets voted off, I am officially a week ahead of schedule! Week 9 was originally planned to be focused around the Voting Scene, but now I'm planning of finally giving the game the visual update it's been needing (and I won't stop talking about)! My plans for next week are as follows:
Bonus: Even though this next week will be majorly focused on the looks of the game, I will also be spending some time making the AI smarter so that we can get more interesting thought processes from each other Crewmates in Discussions and Voting. I will likely be continuing with this over the course of the last 2 weeks of the project. Want to Download the Project?
0 Comments
Leave a Reply. |
Coleman LevyWelcome to my blog! Archives
August 2021
Project |