Logo Platform
Company of Heroes 3
Universe banner wording

Gabby_RE

Gabby_RE

24 days ago Apr 03,2024, 17:41:03 PM

[PC] Coral Viper (1.6.0) - Pathfinding Improvements

Reply
2 950 Views
16 Comments


Pathfinding Improvements – Coral Viper (1.6.0)

Hello everyone, I’m Miguel (DevM) the gameplay designer at Relic working on pathfinding changes post-launch.  I’d like to go over what we have done for pathfinding in both the Year-1 Anniversary update (1.5.0) and the Coral Viper update (1.6.0). Before getting into these, I’m going to cover the feedback and background context driving these changes. 

We have gone through various iterations of pathfinding and come a long way since launch. The main goal for the changes were always twofold: 

  • Reduce player frustration. 

  • Create more consistent unit behaviors. 

 

The problem

Company of Heroes runs into a problem that few RTS games do due to the nature of being more closely related to a war simulation game. 

While in faster paced RTS titles it’s okay for a vehicle to rotate 180 degrees straight away, and for units to overlap often, in CoH that becomes quite noticeable.  

Frustration often results when things happen that are outside your control - like your teammate driving tanks up the frontline and creating traffic jams -  this can usually end up with your vehicle getting destroyed. While in some other games that might be more acceptable from a player’s perspective, since each individual unit is less of an investment, in Company of Heroes, a vehicle is a large investment of your time and economy. 

Another example of frustrating experiences is when your vehicle reverses into battle, given that front-armor in our game is quite important. 

Something that is usually a less obvious problem for players familiar with the franchise is reversing behavior. An experienced player may be used to using the reverse hotkey a lot, but for a newer player that may not be an engrained mechanic.. In fact, most RTS players would not expect required usage of a hotkey for best vehicle movement. 

 

How do we create more consistent behaviors?

Previously we had systems like road preference turned on. This meant vehicles would prioritize moving on roads, often to their detriment. This is an example of sometimes being too smart for your own good. While in theory you get somewhere faster, it also means that once you issue a move order, you’re never sure what your vehicle is going to do. It also becomes heavily map dependent on how the roads are set up. Often in designing these systems, you want to be careful about including behaviors that will mean downstream implications for map designers, since that means every time you author a map you also need to test if vehicles have unexpected behaviors. 

A screenshot of a video game 
Description automatically generated 

 

This image is a clear example. While following the road is faster (red), the player expectation is the shortest path (green). Following the red path might land you in rough situations where your vehicle comes under enemy fire. 


These were the pathfinding items we wanted to tackle for the last 4 months. 

  • Reversing behaviors. 
  • Consistency when a vehicle decides to drive forward versus backward. 
  • Making Casemate vehicles feel better to use. 
  • Fixing the “circle” issue (referred to by the community as “donuts”). 


Before going over what we’ve done, there’s two distinctions we need to make which are hard to get across in patch notes - the difference between the pathfinding algorithm itself and turn plans. 

Without overcomplicating things, since there are many underlying systems, to find a path we use A star (A* for short). A* is an algorithm to find the shortest path to somewhere.  Company of Heroes works on a grid system, so you can imagine A* telling us which squares we should follow to get to the end location. 

A black and white crossword puzzle 
Description automatically generated 

However, we often don’t want A* to give us the shortest path, since that would look very unnatural for tanks and possibly frustrating for the player. We want the system to have some leeway. To understand A*, lets look at the following two examples. 

A graph with a red line 
Description automatically generated 

Here we follow the shortest path. 

A graph with a red line 
Description automatically generated 

Here we try to keep the same overall “direction” as the previous example, but we smooth the curve out. 

Turn plans on the other hand are how the vehicle “realistically” interprets the movement to those squares, making the tanks seem more authentic. This could look something like this (green path): 

A black and white grid with a green line 
Description automatically generated 

The reason why it’s important to have this context is that when we say “tightening” a curve, it could be on the A* side or with the turn plan. 

With these two concepts covered, let’s get into the changes. 

Reversing behaviors

One of the changes we made for (1.5.0) is tightening the A* on reverse moves specifically. This should allow vehicles to more closely follow the player’s intent. While the previous implementation meant that the vehicles would get there faster (wider turns means higher speed) it also meant that sometimes it would stay in danger for longer (a wider arc could mean staying inside the arc of fire of an AT-Gun).  

A video game screen shot of a tank 
Description automatically generated 

 

The green path is now what we’re choosing. Keep in mind that for frontal movements, it's still important to keep the A* picking somewhat wide paths so that vehicles don’t lose as much speed on turns (especially important when flanking vehicles). 

Additionally, turn plans were changed for reverse as well - the range is now halved. This means that if a player doesn’t use the force reverse order, the vehicle will now only reverse much closer to itself. In practice this means that vehicles will  choose to get somewhere by reversing less often. 

This only fixes the turn plan side of the issue since the A* could still decide to draw a path that’s behind the vehicle and as such the fastest order there might still be to reverse. This already makes it feel a lot better. 

 

More consistency when a vehicle decides to drive forwards versus backwards

As described previously, turn plans are only half the solution. In the following image, even if reverse is less preferred in the turn plan, if it has nothing better it will still reverse into the point. 

A video game of a tank 
Description automatically generated 

A* in green, turn plans in orange. 

 

Tied to the previous change, we have made changes once again to how we prefer to path in terms of forwards and backwards. To keep things brief, we have changed how it works so that vehicles prefers moving forward more oftenin these scenarios, so that it looks more like this. 

A screenshot of a video game 
Description automatically generated 

 

This will alleviate instances where the player clearly wanted to move somewhere with their vehicle front-facing, even if the angle of the click was somewhat behind the vehicle. If players want to still reverse into it, they always have the option to force the reverse through the appropriate command. 

