The ProblemIf you play video games, you might notice that the combat AI is somewhat unrealistic. Characters will continue to fight and emit non-contextual “Barks” even when their is no hope of surviving against the player. While I don’t play video games, I am interested in behavioral AI for combat scenarios. There may be a template that can be used to make enemy characters to behave more realistically. This brings us to the concept of “Fight or Flight.” Fight or Flight or something else?American physiologist Walter Bradford Cannon coined the term “Fight or Flight” but it’s not the whole story. Animals don’t always fight or flee. When a cat feels threatened, it arches its back. When a dog yields to authority, it shows its belly. So what if “Fight or Flight” should be more like “Fight, Flight, Posture or Submit?” On KillingCol David Grossman, proposed this “Fight, Flight, Posture or Submit'“ theory in his book “On Killing.” Soldiers are a product of their society. If soldiers are told that “killing it wrong” for 18 years, they aren’t going to change after 13 weeks of training. During World War 2, only 20% of soldiers fired their weapons at the enemy - mainly because soldiers were taught to shoot at bullseyes. But the problem is that nothing on the battlefield looks like a bullseye. This was solved by the Vietnam War with the creation of pop-up targets, also known as “Ivans.” This target “pops up” at various ranges for set lengths of time, simulating an enemy soldier suddenly appearing and then disappearing. This new concept raised the firing rate to over 90%. So this may be a concept we can work with. If training has a direct effect on the willingness to fight, we could use that as a template. Enter FortitudeThe solution is the concept of “Fortitude.” The roll-playing game “Dungeons and Dragons” created this concept which indicated a characters endurance and resilience to harmful effects. Here is how this could work in practice. When a player encounters enemies, every enemy is given a random fortitude value from 0 to 20. In the case below, assume that we have 10 enemies in a building which must be cleared for the player to continue. Characters with a Fortitude 17-20 fight. Characters with a Fortitude of 11-16 Posture. Characters with a Fortitude of 5-10 Flee. Characters with a Fortitude of 0-4 Submit or surrender. Here is how that chart might look: However, there is a problem with the chart. Only one character will fight. We need a way to increase or decrease Fortitude based on emergent conditions. So we need two values in the table: a starting Fortitude and a total fortitude which can go up or down, depending on conditions. So what values can we use can we use to increase or decrease Fortitude? Distance to AlliesOne interesting fact in “On Killing” was that machine gunners during World War II had a 98% chance of firing their weapons. Why? Because a machine gun is typically a crew-served weapon. The gun team typically has two or three personnel - a gunner, an assistant gunner and an ammo bearer. So being close to an ally could increase Fortitude. We could program this into the AI by saying that:
Being PinnedA second modifier would reflect the consequences of being pinned down. If an enemy is under cover and not pinned down, they may be more inclined to fight since they feel safer. We could write that as:
Being WoundedWounded enemies may also be far less likely to fight either due to the nature of their wounds, or due to the morale shock of being wounded and facing mortality. However, we also need to account for enemies who have the Fortitude to ignore their wounds and stay in the fight. So we could say that any enemy with a starting Fortitude that is greater than 17 will continue to fight, even if wounded. We could write that as:
Out of AmmunitionEnemies who are low or out of ammunition may be less likely to fight either due to the morale loss or the inability to resist. We also may need to take starting Fortitude into account here since an enemy who is out of ammunition may continue to resist by other means. We could write that as:
LeadershipEnemies who lose their leaders in combat are far less effective than ones who are being actively led. This is especially true among untrained troops. The being in the presence of a leader should increase the enemy’s fortitude. Leaving that presence should remove that Fortitude bonus, but the loss of a leader should permanently decrease decrease Fortitude. This could be written as:
The ConsequencesThis system could create a far more dynamic game with enemies responding to changing battlefield conditions. It could also create interesting moral choices. What do you do with a surrendering enemy? Would an enemy of high Fortitude gun down one of their comrade as punishment for surrendering or fleeing? The concept of "Fortitude" presents a promising framework for enhancing the realism and complexity of combat AI in video games. By incorporating factors such as distance to allies, being pinned, wounds, ammunition status, and leadership presence, game developers can create a more dynamic and immersive gameplay experience. Moreover, this system introduces ethical dilemmas for players to navigate, adding depth and nuance to their interactions with virtual enemies. As technology continues to evolve, so too will our ability to simulate and understand the intricacies of human behavior, paving the way for even more engaging and thought-provoking gaming experiences. So the next time you pick up your controller, consider the complexities behind the actions of your virtual adversaries, and appreciate the innovation that brings them to life. You're currently a free subscriber to The official Ryan McBeth Substack. For the full experience, upgrade your subscription. |
Search thousands of free JavaScript snippets that you can quickly copy and paste into your web pages. Get free JavaScript tutorials, references, code, menus, calendars, popup windows, games, and much more.
How to Simulate Fear in Video Games
Subscribe to:
Post Comments (Atom)
Why Carousels Are a Poor Way to View Product Images
Introducing the scrolling image stream ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ...
-
code.gs // 1. Enter sheet name where data is to be written below var SHEET_NAME = "Sheet1" ; // 2. Run > setup // // 3....
No comments:
Post a Comment