Just like in XR, ship may get stuck inside a structure: only me?

This forum is the ideal place for all discussion relating to X4. You will also find additional information from developers here.

Moderator: Moderators for English X Forum

Browser_ice
Posts: 488
Joined: Sun, 5. Feb 06, 17:15
x4

Just like in XR, ship may get stuck inside a structure: only me?

Post by Browser_ice »

On some rare occasions (happened 3 times in my first 3 weeks of playing it), the ship I am in, either driving it or has a pilot, will go through the first layer of the station structure and get stuck in it. The AI is not intelligent enough to go around it instead going through the structure because its destination is right on the other side. That used to happen more often in XR and was annoying.

Has anyone had this or its just me?

If its just me, then maybe I should go in game testing ... ;-)
Ubuntu 24.04 playing with ProtonDB
Intel I7-12700K
32Gb Memory
Nvgidia RTX-3060
brekehan
Posts: 952
Joined: Sun, 15. Feb 04, 08:33
x4

Re: Just like in XR, ship may get stuck inside a structure: only me?

Post by brekehan »

Happens to me too. Has happened since X2
To understand recursion you must first understand recursion.
Aven Valkyr
Posts: 228
Joined: Thu, 13. Mar 14, 23:52
x3ap

Re: Just like in XR, ship may get stuck inside a structure: only me?

Post by Aven Valkyr »

This has happened to me as well. And the reason this happens is simple. The AI is programmed to fly as if it were out of sector at all times. The AI is blind to obstacles being loaded up by the player being in-sector. So the AI thinks it's still out of sector where it can fly through objects without any problems and just get to the dock point. What Egosoft needs to do is do a layer of programming where the AI takes curved vector pathing in order to go around objects. I don't know how hard it would be to program this, but the AI is blind to objects in space. This is and always has been a problem in the X series
brekehan
Posts: 952
Joined: Sun, 15. Feb 04, 08:33
x4

Re: Just like in XR, ship may get stuck inside a structure: only me?

Post by brekehan »

Aven Valkyr wrote: Mon, 8. Apr 19, 06:37 This has happened to me as well. And the reason this happens is simple. The AI is programmed to fly as if it were out of sector at all times. The AI is blind to obstacles being loaded up by the player being in-sector. So the AI thinks it's still out of sector where it can fly through objects without any problems and just get to the dock point. What Egosoft needs to do is do a layer of programming where the AI takes curved vector pathing in order to go around objects. I don't know how hard it would be to program this, but the AI is blind to objects in space. This is and always has been a problem in the X series
That's not what happens, nor is it the reason.
To understand recursion you must first understand recursion.
Aven Valkyr
Posts: 228
Joined: Thu, 13. Mar 14, 23:52
x3ap

Re: Just like in XR, ship may get stuck inside a structure: only me?

Post by Aven Valkyr »

brekehan wrote: Mon, 8. Apr 19, 06:45 That's not what happens, nor is it the reason.
That is 100% why it happens. The AI thinks it's out of sector at all times and doesn't realise there's obstacles loaded, and tries to fly through them just as if they were out of sector. Sometimes the AI remembers that it's in sector. But the pathing is all messed up while in sector, and takes this weird segmented pathing algorithm where the pilot will fly a short distance, stop, then recalculate the route, fly a short distance, stop, recalculate, rinse, repeat. Or it doesn't realise you are in sector and objects are loaded up, and just tries to fly straight through them. I've been playing X since 2011 and this has been the main issue with AI pathfinding, this isn't the first time I've brought this up in the forums. It's also something Egosoft has never grabbed by the horns and really dialed down. While in-sector the AI needs to use different pathfinding algorithms. Other games have done it, such as Freespace 1 & 2, freelancer, Starpoint Gemini, and many other flight/space sim games. They are all able to do it, but then again none of those games had "out of sector" algorithms where the AI were able to just fly through objects when they aren't loaded. This is 100% why it's happening.

I would like to see your evidence based on your response, since you have provided none, and I have provided plenty to prove my point.
brekehan
Posts: 952
Joined: Sun, 15. Feb 04, 08:33
x4

Re: Just like in XR, ship may get stuck inside a structure: only me?

Post by brekehan »

Aven Valkyr wrote: Mon, 8. Apr 19, 06:59 I would like to see your evidence based on your response, since you have provided none, and I have provided plenty to prove my point.
I see. I didn't realize you provided evidence. I thought you had provided "guesses." In that case, can you share the source code? I have some modifications I'd like to make...

