Ship behaviour while cloaked

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

Moderators: winston, another_commander, Getafix

User avatar
Mauiby de Fug
---- E L I T E ----
---- E L I T E ----
Posts: 847
Joined: Tue Sep 07, 2010 2:23 pm

Ship behaviour while cloaked

Post by Mauiby de Fug »

I've noticed that whilst cloaked, I am still able to use the turrets on my Caddy (if the ship is regarded as hostile), which means that I can just sidle up alongside them and blast them whilst they can do nothing about it.

Also, ships that send messages to you can do so while you're cloaked, even though they can't see you and don't know that you're there. Example ships that do this are Deepspace pirates.

I don't know if these things are bugs, exactly, but they don't seem quite right to me.
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Re: Ship behaviour while cloaked

Post by JensAyton »

The first thing is true of the primary weapon, too. Not so much a bug as an inherited balance problem.

The second thing is, at least in part, an OXP bug. (The built-in AI’s will do it with distress signals, but they also do it when no-one’s around. Of course, the player doesn’t know that, since it’s a tree falling in the woods when no-one’s around. Possibly broadcastDistressMessage should build a list of candidate receivers and only send the message if there are non-cloaked friendlies.)
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:

Re: Ship behaviour while cloaked

Post by Commander McLane »

Mauiby de Fug wrote:
I've noticed that whilst cloaked, I am still able to use the turrets on my Caddy (if the ship is regarded as hostile), which means that I can just sidle up alongside them and blast them whilst they can do nothing about it.
Ahruman wrote:
The first thing is true of the primary weapon, too. Not so much a bug as an inherited balance problem.
Out of interest: does the cloak_passive setting also work for turrets?
Ahruman wrote:
The second thing is, at least in part, an OXP bug.
What about the cloak not being perfect? When working with the target inspector while cloaked, I regularly notice that a pirate does find me and makes me his primary target for the blink of an eye. The target gets deleted immediately, but it lasts long enough for me to notice. I guess during this very brief window of visibility he could also send a commsMessage.

I've always assumed this acquiring-target-and-dropping-it-immediately to be an Oolite feature/bug. So I'm interested, where does the OXP bug come in, and how?
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Re: Ship behaviour while cloaked

Post by JensAyton »

Commander McLane wrote:
Out of interest: does the cloak_passive setting also work for turrets?
Doesn’t look like it.
Commander McLane wrote:
Ahruman wrote:
The second thing is, at least in part, an OXP bug.
What about the cloak not being perfect? When working with the target inspector while cloaked, I regularly notice that a pirate does find me and makes me his primary target for the blink of an eye. The target gets deleted immediately, but it lasts long enough for me to notice. I guess during this very brief window of visibility he could also send a commsMessage.
That’s part of it (and could be addressed), but I was thinking in terms of scripts doing stuff based on player position rather than scanning. However, DPS ships only send messages when they acquire a target, so it’s off the hook.
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6683
Joined: Wed Feb 28, 2007 7:54 am

Re: Ship behaviour while cloaked

Post by another_commander »

Mauiby de Fug wrote:
I've noticed that whilst cloaked, I am still able to use the turrets on my Caddy (if the ship is regarded as hostile), which means that I can just sidle up alongside them and blast them whilst they can do nothing about it.
I'm a bit perplexed by this. Normally, when the cloak is activated, the hostile ship loses the target and stops exhibiting hostile behaviour as a result. This means that the turrets do not have all the conditions for firing satisfied and should not be firing at all with cloak on. I tried it with a Vortex and a Coriolis station (plus Vortex and various ships in combat) and there was no way I could get it to continue firing with the turrets once the cloak became active. Can you please provide some more details how to reproduce this? My test was done using trunk, but it should be the same with 1.74.2 (in theory).
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:

Re: Ship behaviour while cloaked

Post by Commander McLane »

