Battle size calculation of the Morale Chart

Battle size calculation of the Morale Chart; support/discussion/questions

Moderator: thunderchero

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

Battle size calculation of the Morale Chart

Post by Spocks-cuddly-tribble » Sat Jan 02, 2010 2:33 pm

And finally the last secret of the morale chart. :)


As mentioned before in the Crew Experience topic, there is a need of at least one warship (ship function 0-4) for a participation in morale effects of battles.

The classification of the battle size depends on the ratio of the cumulated involved ship cost vs. total fleet cost of the empire - regardless of opposite side!


A battle is not treated as morale event if the cost of the involved or imperial fleet is zero (ship functions 0-4 only i.e. outposts, starbases, colony ships & TTs, even if armed, do not count).

else the battle is treated as

- Small if a maximum of 5% of the imperial fleet is involved or cost of the involved fleet is below 1000 credits

else

- Large if more than 50% of the imperial fleet is involved

else

- Medium



:arrow: Modding

check(s) for Small:

at 0x4757B -> default 05 (%)
at 0x47581 -> default 1000 (credits)

check for Large:

at 0x47589 -> default 50 (%)


Option: treat zero cost battles (stations, colony ships or TTs) as small:

jump statement at 44815B i.e. at 0x4755C change 0x3D to 0x41
jump statement at 448177 i.e. at 0x47578 change 0x18 to 0x25



To-Do devoutly to be wished:

There should be a way to prevent morale effects if no ship is destroyed or at least damaged.

-> sub_448100 determines size of battle - stored at ds:5B5514[+10h] (block size 0x28) 0=no, 1=small, 2=medium, 3=large
-> sub_470B80 reads it (calls: Lose from 470CBD / Win from 470C98)

ds: 5B5538 another battle reg. (block size 0x3C) - checked at loc_47084D ->loc_470AB0 ->loc_470AE2(ship or base destroyed)
On the verge of a nervous breakdown? Try the relaxing tribble sounds.

User avatar
DOT
Lieutenant-Commander
Lieutenant-Commander
Posts: 100
Joined: Tue Dec 23, 2008 3:00 am
Location: 49°N, 8°E

Post by DOT » Mon Jan 04, 2010 1:24 pm

Just an idea: How about changing code to "number of destroyed ships" instead of "percentage of involved ships" limits?
Spocks-cuddly-tribble wrote:Yes, that is what we want. So could you please tell us how to do that, or is there a reason to play this one close to the chest?
(of course, ruthlessferengi will instruct some kidnappers to sell you to a cardassian labor camp, but you're strong enough to take it. Aren't you?)
life long and prosper

User avatar
ruthlessferengi
Multiple Tournament Champion
Multiple Tournament Champion
Posts: 880
Joined: Sat Apr 26, 2008 2:00 am
Location: GMT- 5

Re: Battle size calculation of the Morale Chart

Post by ruthlessferengi » Sat Jan 09, 2010 11:17 pm

Spocks-cuddly-tribble wrote: The classification of the battle size depends on the ratio of the cumulated involved ship cost vs. total fleet cost of the empire - regardless of opposite side!
i.e. the way it currently stands (forgive my thick skull), is that it pays to haul at least 50 percent of my fleet to battle a single enemy tt - i'd still get a :Large battle bonus?
Spocks-cuddly-tribble wrote:At least 51% , but yes.

That asymmetric behavior is a powerful exploit for team matches. Years ago, I and my old buddy the_Voice_of_Morn won a team match (T2, no minors) just because we exploited the partners colony/TTs for morale boosting. :roll: :x
Spocks-cuddly-tribble wrote:Yes, that is what we want. So could you please tell us how to do that, or is there a reason to play this one close to the chest?
(of course, ruthlessferengi will instruct some kidnappers to sell you to a cardassian labor camp, but you're strong enough to take it. Aren't you?)
it shall depend on the going rate for the camp fodder, but you have my attention...
Relevance is a post hoc phenomenon

На безптичье и жопа воробей...
Ancient Klingon Battlecry

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

Disabling the chasing ships away / morale-boosting exploit