As much as I like to have random arguments with random people on the internet...I'm gonna pass.
To understand recursion you must first understand recursion.
Tomonor
EGOSOFT
EGOSOFT
Posts: 1930
Joined: Wed, 12. Sep 07, 19:01
x4

Re: Just like in XR, ship may get stuck inside a structure: only me?

Post by Tomonor »

Yes, it happens to all of us. I'm sure what's happening is we all try to put a blind eye on this, because it's got to be the most reported bug ever that eventually never gets fixed - concluding that it cannot be fixed.
Image
User avatar
MakerLinux
Posts: 304
Joined: Tue, 14. Nov 17, 13:10
x4

Re: Just like in XR, ship may get stuck inside a structure: only me?

Post by MakerLinux »

I also tend to think that this explanation of Out-of-Sector pathing for In-Sector AI doesn't make much sense, e.g. how can an AI "sometimes remember" to do differently? In my case, I have been watching both autopilot and commanded pilots trying to deviate from obstacles, but reacting too slowly and failing.

I don't know if that helps, but I've noticed that if you get stuck inside a structure, if you relinquish command to the NPC he/she gets unstuck, it also works if you teleport to another sector then back again.
Brazilian Linux-only user living in Poland, https://steamcommunity.com/id/patolinux on Steam. PC I use for playing: Ryzen 7 7800X3D with 64 GB 6GHz DDR5 CL30, AMD Radeon RX 7900 XTX, ArchLinux on KDE 6 Wayland
Controllers: steam controller via sc-controller or HOTAS set: Saitek X52 Pro + MFD F-16 + G29 pedals.
VR headset: Valve Index & Meta Quest 2. My other PC: Steam Deck OLED with nReal AIR AR headset
Aven Valkyr
Posts: 228
Joined: Thu, 13. Mar 14, 23:52
x3ap

Re: Just like in XR, ship may get stuck inside a structure: only me?

Post by Aven Valkyr »

My evidence is hard playtime and observation of how the AI works. When you are out of sector and obstacles aren't loaded, the AI does exactly what it needs to do. Flies from point A to point B. When you are in sector, and obstacles ARE loaded, the AI also tries to fly from point A to point B in a straight line. As soon as it comes across an obstacle, stops the ship, rotates the ship, flies the ship. Still in the obstacle path. Stops the ship, rotates the ship, flies the ship, or tries to fly straight through the object. This was horribly prevalent in X3 where AI ships would zig-zag back and forth from the obstacle. It's just poorly written code and the right math isn't being used. I am not going to imply that it's an "easy" fix, but simply observing the AI when obstacles are loaded up is plenty of evidence. Why would I need to provide source code? Would a video of this exact behaviour be evidence enough for you?

What the X series of games needs is a separate calculation the AI needs based on curved vectoring, where they stop, plan a full route from point A to point B, accounting for obstacles and having to fly around them. This formula would be updated as new obstacles are loaded. This would be an intensive calculation for the computer to make but thankfully only so much of the game world is loaded into sector at any time. Once an object is out of field of view, the game basically goes back to OOS flight mode for AI. Honestly, it's something they could easily look at, and any game in the entire history of gaming that has AI movement accounts for obstacles and getting around objects. In a 3D game world this calculation is a little more complicated but it's still there.

Tell you what, Mr. Source code. Why don't YOU provide the source code showing me that this is not how it works? Or how about a video proving that AI ships take curved vectors and ALWAYS account for loaded obstacles? Because in my playthrough of X4 I have seen far too many times the AI tries to fly straight for the distination, despite stations, rocks, ships, gates etc being directly in their path. The AI will try to fly straight through it just as if it were out of sector.
Aven Valkyr
Posts: 228
Joined: Thu, 13. Mar 14, 23:52
x3ap

Re: Just like in XR, ship may get stuck inside a structure: only me?

Post by Aven Valkyr »

MakerLinux wrote: Mon, 8. Apr 19, 16:13 I also tend to think that this explanation of Out-of-Sector pathing for In-Sector AI doesn't make much sense, e.g. how can an AI "sometimes remember" to do differently? In my case, I have been watching both autopilot and commanded pilots trying to deviate from obstacles, but reacting too slowly and failing.

