Stealth and Cloak

Stealth and Cloak; support/discussion/questions

Moderator: thunderchero

Post Reply
User avatar
Gowron
Code Master
Code Master
Posts: 304
Joined: Sat Apr 26, 2008 2:00 am
Location: 50° N, 11° E

Stealth and Cloak

Post by Gowron » Thu May 01, 2008 5:11 pm

I've tested the effects of these abilities. The results are a bit disappointing, since especially Stealth doesn't seem to have as much of an effect as some people thought.


Orbital Bombardment

Stealth and Cloak don't help against orbitals. They do exactly nothing, regardless of Stealth/Cloak level.


Scan Strength

A scan strength of +1 is enough to see Stealth ships on the F1 screen (i.e. Stealth does nothing in this case, regardless of Stealth level).
A scan strength of +30 or more is needed to see cloaked ships on the F1 screen, regardless of cloak level.

User avatar
siggi
Lieutenant-Junior Grade
Lieutenant-Junior Grade
Posts: 64
Joined: Sat Apr 26, 2008 2:00 am
Location: Germany

Post by siggi » Fri May 02, 2008 8:16 pm

That's truly a bit disappointing. Maybe just one more feature that wasn't really finalized before the game was rushed out.

But thanks for the testing effort, Gowron :-).

Cheers,
Siggi
...of course, this was also true at the Birth of the Federation...
_______________________________
Download UDM III and patches here:

http://www.4shared.com/dir/2718319/cd23df1/sharing.html

User avatar
Gowron
Code Master
Code Master
Posts: 304
Joined: Sat Apr 26, 2008 2:00 am
Location: 50° N, 11° E

Re: Stealth and Cloak

Post by Gowron » Mon Jul 28, 2008 1:52 pm

Spocks-cuddly-tribble wrote:
Gowron wrote:A scan strength of +30 or more is needed to see cloaked ships on the F1 screen
Is the value location known ?
Not yet, AFAIK.
And I'm not sure if it would be worth the effort to search it.
A discovery consists in seeing something everybody has seen and at the same time thinking something nobody has thought yet.

User avatar
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 723
Joined: Sun Apr 27, 2008 2:00 am

Post by Spocks-cuddly-tribble » Sat Feb 14, 2009 4:08 pm

F1-interface cloak checks - now uncloaked in trek.exe :wink:


0xD9729 (1E) -> icon on F1 map
asm - 4DA326 cmp dword ptr [edx+40h], 1Eh

0xE0A73 (1E) -> F1 map icons pop-up (task force counter)
asm - 4E166F cmp dword ptr [ebp+edx*4+40h], 1Eh

0xE953C (1E) -> F1 task forces column (below empire info)
asm - 4EA13A cmp ebx, 1Eh

4DC805 cmp ebx, 1Eh -> player GUI scan strength green


Different values are possible, i.e. increasing of the third value will veil number/type of ships in cloaked task forces. :)
An additional increasing of the second value will also veil number of cloaked task forces. Be careful in this case an uncloaked task force will "mask" any cloaked presence of the same owner.

I tested F1 interface only, but there appear to be another cloak checks, maybe regarding engage/intercept or AI related.




:arrow: cloak approach (tactical combat - initial distance)

520286 fld ds: 584E0C // 0x182C0C (8 bytes)
default: 300.0

NOTE: multiplied by 1.5 (shared value)



Edit: My tests didn't show any influence of different Stealth/Cloak levels in tactical combat.
Last edited by Spocks-cuddly-tribble on Sat Apr 16, 2016 9:52 am, edited 1 time in total.
On the verge of a nervous breakdown? Try the relaxing tribble sounds.

User avatar
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 723
Joined: Sun Apr 27, 2008 2:00 am

Cloak checks & default fix for task forces

Post by Spocks-cuddly-tribble » Thu Apr 28, 2011 6:21 pm

Spocks-cuddly-tribble wrote:
Gowron wrote:A scan strength of +30 or more is needed to see cloaked ships on the F1 screen
F1-interface cloak checks (...)