Ahruman wrote:
I was thinking in terms of scripts doing stuff based on player position rather than scanning.
Can that be addressed? Is there a way to properly scan via JS? What I have done is to add a !ship.isCloaked to my search conditions (which doesn't accurately emulate the AI scan, because it won't find anything cloaked, even for a brief moment). Is that what you mean or do you have something else in mind?
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Re: Ship behaviour while cloaked

Post by Eric Walch »

Commander McLane wrote:
I've always assumed this acquiring-target-and-dropping-it-immediately to be an Oolite feature/bug. So I'm interested, where does the OXP bug come in, and how?
I still do not know if this is a feature or a bug, specially because a player is also able to spot cloaked ships. (How would one complete the cloacked-asp mission when that ship was really cloaked?) Almost all scanning functions don't look at the cloak status. Only when wanting to attack, the cloak comes in. I never wanted to change it as I was afraid to break something that needed that behaviour and it always has worked this way from the beginning.
Only "scanForNonThargoid" checks the cloak status since 1.74

But maybe the current status generates more bugs than a change would do. And scripts that need to track cloaked ships can now use JS scanning were the script itself can decide to skip cloaked ships.
User avatar
Disembodied
Jedi Spam Assassin
Jedi Spam Assassin
Posts: 6885
Joined: Thu Jul 12, 2007 10:54 pm
Location: Carter's Snort

Re: Ship behaviour while cloaked

Post by Disembodied »

It might be simpler if all the cloak did was break missile locks, and put a large negative on the accuracy of any hostile ships. As Eric says, players can still see cloaked ships: they're not completely invisible. (I say "simpler", of course, without having the slightest understanding of the underlying programming involved ...)
User avatar
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 16081
Joined: Sat Jul 04, 2009 9:31 pm
Location: The Lizard's Claw
Contact:

Re: Ship behaviour while cloaked

Post by Cody »

Disembodied wrote:
It might be simpler if all the cloak did was break missile locks
That's all I use my cloak for.
I would advise stilts for the quagmires, and camels for the snowy hills
And any survivors, their debts I will certainly pay. There's always a way!
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Re: Ship behaviour while cloaked

Post by Thargoid »

Eric Walch wrote:
(How would one complete the cloacked-asp mission when that ship was really cloaked?)
If cloak passive (dropping when firing for at least a period of say 10s) was implemented for NPCs (and player for balance) then things would work. Ship only shows up when it attacks you for a brief period of time, and during then you have to drain its energy down low enough for the cloak to be disabled by low energy.

Of course even if the ship is not visible it should still be affected by lasers which intersect with its position (wild firing), which may or may not be possible if the entity isn't drawn.

Indeed for me that would make the cloak mission a damn sight more interesting, as it'd be much more of a challenge. Currently I see the main challenge of fighting a cloaked NPC ship is the lack of target lock making it difficult to keep track of where the thing is (keeping it on-screen), but once it is there then it being cloaked or not makes no difference as you can still effectively enough see the thing. Yes you can't missile-kill it, but any self-respecting Commander should be able to laser-kill things without that fallback anyway.

Veering toward Star-Trek style cloaked ship combat (shoot the Klingon), but possibly none the worse for that.
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6683
Joined: Wed Feb 28, 2007 7:54 am

Re: Ship behaviour while cloaked

Post by another_commander »

Thargoid wrote:
If cloak passive (dropping when firing for at least a period of say 10s) was implemented for NPCs (and player for balance) then things would work. Ship only shows up when it attacks you for a brief period of time, and during then you have to drain its energy down low enough for the cloak to be disabled by low energy.
Isn't this what happens if you set the cloak_passive to true in shipdata.plist for the asp-cloaked ship? The passive cloak is already implemented for NPCs, but it has to be defined on a per-ship basis.
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Re: Ship behaviour while cloaked

Post by Thargoid »

another_commander wrote:
Isn't this what happens if you set the cloak_passive to true in shipdata.plist for the asp-cloaked ship? The passive cloak is already implemented for NPCs, but it has to be defined on a per-ship basis.
Possibly - I last tried that mission before that key was implemented. In 1.74.2 the key isn't set in the shipdata for the cloaked asp, and according to the wiki it is false by default in lieu of that.

