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

Projects Blog

AI Social Deduction: Week 10

8/1/2021

0 Comments

 

Finale and Future Plans

No video this week as this is a fairly short update mostly discussing potential future plans for the project. The parts that were completed to wrap up this project are:

Voting Screen Visual Update

Picture
I felt the plain white background for the  voting scene was very lackluster, so I created a tablet background similar to what you'd see in a real game of Among Us.

Bugfixing

The two largest bugs I was able to find and correct this past week are as follows:
  • Ghosts were visible to Crewmates after voting sessions were complete. Turns out I was turning every Crewmate's visibility back on after the discussions and voting were over without checking if they were alive first. That's been corrected now.
  • Ghosts who were about to investigate a body will still run up to the corpse and begin a discussion scene with themselves as a lead even though they are dead. On death, the simulation now sets their _bodyInSight to false, which makes it so that, upon death, they will cancel attempting to investigate the body.

The Future (Maybe)

Even though the project is "officially" over for school, I still have ideas I would love to implement if I happen to have time in the future. I feel these will add a bit more fun to spectating the simulation and make it more exciting to see what the Crewmates do and learn over the course of a round. The ideas I wish to add are:
  • Update the Memory System to have "Incorrect" memories instead of the Crewmates just straight up forgetting their knowledge. This will lead to Crewmates misremembering some of the things they've seen which can lead to a Crewmate's memories and knowledge having strange and interesting consequences like in a real game of Among Us.
  • Make the Killers even smarter so they think a little more on who to kill, when to do it, who to mention as a Suspect in Discussion scenes, and not vote for each other in the Voting Scenes.
  • Add a Trust and Lies system to where Crewmates can now also lie when in Discussions. If their lie gets pointed out  in the Discussion, this could lead to other Crewmates not trusting them as much and not taking their statements as seriously. This can be very useful for making the game closer to Among Us as the Innocents try to weed out who the lying Killers are.
  • Add a Personality System which can lead to Crewmates acting differently when moving around the Ship and talking in Discussion scenes. There could be Lazy Crewmates who are less likely to perform tasks, Mischevious Crewmates who lie in Discussions for the fun of it, and Vigilant Crewmates who try to follow other Crewmates to see if they kill someone at any point.
  • Lastly, put up more UI to show Crewmates' decision making and their reactions to each.

If any of these come to fruition, you can be certain I'll post them here! For now, however, the project is complete and I can definitely say I enjoyed working on it. I hope readers of this blog will enjoy this journey as much as I have!

Want to Download the Project?


​Click Here:
Github Repository
0 Comments

AI Social Deduction: Week 9

7/25/2021

0 Comments

 

Visual Update

In this video, I show off the new design for the menus along with the updated looks for the Ship. Lastly, I show the Ejection Scene that comes at the end of a completed voting session!

The New Art

The main focus of this update is obviously all of the new art additions that were accomplished over the week. All in all, I was able to accomplish:
  • Adding a space skybox to make it so that The Ship level actually looks like it's floating in space.
  • Adding materials and decorations throughout the ship to make it a more interesting a visually pleasing level to watch the Crewmates run around in. (All materials and decorations from asset packs provided by Unreal and Unreal Store.)
  • Making and adding the new menu backgrounds and button art I created to the game so that they're not just plain white menus any more.

Here's a catalog of images for the updated art in case the video happens to move too quickly:
​
I would also like to thank Sella Alcazar for help with getting the Skybox set up, and for giving me tips on the lighting and decoration of the ship!

The Ejection Scene

I wanted to recreate the ejection scene from Among Us, because I felt it would look pretty funny in the realistic environment of the ship and would sell the voting off of the suspicious crewmates even better. To accomplish this, I used a fairly simple trick: I have a long plane that sits in front of the ship which is hidden in game. Then I teleport the voted off Crewmate to one end of the plane, and I have them walk to the other end while rotating their mesh. Once they go off-screen, I return the Crewmate as a ghost back to their original starting position. Ta-dah, the ejection is complete and looks as humorous as I had hoped it would!
Picture
The plane that is hidden in-game. Crewmates walk from the left sphere to the right sphere. (The spheres are above the plane, but are a little hard to see due to looking similar to the stars.)

What's Next?