I tested F1 interface only, but there appear to be another cloak checks, maybe regarding engage/intercept or AI related.
Some more scan strength checks for cloaked taskforces:

Code: Select all

42032A    837C85 40 1E   CMP [EBP+EAX*4+40], 1E // AI map scan (for accept demand?)

476510    833C04 1E      CMP [ESP+EAX], 1E  // get cloaked ships for combat
The game behavior appears to be inconsistent (affected by territory claim?), so e.g. edo god forces all cloaked ships into combat whilst combat drone not. Also stations seem to have an advantage in this area.




Sub_4485D8 - SetTaskForceAbilities (e.g. speed/range, intercept yes/no)


Cloak check: (loops for all ships in task force)

Code: Select all

44866D                 call    read_shiplist_sst
448672                 test    byte ptr [esp+0B0h], 4  // test shiplist.sst cloak entry
44867A                 jnz     short loc_44868C  // if 3rd bit set goto cloak OK
44867C                 mov     dl, [ecx+40h]   // load ability bitmask
44867F                 mov     dword ptr [ecx+68h], 0  // decloak task force
448686                 and     dl, 7Fh  // clear cloak command bit
448689                 mov     [ecx+40h], dl  // remove cloak ability
As you can see it's a test 4, not a compare validator, i.e. check 3rd bit (cf. binary table). Consequently e.g. a cloak 8 cannot even cloak :!:



Sub_449890 - PrepareTaskForceEntry (inter alia for new ships/monster, stolen ships, ships from acceded minors, separated ships after redeploy or after retreat)

Code: Select all

449912                 mov     dword ptr [ecx+68h], 0  // cloak default (off)
At first blush this appears to be right, since not all ships can cloak, but due to the global code structure (see above), quite the contrary applies:



:arrow: Cloak default fix for task forces: (see update below)

In trek.exe at 0x48D15 change 00 to -> 01 (cloak on)


This fixes a couple of issues in BotF:
  • AI cloak behavior bug (for majors & minors - e.g. Yridian scout default)
  • the handling of cloaked fleets becomes a lot easier (new ships auto cloak after leaving shipyard, also separated ships after redeploy/retreat, stolen ships, ships from acceded minors)
  • enables cloak for monster (Warning - see: Monster Editing Info)
Last edited by Spocks-cuddly-tribble on Sun Jul 10, 2011 1:26 pm, edited 1 time in total.
On the verge of a nervous breakdown? Try the relaxing tribble sounds.

User avatar
Tethys
Past Administrator
Past Administrator
Posts: 2065
Joined: Fri Jul 18, 2008 2:00 am
Location: Your mom's bed ;)
Contact:

Post by Tethys » Thu Apr 28, 2011 7:30 pm

This is very good! Works flawlessly thank you :)
Not for the weak of heart...
Image
GALM <--- GALM/Galaxies Mod

User avatar
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 723
Joined: Sun Apr 27, 2008 2:00 am

Cloak vs. Attacking a System -Bugfixes

Post by Spocks-cuddly-tribble » Fri Aug 05, 2011 11:23 am

Due to some issues wrt cloaking capable ships and the "attack system" menu option, I had a closer look at that code.

Unmodded, cloaked ships don't have the option to attack systems. If you de-cloak and wait a turn, the "attack system" option gets unlocked. Attacking at the same turn does still work via redeploy, though. And even worser, after ordering "attack system" you can re-cloak again. :x

But the one turn delay was never intended. It's just a bugged part of the flawed code which should prevent re-cloaking during system attack. :?



:arrow: Cloak default fix for task forces - UPDATE:

This unlocks the "attack system" option for cloaked & former cloaked ships: (possible via redeploy anyway)

Code: Select all

trek.exe at 0x47B24
replace: (22 bytes)
83 79 68 00 75 04 80 49 41 08 83 7B 70 00 76 0A 83 79 68 00 75 04
with:
90 90 90 90 90 90 80 49 41 08 83 7B 70 00 76 0A 90 90 90 90 90 90

code changes:

00448724     909090909090       NOP

00448734     909090909090       NOP