There’s also another lever that governs this behavior which we’ve also changed. You can think of it as Sector pathing (let’s call it SP for short). SP governs the A* itself. We use A* for close range squares since doing an A* on our bigger maps would be super expensive. As such SP gives some directives to what the general path should be and A* tries to follow that as close as it can. 

We’ve made changes so that this algorithm on top of A* also cares about vehicle facing. This means that for its higher-level calculation it will also make vehicles generally follow paths that are in front of them. 

The end result is much more consistent vehicle behaviors. Players can expect front facing movements most of the time unless they are clicking directly behind a vehicle. 

Making Casemate vehicles feel better to use: 

For casemate vehicles, we noticed that often they would do wide “S” movements, which can feel particularly bad since this unit really cares about its facing. Below of we have an image comparing CoH2, CoH3 live and the new change: 

 

 

 

 

This effectively means that given a move order, the casemate vehicle will be facing the direction a lot sooner, both at the beginning and at the end since the “S” turns were also tightened (on the turn plans). It also means it's less likely to get itself into dangerous situations where it oversteps the forward movement.  

In the end we hope this ends up feeling better than even previous CoH games. 

Fixing the “circle” issue (referred to by the community as “donuts”). 

 

There were two main problems with this one. One of them is that sometimes turns (turn plans) with big radiuses (which caused the full circle players experienced), were sometimes given too much weight in terms of how fast they were.This meant that vehicles would sometimes prefer a full wide circle that keeps their speed as opposed to just moving in a straight line. This was addressed so that wide turns are deprioritized. 

A bonus to this change is that vehicles will now more often choose to do tighter turns which meets player expectations. In the example below the red path is the live game and the green path is the new preferred path. 

A video game screen shot of a house on fire 
Description automatically generated 

 

 

We feel that these changes will ensure vehicles feel more responsive and fun, while also reducing any previous frustrations with vehicle control. Changes to pathfinding in Company of Heroes 3 have deep cascading effects on the rest of the game, and as such, it often requires ample time for iteration and testing. We know players have wanted to see this addressed quickly, and some feel that we were moving too slowly to respond to pathfinding feedback. However, at the end of the day we wanted to make sure we did not rush this work and that we did it right. Our team is always listening to feedback on how we can improve the CoH experience, and we want to thank everyone for their patience as we kept working on this in the background. Let us know what you think of the changes! 

 

Copied to clipboard!
a month ago
Mar 22, 2024, 10:59:22 PM

I think it's good that you take your time but could balance patch come 2 times a month




sir thank god for crop steel Voice line from Coh 1

0
0
a month ago
Mar 29, 2024, 7:11:12 PM

Nice. This is the Relic we want - this is the Relic we need :)

0
a month ago
Mar 29, 2024, 8:37:40 PM

Amazing & surprising post!

To be fair, CoH1 has always been the best game in terms of response time & reactivity, sometimes it's silly but never, ever frustrating, but I would've liked more comparisons to CoH1's curves, as each time I fire it up I'm amazed at the smoothness of it!

Keep up the good work!

Updated a month ago.
0
0
a month ago
Mar 30, 2024, 11:22:13 AM

Will we finally get the chance to seperate retreat and reverse button with Croal Viper update? That would help a lot...

0
a month ago
Mar 30, 2024, 6:05:17 PM

Thank you for taking the time and doing the effort of explaining all this. It’s very interesting, 

0
a month ago
Mar 30, 2024, 7:12:44 PM

Why in some cases tracked vehicles can't rotate on the same spot? I thinks, it will remove wide turns(or any turns), especially in cases like on last picture.

P.S. Thank you for sharing such interesting info ^^

Updated a month ago.
0
a month ago
Mar 31, 2024, 1:33:16 PM

i have a better idea. use different pathfinding for different situation.

when you go to somewhere far away or flanking enemy, use wide turn to get fast acceleration.

when you go to somewhere close, use tight turn to avoid unexpected movement.


i found vehicle shake while turning, is that pathfinding problem?


also i hope the vehicle behave more like a real vehicle, incoluding acceleration, deacceleration, rotation.

the rotation rate of vehicle is too high to feel natural. and the survivability is too high.

somewhat i feel the game is a comparison of data, not challenge for game and battlefield understanding. 

which destory the fun, what the strategy for if you just need to blob op units to win?


and keep the track of vehicle visable longer for like 1min.

Updated a month ago.
0
a month ago
Mar 31, 2024, 3:00:01 PM
VonManteuffel wrote:

Will we finally get the chance to seperate retreat and reverse button with Croal Viper update? That would help a lot...

i can't agree more.

why can't we use qwert 3*5 key map.

0
0
25 days ago
Apr 2, 2024, 5:44:52 PM

Great Job! Looks like a tremendous amount of effort and love went into this.  

0
21 days ago
Apr 6, 2024, 3:14:56 PM

hello,im Chinese player and my Internet is not good,Since last update I always drop out of the game and then reconnect, but when I finish a whole game, I'm told I'm blocked for 3 hours because I dropped out, but I finished the game, can you unblock me, I'm playing with my friends, I'm not interfering with any players, I hope I can play with my friends tomorrow

0
0
17 days ago
Apr 10, 2024, 10:14:24 AM

Good that u investigate into this ... it was so **** in CoH1 but specially in CoH2 it was really really §$&/()!!?=("!

0
11 days ago
Apr 16, 2024, 4:54:26 AM

It is precisely these ways of thinking that make the game so unique, as it is all about "real tactics". Gets better with each update. (I'm really looking forward to seeing how the game evolves)

0
?

Click here to login

Reply
Comment
0