I don't know if that helps, but I've noticed that if you get stuck inside a structure, if you relinquish command to the NPC he/she gets unstuck, it also works if you teleport to another sector then back again.
I think what's happening here is the AI is bouncing between 2 math formulas. Hence sometimes it works, sometimes it doesn't. Or it finds some sort of balance because it knows it needs to move the ship, and what happens is what I call segmented vectoring. I'm not saying there's zero math for in sector flight. What I'm saying is the math isn't working and the formula needs to be scrapped. The AI is capable of planning a route, but the devs need to approach the math for in sector flight a little differently than they have been. Right now what it seems like to me is the formula has been carried forward from all of their previous games, and at one point it was utterly broken, and then "sorta fixed" with a bandaid fix. Then in X3 with the complexity of the engine the formula was sub-par, but instead of writing a whole new block of code for it and approaching the way AI handles in sector flight, they just added more bandaids to this fix. Now we have X4 and the bandaids still apply, and the flight model is getting more and more broken.

So while I'm not saying there's absolutely nothing for in sector flight, what I am saying is that the vectoring math is being used wrong and the code could be cleaned up and simplified if the devs approach the whole thing differently and write their formula from scratch
brekehan
Posts: 952
Joined: Sun, 15. Feb 04, 08:33
x4

Re: Just like in XR, ship may get stuck inside a structure: only me?

Post by brekehan »

Ok, I can't even help it.
Aven Valkyr wrote: Tue, 9. Apr 19, 04:28 My evidence is hard playtime and observation of how the AI works.
You know there are people in the world that swear the earth is flat, citing the same evidence. After all, they can clearly observe the horizon over years of experience.

Irregardless, how about instead of making assumptions about how the code, that you've never seen, works, and pointlessly arguing about it, we just leave it at:

"There is a problem with collision detection and avoidance that has existed since the beginnings of the X series?"

I can agree that it would be nice if they fixed it.
I can agree that I experience it.

I will not agree to make assumptions about 2d and 3d pathfinding, in sector, and out of sector algorithms, collision detection, and avoidance systems that are probably 10s of 1000s of lines of code each, that I have never ever seen, much less make suggestions on how to fix it. I will leave that to the developers , their bug tracker, and maybe their JIRA, if they use it.
To understand recursion you must first understand recursion.
adeine
Posts: 1443
Joined: Thu, 31. Aug 17, 17:34
x4

Re: Just like in XR, ship may get stuck inside a structure: only me?

Post by adeine »

brekehan wrote: Tue, 9. Apr 19, 04:36 "There is a problem with collision detection and avoidance that has existed since the beginnings of the X series?"
This is not even true. X3's AI/autopilot is suboptimal, but it is nowhere near as bad as X4. Ships can actually dock and undock, navigation works as expected, and ships almost never run into static objects when pathing outside SETA.
Aven Valkyr
Posts: 228
Joined: Thu, 13. Mar 14, 23:52
x3ap

Re: Just like in XR, ship may get stuck inside a structure: only me?

Post by Aven Valkyr »

brekehan wrote: Tue, 9. Apr 19, 04:36 You know there are people in the world that swear the earth is flat, citing the same evidence. After all, they can clearly observe the horizon over years of experience.

Irregardless, how about instead of making assumptions about how the code, that you've never seen, works, and pointlessly arguing about it, we just leave it at:

"There is a problem with collision detection and avoidance that has existed since the beginnings of the X series?"
Well actually it's less the flat earth argument and more, like this argument:

The wheels on the car are turning therefore the car is in motion.

Pretty obvious. And that's how obvious it is to me. Here's another analogy:

The ball is bouncing so the ball must be the bouncing type of ball.

It's based more on hard evidence than theory. Also when police are investigating a crime they will take witness statements as evidence. Do they always necessarily need to see the video of "hard evidence" before a verdict can be reached? No. Testimony statements from witnesses are good enough for a conviction. So let me give you my witness testimony.

- I am on a ship. I tell the pilot (or AI in previous X games) to drive the ship from point A to point B.
- AI logic: What's the shortest path? A straight line.
- Enter obstacle that is loaded while in sector
- AI logic. Dum-de-doo all is going well. OH CRAP AN OBSTICLE
- In previous X games: Pick a random vector and fly a short distance away. Re-negotiate route. Dum-De-Doo. OH CRAP IT'S THE OBSTACLE AGAIN.
- In X4: Flight path is a straight line, OH CRAP AN OBSTICLE. Fly straight through it. Dum-De-Doo. Oh my ship can't move anymore. Crap. Re-negotiate vector.