But if that could be set to true then for me there is no need for the flicker to be there at all (the ship can be truly invisible) without degrading the mission - indeed it would probably improve it.

And I guess even if the cloak passive is false but the target ship is firing, then there would be a combat possibility (albeit a very tough one) for firing back based on the origin of the laser shot. That is presuming that the player laser can still be registered as hitting a ship that isn't drawn for that frame (or at all if the flicker was removed).
User avatar
Mauiby de Fug
---- E L I T E ----
---- E L I T E ----
Posts: 847
Joined: Tue Sep 07, 2010 2:23 pm

Re: Ship behaviour while cloaked

Post by Mauiby de Fug »

another_commander wrote:
Mauiby de Fug wrote:
I've noticed that whilst cloaked, I am still able to use the turrets on my Caddy (if the ship is regarded as hostile), which means that I can just sidle up alongside them and blast them whilst they can do nothing about it.
I'm a bit perplexed by this. Normally, when the cloak is activated, the hostile ship loses the target and stops exhibiting hostile behaviour as a result. This means that the turrets do not have all the conditions for firing satisfied and should not be firing at all with cloak on. I tried it with a Vortex and a Coriolis station (plus Vortex and various ships in combat) and there was no way I could get it to continue firing with the turrets once the cloak became active. Can you please provide some more details how to reproduce this? My test was done using trunk, but it should be the same with 1.74.2 (in theory).
It happens with the Hockey Fan Nemesis Revenge ships in Assassins.oxp every time, and I'm sure I've had it with other ships as well, although I can't remember which ones off hand (possibly DeepSpace Pirates, though I'm not sure and might be wrong about those). With these ships they almost constantly target and untarget you - probably the thing that Commander McLane said about the cloak not being perfect - and you hear the alert sound of someone targeting you a few times a second.

I'll do a few tests to check which ships and provide screenshots.
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Re: Ship behaviour while cloaked

Post by Eric Walch »

The current state is that a scan still can find cloaked ships. Only when you use "setTargetToFoundTarget", you are making it the primary target.

At this moment it will pas a check in the next update that recognise that you have a cloaked target. But in the current update you can use "setTargetToFoundTarget", "performAttack". This makes that the ship has during one update a cloaked ship as target. Not a real problem in the past, but it might be enough for the player ship to fire one turret salvo.
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Re: Ship behaviour while cloaked

Post by JensAyton »

Commander McLane wrote:
Ahruman wrote:
I was thinking in terms of scripts doing stuff based on player position rather than scanning.
Can that be addressed? Is there a way to properly scan via JS?
Most (hopefully all) of the AI scan methods can be implemented in terms of System.filteredEntities(). For instance, scanForRandomMerchantm[ae]n could be implemented along the lines of:

Code: Select all

Ship.prototype.scanForRandomMerchantman = function ()
{
    var candidates = System.filteredEntities(this, function(target)
    {
        return target.isShip && target.isPirateVictim && target.status != "STATUS_DEAD" && target.status != "STATUS_DOCKED";
    }, this);
    
    var count = candidates.length;
    if (count == 0)
    {
        this.sendAIMessage("NOTHING_FOUND");
    }
    else
    {
        var i = floor(Math.random() * count);
        this.foundTarget = candidates[i];
        this.sendAIMessage("TARGET_FOUND");
    }
}
Ship.prototype.scanForRandomMerchantman = Ship.prototype.scanForRandomMerchantmen;
This will find a cloaked player, just like the built-in version currently does. This can be addressed in the obvious way, if it is considered a good idea to do so. As Eric said, it’s not clear that “fixing” this would actually be the right thing.

By “doing stuff based on player position rather than scanning”, I meant that a script might periodically check the player’s position and, if it’s in a certain region, call in a bunch of ships explicitly to attack (or otherwise interact with) the player. As I said before, this doesn’t actually apply in the case of DPS. The only apparent way to address this would be to lie about the player’s position, or quietly kill scripts trying to access it while cloaked, neither of which appeals.
Post Reply