Hostility is a state that a character's AI state machine can enter. More specific states will inherit from the hostile state to prompt targeting, aggressive, and defensive behavior. It's a very similar concept to <a href="https://wiki.guildwars.com/wiki/Aggro">aggro</a> in Guild Wars because weaving through patrol patterns and balling mobs is one of my favorite things from any game. <br>
<br>
<h2>when does a character become hostile? </h2><br>
<h3>when does a character become hostile? </h3><br>
NPCs generally will not seek out the player for combat. They will either stand stationary or follow their patrol route, oblivious of the player until becoming hostile. <br>
<br>
Usually, if an NPC is hostile, that means a threat got too close. Currently, proximities in Blessfrey mirror <a href="https://en.wikipedia.org/wiki/Proxemics">Edward T. Hall's zoning</a> for interpersonal distances. Intimate distance is the range for physical interaction and melee attacks and social distance is the range for assessing hostility and ranged attacks. <br>
<center><img src="/static/img/ent/Personal_Space.svg" alt="(image: A visualization of proxemics by WebHamster of Wikipedia. Around someone are 4 concentric circles with varying diameters: within 25 feet is their public space, 12 feet is their social space, 4 feet is their personal space, and 1.5 feet is their intimate space.)" width="500" height="267.72"></center>
<center><a href="https://en.wikipedia.org/wiki/Proxemics#/media/File:Personal_Space.svg"><img src="/static/img/ent/Personal_Space.svg" alt="(image: A visualization of proxemics by WebHamster of Wikipedia. Around someone are 4 concentric circles with varying diameters: within 25 feet is their public space, 12 feet is their social space, 4 feet is their personal space, and 1.5 feet is their intimate space.)" width="500" height="267.72"></a></center>
An NPC will become hostile under a few conditions: <br>
<ul>
<li>An enemy faction member enters its social distance. Every character has a RangeBubble (Area2D) representing its social space. When a character enters range, its AI will assess both set of factions and change states upon finding a conflict. If there is a significant level desparity in the opponent's favor, though, the character will remain idle. </li>
<li>An enemy faction member enters its social distance. Every character has a RangeBubble (Area2D) representing its social space. When a character enters range, its AI will assess both set of factions and change states upon finding a conflict. If there is a significant level disparity in the opponent's favor, though, the character will remain idle. </li>
<li>Someone attacked it or dealt damage to it. If their opponent isn't in range, they will become hostile and begin searching or ambushing. (There is no friendly fire, so teams aren't going to implode.) </li>
<li>Someone was damaged or attacked by it. Once again, if their opponent isn't in range, they will begin the hunt. </li>
<li>When the majority of a team is hostile towards an opponent, any team of the same faction or type entering the social space of the hostile team will also become hostile towards it. </li>
<li>When one member of a team becomes hostile, the others remain idle until aggravated. This allows skilled players to pull individual opponents away at a time without alerting the others and divide and conquer. This also prevents one foolhardy teammate from programmatically pulling aggro onto its entire team. </li>
</ul>
<br>
<h2>what changes when a character is hostile? </h2><br>
<h3>what changes when a character is hostile? </h3><br>
A hostile NPC will enter a combative AI state, usually with the goal of pursuing its opponent until either is killed or out of range. During combat, its passive health regeneration will slow, while energy regeneration will remain constant. Maybe certain skills and items can't be used during combat. If it has hostility towards multiple targets, it will prioritize targets according to its targeting AI state, probably favoring the nearest and weakest opponents. <br>
<br>
Each NPC will express hostility differently. Broadly, hostile behavior falls into 3 groups: offensive, defensive, and targeting. Offensive states may involve melee or ranged attacks, weapon attacks or offensive skill usage, single-target attacks or AoE, frontlining or backlining, and so on. Defensive states may involve buffing or healing, fleeing or kiting, protecting themselves or their teammates, and so on. The targeting state will allow the character to have unique opinions on who is most deserving of its attention. <br>
<br>
When a character becomes hostile toward the player, there will be feedback, such as battle music playing, the opponent's name turning red, or a sound effect playing. (Now I have the <a href="">Aion aggro sound effect</a> in my head.) <br>
<br>
<h2>when is a character no longer hostile? </h2><br>
<h3>when is a character no longer hostile? </h3><br>
An NPC will lose hostility under a few conditions:
<ul>
<li>Enough distance has spread between the NPC and its opponent. Usually, an NPC will not pursue an opponent very far. The farther the NPC is led from its idle route, the less tolerance it has to pursue its opponent. However, if pulled slowly, a few steps at a time, it can be led almost anywhere. </li>
@ -39,18 +39,22 @@ An NPC will lose hostility under a few conditions:
<li>The opponent no longer belongs to a conflicting faction. </li>
</ul>
<br>
<h2>what happens after a character is no longer hostile? </h2><br>
<h3>what happens after a character is no longer hostile? </h3><br>
The character will return to its idle position or the nearest waypoint of its patrol route. Its passive health regeneration returns to its usual rate. Possibly some skills and items will be combat-only and will become disabled. <br>
<br>
<h2>team hierarchy </h2><br>
<h2>hostility in action </h2><br>
This next section is mostly for me. Let's run through some faction clash examples after illustrating the relationship of teammates and allies.<br>
<br>
<br>
<h3>team hierarchy </h3><br>
Teams have a leader. If there are additional teammates, they will be followers of the leader. Teams can be allied with other teams. Generally, the leader of the ally team will become a follower of the main team's leader, while its teammates will be followers of their local leader. If a teammate has a pet, raises a minion, casts a summon, or triggers an event that grants it an ally, that character will be the leader of its own group, allied with the responsible teammate. Alliances can be gained or broken. <br>
<br>
Teams will be more or less oblivious to their allies' position and lose them if they aren't keeping up. They will support allies in combat, but they characters usually prioritize teammates over allies. <br>
<br>
<center><img src="/static/img/ent/team_hierarchy.png" alt="(A diagram of team hierarchy. )" width="500" height="375"></center> <br>
<br>
<h2>scenarios </h2><br>
<center><img src="/static/img/ent/ally_chain.png" alt="(An illustration of the chain resulting from paladins allying with a necromancer who summons a vampire who converts a ghoul who is friends with a chaos dwarf who build a war golem.)" width="500" height="375"></center> <br>
<h3>scenarios </h3><br>
<center><img src="/static/img/ent/teams_collide.png" alt="(An illustration of the chain resulting from paladins allying with a necromancer who summons a vampire who converts a ghoul who is friends with a chaos dwarf who build a war golem.)" width="500" height="375"></center> <br>
<br>
A, B, and C are in team 1. D is allied with them. They are preparing to attack the idle team 2 (V, W, and X with ally Y). Both teams will be spotted by the patrolling team 3 (M, N, and O with ally P) in a minute. Team 2 and 3 are members of the same faction, while Team 1 is of an opposing faction. A, B, and D are within range of either other, while C is investigating something just out of range. V, W, and X are within range, while Y is stuck behind a rock just out of range. M, N, and O are patrolling, while P walks too slowly to be in immediate range of the others. A, V, and M are leaders of their teams. They lead, while their teammates flock with them. Allies are members of their own team(s). Ally team leaders will follow the team leader of the main team, while their teammates flock with them. Allies can have their own allies, resulting in large trails of allied groups. Allies will not engage against allies or support direct enemies of their allies. Allies may engage against allies removed or support direct enemies of allies twice removed, though. <br>
<br>
@ -61,21 +65,25 @@ Technically, allies are in their own team by themselves. Allies will flock withi
<li>A lays a trap. V walks into the trap and takes damage. A and V are now hostile towards each other. A and V will prepare for battle and begin hunting for each other. Their RangeBubbles will extend farther during this time. If they search for too long or travel too many steps without finding an opponent, they will resume their idle positions. If A finds an opponent, any teammates or allies within their RangeBubble will gain hostility towards the opponent and move within range. Combat will ensue. If very few or no members were in range of A, its team will idle on without it. If most members were in range, the remaining members will flock to their team and inevitably gain hostility and enter combat. </li>
<li>A one-hit-kills V from a safe distance. A becomes hostile and searches for an opponent. Team 2 is oblivious. </li>
<li>Teams 1 and 2 are hostile towards each other. Team 1 changes to the same faction. Teams 1 and 2 lose hostility. They will now consider each other friendly and possibly support each other. If one team gains hostility towards another team, the other will share hostility if still in range. </li>
<li>Teams 1 and 2 are friendly with each other and following each other. Team 1's faction changes to an adversial one. They are all so close, they all gain hostility towards the other team's members immediately. </li>
<li>Teams 1 and 2 are friendly with each other and following each other. Team 1's faction changes to an adversarial one. They are all so close, they all gain hostility towards the other team's members immediately. </li>
<li>All of team 1 is hostile towards all of team 2. Team 3 enters range of team 2. All of team 3 gains hostility towards team 1 the moment a member of team 2 enters range of a single member of team 3. </li>
<li>Team 1 and team 2 are hostile towards each other with team 3 approaching. Ally P intersects with ally Y, triggering hostility between them. Teams 1 and 2 remain oblivious towards Team 3 and vice-versa. If team 3 starts going somewhere else, P will be left behind. Members of team 3 will gain hostility on a case by case basis as they flock nearby and inevitably get too close. </li>
<li>Team 1 and team 2 are hostile towards each other with team 3 approaching. Teammate M intersects with ally Y, triggering hostility between all of team 3 and ally Y. Team 2 will eventually enter the fray coincidentally. </li>
</ul>
<br>
<h3>ally chains </h3><br>
<br>
<center><img src="/static/img/ent/ally_chain.png" alt="(An illustration of the chain resulting from paladins allying with a necromancer who summons a vampire who converts a ghoul who is friends with a chaos dwarf who build a war golem.)" width="500" height="375"></center> <br>
<br>
If a necromancer is allied with a team of paladin, they will only enter hostility through their own terms. For instance, the paladins may attack a bear, but the necromancer will ignore it until the bear is a direct threat to itself. If the paladins attack another necromancer, the enemy necromancers will likely ignore the paladin-allied necromancer and never pose a direct threat. The allied necromancer may express idle supportive behavior like buffing the paladins, but it will remain idle. The politics of the main team trump that of other roaming teams. The allied necromancer will not enter combat with the paladins merely because it is the same type as the necromancers. It will also not idly heal the team that is currently directly opposed to its paladin allies. If the enemy necromancers were fighting a team of merchants, and the paladins completely ignore both groups, the necromancer ally will enter the fray in support of the necromancers and against the merchants. This may draw the paladins in, who will support the merchants and fight the necromancers. The allied necromancer will immediately lose hostility towards anyone directly opposed to the main team's leader. <br>
If a necromancer is allied with a team of paladins, they will only enter hostility through their own terms. For instance, the paladins may attack a bear, but the necromancer will ignore it until the bear is a direct threat to itself. If the paladins attack another necromancer, the enemy necromancers will likely ignore the paladin-allied necromancer and never pose a direct threat. The allied necromancer may express idle supportive behavior like buffing the paladins, but it will remain idle. The politics of the main team trump that of other roaming teams. The allied necromancer will not enter combat with the paladins merely because it is the same type as the necromancers. It will also not idly heal the team that is currently directly opposed to its paladin allies. If the enemy necromancers were fighting a team of merchants, and the paladins completely ignore both groups, the necromancer ally will enter the fray in support of the necromancers and against the merchants. This may draw the paladins in, who will support the merchants and fight the necromancers. The allied necromancer will immediately lose hostility towards anyone directly opposed to the main team's leader. <br>
<br>
If the necromancer raises 2 liches, each lich is the leader of its own team, and each team is allied with the necromancer. Let's say the liches summon vampiric minions, one of which converts someone to an allied ghoul whose alliance remains constant with its chaos dwarf buddy who in turn is allied with its wargolem. The paladin will respect the necromancer and liches but become hostile towards the vampires and all other evil monsters and vice-versa. In the case all these groups were factionless, the paladin would be neutral towards the vampires and everything else down the chain. Neutral characters are generally low priority in combat, but AoE attacks can easily whip up hostility. <br>
If the necromancer raises 2 liches, each lich is the leader of its own team, and each team is allied with the necromancer. Let's say the liches summon vampiric minions, one of which converts someone to an allied ghoul whose alliance remains constant with its chaos dwarf buddy who in turn is allied with its wargolem. The paladin will respect the necromancer and liches but become hostile towards the vampires and all other evil monsters and vice-versa. In the case all these groups were factionless, the paladin would be neutral towards the vampires and everything else down the chain. Neutral characters are generally low priority in combat, but AoE attacks can easily whip up hostility. <br>
<br>
If the necromancer dies, the lich and paladins will no longer restrain themselves from becoming hostility towards each other. <br>
<h2>hostility concluded </h2><br>
Before, I was trying to force the combat state into flat booleans, but clearly there is more nuance to the issue. A character can be hostile but not in active combat. A character can be in combat but not hostile. Also, hostility is more of a product of a character's surroundings, actions, and actions inflicted on it. Structurally, it needs to resemble (extremely obviously) an AI state rather than any kind of variable. <br>
<br>
The characters' state machines now behave more like the above scenarios, and I'd love to make a cutscene-like demo for Blessfrey's second demo that sets differently factioned groups on clashing patrols to make sure it all works. Look forward to it! <br>
<li>I'm finally caught up! It feels like I've been going nonstop for months, with househunting, moving, making a new wardrobe, meeting my guildies, getting the house together for Christmas, hosting for my husband's family, meeting end-of-the-year deadlines,...then nothing! My next goals are to get the house not merely presentable but cute and comfortable and get a demo out for my game. </li>
<li>For New Year's Eve, we watched an anime stream with guildies. When the neighbors started shooting fireworks, I asked my husband to go on a walk together around the lake. We went to the bridge, which was a little sentimental since one of the first New Years I celebrated was in RuneScape on the Keldagrim bridge with some random passerby. It was nice. At least, it was nice until my husband spotted an alligator. It was just his head sticking out of the water, gliding along beside us. When we spotted him, he dived. It was pretty freaky. Judging from the size of his head, he was twice my size. A handler at Gatorland told me they are usually pretty slow on land (especially during winter), but this guy was thrashing around. We took our bet with running the entire way back to my neighborhood. Looking it up online, though, it says they can easily outrun a human. Aaaahhhhhhhhhhh! <li>
<li>A week later, everyone in my family and my husband's family tested positive for COVID except for us. I feel so bad. We've been using COVID fear as an excuse to avoid family gatherings, but they heard none of it this year. There are vulnerable people on both sides and not everyone's vaccinated. My side thinks they caught it from work, and his side thinks they caught it from traveling. Everyone came down with it at the same time after the get-together, though, so...it was our get-together, wasn't it? Dang. </li>
<li>I'm finally caught up! It feels like I've been going nonstop for months...and now nothing! My next goals are to get the house not merely presentable but cute and comfortable and to get a demo out for my game. </li>
<li>For New Year's Eve, we watched an anime stream with guildies. When the neighbors started shooting fireworks, I asked my husband to go on a walk together around the lake. We went to the bridge, which was a little sentimental since one of the first New Years I celebrated was in RuneScape on the Keldagrim bridge with some random passerby. It was nice. At least, it was nice until my husband spotted an alligator. It was just his head sticking out of the water, gliding along beside us. When we spotted him, he dived. It was pretty freaky. Judging from the size of his head, he was twice my size. A handler at Gatorland told me they are usually pretty slow on land (especially during winter), but this guy was thrashing around. We took our bet with running the entire way back home. Looking it up online, though, it says they can easily outrun a human. Aaaahhhhhhhhhhh! </li>
<li>A week later, everyone in my family and my husband's family tested positive for COVID except for us. I feel so bad. We've been using COVID fear as an excuse to avoid family gatherings, but they heard none of it this year. There are vulnerable people on both sides and not everyone's vaccinated. My side thinks they caught it from work, and his side thinks they caught it from traveling, but everyone came down with it at the same time...It had to be the get-together. Dang. </li>
<li>At least Christmas went well while it lasted. Best Christmas ever, honestly. Never been so happy to finally see everyone again. </li>
</ul>
<h3>wednesday, january 5 </h3>
<ul>
<li>Colored new sprites, portraits, and threw together a mockup for the second or third demo's level, whichever one will have a simple branching story event. It'll be much cooler than the first proof-of-concept, vertical slice demo. I want to finish this one and move on already. Also messed with interact code, so you can't talk to Chloe after she dies. </li>
<li>Watched The Weekenders while I did that. People have a lot of nostalgia for a lot of cartoons, but it's never for the ones I liked. Isn't everything like that? It holds up okay. Cute show, and I like their willingness to put two random characters together and show how they interact. </li>
<li>Watched The Weekenders while I did that. People have a lot of nostalgia for a lot of cartoons, but it's never for the ones I liked. Isn't everything like that? This show holds up okay. Cute characters, and I like their willingness to put two random characters together and show how they interact. </li>
</ul>
<br>
<h3>friday, january 7 </h3>
@ -36,6 +36,7 @@ february 1, 2022<br>
<li>Web maintenance </li>
</ul>
<h3>friday, january 14 </h3>
<ul>
<li>Before, I wanted to jump right in and force a murky concept of "in combat" and "out of combat" (or "hostility"), and it didn't turn out well. When I took a moment to research, draw charts, and write user stories, hostility clicked. Implementing a feature feels more instantly gratifying than the abstract process of design or devops. The temptation of coding from the hip is too strong to resist, but much of that code gets stashed and abandoned, including the hostility code. Instead of flailing around in the editor, that time might as well have been spent playing Divine Divinity if I really didn't feel like doing design work...When will I learn? </li>
</ul>
<h3>saturday, january 15 </h3>
@ -62,7 +63,7 @@ february 1, 2022<br>
<ul>
<li>Added navmesh to demo levels </li>
<li>Refactoring and debugging: spawnpoints, updating any old code. </li>
<li>Removed sex option from character creation. TBH, adding a male playable character is a lot of extra work since the player character isn't a complete Tabula Rasa. I'm not going to do the bizarre thing a lot of games do where the girl is just the guy again with swapped pronouns. It's so weird and cringy. Even Guild Wars 2, which made a huge deal about roleplaying your character through dialog, forces some strange lecherous desire for the human noble women onto your character no matter your sex. Either they meant for all male main characters to be straight and all female main characters to be gay (lol), or they are yet another lazy dev. I'd want to actually rewrite everything to acknowledge your character's sex, so I couldn't bother unless I was discovered by a playerbase who'd appreciate it. Female protagonists is my comfort zone, though, so I can't promise a male protagonist wouldn't be weirdly and cringily effeminate. </li>
<li>Removed sex option from character creation. TBH, adding a male playable character is a lot of extra work since the player character isn't a complete Tabula Rasa. I'm not going to do the bizarre thing a lot of games do where the girl is just the guy again with swapped pronouns. It's so weird and cringy. Even Guild Wars 2, which made a huge deal about roleplaying your character through dialog, forces some strange lecherous desire for the human noble women onto your character no matter your sex. Either they meant for all male main characters to be straight and all female main characters to be gay (lol), or they are yet another lazy dev. I'd want to actually rewrite everything to acknowledge your character's sex, so I couldn't bother unless I was discovered by a player-base who'd appreciate it. Female protagonists is my comfort zone, though, so I can't promise a male protagonist wouldn't be strangely effeminate anyway. </li>
</ul>
<h3>saturday, january 22 </h3>
<ul>
@ -77,15 +78,43 @@ february 1, 2022<br>
</ul>
<h3>tuesday, january 25 </h3>
<ul>
<li>I'm getting really good at making my own french fries and chips. I think boiling them first then frying in hot oil is best so far. I boil them in bay leaves and black pepper oil, fry in peanut oil, and toss in salt and cracked black pepper. If only fried pickles were so easy. I also made spice cookie dough rolls to leave in the freezer, mostly following <a href="https://homemadehooplah.com/christmas-spice-cookies/">Homemade Hooplah's Christmas spice cookie recipe</a>. Instead of flour, I'm trying pecan flour. It seems fattier, moister, and nutty, so maybe it would be good for cookies. </li>
<li>I'm getting really good at making my own french fries and chips. I think boiling them first then frying in hot oil is best so far. I boil them in bay leaves and black pepper oil, fry in peanut oil, and toss in salt and cracked black pepper. If only fried pickles were so easy. I also made spice cookie dough rolls to leave in the freezer, mostly following <a href="https://homemadehooplah.com/christmas-spice-cookies/">Homemade Hooplah's Christmas spice cookie recipe</a>. Instead of flour, I'm trying pecan flour. It seems fattier, moister, and tastes nuttier. </li>
<li>Website maintenance </li>
<li>Refactoring and debugging: container, inventory items </li>
<li>Refactoring and debugging: container, inventory items, highlight, hitbox </li>
</ul>
<h3>wednesday, january 26 </h3>
<ul>
<li>UI plates were either static textures that toggle with hide() and show() or some kind of PopUp. I'm converting them into containers that can be popped into the content container of a custom window, complete with dragging and X to exit. I'm adding this only because the UI plates overlapped before, making the game unnecessarily annoying to play. I'll try to add window focus bringing it to the front and only allowing each window to be open once at a time, but those don't prevent anyone from playing. Later, I'll have the UI remember where you like each window and make them look less stark. </li>
<li>Refactoring and debugging: container, inventory items </li>
</ul>
<h3>thursday, january 27 </h3>
<ul>
<li>Containers work with custom windows </li>
<li>Refactoring and debugging: character creation screen </li>
</ul>
<h3>friday, january 28 </h3>
<ul>
<li>Adding skill library and containers to custom windows </li>
</ul>
<h3>saturday, january 29 </h3>
<ul>
<li>Refactoring and debugging: known skills use containers instead of being a cluster of floating labels and textures </li>
</ul>
<h3>sunday, january 30 </h3>
<ul>
<li><a href="https://www.youtube.com/watch?v=roughtzsCDI">Ring Ding Dong</a> is stuck in my head. Ring diggy ding diggy ding ding ding 오직 너만 들린다 Ring ding dong ring ding dong♪ This must be exactly the kind of song that would give my neighbor vibes of living next door to Kaoru from Welcome to the NHK. At least, if I didn't wear earbuds. </li>
<li>Less graphic weirdness with displaying skill library in a custom window </li>
<li>Smartphone uses containers instead of being a random cluster. Inventory app no longer opens with hotkey, though. </li>
<li>Refactoring and debugging: translation server keys, entity ids </li>
</ul>
<h3>monday, january 31 </h3>
<ul>
<li>NYT bought <a href="https://www.powerlanguage.co.uk/wordle/">Wordle</a>...dang. Fun while it lasted. </li>
<li>More or less added critical hits, life drain, cure, heal, mark, eye strain keywords and 7 new skills that use them.</li>
<li>Skillmaker supports keywords that rely on co-routines </li>
<li>Refactoring and debugging: keywords, status effects </li>