Commands in Tactical Combat

Commands in tactical combat; support/discussion/questions

Moderator: thunderchero

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

Re: Commands in Tactical Combat

Post by thunderchero » Wed Apr 11, 2018 10:27 pm

I found this interesting for those how hate AI ships retreating. :wink:
Spocks-cuddly-tribble wrote:
Wed Apr 11, 2018 3:35 pm
The AI battle calculation (run or fight) seems to hide in sub_479020, with the below codes initiating the fleet retreat:

Code: Select all

AUTO:00477B00                 mov     edx, 0Ah
AUTO:00477DED                 mov     edx, 0Ah
If you change retreat to a different command such as evade at;

Code: Select all

0x771ed    BA 0A -> BA 07
and
0x76f00    BA 0A -> BA 07 
A single Ai ship will fight to death.... but if AI ships can use group command (more than 1 ship present of same Group ID) they will still retreat :shock:

note; this was very min/quick testing, but interesting results.

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

Forcing AI to ram instead of retreat?

Post by Spocks-cuddly-tribble » Thu Apr 12, 2018 8:48 am

Let's go deeper. In sub_478370 we find some nice retreat orders:

Code: Select all

AUTO:00478482                 mov     dword ptr [ecx+1FCh], 0Ah // non-combat unarmed
AUTO:00478563                 mov     dword ptr [ecx+1FCh], 0Ah // non-combat armed
AUTO:004785C8                 mov     dword ptr [ecx+1FCh], 0Ah // warships
Fun fact is that the codes here can only switch between retreat and the ram orders I listed above.

So let's give more teeth to AI by forcing the ram command: :up: :twisted:

Code: Select all

AUTO:004783C7                 jnz     loc_478590 -> nop        // warships
0x777C7 -> 0F 85 C3 01 00 00 -> 90 90 90 90 90 90

AUTO:00478480                 jge     short loc_4784E4 -> jmp  // non-combat unarmed
0x77880 -> 7D -> EB

AUTO:00478507                 jnz     short loc_478563 -> nop  // non-combat armed
0x77907 -> 75 5A -> 90 90

EDIT:
thunderchero wrote:
Wed Apr 11, 2018 10:27 pm
if AI ships can use group command (more than 1 ship present of same Group ID) they will still retreat :shock:
This option won't force Ram but might avoid Retreat of warships: :wink:

Code: Select all

AUTO:004785BC                 jle     loc_4783E6 -> nop jmp loc_4783E6
0x779BC -> 0F 8E -> 90 E9
EDIT2:

Alternatively just change the warship retreat command to ram. This might leave the standard command selection intact, but still force warships to ram instead of retreat. :idea:

Code: Select all

AUTO:004785C8                 mov     dword ptr [ecx+1FCh], 0Ah // retreat warships ->  set 09 ram
0x779CE -> 0A -> 09
This might also work with other commands like evade, but code switches at some points expect either retreat or ram. Not sure how this performs.
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: 5894
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.
Contact:

Re: Commands in Tactical Combat

Post by thunderchero » Sun Apr 15, 2018 9:29 am

Hi Spocks-cuddly-tribble,

I have been looking for the location for commands for each combat group. I know I am just missing it or blind

I presume you are selecting ram same as me due to it is a "safe" command for all groups? the main group issue being the support / non-combat group. Since all ship models have at least 1 phaser slot. we can add min ship stats to all support / non-combat ships to allow more "safe" options.

Example; if fast attack command "charge" was changed to "assault" Then we would have a safe "assault" command for all combat group for this concept preventing AI from retreating and still allow them to have a good fight.

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

Re: Commands in Tactical Combat

Post by Spocks-cuddly-tribble » Mon Apr 16, 2018 9:36 am

thunderchero wrote:
Sun Apr 15, 2018 9:29 am
I have been looking for the location for commands for each combat group. I know I am just missing it or blind
Problem is there are different switch modes in different processing depths.

Special cases:

- vs. monster, station, minor ships, 3+ way battles (with allies?)
- non-combat group
- special checks for selected retreat and ram commands -> triggering of a new command selection loop with changed input values? e.g. at 477E79, 477EA7 & 477FD5

Some examples:

- loc_4784F0: non-combat(armed) vs. ships: assault, evade, retreat & ram
- 4786F5... : group commands vs stations
- ship vs. ship commands for groups 0-2 are taken from data fields ds:5905D4(fast), ds:590674(long range) and ds:590714(slow) via intricate index operations (special case: evade at 478863)

I presume you are selecting ram same as me due to it is a "safe" command for all groups?
No, I just adapted the default code switches at this point.
the main group issue being the support / non-combat group. Since all ship models have at least 1 phaser slot. we can add min ship stats to all support / non-combat ships to allow more "safe" options.
Non-combat group shouldn't be a problem due to the special code switches. :wink:
Just edit their special retreat / ram codes for your taste (or leave them alone).

Problem could be the special checks for selected retreat and ram commands -> triggering of a new command selection loop with changed input values? e.g. at 477E79, 477EA7 & 477FD5

Means if we change the retreat command to something other than ram, the code might miss some trigger point information, maybe with side effects like an infinite loop i.e. crash/freeze. So testing/verifying all possible combat constellations might be frustating/time-consuming.
On the verge of a nervous breakdown? Try the relaxing tribble sounds.

Post Reply

Return to “Commands in tactical combat”

Who is online

Users browsing this forum: No registered users