Hey Folks,
It’s been a while since we’ve had the opportunity to sit down and discuss Camelot Unchained in a bit more depth than our typical patch notes. As a studio, it’s important for us to communicate with our players and offer you the details behind changes we make, mechanics we introduce, and systems that we add to the game. We are making this kind of communication a priority with a new monthly newsletter, Beyond the Veil. The name might seem familiar to some of our long-time Backers, and that’s not by accident. With Beyond the Veil, we want to take time to focus on the efforts of a specific team or developer, explaining something impactful and player-facing that you’ll be able to see inside the game.
With today’s inaugural edition, we’ll hear from Mike D, who’s been spearheading our efforts to improve how NPCs work in the world of Camelot Unchained. From the monsters guarding Points of Interest to bandits in the woods, from guards that harangue your efforts to capture Keeps to the Champions that defend the final line, NPCs and their AI have been significantly improved from what existed before. We know that CU is a RvR-focused game first and foremost, but we also know that having NPCs to properly challenge players can add an extra degree of strategy to the war between the Realms. We hope you enjoy the read, and we look forward to sharing more developer insights with you moving forward.
Without further ado, here’s Mike D.
~ Travis
Be sure to check out our Twitch and Youtube channels, where you can catch weekly updates, or join our Discord server to stay up-to-date on all the latest news.
Unchained Engine – NPC System Fall Update
By Mike D
Introduction
The Unchained Engine NPC system has undergone quite a few enhancements in the past several months. While Camelot Unchained steadfastly remains an RvR title, we’ve seen increased NPC presence as an important part of the player experience and core RvR game loop. NPCs augment the CU universe through keep defense, support for a variety of character progression activities, serving as sources of loot and experience, and generally bringing the vast regions of the CU world to life. In this update we cover the major improvements players can expect to see in the current build, and what we’re working on for later releases.
Current Improvements
Driven by a combination of player feedback and longstanding design goals, the latest live build contains quite a few improvements that players can observe as they engage in combat and explore the world.
Target Selection
NPCs will now correctly ignore potential targets that are in the veil, stealthed, or invisible. Previously, if a chosen target was visible but then entered the veil, the NPC would continue to attack for several seconds. This was due to a delay in the NPCs reevaluating if their current target has changed state in some meaningful way. Now, the NPC will immediately observe that the target has disappeared and will enter an explicit state of confusion, briefly searching for the lost target before giving up and moving on. On a related note, NPCs that are forced into the veil through player abilities will be able to target other entities in the veil for as long as they remain there.
We’ve also made improvements to targeting decisions NPCs make when they are already engaged in combat. Previously, NPCs were locked to their current target until death or their target moved out of range. We’ve since added logic that allows the NPC to periodically check for other targets and score them based on a number of factors including proximity and damage received, resulting in a greater opportunity for players to draw attention away from a damaged teammate or otherwise influence NPC combat decisions.
Combat and Search Behavior
The next set of fixes was broader and more impactful. The core combat behavior had a number of bugs causing the NPC to “stall” movement and potentially go inactive. This was due to both errors in detection as well as logic bugs in the behavior implementation. With these issues fixed, we are seeing the NPCs operate much more effectively as they detect and chase enemies, and especially when they lose sight of a chosen target. In this case, an NPC will rush to where it last saw the enemy and begin searching the area for a while. If line-of-sight is reacquired, the chase and combat will resume. Otherwise, eventually the NPC will give up and return to its home location, assume a defensive patrol of the area, and keep an eye out for intruders.
Ability Use
One of the larger efforts underway for improving NPCs is their ability logic. Previously, NPC ability use was driven by a simplistic cycling of abilities, one after the other. This was done without regard for tactical concerns like attack distance, entity size, relative movement rates, splash damage, armor, and other factors that make one ability more effective than another in a given situation.
While work in this area is ongoing, some improvements have already made it into the build. Most notably, NPCs are now aware of what abilities they possess and what positioning relative to the target is desirable in order to use them effectively. A ranged NPC, for example, will pursue a target until it is within firing range and then take a fixed position to unleash its attack. Similarly, melee attackers will now take their attack range into consideration when positioning relative to an enemy, allowing attacks to play out with correct spacing based on the animation associated with the attack. Finally, for all NPCs we have fixed the issue with them coming right up into players’ faces during combat.
As part of improving NPC ability use, we’ve resolved a number of bugs in the NPC combat decisions logic as well. We fixed a variety of cases where an NPC could freeze indefinitely due to errors in the hunt and chase sequence of events, or when the target would leave the NPC’s engagement range. With those fixes in place, NPCs are now engaging players more naturally in high-density skirmishes, moving between attack and defensive positions without stalling, and returning to their posts once the action settles down.
Custom pathing
One of the newest features that completed recently is NPC custom pathing. With this feature, designers can now specify routes for NPCs to follow rather than relying purely on the NPCs deciding where to go in the world. Designers can use custom pathing to create NPC patrols along castle walls, for example, or have guards that travel between all external buildings ensuring that everything is in order. Custom routes can also be laid down for bandits, giving them specific means of ingress to contested points of interest, or for animals, giving them terrain-sensible migration routes.
This feature was engineered to give level designers maximum control with minimal effort. Rather than requiring designers to meticulously lay out every movement change along the routes, they can instead focus on key destinations, leaving the actual pathfinding between route waypoints to the NPCs. This allows NPCs to spawn in one part of the map, move autonomously to a route that begins far from their spawn location, traverse the waypoints of the route, and then resume autonomous movement once the route is finished. The feature also provides flexible waypoint selection options, ranging from looping all waypoints endlessly, choosing each point at random, or iterating the waypoints one time and then moving on to other activities in the area. Along with additional controls for movement rates and pause times, it is expected that this feature will be used heavily to enhance the NPC presence in the world, giving more purpose to movement patterns appropriate for kingdom operations and bandit and wildlife activities.
NPC debugging
One final area of improvement worth mentioning is some enhanced NPC debugging capabilities that empower engineers and designers to troubleshoot behavioral issues. These include both 3D visualization of NPC movement positions as well as on-screen text updated in real time detailing the current state of the running behaviors. Both types of information have been augmented to reflect the variety of changes mentioned above so that the new capabilities can be audited for expected results.
What’s Next?
The next phase of development will see a return to many of the previously improved systems with an eye towards completing long-awaited objectives within them. Some of the planned work is described next.
Combat and Ability Use
Next up in this area is having NPCs manage multiple abilities, making smart decisions about when to switch between ranged and melee, and when to use special abilities appropriate only in specific situations. With the foundation for these improvements already laid in the previous pass, it is expected that the majority of the work will be in the behaviors rather than the underlying core systems and networking. This means rapid development and lots of cool results coming in quickly.
Also planned is improved reaction to combat events. NPCs will more readily respond to taking damage, potentially switching targets to take down whomever recently hurt them and even tracking down siege engines that did them wrong from afar. Alternatively, NPCs may choose to leave an area of intense combat, regroup, and plan a different approach back into the fray.
Movement and Navigation
We also have plans to improve NPC navigation, with particular attention on exploiting powerful features in our underlying navmesh system to help NPCs find attack and defense positions, flee locations, flanking approaches, and wander positions that are clear of obstruction. With the arrival of wall destruction, we will start to see NPCs pour through holes in keep walls, and otherwise planning routes that take the changing landscape into account. Finally, some long standing navigation bugs are planned for resolution, reducing the incidence of NPCs getting stuck in tricky, organic geometry or failing to find paths to out-of-reach destinations.
Behavior System
A final goal of the next phase of NPC development is group behaviors. Currently, all NPCs act completely independently of each other, with apparent coordination coming from designers painstakingly scripting NPC activities to create the illusion of teamwork. The planned work will formalize NPC groups, with defined roles and behaviors tailored to each role. This will allow leader NPCs to direct their underlings on the battlefield, coordinated attacks, intelligent group movement, and eventually more sophisticated keep defense activities.
We hope you enjoy the NPC enhancements that have landed recently, and look forward to bringing you even more improvements in the coming months.