This upcoming week is the last official week of working on "Among AI". I've accomplished a lot of what I had hoped to over the course of the project, so I'll be wrapping it up with just a few tweaks:
  • Better AI - Having Crewmates recognize the if they see someone sitting in the room with the body, it is likely to be the Killer and should be prioritized when throwing out suspects during discussions.
  • Updating the Voting and Discussion scene to have similarly updated graphics along with graphics to indicate which of the Crewmate are dead and cannot speak.
  • Create a menu for visualizing the suspicion percent of each Crewmate during the voting scene.
  • Bugtesting and Bugfixing.

And these will finish off the project for now! Next week, I'll discuss what I'd like to do as bonus if I ever have unofficial time to work on the project in the future.

Want to Download the Project?


​Click Here:
Github Repository
0 Comments

AI Social Deduction: Week 8

7/17/2021

0 Comments

 

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 UI

My 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.
Picture
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 Votes

I 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 Voting

Initially, 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:
  • Killers won't report seeing the Victim in the murder room at the time of their death.
  • Killers won't report each other for being in the murder room at the time of the murder.
  • Crewmates won't vote for themselves.
  • If there is only one suspect, the suspect's "Suspicion" value is increased by 0.5 as a modifier since, if there's only one suspect, they usually have a higher chance of being considered the Killer than usual.

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:
  • Update the menus to be more than blank white screens with text.
  • Work on the ship to make it more than a whitebox.
  • Update the skybox around the ship to be more space-like.
  • Create the voted Crewmate being ejected scene.
Picture
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?


​​Click Here:
Github Repository
0 Comments

AI Social Deduction: Week 7

7/11/2021

0 Comments

 

All About Dialogue

In the video above, Red kills Brown. Brown's body is eventually found, sparking a discussion amongst the survivors who the killer may be!

Dead Body Discovery

To start off, I had to make it so that crewmates were capable of starting a discussion scene whenever they spotted a dead body. However, they had to first approach the dead body, because there is a range limit in which a player can report a body in Among Us. To do this, I set it up so that dead bodies will stop the Innocent's Behavior Tree and turn a "Body in Sight" bool to true (indicating the crewmate sees a dead body). Once this is complete, the Behavior tree is restarted and follows this behavior:
Picture
This branch consists of what an Innocent should do upon seeing a dead body. If there is one visible, the crewmate will get the body's location, move to it, and then indicate to the AIDeductionGameMode that a discussion/voting scene should be started. The AIDeductionGameMode will then record who found the body, the information of the body's location and owner, and then the Game Mode will proceed to set all Crewmates around the discussion table while also deactivating their trees. Lastly, the Game Mode will clean up and remove all dead bodies currently on the ship.

This is all done in this manner to set up the discussion scene to have everything it needs to be performed and so as to match what occurs in the game Among Us when a body is found.


The Discussion Scene

The discussion scene consists of UI that display what the Crewmates "Know" about the victim and the room the murder took place in. The actual discussion is managed by a loop. In order the events as of currently are:
  1. The finder of the body gives a short summary of the victim, mentioning who it was and the location of their death. This finder is considered the lead for the conversation.
  2. The lead then asks what was the last time every Crewmate saw the victim alive.
  3. Every living Crewmate (including the lead) searches their memories for the last time they saw the victim. They then mention what they know. If they don't know the last time they saw the victim alive, they just say they haven't seen anything. I am planning to use the most recent time the victim was seen alive to slim down the number of memories the Crewmates search through to be in a certain time frame around that time.
  4. The lead will then ask who was the last person everyone saw in/entering/leaving the murder room.
  5. Similar to step 3, the Crewmates mention what they've seen when it comes to the murder room. The most recent person seen in/entering/leaving the room will then be determined as the killer. I could use the time of the murder room sighting and the time of the most recent victim sighting to give a percent chance that the suspect is the killer. This percentage could be used to spread out votes between the suspicious Crewmates, making the voting more like a natural game of Among Us. If not, I can just have all Crewmates vote for the most recent Crewmate in/entering/leaving the murder room.
Picture
An image of the blueprint for the discussion loop. Based on the question given, the crewmates have a different set of memories they search through and the response they give.
Picture
This image shows Purple, the lead of this discussion, asking the question of when everyone last saw Pink alive and each Crewmate saying when and where they last saw Pink.

Crewmate Portraits

