• Home
  • Unreal Engine
  • C++
  • Blog
  • About

Projects Blog

AI Social Deduction: Week 5

6/27/2021

0 Comments

 

Knowledge and Sliders

In the video above, I show the Crewmates' new ability to be able to see each other and what other rooms the crewmates all traverse to. This is all visible along with timestamps on the Knowledge Bar at the bottom right. On top of this, I have added slides to the main menu for allowing the altering of the Crewmates' behaviors on the fly.

AI Observed Knowledge

The Crewmates have finally gained ability to record observations! Being able to accomplish this in the first of the two weeks is an exciting amount of progress, because it means we're past the barebones implementation of observation learning for the Crewmates and can soon move onto deeper memory management implementations. I will discuss my future plans for this in the "What's Next?" section below. For now, the observational learning system works as such:
  • Each Crewmate holds a list of "CrewmateInformation" structs. These structs are what store all the information of what the Crewmates have observed from each other. The struct consists of these parts:
    • ​SimulationTime - The time in minutes and seconds since the start of that simulation session that timestamps every observation.
    • CrewmateName - The color (aka name since all Crewmates are named after their color) of which Crewmate was observed.
    • RoomIn - The room that the Crewmate was seen in or entering when observed.
    • RoomOut - The room that the Crewmate has just left when entering a new room. Can be set to "None" if the Crewmate was not entering a room when first observed.​​
  • These structs are what's used to create the Knowledge entries in the Knowledge Bar. If the entry's RoomOut variable is set to none, the message comes out as "I saw ____ in ____". If it is not none, this means the Crewmate was observed entering a new room which results in the message coming out as "I saw ____ go into ____ from ____"
  • Observation entries are logged based on two separate events: when a Crewmate enters a new room, or when the Crewmate was first seen in a room.
    • ​For the situation where a Crewmate is first seen in a room, the Observer sends a request to the Observed. This request returns with a CrewmateInformation struct which is then logged into the list of Observed Knowledge.
    • For the situation where  a Crewmate enters a new room, this system works in the opposite direction. The Crewmate entering the room sends a CrewmateInformation struct to every Crewmate it can see. In a way, we can consider this similar to the Crewmate declaring to every other Crewmate in sight that it has entered the room, and the others record this announcement.

The Sliders

Picture
I wanted to be able to change the Meander and Attempted Murder chances of the Crewmates on the fly before each simulation. Originally, I had to go into the Behavior Trees and change the chance values for the two types of Behavior Tree. However, I've decided to move the chance variables to the AIDeductionGameMode, and I've added these two sliders which are attached the the GameMode's variables. The UI sliders and buttons are provided by Unreal's widget system.

Bugs/Improvements

Now that we've hit the halfway point of the project, I'd like to make mention of some bugs that have arisen from the latest implementation and some much wished for improvements to the project.

First, the new Observation has a noticeable bug if I intend for this project to fully replicate the original Among Us: The Crewmates can't see through each other. In the picture below, you can see that, while the scenery is able to block a player's vision, other crewmates do not hinder the player's vision. In the AI Deduction project, the AI Perception Component's vision is still being blocked by other Crewmates. This causes issues mostly for the Killer in the fact that two Crewmates can enter a room one after another, and the Killer would only see the front one. If the Killer only sees the first one, then the Killer will think there's only one Crewmate in sight and will kill that Crewmate even though a potential witness is right behind them. Another problem is that, since the Crewmates are set to pass through each other, they can lose vision while phased into one-another. This means that Crewmate will lose vision of all others in sight and then re-log all nearby crewmates. I intend to test different types of collision on the Crewmates to see if it gives the Crewmate's Perception Component the ability to see through each other.
Picture
The second problem I've run across is that the Crewmates' mouse collision for the ability to click on them doesn't work terribly well unless the player's camera is fairly close to the Crewmate of choice. I will work on playing around the the collision capsule used for the clicking on Crewmates to see if a certain size will allow me to perform mouse events on them from any distance.

Lastly, an improvement I'd like to add is the ability to have a button to freeze the Crewmates in the tracks and pause their task progress. I've made a first pass on this, but the current version doesn't stop them if they're in the middle of performing a task or moving to a location. It only freezes them once those actions are complete. I will try to update it so that their movements and task performance also freeze.


What's Next?

Since the basics of the Observation has been implemented, I want to try and implement a suggested "Memory System". Along with this, I would also like to address the Bugs/Improvements previously mentioned. The plan for next week goes as such:
  • ​Implement the ability for the Crewmates to forget certain Observations. Over the course of the game, the system will go through the list of Knowledge that Crewmate has accrued and randomly select that piece of information to be "Forgotten". This will flip a bool on that entry which will mark that piece of Knowledge as unusable in discussions. The entry will have its text turned red on the Knowledge Bar instead of removing it so that the Spectator can know which information has been lost.
    • ​I would also like to give importance values to certain information so that certain entries are easier/harder to forget than others. I would also like to add a forgetfulness slider to the main menu to indicate how often memory entries should be forgotten by the Crewmates.
  • ​Work on implementing the improvements and fixing the bugs presented in the Bugs/Improvements section.
  • Add the dead bodies mentioned in last week's update.

Want to Download the Project?


​Click Here:
Github Repository
0 Comments



Leave a Reply.

    Coleman Levy

    Welcome to my blog! 

    Archives

    August 2021
    July 2021
    June 2021
    May 2021

    Project

    All
    AI Social Deduction

    RSS Feed

  • Home
  • Unreal Engine
  • C++
  • Blog
  • About