Page 1 of 2

How does AI work in Oolite?

Posted: Thu Aug 05, 2010 6:44 pm
by shodex
I've been playing for a while, but I never really figured this out, how does the AI work in Oolite? Do all the ships wander aimlessly until the player interacts, or do they all have a scheduled Alife system?

This was just out of curiosity, thanks in advance for the reply.

Posted: Thu Aug 05, 2010 6:52 pm
by Smivs
Yes, put simply they all have various 'standard roles' which they follow until they're interacted with. For example a Trader will often just slowly make its way from the witchpoint to the station and then dock.
When another vessel (including you) interacts with them, they follow a pre-defined set of actions depending on the nature of the interaction.
Oh, and welcome to the forum, reputedly the friendliest this side of Ridquat.

Posted: Thu Aug 05, 2010 6:59 pm
by shodex
Thanks! So, does the AI continue doing it's thing even when I'm not there? Or is it just in a frozen state until I'm within range to know whats happening.

Posted: Thu Aug 05, 2010 7:02 pm
by Loxley
The whole system runs whether you choose to interact with it or not.
Miners mine, traders fly to the main station and pirates prey on them whether you see it or not.

Awesome isn't it?

Posted: Thu Aug 05, 2010 7:07 pm
by Commander McLane
Hi, shodex, and first of all welcome to the boards, and of course to this great game! :D

One of the beauties of Oolite (and one of the points that make it superior to the original Elite) is that it is not player-centred. This means that the whole Oonivese around you (well, your current system, to be precise) is completely alive around you, even if you don't look.

So yes, together with you there are some 30–50 other ships (it depends on where you are, and also on which OXPs you have installed) in the system, and every last one of them is going after their own business all the time: traders slowly approach the planet and later the station, exiting traders leave the station and vanish into witchspace, pirates are lurking somewhere in-system and attack any passing traders, bounty hunters and police patrol the major space lanes and intervene if a trader is attacked by pirates, escorts help their mothers to defend themselves or to attack, miners slowly blast asteroids to bits and collect the debris, and the occasional thargoid simply attacks everything in its way.

You as the player are moving through this scenery and may interact with every one of them, but even if you choose not to interact at all but simply watch, the NPCs will continue to do their business. That's the reason why you sometimes may help a trader against a bunch of pirates, because the pirates already have attacked him when you were nowhere near the place. Or at other times you will find cargo containers floating in space, telling the tale of a battle that ended long before you approached. And often you see laser beams flashing in the distance. That's where the action is, regardless where you are in the system.

In one word: it is alive!

Posted: Thu Aug 05, 2010 7:18 pm
by shodex
Ooh, thats exactly how I hoped it would be. :D Thanks for all the quick replies.

Posted: Thu Aug 05, 2010 10:15 pm
by DaddyHoggy
There is, I think, one exception, to this non-player-centric rule, Thargoids will target the player first, in preference to any other targets.

Posted: Thu Aug 05, 2010 10:24 pm
by maik
DaddyHoggy wrote:
There is, I think, one exception, to this non-player-centric rule, Thargoids will target the player first, in preference to any other targets.
I'm not so sure. I think that when I stumble upon some Thargoids that are already engaged in a fight with another trader they don't interrupt it to go after me until I start shooting them.

Posted: Thu Aug 05, 2010 11:22 pm
by DaddyHoggy
maik wrote:
DaddyHoggy wrote:
There is, I think, one exception, to this non-player-centric rule, Thargoids will target the player first, in preference to any other targets.
I'm not so sure. I think that when I stumble upon some Thargoids that are already engaged in a fight with another trader they don't interrupt it to go after me until I start shooting them.
I point you at Ahruman's post in this thread... :wink: https://bb.oolite.space/viewtopic.ph ... 308714c2ca

Posted: Fri Aug 06, 2010 7:13 am
by maik
DaddyHoggy wrote:
maik wrote:
DaddyHoggy wrote:
There is, I think, one exception, to this non-player-centric rule, Thargoids will target the player first, in preference to any other targets.
I'm not so sure. I think that when I stumble upon some Thargoids that are already engaged in a fight with another trader they don't interrupt it to go after me until I start shooting them.
I point you at Ahruman's post in this thread... :wink: https://bb.oolite.space/viewtopic.ph ... 308714c2ca
Ok.... Of course I wouldn't doubt the words of our supreme master and commander. ;-) Could it be though that e.g. the galactic navy OXP changes that? If there is a battle going on with hoards of Thargoids and fleets of Navy vessels, wouldn't that imply that all the Thargoids attack me when I enter the furball? This is not what happens.

