![]() |
Zombies feast on a settler in the middle of the road. |
Behavior Update
The Fallout 4 engine uses a combination of AI packages and linked references to mostly govern actor behavior outside of combat. I already created a custom package for zombies for their horde movement behavior based on the default package master that I have now stripped down and simplified to ensure zombies only perform the actions I want them to.
![]() |
Package used by zombies to Sit, Follow, or Patrol based on the linked references they may have assigned. |
Note that procedures can also have conditions assigned to it which can cause a procedure to be skipped. In the screenshot above, the Sit procedure will only execute if the linked reference is not disabled and the actor has the FeralGhoulRace. I added the race condition to prevent Ghoul zombies (from NPC Resurrection) from trying to use furniture they have no animation for which would otherwise cause them to just stand around.
Procedures Used
Sit procedure - This procedure causes an actor to use a particular piece of furniture. Maybe it should be called "Use Furniture" instead? This is used to link zombies to the special feral ghoul eating furniture next to a dead body.
Follow procedure - This procedure causes an actor to follow another actor around. This is used to group zombies together. Zombies follow each other until ones becomes the defunct leader and wanders.
Patrol procedure - This procedure causes an actor to move to a marker of some kind and markers can be chained together forming a path (or moved like this mod does to implement wandering zombies - see Horde Behavior).
Setting Linked References
![]() |
SandboxFeralGhoulSquatEating furniture |
There is a script attached to all zombies that initializes a zombie (once) when they are spawned, listens to certain events (like a zombie dying or entering combat), and updates their behavior. The behavior update portion of the script essentially sets the linked reference for that zombie so that the appropriate procedure described above triggers.
In the case of zombie feeding, the script searches for nearby corpses and if found actually creates the furniture object. The furniture is then linked to the zombie with the keyword LinkAmbushFurniture since that is the same keyword used by existing ferals in the game.
The end of the script executes EvaluatePackage to make the zombie re-evaluate the package tree described above. This causes the Sit procedure to execute which makes the zombie walk to the furniture and use it. Furniture has animations linked to it that are specific to the type of actor the furniture was made for. The SandboxFeralGhoulSquatEating furniture is what is used by zombies and makes the zombies squat down over the corpse and use their hands to grab from the ground in front of them and then move to their mouths as if eating.
What About the Corpse?
There are two events you can register for to detect when an actor uses furniture (OnSit) and stops using furniture (OnGetUp). When OnSit is triggered, the corpse being "eaten" by the zombie has a random limb chosen and Dismembered. Once all limbs are dismembered the corpse is marked as eaten so other zombies now ignore it.
A cleanup script runs and disables the zombie furniture after about 1 hr in game. When this happens the OnGetUp event is triggered as the zombie exits that no longer valid furniture. This allows the script to update the zombie behavior again which could cause the zombie to move on to the next body part or wander away if nothing is left to consume.
Limitations and Future
The corpse eating is limited to Feral Ghoul zombies right now. Zombies spawned by NPC Resurrection or replacement of humans are actually Ghouls and do not have the animations required to use the furniture. I am exploring alternatives for them possibly including the game's built in Cannibal perk. Early experiments have failed but I will pursue it.
Some corpses, like the dead raider across Sanctuary bridge, refuse to be eaten for some reason and I have yet to figure out why. If "Already Dead" is enabled under Spawn Settings -> Replacements -> General Settings, then that raider is marked as zombie food until it resurrects as a zombie itself. The zombies nearby detect this and create the furniture marker but don't use it.
The behavior updates described above do not apply to all zombies. Some zombies have pre-defined behavior like ambushes (Crawling out from under cars) that I didn't want to break so I exclude them from being changed. Also, currently the behavior updates do not apply to interior locations. This was mostly to avoid zombies trying to wander to inaccessible areas and getting stuck, but I may revisit this to at least allow them to search for food.
This comment has been removed by the author.
ReplyDeleteWhoa.... been a long time since I posted on my old blogger account... looks like I posted and deleted my own comment... :)
ReplyDeleteAnyway... the dead raider across the Sanctuary bridge.... always seems to be bugged out, and often reappears on its own when the cell resets...
Ruined
Yeah, I'm not sure why that one is special but I've notice it constantly resetting also in my games.
ReplyDeleteI have a question. Could it be possible you could make quests for this mod. I love the idea of this game being a zombie apocalypse instead of Fallout cause the game itself dosent seem like fallout
ReplyDeleteI've thought about Quests before. It would take a fair amount of work and be a new avenue not really explored yet for the mod. I do like the idea of spawning in the game with a "The apocalypse is just beginning and I left my daughter at the library" type quest. Also, some random encounters or wandering hordes being reported might be fun. We'll see.
ReplyDeleteSounds fun
ReplyDeleteYet another reason to use a 토토사이트 is to avoid dropping money.
ReplyDeleteIt's real easy to start digging into the Internet sources of gaming industry news. For starters, you can search in any search engine for "gaming news" or similar search term. Playstation news
ReplyDelete