Post by Spocks-cuddly-tribble » Thu Jul 28, 2011 1:26 pm

Spocks-cuddly-tribble wrote:To-Do devoutly to be wished:

There should be a way to prevent morale effects if no ship is destroyed
That chasing ships away / morale-boosting exploit has always been hurting gameplay:
Morale battles are simply repeated small fights with a minors ship or small fleet were the minor is not killed but always retreats giving you a small victory and morale boost each turn.
:!: WARNING - Modification seems to cause multiplayer issues :!:


:arrow: Disabling the chasing ships away / morale-boosting exploit

The below fix sets a requirement of at least one destroyed ship for the "win a battle" morale bonus.

1.) Create destroyed ships count at ds:[5B5514]+24h

Code: Select all

trek.exe at 0x72187
replace: (145 bytes)
07 05 C8 03 00 00 EB E1 8B 88 78 01 00 00 83 F9 05 73 22 83 F9 01 75 E9 66 8B 90 DC 01 00 00 66 39 D7 76 53 89 D1 89 F2 D3 E2 09 54 24 10 05 C8 03 00 00 EB B4 77 1B 66 8B 88 DC 01 00 00 66 39 CF 76 4E 89 F2 D3 E2 09 54 24 10 05 C8 03 00 00 EB 97 83 F9 07 75 AA 66 8B 90 DC 01 00 00 66 39 D7 76 14 89 D1 89 F2 D3 E2 09 54 24 10 05 C8 03 00 00 E9 72 FF FF FF 31 C9 66 89 D1 83 E9 20 89 F2 D3 E2 09 54 24 14 05 C8 03 00 00 E9 58 FF FF FF
with:
6E 05 C8 03 00 00 EB E1 8B 88 78 01 00 00 83 F9 05 73 22 83 F9 01 75 E9 66 8B 90 DC 01 00 00 66 39 D7 76 6D 89 D1 89 F2 D3 E2 09 54 24 10 05 C8 03 00 00 EB B4 77 1B 66 8B 88 DC 01 00 00 66 39 CF 76 4E 89 F2 D3 E2 09 54 24 10 05 C8 03 00 00 EB 97 83 F9 07 75 AA 66 8B 90 DC 01 00 00 66 39 D7 76 2E 89 D1 89 F2 D3 E2 09 54 24 10 EB 36 8B 88 B0 01 00 00 F6 C1 02 74 8E F6 C1 04 75 89 6B 0D 08 55 5B 00 28 03 0D 14 55 5B 00 FF 41 24 EB EC

code changes:

00472D86     74 6E           JE SHORT 472DF6

00472DA9     76 6D          JBE SHORT 472E18

00472DE8     76 2E          JBE SHORT 472E18

00472DF4     EB 36              JMP SHORT 472E2C
00472DF6     8B88 B0010000      MOV ECX, [EAX+1B0]
00472DFC     F6C1 02            TEST CL, 2
00472DFF    ^74 8E              JE SHORT 472D8F
00472E01     F6C1 04            TEST CL, 4
00472E04    ^75 89              JNZ SHORT 472D8F
00472E06     6B0D 08555B00 28   IMUL ECX, DWORD [5B5508], 28
00472E0D     030D 14555B00      ADD ECX, DWORD [5B5514]
00472E13     FF41 24            INC DWORD [ECX+24] // destroyed objects
00472E16    ^EB EC              JMP SHORT 472E04
2.) Check destroyed ships count ds:[5B5514]+24h

Code: Select all

trek.exe at 0x6FF9F
replace: (8 bytes)
8B 4C B9 10 83 F9 03 77
with:
39 59 24 7C E7 8B 4C B9


00470B9F     3959 24       CMP DWORD [ECX+24], EBX // ebx = 0 lose / 1 win
00470BA2    ^7C E7         JL SHORT 470B8B // skip morale effect if win but no destroyed ships
00470BA4     8B4CB9 10     MOV ECX, [ECX+EDI*4+10] // load battle size
3.) Change location of battle read marker to ds:[5B5514]+26h

Code: Select all

