kuertee / x4-mod-da-ku-ai-tweaks

deadairaitweaks + kuertee attack ai tweaks
17 stars 4 forks source link

Possible bug in Sanctuary of Darkness pathing #11

Closed dephekt closed 1 year ago

dephekt commented 1 year ago

When KUDA is turned on, in Sanctuary of Darkness, my ships are killing themselves constantly to the environment hazard. I will plot a safe path for them with "move to position" waypoints, but they will randomly veer off in radical directions deep into the dangerous areas and promptly die.

If I turn KUDA off, I can give a single order for a ship to fly to the opposite gate and it automatically paths properly around the safe areas without even being directed to step by step.

It seems like maybe there is a bug/unintended interaction here between KUDA and whatever special thing EgoSoft has done in this system for the AI to know how to path properly around the dangerous area. This is in the release version of Kingdom End (not the RCs or betas).

dephekt commented 1 year ago

After more testing, it seems like the AI is just really bad in general at this zone. Without KUDA enabled, I told a Chimera to fly from one gate to the other. For most of its path, it took a safe way there. When it returned (to the carrier it belongs to), it took a safe path back as well, but in the very last leg it decided to just tangent off in a negative Y axis until it died.

kuertee commented 1 year ago

It's a known issue in the base game.

But I have a question: When you first noticed it with Kuda, did the ships get the custom behaviours "Avoid high-risk enemy" or "Withdraw"? I've yet to go into KE areas, so I don't know.

dephekt commented 1 year ago

In this case I had specifically disabled avoid high risk enemies and step forward/withdraw since I thought that might be part of the issue. I was thinking they were getting struck by the lightning and then taking some panic/flee maneuver. But when this happens when KUDA was on, they still had the one "move to position" order only and also weren't fleeing (or at least they were reporting the fleeing action in the UI).

I will say that it happens a lot more when I had KUDA on, but since you mention it's already a known bug in the base game, there could be some kind of complex interplay happening as a result that wouldn't be happening if the bug was fixed, so this probably isn't useful.

I'm going to go back and check with KUDA on if they were even attempting to follow the correct path when I don't try to give them multiple waypoints. From memory, they made no attempt to follow the safe path like the vanilla AI/autopilot is trying to do, but I need to double check that.

dephekt commented 1 year ago

Yeah, nevermind. With KUDA on they are still trying to follow the safe path. The caveat seems to be you can't set a bunch of "move to" waypoints along the path or that seems to increase their likelihood of going off on tangents. If you have a ship in Kingdom End I and you just tell it "move to this position in Great Reef", it does a mostly OK job at avoiding damage while traversing Sanctuary of Darkness. But if you try to tell it to move to specific points in SoD, that seems to really increase the chance of it going crazy.

In any case, looks like KUDA isn't to blame here, so I apologize for raising the alarm. And thanks for mentioning it's a known bug, because I didn't see this thread until you mentioned it: https://forum.egosoft.com/viewtopic.php?f=180&t=453510

kuertee commented 1 year ago

Thanks heaps for the report, anyway.

Just FYI: You'll see the orders "Avoid" and "Withdraw" in the ship's Behaviour menu when they are getting controlled by my portion of Kuda. Otherwise, it's their base-game AI. Note that DeadAir's portion of the Kuda does affect their base-game AI - but does not make them change their course.