Unknown ship stats pop-up bug (fix)

Unknown ship stats pop-up bug (fix); support/discussion/questions

Moderator: thunderchero

User avatar
DCER
Code Master
Code Master
Posts: 683
Joined: Sat Apr 26, 2008 2:00 am

Unknown ship stats pop-up bug (fix)

Post by DCER »

Ok, I'm posting a fix here and later two screenshots showing the difference.

The solution is a bit complicated as I had to add code that checks whether the ship is unknown or not. The downside is that to get space I had to disable and overwrite 3 error checks. These are: Shipbox != Null, Widget != Null and ShipclassMem Is Null

Ok, here's the fix. The assembly instructions are from IDA 5 Pro, they are there for double checking.

before -> after

Code: Select all

1.Remove ShipBox error message

At 0x17FC28 fill with 15x 0x00

2.Disable error message at 0x13D208
	
	75 1C  -> EB 1C

	jnz short loc_53DE26 -> jmp short loc_53DE26
	
3.Change code flow at 0xEC14A

	0F 84 14 01 00 00 -> E9 BB 10 05 00 90

	jz loc_4ECE64  -> jmp loc_53DE0A, nop

4.Overwrite error message at 0x13D20A

	BB 24 7A 58 00 BA 47 00 00 00 B8 34 7A 58 00 E8 92 A3 FC FF 85 
	C0 74 04 85 C9 74 E4

	->

	89 2D 28 1E 58 00 0F 84 4E F0 FA FF E9 35 EF FA FF B8 71 05 00 
	00 E8 BB D4 F4 FF C3

	mov     ebx, offset aWidgetNull
	mov     edx, 47h
	mov     eax, offset aWidget_c
	call    sub_5081B0
	test    eax, eax
	jz      short loc_53DE26
	test    ecx, ecx
	jz      short loc_53DE0A

	->
	
	mov offsetShipboxNull, ebp 	; stores whether this ship is unknown for later use
	jz loc_4ECE64		; if 0 load normal image else load ufo image
	jmp loc_4ECD50
	mov eax, 571
	call sub_48B2E0
	retn
	

5.Disable error message at 0x6EDD0

	75 A1 -> EB 1A

	jnz short loc_46F9EC -> jmp short loc_46F9EC

6.Overwrite error message at 0x6EDD2

	BE 2C AD 57 00 BB EC AD 57 00 BA 2D 01 00 00 89 F0 E8 C8 87 09 00 85 C0 75 EB

	->

	E8 44 E4 0C 00 50 8D 44 24 04 50 E8 B7 43 0A 00 83 C4 08 E9 36 B9 07 00 90 90

	mov     esi, offset a____SourceG_22 
	mov     ebx, offset aShipclassmemIs
	mov     edx, 12Dh
	mov     eax, esi
	call    sub_5081B0
	test    eax, eax
	jnz     short loc_46F9D7

	->

	call sub_53DE1B
	push eax
	lea eax, [esp + 04h]
	push eax
	call sprintf_
	add esp, 8
	jmp loc_4EB320
	2x nop

7.Disable error message at 0xEC043

	75 1C -> EB 1C

	jnz short loc_4ECC61 -> jmp short loc_4ECC61

8.Overwrite error message at 0xEC045

	BB 28 1E 58 00 BA 2B 03 00 00 B8 AC 1D 58 00 E8 57 B5 01 00 85 C0 74 04 85 F6 74 E4
	
	->

	83 3D 28 1E 58 00 00 0F 85 80 2D F8 FF 8B 94 24 A8 02 00 00 E9 14 E6 FF FF 90 90 90

	mov ebx, ds:aShipboxNull
	mov edx, 32Bh
	mov eax, offset a____SourceU_71
	call sub_5081B0
	test eax, eax
	jz short loc_4ECC61

	->

	cmp ds:aShipboxNull, 0
	jnz loc_46F9D2
	mov edx, [esp + 2A8h]
	jmp loc_4EB272
	3x nop

9.Change code flow at 0xEA66B

	8B 94 24 A8 02 00 00 -> E9 D5 19 00 00 90 90

	mov     edx, [esp + 2A8h]

	->

	jmp loc_4ECC45
	2x nop
Last edited by DCER on Thu Oct 23, 2008 3:39 am, edited 1 time in total.
User avatar
DCER
Code Master
Code Master
Posts: 683
Joined: Sat Apr 26, 2008 2:00 am

Post by DCER »

Screenshot before:



Screenshot after:
User avatar
Flocke
BORG Trouble Maker
BORG Trouble Maker
Posts: 3197
Joined: Sun Apr 27, 2008 2:00 am
Location: Hamburg, Germany
Contact:

Post by Flocke »

Cool, great work DCER! :D
Spocks-cuddly-tribble wrote:Unfortunately klingon/ferengi controle is still shown by the deviating experience stars.
Well, the experience images could just be changed to a single version, if there's no other solution.
stardust
Rear-Admiral
Rear-Admiral
Posts: 1381
Joined: Sat Apr 26, 2008 2:00 am
Location: good ole Blighty