Picture
The last part I'd like to discuss for this project is that each Crewmate now has a portrait! This is helpful for quickly recognizing which Crewmate is being observed on the Knowledge Bar and who is talking in discussions! The image being shown is bound to the name of the Crewmate being observed/the Crewmate who is "speaking".

What's Next?

The Discussion Scene isn't quite finished. To wrap up the implementation for now, I will be working on:
  • Having the Crewmates determine who the likely killer is. 
  • Having the discussion scene end and transition to the voting scene where the suspect will be voted on by all other Crewmates.
  • Making it so that the Discussion/Voting scene ends and the Crewmates return to their business as usual.
  • If I can, I would also like to have the voting scene kill off whichever Crewmate got the most votes against them.

As always, a nice bonus (if I can find time to do so):
  • Work on the visuals of the game. Updating the ship, the skybox around the ship, and the UI.

Want to Download the Project?


​Click Here:
Github Repository
0 Comments

AI Social Deduction: Week 6

7/3/2021

0 Comments

 

Memory System and Bugfixes

In the video above, I show the new sliders, the better pause button, the new Knowledge bar controls, and the new memory system.

Memory System

The memory addition is the newest major feature to be added to the game. The general concept of it is that, every couple of seconds, each Crewmate will have a chance two forget two random pieces of memory. Forgotten memories have their text set to a red color and will not be usable in the soon-to-be-added voting discussions. Crewmates can have, at the very least, 8 memories that aren't forgotten. This prevents the system from leaving the Crewmates with no usable memories in discussions.

Also, main menu has had the "Forget Memory Chance" slider added to it as well to allow the user to specify what percent chance the Crewmate will lose 2 memories every 2 seconds. If I have bonus time, I'd like to be able to update the sliders page to allow the spectator to specify the memory loss chance, the number of memories lost, and the delay between memory loss checks.

Bugfixes/Polish

As was mentioned in the last update, I had three areas of concern when it came to bugs and polish. Here are the three issues I tackled and the solutions I came up with to solve them:
  • The Crewmates weren't able to see through each other. - This was being caused by the fact that the AIPerception component's sight sense was dependent on an object's "Visibility" collision channel. All of the Crewmates were set to Block on their mesh and their capsule component. This was stopping the Crewmate's line of sight at the first object in front of them. To correct this, I instead set all of their components to be Overlap collision on their capsule component and ignore on all other components. Now, the crewmates are able to see through each other while also still being able to register each other. However, this caused a problem with the ability to click on Crewmates, which I will discuss in the next bullet point.
Picture
Green is able to see past all of the Crewmates standing in front of him so he is now able to register Blue, Turquoise, Red, and Gray even though Blue is directly in front of his line of sight.
  • The clicking on Crewmates only sometimes works. - Similar to the AIPerception's vision sense, the mouse over and on click events in Unreal depend on the Visibility collision channel. Setting all Crewmates' components to ignore except for the capsule being set to Block fixed this issue so that mouse events would work correctly on the Crewmates at all times. However, the Block on the capsule component caused the issue of the Crewmates not being able to see through each other. I decided it was more important for the Crewmates to have the correct vision capabilities, so I changed the Knowledge bar's controls to be keyboard-based. Now, the Spectator can hit R to show/hide the Knowledge bar. Q and E are used to show the previous and next Crewmate's knowledge, respectively. Mouse controls have been removed. These controls aren't as quick and easy to use, but it's an acceptable change.
  • The pause button needs to stop Crewmate movement and task progression. - The pause button now sets every Crewmate's walking speed to zero to make certain they stop in their tracks. It also prevents the progress bars above the Crewmates' heads from filling up, now. This makes it so that all Crewmate activity stops while leaving the spectator the ability to continue flying around and check each Crewmate's knowledge. Pausing the simulation also stops the Memory system to prevent a bug with Crewmates forgetting Knowledge while being paused. 

Crewmate Dead Bodies​

Picture
I was also able to implement a dead body drop for whenever Innocents are killed. The gravestones act at the representation of a Crewmate's dead body in the simulation. Currently, these dead bodies hold the last Crewmate Information state that the Innocent had, which is how the dead bodies record who was killed and what room they were killed in. Crewmates are currently able to see these dead bodies on the ground and are able to send up a print message stating whose dead body they found. This function will be updated to begin the Voting Discussions scene in the next update.

What's Next?

