Stealth and Cloak

Stealth and Cloak; support/discussion/questions

Moderator: thunderchero

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 »

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 »

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 »

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: 1884
Joined: Sun Apr 27, 2008 2:00 am

Post by Spocks-cuddly-tribble »

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.
I don't know how many bugs is too many but that point is reached somewhere before however many in BotF is.
User avatar
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 1884
Joined: Sun Apr 27, 2008 2:00 am

Cloak checks & default fix for task forces

Post by Spocks-cuddly-tribble »

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.
I don't know how many bugs is too many but that point is reached somewhere before however many in BotF is.
User avatar
Tethys
Past Administrator
Past Administrator
Posts: 2392
Joined: Fri Jul 18, 2008 2:00 am
Location: Your mom's bed ;)
Contact:

Post by Tethys »

This is very good! Works flawlessly thank you :)
Not for the weak of heart...
Galaxies MOD v0.4.0 <--- GALM/Galaxies Mod latest version
User avatar
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 1884
Joined: Sun Apr 27, 2008 2:00 am

Cloak vs. Attacking a System -Bugfixes

Post by Spocks-cuddly-tribble »

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). :)
I don't know how many bugs is too many but that point is reached somewhere before however many in BotF is.
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 »

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 »

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 »

@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: 1884
Joined: Sun Apr 27, 2008 2:00 am

Disable Cloak within Nebula (Fix?)

Post by Spocks-cuddly-tribble »

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)
I don't know how many bugs is too many but that point is reached somewhere before however many in BotF is.
User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 7849
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.

Re: Stealth and Cloak

Post by thunderchero »

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: 1884
Joined: Sun Apr 27, 2008 2:00 am

Re: Stealth and Cloak

Post by Spocks-cuddly-tribble »

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
I don't know how many bugs is too many but that point is reached somewhere before however many in BotF is.
User avatar
EnPhreg
Lieutenant-Commander
Lieutenant-Commander
Posts: 130
Joined: Thu Jul 10, 2008 2:00 am

Re: Stealth and Cloak

Post by EnPhreg »

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?!
User avatar
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 1884
Joined: Sun Apr 27, 2008 2:00 am

Emergency evade during surprise attack

Post by Spocks-cuddly-tribble »

Here is how to change the enforced 'hold' into 'evade' when surprise-attacked by a fully cloaked fleet:

Code: Select all

4721E1                 mov     dword ptr [ebx+1FCh], 0Dh ; set ship hold  // 0x715E7 -> 07 'evade'

4721F0                 mov     dword ptr [ecx+54h], 0Dh  ; set group Hold // 0x715F3 -> 07 'evade' 

472213                 or      byte ptr [ebx+20Ch], 10h ; lock weapons // 0x71613 (80 8B 0C 02 00 00 10) -> 90 90 90 90 90 90 90
Note that removing the lock-weapons statement on rare occasions might enable random torpedo fire at decloaking ships :!:


Test patch:

Code: Select all

NAME: Emergency evade during surprise attack
DESC: Changes the enforced 'hold' into 'evade' when surprise-attacked by a fully cloaked fleet.
AUTHOR: Spocks-cuddly-tribble
URL: https://www.armadafleetcommand.com/onscreen/botf/viewtopic.php?f=201&t=66&p=52556#p52556


>> 0x000715E7 0D
<< 0x000715E7 07

>> 0x000715F3 0D
<< 0x000715F3 07

# remove lock weapons (on rare occasions random torpedo fire at decloaking ships possible):

>> 0x00071613 80 8B 0C 02 00 00 10
<< 0x00071613 90 90 90 90 90 90 90
Take note: This is mainly an AI helping patch recommended for single player mode.

Cloaked ships in partly cloaked fleets also use 'evade' instead of 'hold' i.e. they lose cloak advantage next turn!

This means no one-uncloaked-ship tactic/exploit anymore (which again can be countered by using the 'hold' command when made available for players).

On the other hand decloaking ships using 'evade' don't have their shields down when targeted by torpedoes, which is possible when uncloaked ships in same combat group. Since a human player hardly would put cloaked and un-cloaked ships in the same combat group(not fleet) vs a cloaked enemy, this again mostly helps AI.



Option with cloaked ships using 'Cloak' instead of 'Evade' (same movements as Evade but they should stay cloaked same as with 'Hold'):

Code: Select all

NAME: Emergency evade during surprise attack (cloaked ships staying cloaked)
DESC: Changes the enforced 'hold' into 'evade' resp 'cloak' for cloaked ships when surprise-attacked by a fully cloaked fleet.
AUTHOR: Spocks-cuddly-tribble
URL: https://www.armadafleetcommand.com/onscreen/botf/viewtopic.php?f=201&t=66&p=52556#p52556


# 004721E1   BA 07000000      MOV EDX, 7          //  Evade
# 004721E6   0353 38          ADD EDX, [EBX+38]   //  +1 if cloaked = 8 Cloak
# 004721E9   8993 FC010000    MOV [EBX+1FC], EDX  // set ship order
# 004721EF   3B41 50          CMP EAX, [ECX+50]   // if group leader
# 004721F2   75 03            JNZ SHORT 004721F7
# 004721F4   8951 54          MOV [ECX+54], EDX   // set group order

>> 0x000715E1 C7 83 FC 01 00 00 0D 00 00 00 3B 41 50 75 07 C7 41 54 0D 00 00 00
<< 0x000715E1 BA 07 00 00 00 03 53 38 89 93 FC 01 00 00 3B 41 50 75 03 89 51 54


# remove lock weapons (on rare occasions random torpedo fire at decloaking ships possible):

>> 0x00071613 80 8B 0C 02 00 00 10
<< 0x00071613 90 90 90 90 90 90 90
Last edited by Spocks-cuddly-tribble on Sat Jun 13, 2020 3:43 am, edited 1 time in total.
I don't know how many bugs is too many but that point is reached somewhere before however many in BotF is.
Post Reply

Return to “Stealth and Cloak”