Commit 9e73127
authored
AI Cleanup and Flag Fixes (#6788)
* AI Cleanup and Flag Fixes
This PR does 3 things.
1) Cleanup `ship_subsystem_in_sight` so it properly returns a bool, which is the return type of the function. Also update `ai_big_maybe_follow_subsys_path` to be a bool instead of int.
2) Adds `+subsystem attack pathing extra distance:` for use within `"$improved subsystem attack pathing:"`. FotG found, especially with the new strafing values we use, could really use the ability to set at what distance `ai_new_maybe_reposition_attack_subsys()` determines if it wants to pick a new point or not. By default the value was 2000.
3) In FotG we started using the `standard_strafe` mode more now thanks to #6511, but we have now discovered some inherit issues with it, namely that it will prematurely trigger `ai_big_strafe_maybe_retreat` because the distance it uses for determining if a collision is going to occur is `dist_normal_to_target`, which commonly resulted in the AI flying to a point to start a strafe, then thinking it would collide with the target and then retreating from strafe mode, only to realize it was now far enough to re-engage strafe mode, which commonly resulted in AI just flying around not accomplishing much. This PR adds a flag which instead uses the `distance_to_target` and a check to see if the ship is even facing the target.
Overall all are tested and work as expected. Happy to change or tune however requested, especially regarding point 3.
* clang cleanup
* cleanup copy paste name
* remove un-needed exposed float1 parent 742dd07 commit 9e73127
4 files changed
+44
-28
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
| 173 | + | |
173 | 174 | | |
174 | 175 | | |
175 | 176 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
669 | 669 | | |
670 | 670 | | |
671 | 671 | | |
| 672 | + | |
| 673 | + | |
672 | 674 | | |
673 | 675 | | |
674 | 676 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
| 65 | + | |
66 | 66 | | |
67 | | - | |
| 67 | + | |
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| |||
347 | 347 | | |
348 | 348 | | |
349 | 349 | | |
350 | | - | |
| 350 | + | |
351 | 351 | | |
352 | 352 | | |
353 | | - | |
| 353 | + | |
354 | 354 | | |
355 | 355 | | |
356 | 356 | | |
| |||
1416 | 1416 | | |
1417 | 1417 | | |
1418 | 1418 | | |
1419 | | - | |
| 1419 | + | |
1420 | 1420 | | |
1421 | 1421 | | |
1422 | 1422 | | |
1423 | 1423 | | |
1424 | 1424 | | |
1425 | 1425 | | |
1426 | 1426 | | |
1427 | | - | |
1428 | | - | |
1429 | | - | |
1430 | | - | |
1431 | | - | |
1432 | | - | |
1433 | | - | |
1434 | | - | |
1435 | | - | |
1436 | | - | |
| 1427 | + | |
1437 | 1428 | | |
1438 | 1429 | | |
1439 | 1430 | | |
1440 | 1431 | | |
| 1432 | + | |
| 1433 | + | |
| 1434 | + | |
| 1435 | + | |
| 1436 | + | |
| 1437 | + | |
| 1438 | + | |
| 1439 | + | |
| 1440 | + | |
| 1441 | + | |
| 1442 | + | |
| 1443 | + | |
| 1444 | + | |
| 1445 | + | |
| 1446 | + | |
| 1447 | + | |
| 1448 | + | |
| 1449 | + | |
| 1450 | + | |
| 1451 | + | |
| 1452 | + | |
| 1453 | + | |
| 1454 | + | |
| 1455 | + | |
| 1456 | + | |
| 1457 | + | |
1441 | 1458 | | |
1442 | 1459 | | |
1443 | 1460 | | |
1444 | 1461 | | |
1445 | | - | |
| 1462 | + | |
1446 | 1463 | | |
1447 | 1464 | | |
1448 | 1465 | | |
| |||
1486 | 1503 | | |
1487 | 1504 | | |
1488 | 1505 | | |
1489 | | - | |
| 1506 | + | |
1490 | 1507 | | |
1491 | 1508 | | |
1492 | 1509 | | |
| |||
1606 | 1623 | | |
1607 | 1624 | | |
1608 | 1625 | | |
1609 | | - | |
| 1626 | + | |
1610 | 1627 | | |
1611 | 1628 | | |
1612 | 1629 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16977 | 16977 | | |
16978 | 16978 | | |
16979 | 16979 | | |
16980 | | - | |
| 16980 | + | |
16981 | 16981 | | |
16982 | 16982 | | |
16983 | 16983 | | |
| |||
16988 | 16988 | | |
16989 | 16989 | | |
16990 | 16990 | | |
16991 | | - | |
| 16991 | + | |
16992 | 16992 | | |
16993 | 16993 | | |
16994 | 16994 | | |
| |||
17008 | 17008 | | |
17009 | 17009 | | |
17010 | 17010 | | |
17011 | | - | |
17012 | | - | |
| 17011 | + | |
| 17012 | + | |
17013 | 17013 | | |
17014 | 17014 | | |
17015 | 17015 | | |
| |||
17028 | 17028 | | |
17029 | 17029 | | |
17030 | 17030 | | |
17031 | | - | |
| 17031 | + | |
17032 | 17032 | | |
17033 | 17033 | | |
17034 | 17034 | | |
17035 | 17035 | | |
17036 | 17036 | | |
17037 | | - | |
17038 | | - | |
17039 | | - | |
17040 | | - | |
17041 | | - | |
| 17037 | + | |
17042 | 17038 | | |
17043 | 17039 | | |
17044 | 17040 | | |
| |||
0 commit comments