:arrow: Re-cloak during system attack bug-fix:

The fix auto de-cloaks task forces when ordering "attack system" and prevents any re-cloaking until another order is given.

Code: Select all

trek.exe at 0x47E60
change:
0F 87 36 01 00
to:
75 04 C6 40 68

00448A60     75 04         JNZ SHORT 448A66
00448A62     C640 68 00    MOV BYTE [EAX+68], 0
Note; this is a player GUI only fix. The AI code also has a bug (auto de-cloaks after the first turn of a system-attack). Since fixing this would be too time consuming, we just leave this small advantage for the AI (it's somewhat crippled anyway).


Thanks to DCER & thunderchero, who pointed me to the issue, another infamous bug of BotF resolved (iirc even Mickar requested this fix). :)
On the verge of a nervous breakdown? Try the relaxing tribble sounds.

User avatar
Peter1981
Rear-Admiral
Rear-Admiral
Posts: 1118
Joined: Tue May 06, 2008 2:00 am
Location: England

Re: Stealth and Cloak

Post by Peter1981 » Tue Aug 16, 2011 3:50 am

great work SCT

"AI (it's somewhat crippled anyway)."

LOL love it! :)

User avatar
hupa
Cadet 1st Year
Cadet 1st Year
Posts: 2
Joined: Wed Sep 10, 2008 2:00 am

Re: Stealth and Cloak

Post by hupa » Mon Sep 05, 2011 2:26 pm

hi all

not sure if this will help but, i remember using a botf editor many years ago and it gave cloak options 1-5, i think option 4-5 cloaked the ships and 1-3 did not so i wondered and tested what it done.
I noticed that option 1-3 had an effect on the tactical battles, that a ship would start at a further or closer distance at the begining of a battle dependent on the 1-3 value.

i could be wrong as this was a long time ago, but pretty sure it did do this as i edited all strike vessels with the value that set them further back than the rest of the ships to give there long range torps
an advantage.

i cant remember which value was short/long 1/3, but im sure it would be easy enough for u guys to test and hopefully make more sense of the code.
anyhow if im wrong i appologise.

and to all u guys great work, what uve done to this game gives me the same felling as lookin at 7 of 9

i love it . thanx
Spocks-cuddly-tribble wrote:
hupa wrote:i remember using a botf editor many years ago and it gave cloak options 1-5, i think option 4-5 cloaked the ships and 1-3 did not so i wondered and tested what it done.
I noticed that option 1-3 had an effect on the tactical battles, that a ship would start at a further or closer distance at the begining of a battle dependent on the 1-3 value.
As already mentioned, that's clearly contradicted by code analysis (and already previously via empirical tests). But I see where you come from. This was also my first impression, ruled out by running proper experiments (try google -> coincidence vs.causality).

Btw, this editor was a bit buggy i.e. changed other unwanted things.

User avatar
Peter1981
Rear-Admiral
Rear-Admiral
Posts: 1118
Joined: Tue May 06, 2008 2:00 am
Location: England

Re: Stealth and Cloak

Post by Peter1981 » Wed Nov 16, 2011 4:24 am

@SCT when you investigated this section of the trek.exe do you remember if there was any evidence that the programmers were going to use diffrent stealths/cloaks levels? or was there a diffrent purpose evident. any info in this regard may be of use to me ;)
Spocks-cuddly-tribble wrote:Stealth/cloak-level is just a myth, based on shiplist.sst defaults, without code support of any kind(aside of our new tactical combat cloak command check).

We know about all scan resp. cloak codes and I already looked into implementing cloak for stations(way too much work) and adding a stealth/cloak-level feature(still much work, but might be possible).

Remember these would be task force abilities, so, as a first step, the task force code would have to be changed.

Here is some info on map scan for a stealth project - cf. cloak 30 values above:

Code: Select all

