Difference between revisions of "AI"
(Started adding OXP's) |
Cholmondely (talk | contribs) (→Understanding what is happening: Added link to Littlebear's posts) |
||
| (27 intermediate revisions by 7 users not shown) | |||
| Line 1: | Line 1: | ||
| − | + | This page was last edited in 2012. Oolite v.1.80 (2014) introduced new AI's which probably replaced what is here. See the '''notice''' on [[OXP howto AI]]. | |
| − | == Oolite standard | + | |
| + | All entities in Oolite have an AI, this is a plist file that defines a [[state machine]] that determines their behaviour. This behaviour can be simple for rocks tumbling (DumbAI.plist) to complex for escorting craft (escort.plist). | ||
| + | |||
| + | == Oolite standard AIs == | ||
* [[buoyAI]] | * [[buoyAI]] | ||
| − | + | ::Sends warning messages when attacked, summons police. | |
* [[collectLootAI]] | * [[collectLootAI]] | ||
| − | + | ::collects loot, jobAI. | |
| − | + | ::(Requires: scanForRandomLoot>TARGET_FOUND:setTargetToFoundTarget,setAITo:collectLootAI.plist) | |
| − | |||
* [[dockingAI]] | * [[dockingAI]] | ||
| − | + | ::scripts the docking manoeuvres. | |
* [[dumbAI]] | * [[dumbAI]] | ||
| − | + | ::just tumbles randomly | |
* [[enteringPirateAI]] | * [[enteringPirateAI]] | ||
| − | + | ::pirate, checks cargo switches to either [[pirateAI]] or [[enteringTraderAI]]. | |
* [[enteringTraderAI]] | * [[enteringTraderAI]] | ||
| − | + | ::trader role behaviour, choosing route. | |
* [[escortAI]] | * [[escortAI]] | ||
| − | + | ::escort behaviour. | |
* [[exitingTraderAI]] | * [[exitingTraderAI]] | ||
| − | + | ::Trader behaviour, navigation towards witchpoint. | |
* [[fallingShuttleAI]] | * [[fallingShuttleAI]] | ||
| − | + | ::Shuttle station -> planet. | |
| + | * [[fttAI]] | ||
| + | ::Introduced v1.65, NPC racing pilot AI. | ||
* [[hardMissileAI]] | * [[hardMissileAI]] | ||
| − | + | ::Identical to missileAI, minus detonation upon ECM. | |
* [[homeAI]] | * [[homeAI]] | ||
| − | + | ::Landing on planet. | |
* [[interceptAI]] | * [[interceptAI]] | ||
| − | + | ::General interception and combat. | |
* [[minerAI]] | * [[minerAI]] | ||
| − | + | ::Looks for rocks, mines them. | |
* [[missileAI]] | * [[missileAI]] | ||
| − | + | ::Intercept and detonation. | |
* [[nullAI]] | * [[nullAI]] | ||
| − | + | ::Only uses performIdle-method, preferred AI for [[Shipdata.plist#subentities|subentities]]. | |
* [[pirateAI]] | * [[pirateAI]] | ||
| − | + | ::Pirate behaviour. | |
* [[planetPatrolAI]] | * [[planetPatrolAI]] | ||
| − | + | ::Police patrol navigation around planet waypoints. | |
* [[policeInterceptAI]] | * [[policeInterceptAI]] | ||
| − | + | ::Interception, attack, comms and legal business. | |
* [[risingShuttleAI]] | * [[risingShuttleAI]] | ||
| − | + | ::Shuttle: planet -> station. | |
* [[rockHermitAI]] | * [[rockHermitAI]] | ||
| − | + | ::Behaviour of rock hermit. | |
* [[route1patrolAI]] | * [[route1patrolAI]] | ||
| − | + | ::Police patroll navigation route 1. | |
* [[route1traderAI]] | * [[route1traderAI]] | ||
| − | + | ::Trader navigation route 1. | |
* [[route2patrolAI]] | * [[route2patrolAI]] | ||
| − | + | ::Police patrol navigation route 2 (sun). | |
* [[route2sunskimAI]] | * [[route2sunskimAI]] | ||
| − | + | ::General navigation route 2. | |
* [[scavengerAI]] | * [[scavengerAI]] | ||
| − | + | ::Scavenger behaviour, looks for loot. | |
* [[shuttleAI]] | * [[shuttleAI]] | ||
| − | + | ::Shuttle behaviour. | |
* [[stationAI]] | * [[stationAI]] | ||
| − | + | ::Station behaviour. | |
* [[sunskimExitAI]] | * [[sunskimExitAI]] | ||
| − | + | ::General navigation sun -> witchpoint. | |
* [[thargletAI]] | * [[thargletAI]] | ||
| − | + | ::Checks for presence of mother Thargoid, requests target from mother, or tumbles. | |
* [[thargoidAI]] | * [[thargoidAI]] | ||
| − | + | ::Kills all humans. | |
* [[timebombAI]] | * [[timebombAI]] | ||
| − | + | ::Pauses 5 second, sets range, then detonates with cascade effect. | |
| + | |||
| + | {{Stub}} - see discussion tab above (from 2006) | ||
| + | |||
| + | == AI as it was == | ||
| + | === AI back in 2008 === | ||
| + | ...Anyway...I wonder if something's wrong, because the pirates typically are so peaceful. It's very rare that a whole group of them shoots at me. It's far more common that a single ship attempts this, while the others (even if they switch to red on the HUD) just fly around without firing. | ||
| + | :Furthermore, there's a bug in the AI, I'd say. If I pursue an enemy ship, that typically does a LOT of direction changes in order to get out of the lasers sights. However, if I am fast enough or hit the injectors just a little bit in order to get closer, then the fleeing ship stops its escape attempts and flies on a straight line, waiting to be shot down. Only if the distance grows again, the pursued ship will re-attempt to get out of my sights. | ||
| + | :Another thing where the AI is very vulnerable: It's very easy to lure a pirate into hitting the injectors. One way is to very briefly hit my own injectors and wait, the other is a very brief burst with the military laser without causing the ship to permanently flee (fer de lance are prone to flee). Examples: | ||
| + | :1) When the screen flashes with multiple yellow lights...I don't check whether they are pirates or not by targeting them, but briefly hit the injectors. True pirates will then use up ALL their fuel to fly around my ship. When they stop, they very soon deliver their cargo to me ;) | ||
| + | :2) As I installed the game shortly ago, I had the constrictor mission today. I wonder why such a whimp counts like about 250 kills...I had common Asps give me a better fight. I hit the constrictor very briefly with the laser, and then the constrictor used up all fuel in the injectors in order to make rapid approaches towards me (without firing), then turn and come back for another approach. It did not fire. So when the fuel was used up, I just pursued it with my Boa Cruiser and shot it down. It didn't even try to evasives. | ||
| + | :So...why better fighting help for the players when the computer enemy has so much trouble? ;) | ||
| + | :Concerning the game: WOW! Very big THANK YOU to all those involved. This game does feel much much better than the original, which did cost me so much time of my youth, back then. | ||
| + | :[https://bb.oolite.space/viewtopic.php?p=63365#p63365 Screet] who likes to ram enemy ships to death with his cruiser | ||
| + | |||
| + | === AI back in 2012 (Cim's synopsis) === | ||
| + | There is some group awareness in AI, but it's pretty basic. One of my plans for the v.1.79/v.1.80 releases is a new Javascript-based AI engine, which should make much more sophisticated AIs practical to write. | ||
| + | |||
| + | At the moment: | ||
| − | = | + | *ships in a group will sometimes come to each other's assistance in a fight, treating hits on each other a bit like hits on themselves for purposes of "should I switch target" questions. For escorts the targeting decisions are mostly directed by the mothership; for general groups it's much more individual choice. |
| + | *the initial decision of a pirate group as to whether to engage is based in part on the relative size of the pirate pack and the trader pack. But it's size only, nothing to do with armaments - and once combat is underway, it's never reassessed. | ||
| + | *at accuracy >= 5, there are some group tactics as a consequence of individual tactics. For example, if two pirates are fighting a lone trader, the pirate who is being targeted by the trader will try to close rapidly to dogfighting range, making it difficult for the trader to consistently target them. Meanwhile, the other one will hang back, firing on them from longer range where their evasive turns are less effective, trying to distract the trader from their colleague. These tactics are technically all individual tactics, so they don't require the attackers to be formally grouped or even aware of each other, and they work okay even if there's just one pirate, but much better with multiple ones. | ||
| + | *pirates can't officially call in other pirates from further away, but in a protracted fight in a dangerous system the steadily spreading debris field seems to have much the same effect. I've certainly had plenty of occasions in anarchy systems where a "simple" fight against three or four pirates has turned into a running battle against about twenty. | ||
| − | + | I'd rather not have group AIs as such - but that's only an implementation detail; an individual AI which takes group strategy into account and sends commands to other nearby individuals would have much the same effect. [https://bb.oolite.space/viewtopic.php?p=196421#p196421 Cim (2013)] | |
| − | |||
| − | |||
| − | |||
| − | |||
| − | // | ||
| − | |||
| − | / | ||
| − | |||
| − | |||
| − | + | [[File:AI (Graphviz).png|thumb|right|600px|[https://bb.oolite.space/viewtopic.php?f=2&t=21443 Graphviz representation] of an AI.plist (route1traderAI.plist)]] | |
| − | + | == Understanding what is happening == | |
| + | There are a number of ways of accessing the AI decision-making process: | ||
| + | *Outputting in [[Latest.log]] - see [https://bb.oolite.space/viewtopic.php?p=291162#p291162 here] for how to enable this (several posts - 2023) | ||
| + | *Graphical Output (not for javascript AIs) - see [https://bb.oolite.space/viewtopic.php?f=2&t=21443 here] for more detail (2023) | ||
| + | * [http://bb.oolite.space/viewtopic.php?f=2&t=2619 Explaining bizarre NPC reactions] - see Littlebear's second and third replies (2006) | ||
== Related Links == | == Related Links == | ||
[[OXP howto]] | [[OXP howto]] | ||
| − | [[OXP howto AI]] | + | [[OXP howto AI]] (.plist AI's) |
[[Methods]] | [[Methods]] | ||
| + | [[AI_methods]] (.plist AI's) | ||
| + | [[Oolite Javascript Reference: PriorityAI Documentation]] | ||
| + | [[Oolite PriorityAI Tutorial]] (Javascript AI's) | ||
| + | [[Role]] | ||
| + | |||
| + | *[https://bb.oolite.space/viewtopic.php?f=6&t=18041 Fixing the agro of the AI] (2016) | ||
| − | [[Category:Oolite]] | + | [[Category:Oolite scripting]] |
Latest revision as of 10:25, 18 June 2025
This page was last edited in 2012. Oolite v.1.80 (2014) introduced new AI's which probably replaced what is here. See the notice on OXP howto AI.
All entities in Oolite have an AI, this is a plist file that defines a state machine that determines their behaviour. This behaviour can be simple for rocks tumbling (DumbAI.plist) to complex for escorting craft (escort.plist).
Contents
Oolite standard AIs
- Sends warning messages when attacked, summons police.
- collects loot, jobAI.
- (Requires: scanForRandomLoot>TARGET_FOUND:setTargetToFoundTarget,setAITo:collectLootAI.plist)
- scripts the docking manoeuvres.
- just tumbles randomly
- pirate, checks cargo switches to either pirateAI or enteringTraderAI.
- trader role behaviour, choosing route.
- escort behaviour.
- Trader behaviour, navigation towards witchpoint.
- Shuttle station -> planet.
- Introduced v1.65, NPC racing pilot AI.
- Identical to missileAI, minus detonation upon ECM.
- Landing on planet.
- General interception and combat.
- Looks for rocks, mines them.
- Intercept and detonation.
- Only uses performIdle-method, preferred AI for subentities.
- Pirate behaviour.
- Police patrol navigation around planet waypoints.
- Interception, attack, comms and legal business.
- Shuttle: planet -> station.
- Behaviour of rock hermit.
- Police patroll navigation route 1.
- Trader navigation route 1.
- Police patrol navigation route 2 (sun).
- General navigation route 2.
- Scavenger behaviour, looks for loot.
- Shuttle behaviour.
- Station behaviour.
- General navigation sun -> witchpoint.
- Checks for presence of mother Thargoid, requests target from mother, or tumbles.
- Kills all humans.
- Pauses 5 second, sets range, then detonates with cascade effect.
- This article is a stub. You can help EliteWiki by expanding it. - see discussion tab above (from 2006)
AI as it was
AI back in 2008
...Anyway...I wonder if something's wrong, because the pirates typically are so peaceful. It's very rare that a whole group of them shoots at me. It's far more common that a single ship attempts this, while the others (even if they switch to red on the HUD) just fly around without firing.
- Furthermore, there's a bug in the AI, I'd say. If I pursue an enemy ship, that typically does a LOT of direction changes in order to get out of the lasers sights. However, if I am fast enough or hit the injectors just a little bit in order to get closer, then the fleeing ship stops its escape attempts and flies on a straight line, waiting to be shot down. Only if the distance grows again, the pursued ship will re-attempt to get out of my sights.
- Another thing where the AI is very vulnerable: It's very easy to lure a pirate into hitting the injectors. One way is to very briefly hit my own injectors and wait, the other is a very brief burst with the military laser without causing the ship to permanently flee (fer de lance are prone to flee). Examples:
- 1) When the screen flashes with multiple yellow lights...I don't check whether they are pirates or not by targeting them, but briefly hit the injectors. True pirates will then use up ALL their fuel to fly around my ship. When they stop, they very soon deliver their cargo to me ;)
- 2) As I installed the game shortly ago, I had the constrictor mission today. I wonder why such a whimp counts like about 250 kills...I had common Asps give me a better fight. I hit the constrictor very briefly with the laser, and then the constrictor used up all fuel in the injectors in order to make rapid approaches towards me (without firing), then turn and come back for another approach. It did not fire. So when the fuel was used up, I just pursued it with my Boa Cruiser and shot it down. It didn't even try to evasives.
- So...why better fighting help for the players when the computer enemy has so much trouble? ;)
- Concerning the game: WOW! Very big THANK YOU to all those involved. This game does feel much much better than the original, which did cost me so much time of my youth, back then.
- Screet who likes to ram enemy ships to death with his cruiser
AI back in 2012 (Cim's synopsis)
There is some group awareness in AI, but it's pretty basic. One of my plans for the v.1.79/v.1.80 releases is a new Javascript-based AI engine, which should make much more sophisticated AIs practical to write.
At the moment:
- ships in a group will sometimes come to each other's assistance in a fight, treating hits on each other a bit like hits on themselves for purposes of "should I switch target" questions. For escorts the targeting decisions are mostly directed by the mothership; for general groups it's much more individual choice.
- the initial decision of a pirate group as to whether to engage is based in part on the relative size of the pirate pack and the trader pack. But it's size only, nothing to do with armaments - and once combat is underway, it's never reassessed.
- at accuracy >= 5, there are some group tactics as a consequence of individual tactics. For example, if two pirates are fighting a lone trader, the pirate who is being targeted by the trader will try to close rapidly to dogfighting range, making it difficult for the trader to consistently target them. Meanwhile, the other one will hang back, firing on them from longer range where their evasive turns are less effective, trying to distract the trader from their colleague. These tactics are technically all individual tactics, so they don't require the attackers to be formally grouped or even aware of each other, and they work okay even if there's just one pirate, but much better with multiple ones.
- pirates can't officially call in other pirates from further away, but in a protracted fight in a dangerous system the steadily spreading debris field seems to have much the same effect. I've certainly had plenty of occasions in anarchy systems where a "simple" fight against three or four pirates has turned into a running battle against about twenty.
I'd rather not have group AIs as such - but that's only an implementation detail; an individual AI which takes group strategy into account and sends commands to other nearby individuals would have much the same effect. Cim (2013)
Understanding what is happening
There are a number of ways of accessing the AI decision-making process:
- Outputting in Latest.log - see here for how to enable this (several posts - 2023)
- Graphical Output (not for javascript AIs) - see here for more detail (2023)
- Explaining bizarre NPC reactions - see Littlebear's second and third replies (2006)
Related Links
OXP howto OXP howto AI (.plist AI's) Methods AI_methods (.plist AI's) Oolite Javascript Reference: PriorityAI Documentation Oolite PriorityAI Tutorial (Javascript AI's) Role
- Fixing the agro of the AI (2016)