Station AI's are broken.

For test results, bug reports, announcements of new builds etc.

Moderators: winston, another_commander, Getafix

User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Station AI's are broken.

Post by Eric Walch »

I just noticed the alertlevels don't work anymore. I had just changed something on the pirate_cove Ai and was testing if it behaved as expected, but it didn't. The AI stuck in the IDLE state. But not only this one, it also effects the internal stationAI

The CONDITION_GREEN in never send anymore. It used to send an RED_ALLERT and YELLOW_ALLERT on increasing alert levels and a CONDITION_YELLOW and a CONDITION_GREEN in decreasing alert levels. To have two different YELLOWs made it possible to distinguish between a decreasing and a increasing alert. But now the two CONDITION versions are removed. I don't see why as a lot of the existing station AI depend on it. Even both internal stationAi and hermitAI still rely on getting a CONDITION_GREEN after an attack and aren't changed to the new names!

This is not a bug, as the messages are deliberate removed. But why not announce than that existing stationAI have to be adapted to this change. And personally I preferred the difference between de- and increasing alert messages.

For now I settle with adding both CONDITION_GREEN and GREEN_ALERT to the AI so it will work with old an new oolite but it will raise confusion.
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Post by Eric Walch »

Looking at the two oolite stations/hermit Ai's I think they are not affected by this change. As the state were it looked for the CONDITION_GREEN never would receive this message.

However the random hits bar heavily suffers from this. In the attack state is decreases the alert level after every random_hits_patrol launch and leaves this state when CONDITION_GREEN. (After launching two random_hits_patrol) Since 1.72 it keeps on launching them! (LB: it now needs a GREEN_ALERT to prevent the continuous flow of launches.)

Also the pirate cove will never recover and will hang in an IDLE state after launching the first series of pirate ships. (And the same problem in ups were I used a clone of the pirate-cove AI)
User avatar
Ark
---- E L I T E ----
---- E L I T E ----
Posts: 664
Joined: Sun Dec 09, 2007 8:22 am
Location: Athens Greece

Post by Ark »

But I also can see a problem in rock hermits. Although their max defenders are 2 they only launch 1 of them (or even none) and if you manage to destroy that defender they never launch a second one. Maybe this has nothing to do with all the above but i just want to mentioned it
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Post by Eric Walch »

Ark wrote:
But I also can see a problem in rock hermits. Although their max defenders are 2 they only launch 1 of them (or even none) and if you manage to destroy that defender they never launch a second one.
You pm'ed me this, but on my try the hermit even launched 3 purple blibs. All turned around and hit the station before I could target the entity. But I have been busy lately with the pirate_cove station. And I noticed some strange things that also are valid for the plain hermit.

Both have a "NO_TARGET" message of with I think is never send. But that is not a problem.

When attacked it enters DEFENSE_MODE in a yellow alert state. This new state does not contain a decreaseAlertLevel so it will never get any green condition in this state so the bug with changed name will not affect this AI.