-ships
4DA31A                 cmp     dword ptr [edx+40h], 0   // icon on F1 map
4EA12C                 test    ebx, ebx   // F1 task forces column
-stations
4DA19D                 cmp     dword ptr [ebx+eax*4+40h], 0  // F1 icon
4EA06A                 cmp     dword ptr [ebp+eax*4+40h], 0  //stats column - shared for ships!
-AI map scan (for accept demand code only?):
420301                 cmp     dword ptr [ebp+eax*4+40h], 5 // deviation should be 0 ?
thank-you very much :D

User avatar
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 723
Joined: Sun Apr 27, 2008 2:00 am

Disable Cloak within Nebula (Fix?)

Post by Spocks-cuddly-tribble » Sat May 28, 2016 11:17 am

A belated solution to a reasonable request by Tethis: viewtopic.php?t=2775

Code: Select all

trek.exe at 0x73CC7 change 0x21 bytes to

D8 E8 D3 42 0B 00 85 C0 74 13 33 D2 89 50 04 89 53 38 80 A3 0C 02 00 00 FE 80 60 68 FD 8B C3 EB 11

-asm--
004748C6   8BD8               MOV EBX, EAX
004748C8   E8 D3420B00        CALL 528BA0  // get ship, station or monster stack position
004748CD   85C0               TEST EAX, EAX
004748CF   74 13              JE SHORT 4748E4  // no ship, station or monster; check next
004748D1   33D2               XOR EDX, EDX
004748D3   8950 04            MOV [EAX+4], EDX  // set shields 0
004748D6   8953 38            MOV [EBX+38], EDX  // de-cloak
004748D9   80A3 0C020000 FE   AND BYTE [EBX+20C], 0FE  // target un-lock
004748E0   8060 68 FD         AND BYTE [EAX+68], 0FD  // shields un-lock
004748E4   8BC3               MOV EAX,EBX
004748E6   EB 11              JMP SHORT 4748F9 // check next object
Notes:

1.) This won't prevent usage of Cloak command in tactical combat (which isn't recommended due to interface bugs anyway): viewtopic.php?f=209&t=1998#p28787

2.) Nebula original code disables monster shields only for tarellian (ID 29h), new code disables shields and cloak for all ships, stations and monster.

3.) the code doesn't affect map cloak of task forces in sector, only tactical combat

4.) for nebula scan perturbing effect see: viewtopic.php?f=157&t=58&p=33478#p33467

5.) Sub_474880 also lowers the tactical combat agility of ships (only) in Black Hole sectors: agility multiplier (8 byte float) at asm-57B0F0 (default 1/3)
On the verge of a nervous breakdown? Try the relaxing tribble sounds.

User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 6069
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.
Contact:

Re: Stealth and Cloak

Post by thunderchero » Mon May 30, 2016 9:10 am

Spocks-cuddly-tribble wrote:5.) Sub_474880 also lowers the tactical combat agility of ships (only) in Black Hole sectors: agility multiplier (8 byte float) at asm-57B0F0 (default 1/3)
I was not aware of agility loss in black holes :grin:

User avatar
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 723
Joined: Sun Apr 27, 2008 2:00 am

Re: Stealth and Cloak

Post by Spocks-cuddly-tribble » Mon May 30, 2016 10:47 am

thunderchero wrote:I was not aware of agility loss in black holes :grin:
Well, it's about black hole sectors, 'in' the black hole you might lose even more agility... :wink:

Btw, here is the table of likelihood for ship destruction by black hole when map speed lower than 2: viewtopic.php?f=75&t=919
On the verge of a nervous breakdown? Try the relaxing tribble sounds.

User avatar
EnPhreg
Lieutenant-Commander
Lieutenant-Commander
Posts: 130
Joined: Thu Jul 10, 2008 2:00 am

Re: Stealth and Cloak

Post by EnPhreg » Sun Jan 01, 2017 1:22 pm

SCT wrote:
Note; this is a player GUI only fix. The AI code also has a bug (auto de-cloaks after the first turn of a system-attack). Since fixing this would be too time consuming, we just leave this small advantage for the AI (it's somewhat crippled anyway)
means re-cloak? otherwise it would be no advantage for tha AI?!

Post Reply

Return to “Stealth and Cloak”

Who is online

Users browsing this forum: No registered users