Next week marks the second half of the Crewmate's reasoning and understanding: learning through Dialogue. To accomplish this next part of the system, I will be working on:
  • Creating the discussions scene where Crewmates will enter this upon finding a dead body and then will proceed to talk through who was last in the area of the dead body.
  • This Dialogue scene and learning system will take up most of the time this next week, but if I find myself with some free time after it, I will also work on updating the visuals of the menus and the ship itself. I really want to finally get around to updating the art and design of these to make the simulation also look better than a whitebox.

Want to Download the Project?


​Click Here:

Github Repository
0 Comments

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

AI Social Deduction: Week 4

6/20/2021

0 Comments

 

Victories, Progress Bars, and Clickable Crewmates, Oh My!

In the video above, I go on to show how the Simulation's new features look in the project. Firstly, it is easy to notice that I have upped the number of Crewmates to the full 10 I had planned to reach and will be keeping throughout the project to mimic the original Among Us game. I begin the video by clicking on one of the Crewmates to show the information bar at the bottom displaying their knowledge. Once the Crewmate crosses into the Storage room, you can see their current room changes to be "Storage". You can also see the "Total Tasks Completed" bar at the top left similar to what you would see in the actual Among Us game. Lastly, when all of the Innocent Crewmates complete their tasks, you can see the game cuts to a simple "Innocent Victory" screen. 
Picture
Now, to discuss how the new features work:

The Victories

Picture
Picture
In a similarly simple art style to the Main Menu, I've created Victory screens to indicate if the Innocents won the game through their tasks or the Killers through lowering the number of Innocents.

The Victories are managed through the AIDeductionGameMode. When the tasks are distributed, the GameMode records the total number of tasks distributed to the Innocents (ignores the tasks distributed to the Killers as those tasks will never be performed), and whenever an Innocent completes a task, the total number of completed tasks are compared to the total number of tasks distributed. When the number of completed tasks is equal to the total number of tasks, the GameMode reveals the Victory screen and pauses the simulation in the background. Killer Victories work similarly in that the game checks every time a kill occurs if the number of Killers is equal to or greater than the number of Innocents.  If it is, then reveal the Victory Screen.

The Victory screen's text is used to differentiate between whether the victory was for the Killers or the Innocents. This text is set on Victory so that there is only need for one victory screen.

Picture
The "Total Tasks Completed" progress bar uses an Unreal Progress bar similar to how the Innocent Crewmates' task progress bars. This task bar's percentage is calculated as NumberOfCompletedTasks/TotalNumberOfTasks.

The Clickable Crewmates

Picture
The clicking of the Crewmates comes in two parts: hovering the cursor over a Crewmate and actually clicking on the crewmate. 

Hovering: To accomplish the glowing effect for whenever the Spectator hovers their mouse over the Crewmate, I added a white fresnel to the Crewmate's shared material parent. Then, I added a parameter that jumps between 0 and 1 to turn the fresnel on and off based on whether or not the Spectator's cursor is on the Crewmate.

Clicking: When a crewmate is clicked on, the Crewmate sets itself as the Crewmate being observed in the AIDeductionGameMode. The observed Crewmate is the one used for displaying "Knowledge Data" on the "Knowledge Bar" at the bottom of the screen.
Picture
The "Knowledge Bar", displayed at the bottom showing Gray's name and Current Room.
The text of the "Knowledge Bar" is bound to whatever Crewmate is currently being observed. So far, the only data to be gleaned from the Crewmates is their name and what room they are currently residing in. I hope in future to make it so that the bar and Crewmate information hides itself if no Crewmate is selected.

Knowledge of Current Room

The Crewmate's ability to recognize what room they were in was an exciting bonus to be able to accomplish. This is a big step towards the observation system of the Crewmates as this will be used to determine what room each Crewmate sees each other in and what rooms they see each other entering.
Picture
The current system of the Crewmates recognizing which room comes in two simple parts: The Crewmates having a String variable indicating the name of the room they currently preside in, and a new class called "Room".

Room class: This class is a scalable collision box that holds a string that is the name of the room it is presenting. Whenever a Crewmate collides with this box, the Room class then gives the Crewmate its room name. Since the entire map is laid out in a Grid-like format, I will be able to use simple boxes like this to cover each room for indicating when a Crewmate has entered said room.