Post by stardust »

Flocke wrote: Well, the experience images could just be changed to a single version, if there's no other solution.
Id'd make more sense doing this as you wouldn't know what the crew exp is if you don't even know what race built the ship at the time.
Computers! [Expletive deleted]

My 4shared folder
User avatar
DCER
Code Master
Code Master
Posts: 683
Joined: Sat Apr 26, 2008 2:00 am

Post by DCER »

This will disable the experience bar for ships that you don't own.

Code: Select all

10.Replace owner check with one checking for player empire at 0xEC1CB

	66 83 FA 05 0F 83 08 01 00 00 31 C0

	->

	3A 15 2A 2B 5A 00 0F 85 44 00 00 00

	cmp     dx, 5
	jnb     loc_4ECEDD
	xor     eax, eax

	->

	cmp     dl, ds:byte_5A2B2A
	jnz     loc_4ECE1B
If there's demand I can look into disabling the pop-up info for ships you don't own as well not just the unknown ones.

EDIT: I can also look into the experience bar be disabled only for unknown ships
User avatar
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 1884
Joined: Sun Apr 27, 2008 2:00 am

Post by Spocks-cuddly-tribble »

Bitten with enthusiasm again.:)
DCER wrote:If there's demand I can look into disabling the pop-up info for ships you don't own as well not just the unknown ones.
That's not much important to me and would only hide the damage status, wich is still shown by the bar below the pic.
DCER wrote:EDIT: I can also look into the experience bar be disabled only for unknown ships
I think it's already great as you did it. Since it's unrealistic to read crew experience via long range sensor.


Unknown Outpost/Starbase (or monster) disabling on F1 map would be great. But I don't belief in that's possible.
I don't know how many bugs is too many but that point is reached somewhere before however many in BotF is.
User avatar
DCER
Code Master
Code Master
Posts: 683
Joined: Sat Apr 26, 2008 2:00 am

Post by DCER »

nothing's impossible ;) but probably much harder to do :(
User avatar
EnPhreg
Lieutenant-Commander
Lieutenant-Commander
Posts: 130
Joined: Thu Jul 10, 2008 2:00 am

Re: Unknown ship stats pop-up bug (fix)

Post by EnPhreg »

a little bug from vanilla that's still active:
if you met unknown minor ships, the f1 map task force counter pop-up (if you hover over the small unknown icon in a sector on f1 map) has two lines (instead of normal one line) and shows:
minor ship name
1 unknown unit

if you know the minor race already, it only shows the ship name without the task force counter.
User avatar
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 1884
Joined: Sun Apr 27, 2008 2:00 am

Task Force Icon Pop-up Fix for Minor Races

Post by Spocks-cuddly-tribble »

The Pop-up for the small task force icon on the F1 map for minor races mistakenly uses monster code. :dwn:

Above the bug for unknown and known minor race task forces and below the fix:

Minor_TF_Popup.png
Minor_TF_Popup.png (21.92 KiB) Viewed 790 times

Code: Select all

NAME: Task Force Icon Pop-up Fix for Minor Races
DESC: Fixes wrong monster code for minor race task forces.
AUTHOR: Spocks-cuddly-tribble
URL: https://www.armadafleetcommand.com/onscreen/botf/viewtopic.php?p=59816#p59816

>> 0xE0C01 05
<< 0xE0C01 24

# 004E17FE           cmp   dx, 24h                             ; FIX -> 0xE0C01 -> 0x24

This extra fix finally completes the 'Unknown ship stats pop-up bug (fix)' for minor races, but unknown stations and monster still can be identified.
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: 7851
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.

Re: Task Force Icon Pop-up Fix for Minor Races

Post by thunderchero »

Spocks-cuddly-tribble wrote: Wed Aug 30, 2023 1:54 pm The Pop-up for the small task force icon on the F1 map for minor races mistakenly uses monster code. :dwn:

Above the bug for unknown and known minor race task forces and below the fix:

This extra fix finally completes the 'Unknown ship stats pop-up bug (fix)' for minor races, but unknown stations and monster still can be identified.
ready to add to ECM? and you still have time for stations and monster lol
User avatar
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 1884
Joined: Sun Apr 27, 2008 2:00 am

Re: Task Force Icon Pop-up Fix for Minor Races

Post by Spocks-cuddly-tribble »

thunderchero wrote: Wed Aug 30, 2023 2:34 pmready to add to ECM?
Should be, but there is one more single byte correction (AI scan strength deviation Fix for uncloaked ships), so better wait for a multi-update-patch.

thunderchero wrote: Wed Aug 30, 2023 2:34 pmstations and monster lol
DCER stayed away from unknown stations for good reasons. Many pesky codes...

I could use hints for the names of some gif/tga files:
station_pics.png
station_pics.png (194.46 KiB) Viewed 767 times
- :?: for unknown ships (the small in the map, red big in TF column and red big with margin -> bottom)

For Outposts and Starbases:

- small station icons in the map
- TF column pics for Stations -> left
- big build list pics for stations (bottom -> finished and construction)
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: 7851
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.

Re: Task Force Icon Pop-up Fix for Minor Races

Post by thunderchero »

all are tga's

- :?: for unknown ships, the small in the map, (ufo_12.tga)
- :?: for unknown ships, red big in TF column (ufo_26.tga)
- :?: for unknown ships, red big with margin -> bottom (i_ufo30.tga)

For Outposts and Starbases:

- small station icons in the map (outposts -> i_*o11.tga and i_*o11on.tga) (starbase -> i_*s.tga and i_*son.tga)
- TF column pics for Stations -> left (outpost -> i_*o30.tga) (starbase -> i_*s30.tga)
- big build list pics for stations (bottom -> finished and construction) (outpost -> i_*o120.tga and i_*ow.tga) (starbase -> i_*s120.tga and i_*sw.tga)
replace * with major race cfhkr

if you need any created let me know possible file names
example;
"small station icons in the map" with :?: (i_ufo.tga) should display same if outpost or starbase ("on" not used?)
"big build list pics for stations" with :?: (i_ufo120.tga) show same icon if under construction or completed, outpost or starbase
game does not have these images.

EDIT;
i_ufo120.jpg
i_ufo120.jpg (18.3 KiB) Viewed 734 times
i_ufo.jpg
i_ufo.jpg (11.59 KiB) Viewed 734 times
icon.zip
(4.54 KiB) Downloaded 15 times
User avatar
Flocke
BORG Trouble Maker
BORG Trouble Maker
Posts: 3197
Joined: Sun Apr 27, 2008 2:00 am
Location: Hamburg, Germany
Contact:

Re: Task Force Icon Pop-up Fix for Minor Races

Post by Flocke »

thunderchero wrote: Wed Aug 30, 2023 9:32 pm - :?: for unknown ships, red big with margin -> bottom (i_ufo30.tga)
refer https://gitlab.com/stbotf/ultimate-edit ... .java#L248
thunderchero wrote: Wed Aug 30, 2023 9:32 pm For Outposts and Starbases:
- small station icons in the map (outposts -> i_*o11.tga and i_*o11on.tga) (starbase -> i_*s.tga and i_*son.tga)
refer https://gitlab.com/stbotf/ultimate-edit ... .java#L327
*on images aren't used, are they?
thunderchero wrote: Wed Aug 30, 2023 9:32 pm - TF column pics for Stations -> left (outpost -> i_*o30.tga) (starbase -> i_*s30.tga)
- big build list pics for stations (bottom -> finished and construction) (outpost -> i_*o120.tga and i_*ow.tga) (starbase -> i_*s120.tga and i_*sw.tga)
replace * with major race cfhkr
refer https://gitlab.com/stbotf/ultimate-edit ... .java#L257
thunderchero wrote: Wed Aug 30, 2023 9:32 pm if you need any created let me know possible file names
example;
"small station icons in the map" with :?: (2 images i_ufo.tga and i_ufoon.tga) should display same if outpost or starbase
"big build list pics for stations" with :?: (i_ufo120.tga) show same icon if under construction or completed, outpost or starbase
game does not have these images.
Adding new i_* images will mess with UE ship model detection. i_ufo30.tga and some other images I exclude from ship model detection by reading and excluding above trek.exe string values. I will have to adapt the algorithm to exclude new icons matching the ship icon name shema.

That's rather a reminder, no disagreement. Even the calamarain has a hob model that by now gets detected.
Some mods and packs however include ship graphics missing the HOB file, that now are detected by the images.
I could make it an optional filter or just hardcode new image exclusions.
User avatar
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 1884
Joined: Sun Apr 27, 2008 2:00 am

Re: Task Force Icon Pop-up Fix for Minor Races

Post by Spocks-cuddly-tribble »

Thanks guys, this is helpful. :up:

Flocke wrote: Thu Aug 31, 2023 5:52 am*on images aren't used, are they?
Correct, even not for ships. Looks like another bug (input ebx for sub_4E13D0 is always 0 = unselected). :dwn:
I suspected subliminal animation time. :???:
Now we need to know the name of the selection frame pictures to determine a valid 'selected' switch...

Flocke wrote: Thu Aug 31, 2023 5:52 amAdding new i_* images will mess with UE ship model detection.
Don't worry, IF this project works out it will be as simple as possible (no new pics at all). :wink:

For unkown stations:

- icons in the map -> ufo_12.tga (bottom left corner of sector)
- TF column pics for Stations -> i_ufo30.tga
- bottom area (with the big station pics and stats) will be omitted/blank
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: 7851
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.

Re: Task Force Icon Pop-up Fix for Minor Races

Post by thunderchero »

Spocks-cuddly-tribble wrote: Thu Aug 31, 2023 2:38 pm Now we need to know the name of the selection frame pictures to determine a valid 'selected' switch...
select.jpg
select.jpg (36.54 KiB) Viewed 703 times
Post Reply

Return to “Unknown ship stats pop-up bug (fix)”