Is this starting to make sense? The in-sector math is based on the out of sector math. Otherwise, the AI would never have chosen the straight line path to begin with. Is it starting to make sense now? This stuff I just said has been hammered on time and time again with VIDEO EVIDENCE of these exact events happening. So like a cop, I can deduct that the perpetrator of this crime is in-sector code being based on the out of sector code. Forget the thousands of lines. Those are all just nuances. It was a copy/paste job with some tweaks. It was lazy coding is what it was.
brekehan
Posts: 952
Joined: Sun, 15. Feb 04, 08:33
x4

Re: Just like in XR, ship may get stuck inside a structure: only me?

Post by brekehan »

Aven Valkyr wrote: Tue, 9. Apr 19, 05:07 Nonsense about his own observations, interpretations, and opinions, being hard evidence
Why are you arguing this?
What do you hope to get out of it?
To understand recursion you must first understand recursion.
Misunderstood Wookie
Posts: 377
Joined: Mon, 15. Mar 04, 08:07
x4

Re: Just like in XR, ship may get stuck inside a structure: only me?

Post by Misunderstood Wookie »

repatomonor wrote: Mon, 8. Apr 19, 15:05 Yes, it happens to all of us. I'm sure what's happening is we all try to put a blind eye on this, because it's got to be the most reported bug ever that eventually never gets fixed - concluding that it cannot be fixed.
This -
But it can be fixed, but it falls between the same issue EgoSoft suffer from for years.
They seem to not prioritize engine fixes very much, there is a lot which needs to be done math-wise to speed up ai logic which would allow for faster pathing what I see is they get the game working at all by taking shortcuts in the equations to reach the best guess but not an accurate output.

It is the dogs at the heels I am afraid of most complex eco simulations need to make CPU time somewhere and the only way to do that is faster operations/ less time running a script.
Obviously they thought the cheapest option here was to have AI flight ignore collision.

Funny tho because you do this yourself by flying at high speed into object you too will get stuck, I believe correction is to be made unto -
concluding that collisions cannot be fixed.
*modified*
*X3 LiteCube User*
MOD GemFX Real Space Shaders
MOD Variety and Rebalance Overhaul Icon Pack
I lost my Hans and should not be flying Solo.
Image
RainerPrem
Posts: 4599
Joined: Wed, 18. Jan 06, 07:39
x4

Re: Just like in XR, ship may get stuck inside a structure: only me?

Post by RainerPrem »

brekehan wrote: Mon, 8. Apr 19, 06:45
That's not what happens, nor is it the reason.
I discussed the issue some time ago, since X:R has the same issue. With a fast moving ship it can be possible to miss the plane between "inner" and "outer" of a structure. Once you're "in" you often can't accelerate fast enough to get "out" again.

Fortunately in X4, you can just teleport to another sector and then command the stuck ship to dock.
graphicboy
Posts: 718
Joined: Wed, 3. Jul 13, 03:21
xr

Re: Just like in XR, ship may get stuck inside a structure: only me?

Post by graphicboy »

brekehan wrote: Tue, 9. Apr 19, 04:36 Irregardless,
Great post, except for that ^ :lol:
User avatar
Red-Spot
Posts: 102
Joined: Wed, 9. Jan 19, 10:22
x3ap

Re: Just like in XR, ship may get stuck inside a structure: only me?

Post by Red-Spot »

brekehan wrote: Mon, 8. Apr 19, 06:45
Aven Valkyr wrote: Mon, 8. Apr 19, 06:37 This has happened to me as well. And the reason this happens is simple. The AI is programmed to fly as if it were out of sector at all times. The AI is blind to obstacles being loaded up by the player being in-sector. So the AI thinks it's still out of sector where it can fly through objects without any problems and just get to the dock point. What Egosoft needs to do is do a layer of programming where the AI takes curved vector pathing in order to go around objects. I don't know how hard it would be to program this, but the AI is blind to objects in space. This is and always has been a problem in the X series
That's not what happens, nor is it the reason.
Effectively quoting the wrong person, feels right though :)

In X2 a much more capable scripter than myself created a script that turned your ship to face a direction, the calculation where impressive to say the least and hogged a decent amount of resources.
I did a rudimentary similar style script with more basic calculations, vastly improved on the calculations needed but it always angled you slightly and did not line your up that perfectly with the direction you would be pushed at.

Now think not 'straight line' but 'parabolic line' imagine the calculations needed for that. Now realize you still need to vector the ship, and not only that you need to calculate how to vector the parabolic line in such way the ship actually gets around the station/object. Now do that 100s of times at the same interval. Not forgetting to implement it in small segments as any curved line is in effect many small straight lines.

I truly hope Ego never implements parabolic flight paths around stations/objects...
'Ignoramus et ignorabimus'

Return to “X4: Foundations”