​I intend to upgrade this system to not use strings for representing the room that the Crewmate currently resides. Instead, I wish to use an Enum as this will give similar levels of conveyance to the Spectator what the room's name is while also being much faster to process when the AI will be comparing this information to what they know about Crewmate placement further down the line. I also wish to make it so that when a Crewmate enters a new room, the other Crewmates will be able to tell what room the entered and where from.

What's Next?

Next week marks the start of the main focus of this entire project: observational learning for the crewmates. As mentioned previously, I've gotten the chance to dip into this subject a little bit, but this next week will consist of more in-depth implementations into having the AI see and remember where and when they saw the other Crewmates. To accomplish this, I will be working on:
  • ​Adding more Room collision boxes so that each room has one that the Crewmates can use to understand where they are and where they are entering.
  • Making it so that when a Crewmate sees another, they record the time and Room they saw the other Crewmate in to a data structure of "Knowledge" that they gain over the course of the simulation.
  • Also adding the functionality for Crewmates to know which room they saw the other Crewmate entering and which room they came from to enter that room.
  • Adding dead bodies, which will spawn on kills. These dead bodies will be seen and recorded on the place and time where they were found.

Bonus:
  • Have the Crewmates recognize that if they see another Crewmate in the room where the body is, then that crewmate is the likely Killer.
  • Adding a short kill animation for Killers so Crewmates can walk in on Murders and easily identify that Crewmate is a Killer.

Want to Download the Project?


Click Here:
Github Repository
0 Comments

Schedule Change

6/18/2021

0 Comments

 
Another week has passed where I haven't been able to work as much as I would have liked on "Among AI" before this Friday came due to other projects. Since this is becoming a bit of a reoccurring theme, I've decided to move my updates to Sundays instead until my other projects slow down enough to where I'm better able to make progress on the days leading up to Fridays. This is so I'm not having to post Friday and Sunday of every week and postpone my description of my plans for the next week every time. 

Thank you for your patience on this matter, and I hope to be able to continue making good progress on what has honestly been a fun programming project with this new update schedule.
Picture

We'll See You on Sunday!

0 Comments

AI Social Deduction: Week 3.1

6/13/2021

0 Comments

 

Who's the killer?

Picture
As previously mention in the Week 3 update, I wanted it to be easier to identify who is the Killer in the simulation. To accomplish this, I've made it so that any Crewmate designated to be a Killer will have this Axe attached to their back. With a little free time, I'd like to have this weapon socketed to the mesh, but this will definitely work for now.

Task Progress Bar

Picture
On top of giving the Killers weapons for their murder sprees, I've added progress bars to the Crewmates to indicate how long their task takes for them to complete. This task bar will be cancelled and reset if they are killed in the middle of their task, similar to how a task is cancelled by a kill in the real Among Us.

What's Next?

Next week is focused around the simulation being able to complete through the ending of the simulated game. To accomplish this, I will be creating Task Victory for Innocents and the Killer Victory for the Killers. To accomplish this I will be working on:
  • Creating a system to keep track of the total number of tasks distributed and UI to help the spectator keep an eye on how many tasks are left for the Innocents to win like is seen at the top left of the screen in Among Us.
  • Creating a system to keep track of the number of Killers and Innocents on The Ship, which will check if the killers have killed enough Innocents to be considered the victors whenever they perform a murder.
  • Adding more Crewmates to the ship. Around 10 should help with simulating a similarly populated game to what would be seen in Among Us. I will try to set it up so you can choose how many Crewmates there are in the Main Menu as a bonus.
  • Lastly, adding victory screens for both the Innocents and Killers which will return the spectator back to the Main menu upon the completion of a simulation session.

Want to Download the Project?


​Click Here:
Github Repository
0 Comments

AI Social Deduction: Week 3

6/11/2021

0 Comments

 

Tasks and Killing

In the video above, I show the behaviors of the three new crewmates that have been updated to include their ability to go do tasks and enact kills. Blue and Green are both Innocents while Red is a Killer.

The order of events in the video above goes as follows:
  1. Red, Blue, and Green split up. Red going to the bridge, Blue going to medbay, and Green headed South towards storage.
  2. Blue reaches the medical cabinet and completes his task. Red comes in the room right as he leaves.
  3. Red can see Blue headed towards him and sees that there is nobody else around, so Red kills Blue in passing, which is why Blue turns into a translucent, brighter shade of blue.

Behavior Trees