trek.exe at 0x6F65A change: 8B 44 02 24 85 C0 -> to: 66 83 7C 10 26 00

and at 0x6F706 change: 01 00 00 -> to: 00 00 01


0047025A     66:837C10 26 00   CMP WORD [EAX+EDX+26], 0

00470302     C74402 24 00000100   MOV DWORD [EDX+EAX+24],10000
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: 6059
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.
Contact:

Re: Battle size calculation of the Morale Chart

Post by thunderchero » Mon Sep 26, 2011 7:59 pm

Hi everyone,

Just to let you know the Disabling the chasing ships away / morale-boosting exploit fix will cause an out of sync error in multi player games.

thunderchero

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

Re: Battle size calculation of the Morale Chart

Post by Tethys » Tue Sep 27, 2011 8:30 am

Thank you TC, looking forward to some longer games now :)
Not for the weak of heart...
Image
GALM <--- GALM/Galaxies Mod

User avatar
ruthlessferengi
Multiple Tournament Champion
Multiple Tournament Champion
Posts: 880
Joined: Sat Apr 26, 2008 2:00 am
Location: GMT- 5

Re: Battle size calculation of the Morale Chart

Post by ruthlessferengi » Tue Sep 27, 2011 8:33 pm

i agree - i don't think that trick hurts game play - it is not a deal breaker in mp anyway - it may help at times on impossible levels ... great find - revived mp mod for sure:)
Relevance is a post hoc phenomenon

На безптичье и жопа воробей...
Ancient Klingon Battlecry

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

Re: Battle size calculation of the Morale Chart

Post by Spocks-cuddly-tribble » Tue Nov 15, 2011 3:13 pm

thunderchero wrote:Hi everyone,

Just to let you know the Disabling the chasing ships away / morale-boosting exploit fix will cause an out of sync error in multi player games.

thunderchero
10 years later... 8O 8O

Sorry to read that. I'll edit the post and add a warning.

Do you still remember if that problem is player vs. player only? Or also player vs. AI?

Also, for understanding the problem, could someone with 2 stable BotF PCs at home please test if sync error also occurs when omitting code change #2:

"2.) Check destroyed ships count ds:[5B5514]+24h"
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: 6059
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.
Contact:

Re: Battle size calculation of the Morale Chart

Post by thunderchero » Tue Nov 29, 2011 12:14 pm

Spocks-cuddly-tribble wrote:
thunderchero wrote:Hi everyone,

Just to let you know the Disabling the chasing ships away / morale-boosting exploit fix will cause an out of sync error in multi player games.

thunderchero
10 years later... 8O 8O

Sorry to read that. I'll edit the post and add a warning.

Do you still remember if that problem is player vs. player only? Or also player vs. AI?

Also, for understanding the problem, could someone with 2 stable BotF PCs at home please test if sync error also occurs when omitting code change #2:

"2.) Check destroyed ships count ds:[5B5514]+24h"

I do not remember exactly when every time it happened but it was mainly between player vs AI.

I did do as you asked and tested in MP my sync error when testing was between player vs AI (both host and joining player had same results)

but when I omitted Check destroyed ships count ds:[5B5514]+24h sync error did not happen.

If you need me to test any more let me know.

BTW this was first battle that I tested and only battle and reused same save to test omitted code and I lost battle (ship destroyed) and used same command in every test.

thunderchero

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

Re: Battle size calculation of the Morale Chart

Post by Spocks-cuddly-tribble » Thu Dec 01, 2011 3:43 pm

thunderchero wrote:when I omitted Check destroyed ships count ds:[5B5514]+24h sync error did not happen.
Thanks for reporting this. So the problem is the asymmetric code setup. This was done to prevent abuse of 'no morale penalties for retreat' via cloaked fleets. Since the default is also asymmetric (colony/TT battle size 0 vs. warships) I didn't expect any issues. Maybe this can be fixed next year.
On the verge of a nervous breakdown? Try the relaxing tribble sounds.

Post Reply

Return to “Battle size calculation of the Morale Chart”

Who is online

Users browsing this forum: No registered users