Turn Processing again.....I need help

You can talk about anything. (please read forum rules before posting)

Moderator: thunderchero

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

Re: Turn Processing again.....I need help

Post by thunderchero »

Spocks-cuddly-tribble wrote: Fri Sep 10, 2021 7:34 am I ran some quick tests by myself and the iterations definitely change AI behavior. As a rule of a thumb I'd say more iterations improve global offensives, but there is still bugged/broken codes in the main loop. We are getting closer to read/fix those codes, but we are not there yet.
sorry I am not much help these days, My test was purely visual (just looking with mudd at map and ships ect).

I told Tethys about code change and first thing he asked "was there same type of counter for combat movements?" It would be nice if larger battles could be sped up a little. But I can't even load combat in a debugger to narrow down sub-sections. I might be able to use CodeXL, but never tried using it in combat.

Thanks for all your hard work
User avatar
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 1926
Joined: Sun Apr 27, 2008 2:00 am

Re: Turn Processing again.....I need help

Post by Spocks-cuddly-tribble »

thunderchero wrote: Fri Sep 10, 2021 6:32 pmI can't even load combat in a debugger to narrow down sub-sections.
sub_477670 AI_TC_Commands loops for each AI ship, but for groups 0-2 only for 'leaders' (unless it's a mixed group of cloaked and uncloaked ships, then it runs twice), see: viewtopic.php?p=52751#p52751

Note that 'Different Solo Commands within AI Combat Groups' should be tested for increased combat lags before adding to massive AI fleet mods (you did not comment this point): viewtopic.php?p=54569#p54569

Latest IDA database: https://workupload.com/file/er2V8XXvSNj

Lag impact of phaser rendering is still disputed (even triggering animation sound effects might add to the initial lag?). But this issue affects only turn one (iirc).


EDIT: You and Tethys could try this:

Remove 474253-474261 and replace with:

mov [esi+1DCh], 1 ; set charge
mov dword ptr [esi+200h], 0FFFFFFFFh (-1) target wildcard
and byte ptr [esi+20Ch], 0F5h // clear bitmask ?

This won't work for mods, but if you are lucky the game crashes late enough to get an impression of possible time savings when skipping the AI code.


OT: ST Armada 1&2 will be republished: https://www.gog.com/partner/startrek

Same with BotF might be nice and troublesome at the same time....
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: 7934
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.

Re: Turn Processing again.....I need help

Post by thunderchero »

Spocks-cuddly-tribble wrote: Fri Sep 10, 2021 8:03 pm
thunderchero wrote: Fri Sep 10, 2021 6:32 pmI can't even load combat in a debugger to narrow down sub-sections.
sub_477670 AI_TC_Commands loops for each AI ship, but for groups 0-2 only for 'leaders' (unless it's a mixed group of cloaked and uncloaked ships, then it runs twice), see: viewtopic.php?p=52751#p52751

Note that 'Different Solo Commands within AI Combat Groups' should be tested for increased combat lags before adding to massive AI fleet mods (you did not comment this point): viewtopic.php?p=54569#p54569
Half the time I can't remember what I did last night. :???:
Spocks-cuddly-tribble wrote: Fri Sep 10, 2021 8:03 pm Lag impact of phaser rendering is still disputed (even triggering animation sound effects might add to the initial lag?). But this issue affects only turn one (iirc).
No combat turn time is definitely related to how many ships. time will decrease as both fleets lose ships.
Spocks-cuddly-tribble wrote: Fri Sep 10, 2021 8:03 pm EDIT: You and Tethys could try this:

Remove 474253-474261 and replace with:

mov [esi+1DCh], 1 ; set charge
mov dword ptr [esi+200h], 0FFFFFFFFh (-1) target wildcard
and byte ptr [esi+20Ch], 0F5h // clear bitmask ?

This won't work for mods, but if you are lucky the game crashes late enough to get an impression of possible time savings when skipping the AI code.
I will try to find some time early next week.
Spocks-cuddly-tribble wrote: Fri Sep 10, 2021 8:03 pm OT: ST Armada 1&2 will be republished: https://www.gog.com/partner/startrek

Same with BotF might be nice and troublesome at the same time....


I posted this late last week on Armada forum also.

As for botf I hope not, if gog get rights what might happen here? but if they can fix game it would also be interesting.

I also wonder if they are having issues fixing Armada to run on windows 10, DxWnd has issues with it.
User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 7934
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.

Re: Turn Processing again.....I need help

Post by thunderchero »

Update on my testing,

I found some time to run a couple more tests. I got some confusing results.

If I add the patch mid game, turn processing is greatly decreased in every test I have done.

but if I use starting seed to test same start. And after the same amount of turns with the patch from turn 1, it is almost like the AI will adapt with intel/research/diplomacy and building more ships (each test they built 200 - 500 more ships :shock: ) and turn processing time ends up being about the same. :???:

in last 3 tests the AI has also been at war more often with other majors and more systems were subjugated.

So I am confused as to how much this patch will decrease turn time. I really expect this to have more effect in games like Galaxy mod when turn time can be up to 8 min, but when turn time is under 1 min the effect is much less.
User avatar
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 1926
Joined: Sun Apr 27, 2008 2:00 am

Re: Turn Processing again.....I need help

Post by Spocks-cuddly-tribble »

thunderchero wrote: Fri Oct 08, 2021 9:57 amit is almost like the AI will adapt with intel/research/diplomacy and building more ships (each test they built 200 - 500 more ships :shock: )
Strange, this code does not look as if it affects AI system behavior and/or fleet buildup?

It seems to try to re-assign ships (sorted by function) to tasks (sorted by modifier).

Here is latest IDA-database if you want to do some debugging: https://workupload.com/file/tZYL93KrKhJ

I see at least two bugs/unfinished code parts:

00426DF5 call get_AI_Task_ax_entry ; Unused BUG?

00426E00 call get_AI_Task_ax_entry ; Unused BUG?
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: 2404
Joined: Fri Jul 18, 2008 2:00 am
Location: Your mom's bed ;)
Contact:

Re: Turn Processing again.....I need help

Post by Tethys »

thunderchero wrote: Sun Sep 05, 2021 3:38 pm That is very interesting,

I did a quick test on a saved game from Galaxy mod on turn 169 with a turn processing time of 8:20
:shock:

I hope this makes GALM a little more playable now.

Edit: I didnt see the second page until after I posted. I am betting turn lag isn't foreign to the developers. Which is why the game is the way it is.
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: 1926
Joined: Sun Apr 27, 2008 2:00 am

Re: Turn Processing again.....I need help

Post by Spocks-cuddly-tribble »

Code: Select all

NAME: AI Ship Tasks Turn-Lag Workaround Test Patch (changes AI behavior)

>> 0x000099e0 53
>> 0x00025e10 53
>> 0x00025eee 8b 40 4e ba 01 00 00 00 c1 f8 10 e8 22 2d 02 00 31 c0
>> 0x000261c6 0f bf 01 e8 c2 38 02 00
>> 0x000261e4 83 fb ff 74 46
>> 0x000261f3 89 d8 e8 d6 3a fe ff 8b 46 04 c1 f8 10 e8 cb 3a fe ff 8b 46 04 c1 f8 10
>> 0x00026214 0f bf 11 e8 54 38 fe ff
>> 0x000262e0 89 d0

<< 0x000099e0 c3
<< 0x00025e10 c3
<< 0x00025eee 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90
<< 0x000261c6 90 90 90 90 90 90 90 90
<< 0x000261e4 90 90 90 90 90
<< 0x000261f3 83 fb ff 75 13 90 90 90 90 90 90 90 90 c6 44 24 04 01 eb 28 90 90 90 90
<< 0x00026214 90 90 90 90 90 90 90 90
<< 0x000262e0 eb 19
Might make AI invasions a bit more risky/aggressive (sometimes better):
thunderchero wrote: Fri Oct 08, 2021 9:57 amthe AI has also been at war more often with other majors and more systems were subjugated.
Note patch should be used with unlock AI task limit patches for larger maps: viewtopic.php?p=57673#p57673 :idea:
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: 7934
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.

Re: Turn Processing again.....I need help

Post by thunderchero »

Spocks-cuddly-tribble wrote: Sun Nov 13, 2022 3:04 am

Code: Select all

NAME: AI Ship Tasks Turn-Lag Workaround Test Patch (changes AI behavior)

>> 0x000099e0 53
>> 0x00025e10 53
>> 0x00025eee 8b 40 4e ba 01 00 00 00 c1 f8 10 e8 22 2d 02 00 31 c0
>> 0x000261c6 0f bf 01 e8 c2 38 02 00
>> 0x000261e4 83 fb ff 74 46
>> 0x000261f3 89 d8 e8 d6 3a fe ff 8b 46 04 c1 f8 10 e8 cb 3a fe ff 8b 46 04 c1 f8 10
>> 0x00026214 0f bf 11 e8 54 38 fe ff
>> 0x000262e0 89 d0

<< 0x000099e0 c3
<< 0x00025e10 c3
<< 0x00025eee 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90
<< 0x000261c6 90 90 90 90 90 90 90 90
<< 0x000261e4 90 90 90 90 90
<< 0x000261f3 83 fb ff 75 13 90 90 90 90 90 90 90 90 c6 44 24 04 01 eb 28 90 90 90 90
<< 0x00026214 90 90 90 90 90 90 90 90
<< 0x000262e0 eb 19
Might make AI invasions a bit more risky/aggressive (sometimes better):
thunderchero wrote: Fri Oct 08, 2021 9:57 amthe AI has also been at war more often with other majors and more systems were subjugated.
Note patch should be used with unlock AI task limit patches for larger maps: viewtopic.php?p=57673#p57673 :idea:
Nice patch,

did some quick tests with patch

tested on MUM

without patch 30 min to turn 187
with patch above only 19 min 20 sec to turn 187
with AI task limit patches (invade and attack only) and patch above no change 19 min 20 sec to turn 187
with AI task limit patches (all 4 locations in that post) and patch above 19 min 20 sec to turn 180 (same time, 7 turns less)

when testing earlier I found "Colonize and Remove Active AI Tasks Limits" slowed turn processing.
User avatar
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 1926
Joined: Sun Apr 27, 2008 2:00 am

Re: Turn Processing again.....I need help

Post by Spocks-cuddly-tribble »

thunderchero wrote: Sun Nov 13, 2022 12:29 pmtested on MUM

without patch 30 min to turn 187
with patch above only 19 min 20 sec to turn 187
In the beginning this patch does not help with the initial slowdown with larger maps, but it should lower the more lag-percentage (compared to default code) the greater the lag becomes due to AI fleets/range. And there is still options to test for a further decrease.

thunderchero wrote: Sun Nov 13, 2022 12:29 pmwith AI task limit patches (invade and attack only) and patch above no change 19 min 20 sec to turn 187
No AI empire at war?

thunderchero wrote: Sun Nov 13, 2022 12:29 pmwith AI task limit patches (all 4 locations in that post) and patch above 19 min 20 sec to turn 180 (same time, 7 turns less)

when testing earlier I found "Colonize and Remove Active AI Tasks Limits" slowed turn processing.
Might be due to faster colonize behavior (faster more systems, range and territory -> earlier first contacts).
But the lower default limit for colonize tasks means fewer un-terraformed AI planets in later game stages (so your first choice might be good?).
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: 7934
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.

Re: Turn Processing again.....I need help

Post by thunderchero »

Spocks-cuddly-tribble wrote: Sun Nov 13, 2022 1:56 pm No AI empire at war?
Klingons and cards were at war at turn 187 in all tests above. looks like they started war around turn 177?
Post Reply

Return to “General Chat”