This update was majorly focused on creating Task nodes and Decorators for the behavior trees of the newly added Crewmates. 

When it comes to the Killer Crewmate's behavior tree, I've added nodes based around deciding on when the killer wishes to kill and how they will perform said kill. Excitingly, I got to begin early on implementing observation into the game through the killer's behavior tree. Each Crewmate in the game keeps a list of all seen crewmates nearby; this is handled by the AI Perception Component and AI Stimuli Component. Each Crewmate is a Sight stimuli, and due to this, the Crewmates are able to keep track of who enter and leave the vision range of the crewmates.

The Killer Crewmate's new behavior nodes are as follows:
  • Decide to Kill - A decorator which takes a random value between 0 and 100; if the value is lower than that "chanceToKill" integer, then the Killer goes down the "Attempt to Kill" branch on left side in the image below. If the Killer decides not to kill based on this chance, they will instead meander using the right path. The "chanceToKill" integer can be set in the Behavior Tree to make the Killers more or less aggressive. I plan to make this settable in the main menu in the future.
  •  Choose a Target - A task node which checks all Crewmates in sight, and then chooses the first Innocent Crewmate it finds as a target to chase down and attempt to kill. This will only target Innocent Crewmates, not other Killers. If no target is chosen,  then the Killer will instead choose to meander on the bottom middle path.
  • Perform Kill - A task node which first checks if there are no more Crewmates in sight that are Innocents. If there are none visible to that Killer, the killer will then call the "GetKilled" function on the target Innocent. Currently, "GetKilled" turns the Dead Innocent into a ghost, changing its color to a see-through version and then removing that Crewmate from being able to be seen by other Crewmates. This Invisibility is achieved by turning off its stimuli, so that the AI Perception Component cannot perceive that Crewmate.
Picture
The Killer Crewmate's behavior tree.
The Innocent Crewmate's tree doesn't use the AI Perception Component yet for its actions, but it now has the ability to check which Tasks that Crewmate has assigned to it and "Perform" them.

To do this, the following behavior nodes were created:
  • Decide to Meander: A decorator that works similarly to the Killer's "Decide to Kill" decorator, but instead is used to determine whether this NPC will decide to meander instead of moving to perform its task.
  • Check If Done With Tasks: A decorator that just checks if the number of completed tasks the Crewmate has is equal to the total number of tasks that Crewmate was assigned. If so, the Crewmate will just wander about The Ship.
  • Pick Random Task: Task node which grabs the next task from the Crewmate's list of randomized tasks as the task to go and perform.
  • Start Crewmate Task: Task node which takes the "Time to Perform" float from the Crewmate Task to determine how long it should take for the Crewmate to complete said task. The Crewmate will wait the given amount of time next to the task.
  • Complete Crewmate Task: Sets that task in its list of tasks to complete by incrementing the "numberOfCompletedTasks" integer.  This makes it so that the next time this Crewmate find a task to perform, it will grab the next task in its list of the ones assigned to it.
Picture
The Innocent Crewmate's behavior tree.

Other Additions

The AI Deduction Gamemode now comes with the ability to distribute random tasks from around the map to all Crewmates on The Ship.

There is now a TaskBase Blueprint that has replaced all of the old task models around the map like the plants in the Greenhouse and the Cabinet in the Medbay; this Blueprint comes with a task description and which room they currently reside in. The Cafeteria table hasn't changed though since it isn't a task.

Materials were made for living and dead Crewmates and there will be more to come as the project moves up to using a full crew for the simulations!

Picture

Better Conveyance

With the newly created Task and Killer systems, I recognize there is a major lack of conveyance and general showmanship that comes with the performance of these two main gameplay elements by the Crewmates. To fix this, I intend to add more visual elements to provide detail as to what is occurring.

The ideas I have are:
  • My original idea for a task progress bar.
  • A mark to indicate the Killer Crewmates on their models.
  • A short animation for when kills occur.
  • A pop-up above the Crewmates to indicate they have completed their tasks.

What's Next?

Once again, I was quite busy with other projects this week, so I will be doing more work this weekend. I will be making a Week 3.1 update on Sunday, and there I will discuss what's to come in Week 4.

This weekend I will:
  • Work to implement the Better Conveyances I discussed in the section above.​

Want to Download the Project?


​Click Here:
Github Repository
0 Comments
<<Previous

    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