I think your testing is probably wrong. When it enters defence mode it does nothing. It needs a further attack to get a red_alert and it launches its first police. For a next launch it needs to be at yelow alert first. Alert is only decreased in an other state. To leave the DEFENSE_MODE it needs a TARGET_DESTROYED (won't happen when you are the target), a TARGET_LOST (Is never send with stations in behaviourIdle) or a ENERGY_FULL. Thus only the last will bring the ship back to its Idle state. And that is the reason this state does not contain a fireECM as reaction on a missile. It needs a little damage to be able from recovery from this state. But when you shoot at it and you give it time to get full energy it will launch a second ship. But of cause this is all easier when you have a mac and can use the target inspector to monitor NPC energy levels in a floating window.

Main problem I see is the missing TARGET_LOST command to recover from an attack state. With pirate_cove I noticed the station is finding a trader, launches its defenders after this trader. The trader flees and keep the defenders busy with its escorts. But the mother keeps seeing the distant trader and keeps issuing groupAttacks for this trader. The defenders switch to this target, but get themselves a TARGET_LOST when the go in attack mode.
Problem with the current script. I think the station has to scan for hostile ships when in defence mode. That way it can setting its target to new more dangerous ships. And keep in defence mode as long as it sees hostile ships. I will keep experimenting with this an when I see better scripting I at least will improve the pirate cove script, but the hermit could also benefit from it. With a better approuch one could let it use fireECM in all its states.
User avatar
Ark
---- E L I T E ----
---- E L I T E ----
Posts: 664
Joined: Sun Dec 09, 2007 8:22 am
Location: Athens Greece

Post by Ark »

Eric Walch wrote:
but on my try the hermit even launched 3 purple blibs.
I think the max_defend_ships for a rock hermit is 2. how is this possible?

In my testing the rock hermit nener leave the red_alert and never launge a second defender. Same for the new constores when i gave them the rock_hermit ai or the plain station ai or the native constore ai. But i will test it again.
Eric Walch wrote:
But when you shoot at it and you give it time to get full energy it will launch a second ship.
So the less agressive you are the more agressive the station will be by launching more fighters :? Do i got it right?
Eric Walch wrote:
All turned around and hit the station before I could target the entity
Well this is a very common spectacle lately
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Post by Eric Walch »

Ark wrote:
Eric Walch wrote:
but on my try the hermit even launched 3 purple blibs.
I think the max_defend_ships for a rock hermit is 2. how is this possible?
Eric Walch wrote:
All turned around and hit the station before I could target the entity
Well this is a very common spectacle lately
I already asked myself as I did see 3 purple launches. I assume one of them that headed back crashed into the dock instead of crashing into the station. This resulting in a proper registered docking that increased the available ships again that made the 3th launch possible.
User avatar
Ark
---- E L I T E ----
---- E L I T E ----
Posts: 664
Joined: Sun Dec 09, 2007 8:22 am
Location: Athens Greece

Post by Ark »

Could this be platform related?
Can anybody with a PC attack a rock hermit please and tell us what will happen. Especially how many defenders will be launched?
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6683
Joined: Wed Feb 28, 2007 7:54 am

Post by another_commander »

Have you tried testing as per Eric's recommendation? I give it an approx. 99.9% probability that it is not platform related.
User avatar
Ark
---- E L I T E ----
---- E L I T E ----
Posts: 664
Joined: Sun Dec 09, 2007 8:22 am
Location: Athens Greece

Post by Ark »

another_commander wrote:
Have you tried testing as per Eric's recommendation? I give it an approx. 99.9% probability that it is not platform related.
Yes!! when i return home but still what is annoying me is that if i got it right the less agressive you are the more agressive the station will be by launching more fighters. Do i got it right? that i must leave the station recover from my first attack before i attack again.
I am an idiot you know :D
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Post by Eric Walch »

Ark wrote:
Do i got it right? that i must leave the station recover from my first attack before i attack again.
Yes, it is written that way to prevent the station to launch all its defence at once. Hermits shouldn't look to aggressive.

EDIT:
I traced the AI. It not just needs energy full but after that is first decreases to yellow alert and some time later to green alert. Only when it has been green it will launch a police when it reaches red again.

But now I noticed also that sometimes only 1 and sometimes even zero police are launched. I assume this is the missing buoy bug. When I remove commies and dictators I do get my two defenders. (police in those two are defined with a condition like the buoy)
User avatar
Ark
---- E L I T E ----
---- E L I T E ----
Posts: 664
Joined: Sun Dec 09, 2007 8:22 am
Location: Athens Greece

Post by Ark »

Eric Walch wrote:
EDIT:
I traced the AI. It not just needs energy full but after that is first decreases to yellow alert and some time later to green alert. Only when it has been green it will launch a police when it reaches red again.

But now I noticed also that sometimes only 1 and sometimes even zero police are launched. I assume this is the missing buoy bug. When I remove commies and dictators I do get my two defenders. (police in those two are defined with a condition like the buoy)
Oh!!!!! My god
I am testing the rock hermit AI in the new Griff constores but the constores are part of the YourAdHere oxp. This oxp has at least 100 entities (buoys) with conditions (greater than 4)
Could that be the culprit?
I have to test the station alone (without the rest of the oxp)
so much for the merging :cry:
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Post by Eric Walch »

Ark wrote:
Eric Walch wrote:
EDIT: Oh!!!!! My god
I am testing the rock hermit AI in the new Griff constores but the constores are part of the YourAdHere oxp. This oxp has at least 100 entities (buoys) with conditions (greater than 4)
No, I only would have a doubt if there was a police with a condition in one of youy oxp's, not with the buoys and conditions.
The launchDefenceShips launches ships with role police when no ships are defined. When you define defenceShips in your shipdata it will select those and there won't be a problem with police at all.

One other thing that delays launches are ships that want to dock. It is a pity that at least a defenseShip has no priority on the launch list.

And when putting AI tracing on for the station you see an other problem. Currently there is a bug in "requestDockingCordinates" that makes that some ships and all escorts don't try to dock on the nearest station to them selves but on the nearest station to the player. When tracing a Hermit you start to see a lot of docking requests for that Hermit station, even when there are no obvious ships nearby. And when you after some time head for the planet you will encounter most of those escorts with that Hermit as target.
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Post by Commander McLane »

I have another issue with what you are describing. I don't think that Rock Hermits should launch police ships (purple blips) at all. The way I understand it Rock Hermits are not a part of the overall GalCop agreement. After all, they have left the main stations and become hermits for a reason. Thus I find it unlikely that they should have Galactic Police on their asteroids.

I would therefore vote for setting their max_police_ships to 0 and give them some variants of their usual mining ships (probably just ordinary Cobra 1 with the pirate/hunter-specs) as defense_ships.
User avatar
Ark
---- E L I T E ----
---- E L I T E ----
Posts: 664
Joined: Sun Dec 09, 2007 8:22 am
Location: Athens Greece

Post by Ark »

Well if a station Ai needs an energy full but after that some time to decrease to yellow alert and even some more time to green alert and only if there is not a docking request launches a second defender... and moreover do not use an ecm when you shot the station with a missile, well that Ai sucks!!!!!!!

Nevertheless I just want to make constores a little more aggressive in potential attackers. Right now they are more like sitting ducks for the simple reason that they share almost the same AI with rock hermits (the only deference from the original rockhermit AI is that they use their EMC always)

Yesterday I took a look to some other station Ais in order to find some ideas. I started with Hoopy casino Ai, well this Ai is out of the question for modifying it and intergrade it to constore AI or to any station Ai (did you know that this thing is actually a big stationary ship and not a station, it even has a condition to perform a jump when its energy is low :shock: ). But I have found some simple and clever ideas in the Secom station and in buoy repair station.

Eric I need a clarification about the energy low state (The wiki just mentioned it but without details). What for oolite considered an energy low state, something below 50% of the max energy? I have seen that some station Ais use that condition for launching a second defender and I want to include it if possible in the modified rockethermit Ai that the constores have.

Also in the socom Ai (Galactic Navy) I have seen that if it is attacked is launches 2 or more defenders by repeating the command “laungedefenceship”. Is this prudent?

@McLane: Is it necessary to set the max_police_ships to 0 if you have dedicated defenders and the entry max_defence_ships in the shipdata

Opps I am off topic here (this is testing and bug reports) sorry
Last edited by Ark on Fri Jan 09, 2009 7:16 am, edited 1 time in total.
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Post by Thargoid »

Ark wrote:
What for oolite considered an energy low state, something below 50% of the max energy?
IIRC that is in the documentation. Energy is <25% of max energy.
Post Reply