Posted: Fri Aug 06, 2010 7:23 am
by Eric Walch
maik wrote:
DaddyHoggy wrote:
There is, I think, one exception, to this non-player-centric rule, Thargoids will target the player first, in preference to any other targets.
I'm not so sure. I think that when I stumble upon some Thargoids that are already engaged in a fight with another trader they don't interrupt it to go after me until I start shooting them.
This still means they prefer the player in their initial search. The same is valid for pirates. When they search for victims and the player is in scanner range, they go for the player.

But, after a target is selected, they start combat and won't look at new ships that enter their scanner, unless that ship is attacking them.

Apart from these two examples, the player has no special role over npc ships I think. And when you enable docking clearance, you have to wait in line for docking like all other ships. The main station has a fast docking option that skips the queue, but at other stations it can take a while sometimes until your turn comes up.

Posted: Fri Aug 06, 2010 12:47 pm
by aegidian
Eric Walch wrote:
This still means they prefer the player in their initial search. The same is valid for pirates. When they search for victims and the player is in scanner range, they go for the player.
If I recall correctly pirates are a bit smarter than that since they should also take into account how many ships they have as allies relative to those of their prospective victim. Which does naturally de-favour the single player.

Posted: Fri Aug 06, 2010 1:01 pm
by Smivs
From the Pirate AI

Code: Select all

"ODDS_GOOD" = (groupAttackTarget); 
"ODDS_LEVEL" = (groupAttackTarget); 
"GROUP_ATTACK_TARGET" = (setTargetToFoundTarget, "setStateTo: ATTACK_SHIP"); 
suggesting that the pirates will weigh up the odds before attacking. There is not an "Odds_Poor", so presumably this defaults to a 'Don't attack'. I can't envisage a situation where a band of pirates would have poor odds, though. Perhaps a phalanx of Vipers?

Posted: Fri Aug 06, 2010 2:54 pm
by Commander McLane
Smivs wrote:
From the Pirate AI

Code: Select all

"ODDS_GOOD" = (groupAttackTarget); 
"ODDS_LEVEL" = (groupAttackTarget); 
"GROUP_ATTACK_TARGET" = (setTargetToFoundTarget, "setStateTo: ATTACK_SHIP"); 
suggesting that the pirates will weigh up the odds before attacking. There is not an "Odds_Poor", so presumably this defaults to a 'Don't attack'. I can't envisage a situation where a band of pirates would have poor odds, though. Perhaps a phalanx of Vipers?
The AI-message is actually called "ODDS_BAD", and you are right, if the odds are calculated as bad, the pirate won't attack. Instead he will simply reach the "UPDATE"-message and begin another scan. If you would enter a response to the "ODDS_BAD"-message, the pirate would do exactly as you tell him (for instance "ODDS_BAD" = ("sendCommsMessage: Darn, I give up!", "switchAITo: dumbAI.plist"); ).
DaddyHoggy wrote:
There is, I think, one exception, to this non-player-centric rule, Thargoids will target the player first, in preference to any other targets.
As the other guys pointed out, this is something different entirely. Thargoids (as well as pirates) will favour the player if they search for a new target and he is in their scanner range. But of course they will attack something else if he is not in reach. They won't wait just for him doing nothing while they wait. That's the non-player-centredness.

Posted: Fri Aug 06, 2010 4:08 pm
by Cmdr Wyvern
I think the pirate AI could be a little smarter in judging bad odds, even in the middle of an attack run.

Like say, the pirate gang attacks an aggressive, iron-assed player, the player opens a can of military grade whupass, and the pirates see two or three or their crewmates get blasted to dust in a few seconds.
At that point, it should look to them that the odds positively suck; it's time for the surviving crooks to break off and leave that guy alone.

But as we all know, pirate NPCs aren't that smart. They press the assault and get blown to kingdom come, or decide to run away when they've taken damage.

Thargoids, on the other hand, I'd expect to see fight madly till the last Bug gets swatted, and that pretty much happens.