
Eliminating the friendly-fire-problems without having to retort to complicated checks in AI+script would be a major step forward, even if it catches 'only' most cases.
Moderators: winston, another_commander
But it does probably mean that you have to rewrite part of your cataclysme end-game. There a captured thargoid ship helps killing the thargoid invasion.Commander McLane wrote:Just saying that I'm very happy to see you guys making this effort.![]()
Eliminating the friendly-fire-problems without having to retort to complicated checks in AI+script would be a major step forward, even if it catches 'only' most cases.
It does help, but it's a reverse-engineered Thargoid ship, not a captured one (that blew up in an earlier stage; perhaps you rescued the engineer who was tinkering with it at the timeEric Walch wrote:But it does probably mean that you have to rewrite part of your cataclysme end-game. There a captured thargoid ship helps killing the thargoid invasion.Commander McLane wrote:Just saying that I'm very happy to see you guys making this effort.![]()
Eliminating the friendly-fire-problems without having to retort to complicated checks in AI+script would be a major step forward, even if it catches 'only' most cases.
Or am I misremembering that the captured ship helps in the battle?
I'm all for consolidating the random check AND friendly fire check in 1 place,Eric Walch wrote:I also think that adding it inanother_commander wrote:Edit: Actually, I think it's probably best to put the friendly check inside -setTargetToPrimargyAggressor. addTarget is used in the code also for things other than combat targets.setTargetToPrimargyAggressor
is the best location. This command already has a random component in it when used from within a combat situation, that makes that it is not always setting a target and current AI code should already be prepared for that. And it still leaves the option to deliberately start a thargoid-thargoid war by using other commands for targeting. (setTargetToFoundTarget
or by using JS for setting a target)
I am not sure if we need the police check, as this is already dealt at other places in the code. But, doing it all in one place is probably clearer for the future.
setTargetToPrimargyAggressor
.-setTargetToPrimaryAggressor
:
Code: Select all
- (BOOL) isFriendlyTo:(ShipEntity *)otherShip
{
BOOL isFriendly = NO;
OOShipGroup *myGroup = [self group];
OOShipGroup *otherGroup = [otherShip group];
if ((otherShip == self) || ([self isPolice] && [otherShip isPolice]) || ([self isThargoid] && [otherShip isThargoid]) ||
(myGroup != nil && otherGroup != nil && (myGroup == otherGroup || [otherGroup leader] == self)) ||
([self scanClass] == CLASS_MILITARY && [otherShip scanClass] == CLASS_MILITARY))
{
isFriendly = YES;
}
return isFriendly;
}
I think that it would be best if we let scripters decide that. For now, battles starting up as a result of one single friendly fire shot seems to be a more imminent bug to fix rather than the possibility of repeated accidental shots not triggering a hostile reaction. As an additional clarification, the fix is not applicable to any player actions, since it is called only withinKiller Wolf wrote:there should only be a given numbr of times you can friendly-fire something before it gets p155ed-off and logs you as an enemy tho, surely?
-setTargetToPrimaryAggressor
, which is a method called by non-player ship AIs.Code: Select all
"EXIT_WORMHOLE" = {
ENTER = (setDestinationToCurrentLocation, "setDesiredRangeTo: 7500.0", "setSpeedTo: 50", performFlyToRangeFromDestination);
There's no hurry. 50 m/s is a reasonably slow speed. 0.5 m/s would be practically not moving at all, and the following ship would crash into the leader. After all, a ship may well be 100 meters long, and the following ship may spawn at the very same place only 2 seconds later. Therefore it's necessary that the leader gets 100 meters away, not only 1 meter. (It'sSwiteck wrote:Really leaving that wormhole in a hurry:Maybe "setSpeedTo: 0.50" was intended instead?Code: Select all
"EXIT_WORMHOLE" = { ENTER = (setDestinationToCurrentLocation, "setDesiredRangeTo: 7500.0", "setSpeedTo: 50", performFlyToRangeFromDestination);
setSpeedTo
:, not setSpeed[color=#FF0000]Factor[/color]To
Seconded. I witnessed the same thing again only yesterday in rev 4524. A mother launched from the main station with four escorts after her, then followed an apparently unrelated trader, and finally the last two escorts. By that time the mother had already jumped out, and the last escorts were orphaned right from the start. But also among the first four escorts only two followed their mother through its wormhole. I can't explain why this happens. The mother was a Monitor, by the way. Perhaps the ship is too fast and reaches jump distance too quickly?Switeck wrote:My other problem with escorts is I'm seeing them hanging around after their mother hyperspaces out instead of trying to enter the wormhole themselves. Is this because the mother ship's AI lacks a wormholeEscorts line in an appropriate place?
I guess so, depending on the star's size. EachSwiteck wrote:For route2sunskimAI.plist, I find it odd that it appears they can be <1 km from a star and can still hyperspace out. Or will they be forced into:
"WITCHSPACE BLOCKED" = (setTargetToFoundTarget, setDestinationWithinTarget, "setDesiredRangeTo: 10000.0", performFlyToRangeFromDestination);
...at least once?
performHyperSpaceExit
first calculates whether there is a blocking mass in the vicinity. If no, the ship receives WITCHSPACE_OKAY, if yes, it receives WITCHSPACE BLOCKED. If the ship doesn't have enough fuel or no motor, it receives WITCHSPACE UNAVAILABLE.Only if the escorts fail to leave the station before the Monitor creates/hits a wormhole should that be the case.Commander McLane wrote:(It'ssetSpeedTo
:, notsetSpeed[color=#FF0000]Factor[/color]To
Seconded. I witnessed the same thing again only yesterday in rev 4524. A mother launched from the main station with four escorts after her, then followed an apparently unrelated trader, and finally the last two escorts. By that time the mother had already jumped out, and the last escorts were orphaned right from the start. But also among the first four escorts only two followed their mother through its wormhole. I can't explain why this happens. The mother was a Monitor, by the way. Perhaps the ship is too fast and reaches jump distance too quickly?Switeck wrote:My other problem with escorts is I'm seeing them hanging around after their mother hyperspaces out instead of trying to enter the wormhole themselves. Is this because the mother ship's AI lacks a wormholeEscorts line in an appropriate place?
Code: Select all
"ENTER_WORMHOLE" = {
"TARGET_LOST" = ("setStateTo: LOOK_FOR_BUSINESS");
It seems to me that in trunk (and I don't know since when; it could be also in 1.75 or 1.74) the interval between launches is longer than it was before. Each ship has already gone a considerable distance before the next ship gets launched. When the mother reaches jump distance (I just witnessed a case where a Boa jumped out at about 12000 meters away from the station), barely four of is escorts have launched. Escorts number five and six would only leave the station after their mother has already left the system.Switeck wrote:Only if the escorts fail to leave the station before the Monitor creates/hits a wormhole should that be the case.
I thoroughly tested these AI additions. And it really is needed there. It can get the message there for two reasons.Switeck wrote:Now for some AI.plist confusion on my part. I'm checking the changes in Oolite's AI files in the latest trunk relative some older ~v1.74.2 AI files.
In escortAI.plist something strikes me as really odd. In the "LOOK_FOR_BUSINESS" section, before I would assume the NPC ship is either an escort or possibly a member of a group there is this line:
"GROUP_ATTACK_TARGET" = (setTargetToFoundTarget, "setStateTo: FLYING_ESCORT", "setAITo: interceptAI.plist");
How would it ever get that message?
This is already explained by others. I usedSwiteck wrote:Really leaving that wormhole in a hurry:Maybe "setSpeedTo: 0.50" was intended instead?Code: Select all
"EXIT_WORMHOLE" = { ENTER = (setDestinationToCurrentLocation, "setDesiredRangeTo: 7500.0", "setSpeedTo: 50", performFlyToRangeFromDestination);
speed
instead of speedFactor
so that all escorts reach their desired range in a known time.I don't know. I am not aware of any problems in this area. The location of the wormholeEscorts is critical and only works at a very specific moment. On the other hand, I can't see any reason to use it at an other moment than when mom herself jumps out. After that all AI actions of mom is frozen.[/quote]Switeck wrote:My other problem with escorts is I'm seeing them hanging around after their mother hyperspaces out instead of trying to enter the wormhole themselves. Is this because the mother ship's AI lacks a wormholeEscorts line in an appropriate place?