[MOD REQUEST]Basic survival logic - AI

The place to discuss scripting and game modifications for X4: Foundations.

Moderators: Moderators for English X Forum, Scripting / Modding Moderators

Post Reply
tandrej
Posts: 4
Joined: Fri, 12. Mar 21, 18:57

[MOD REQUEST]Basic survival logic - AI

Post by tandrej » Mon, 16. Jan 23, 20:01

It's common occurence that traders / miners get destroyed and you figure it out only after they are destroyed. They travel through crowd of Xenon which camp at a gate , they travel close to pirates etc. AI has no sense for basic survival . A bunch of these situations can be resolved with minimum effort - slight course change, short docking until danger passes etc.

I'm sure this could be fixed with a relatively simple mod, even though it should be part of the core.

Basic logic is that weaker ships should report and run away or do some basic survival as soon as danger is detected in sector they are in or sector they are about to enter, long before there is any danger of being attacked. If you are traveling in a car and you see an enemy military vehicle, do you go closer to it or you turn around and run away as far as possible, screaming "HELP HELP ENEMY ENEMY" ?

Examples, from the top of my head:

1. Civilian ship is in a sector with S/M/L/XL enemies or enemy stations or they are about to enter one. Report immediately and:

- if it's transiting and enemy is not close (distance X) to the travel path - continue and recheck enemy position after 30 seconds and recalculate if action is needed.
- if it's visiting a station in a sector and enemy is not close to travel path and not close to the station - continue and recheck enemy position after 30 seconds and recalculate if action is needed.
- don't undock if enemy is close to a station
- if enemy is relatively close, but can be avoided by a change of course - change the course so that you decrease distance to destination and increase distance to the closest enemy , continue, recheck enemy position after 30 seconds and recalculate if action is needed.
- if enemy is blocking the path and change of course won't help (camping at gate / attacking station) , dock at the closest station, ask player for help and wait for instructions.
- if it's targetted at any moment (not attacked yet) or enemy is close and thus probability of being attacked and destroyed is high, dock at the closest station, ask player for help and wait for instructions.

Larger the ship - longer the "safe" distance to enemies due to low movement speed (it's easier to catch up with larger ship) = docking at the closest station in the most cases. I don't mind spending a few minutes manually flying an L trader out of sector or letting it sit in a dock for a while. It's much better than losing it, as it's way too expensive to get lost to some silly pirates or Xenon. I want to be reported about each case so I could react and prevent disaster.

If it's too complex and difficult to implement all above examples (+ those I haven't mentioned) , I'm sure reporting and docking aren't difficult, even if it was to be for L only, that could be the start, even brute force and minimalistic solutions are better than losing millions of credits and valuable time (the last auto save was 30 minutes or an hour ago, you've lost a few L traders, you are about to rage quit...).

Post Reply

Return to “X4: Foundations - Scripts and Modding”