Turn processing patch (CLOSED)

General Modding Information/Questions; support/discussion/questions

Moderator: thunderchero

Forum rules
:idea: Please search before starting new topic. :idea:
There is a good chance it has already been asked.
User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 7935
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.

Re: Turn processing patch (CLOSED)

Post by thunderchero »

here is results of UDML test save with 1:30 tpt,

Code: Select all

trek.exe!0x449c00	12116 * part of Game_Ship_ShipCompareFunc
trek.exe!0x47ae10	06841 * part of Game_Map_PathFind_47AE10
trek.exe!0x47aedb	05531 * part of Game_Map_PathFind_47AE40
trek.exe!0x51b02a	04028 * part of gHeap_SortRange
trek.exe!0x51b044	03921 * part of gHeap_SortRange
trek.exe!0x449c03	02591 * part of Game_Ship_ShipCompareFunc
trek.exe!0x47ae19	02557 * part of Game_Map_PathFind_47AE10
trek.exe!0x51b00f	01919 * part of gHeap_SortRange
trek.exe!0x51b033	01705 * part of gHeap_SortRange
trek.exe!0x51b04d	01679 * part of gHeap_SortRange
trek.exe!0x47aef8	01652 * part of Game_Map_PathFind_47AE40
trek.exe!0x448d00	01629 * part of Game_Ship_TaskForceCompareFunc
trek.exe!0x47ae22	01472 * part of Game_Map_PathFind_47AE10
trek.exe!0x51b018	01432 * part of gHeap_SortRange
trek.exe!0x51abc2	01131 * part of gHeap_PopMax
trek.exe!0x47af0c	01047 * part of Game_Map_PathFind_47AE40
trek.exe!0x47ae11	01032 * part of Game_Map_PathFind_47AE10
trek.exe!0x47a5ac	00794 * part of Game_Map_GridMap_GetEntry
trek.exe!0x449c12	00793 * part of Game_Ship_ShipCompareFunc
trek.exe!0x51a822	00739 * part of gHeap_Search
trek.exe!0x51a81f	00704 * part of gHeap_Search
trek.exe!0x51abe3	00672 * part of gHeap_PopMax
trek.exe!0x51a810	00671 * part of gHeap_Search
trek.exe!0x51a82d	00617 * part of gHeap_Search
trek.exe!0x51a81b	00610 * part of gHeap_Search
trek.exe!0x51ae87	00590 * part of gHeap_Push
trek.exe!0x51ae90	00586 * part of gHeap_Push
trek.exe!0x449c10	00574 * part of Game_Ship_ShipCompareFunc
trek.exe!0x449c0c	00550 * part of Game_Ship_ShipCompareFunc
trek.exe!0x48fcb0	00544 * part of Sound_X_48FCB0
trek.exe!0x51a826	00533 * part of gHeap_Search
trek.exe!0x47ae31	00521 * part of Game_Map_PathFind_47AE10
trek.exe!0x448d03	00487 * part of Game_Ship_TaskForceCompareFunc
trek.exe!0x51abec	00480 * part of gHeap_PopMax
trek.exe!0x47af41	00429 * part of Game_Map_PathFind_47AE40
trek.exe!0x47ae1a	00388 * part of Game_Map_PathFind_47AE10
trek.exe!0x47a669	00380 * part of Game_Map_GridMap_47A620
trek.exe!0x47ae1e	00359 * part of Game_Map_PathFind_47AE10
trek.exe!0x47a5a9	00355 * part of Game_Map_GridMap_GetEntry
trek.exe!0x51abcb	00337 * part of gHeap_PopMax
trek.exe!0x465992	00332 * part of Game_Economy_X_465990
trek.exe!0x47a5a0	00294 * part of Game_Map_GridMap_GetEntry
trek.exe!0x51d6d9	00293 * part of __CHP
trek.exe!0x51b019	00284 * part of gHeap_SortRange
trek.exe!0x51b034	00282 * part of gHeap_SortRange
trek.exe!0x47aeff	00265 * part of Game_Map_PathFind_47AE40
trek.exe!0x51affa	00258 * part of gHeap_SortRange
trek.exe!0x51b04e	00239 * part of gHeap_SortRange
trek.exe!0x47ae64	00232 * part of Game_Map_PathFind_47AE40
trek.exe!0x47aedc	00226 * part of Game_Map_PathFind_47AE40
trek.exe!0x449c0e	00209 * part of Game_Ship_ShipCompareFunc
trek.exe!0x449c17	00206 * part of Game_Ship_ShipCompareFunc
trek.exe!0x51b02c	00189 * part of gHeap_SortRange
trek.exe!0x47ae2a	00189 * part of Game_Map_PathFind_47AE10
trek.exe!0x51b021	00188 * part of gHeap_SortRange
trek.exe!0x472a39	00186 * part of Game_Military_Battle_4729BC
trek.exe!0x47aea8	00184 * part of Game_Map_PathFind_47AE40
trek.exe!0x51afd1	00181 * part of gHeap_SortRange
trek.exe!0x51b046	00181 * part of gHeap_SortRange
trek.exe!0x51aeff	00180 * part of gHeap_SortRange
trek.exe!0x472a40	00176 * part of Game_Military_Battle_4729BC
trek.exe!0x51af17	00175 * part of gHeap_SortRange
trek.exe!0x472a3e	00163 * part of Game_Military_Battle_4729BC
trek.exe!0x448d0c	00162 * part of Game_Ship_TaskForceCompareFunc
trek.exe!0x51afad	00161 * part of gHeap_SortRange
trek.exe!0x48fcb5	00160 * part of Sound_X_48FCB0
trek.exe!0x47af07	00153 * part of Game_Map_PathFind_47AE40
trek.exe!0x47ae17	00152 * part of Game_Map_PathFind_47AE10
trek.exe!0x47a37c	00151 * part of Game_X_47A200
trek.exe!0x47aef6	00147 * part of Game_Map_PathFind_47AE40
trek.exe!0x47a5fe	00145 * part of Game_Map_GridMap_47A5E0
trek.exe!0x47aee2	00142 * part of Game_Map_PathFind_47AE40
trek.exe!0x47a609	00142 * part of Game_Map_GridMap_47A5E0
trek.exe!0x51b011	00141 * part of gHeap_SortRange
trek.exe!0x47aed9	00140 * part of Game_Map_PathFind_47AE40
trek.exe!0x402432	00137 * part of Main_GameFrame_PROBLY
trek.exe!0x47ae6b	00137 * part of Game_Map_PathFind_47AE40
trek.exe!0x51b03b	00135 * part of gHeap_SortRange
trek.exe!0x47aecb	00135 * part of Game_Map_PathFind_47AE40
trek.exe!0x47aef0	00135 * part of Game_Map_PathFind_47AE40
trek.exe!0x47ae35	00135 * part of Game_Map_PathFind_47AE10
trek.exe!0x47a5fb	00135 * part of Game_Map_GridMap_47A5E0
trek.exe!0x47ae9e	00134 * part of Game_Map_PathFind_47AE40
trek.exe!0x47a568	00131 * part of Game_Map_GridMap_WithinGrid
trek.exe!0x51abed	00127 * part of gHeap_PopMax
trek.exe!0x402433	00125 * part of Main_GameFrame_PROBLY
trek.exe!0x47a560	00125 * part of Game_Map_GridMap_WithinGrid
trek.exe!0x51af9c	00123 * part of gHeap_SortRange
trek.exe!0x47aea3	00123 * part of Game_Map_PathFind_47AE40
trek.exe!0x51a82b	00122 * part of gHeap_Search
afterwards I added up total for each sub-section

17694 gHeap_SortRange
17039 Game_Ship_ShipCompareFunc
13646 Game_Map_PathFind_47AE10
10812 Game_Map_PathFind_47AE40
03996 gHeap_Search
02747 gHeap_PopMax
02278 Game_Ship_TaskForceCompareFunc
01443 Game_Map_GridMap_GetEntry
01176 gHeap_Push
00704 Sound_X_48FCB0
00525 Game_Military_Battle_4729BC
00422 Game_Map_GridMap_47A5E0
00380 Game_Map_GridMap_47A620
00332 Game_Economy_X_465990
00293 __CHP
00262 Main_GameFrame_PROBLY
00256 Game_Map_GridMap_WithinGrid
00151 Game_X_47A200

It looks like the top 9 are biggest hotspot sub-sections.
User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 7935
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.

Re: Turn processing patch (CLOSED)

Post by thunderchero »

something I just noticed all locations below are a direct call to "sahf"

trek.exe!0x47aedb 05531 * part of Game_Map_PathFind_47AE40 * sahf
trek.exe!0x47ae19 02557 * part of Game_Map_PathFind_47AE10 * sahf
trek.exe!0x47aef8 01652 * part of Game_Map_PathFind_47AE40 * sahf
trek.exe!0x47ae22 01472 * part of Game_Map_PathFind_47AE10 * sahf
trek.exe!0x47af0c 01047 * part of Game_Map_PathFind_47AE40 * sahf

I am not sure what "sahf" is?
User avatar
Flocke
BORG Trouble Maker
BORG Trouble Maker
Posts: 3246
Joined: Sun Apr 27, 2008 2:00 am
Location: Hamburg, Germany
Contact:

Re: Turn processing patch (CLOSED)

Post by Flocke »

thunderchero wrote: Tue Mar 27, 2018 12:01 pmI am not sure what "sahf" is?
an asm instruction to load the EFLAGS register:
https://x86.puri.sm/html/file_module_x86_id_284.html
https://www.aldeid.com/wiki/X86-assembl ... tions/sahf
https://en.wikipedia.org/wiki/FLAGS_register

By my first thought, those flags might be used to proceed on an earlier operation. For the PathFind it liekely is loaded for each alternate ship move each sector. So it continues the search for one single branch of the possible move decisions but caches the result including those flags to later return back for it and search another branch.

Having another look at the asm source however I see it always is called after a float comparision 'fcomp' and used to set the flags for the jump decisions to work (jb, jnb, ja). Nothing special I'd say.
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 patch (CLOSED)

Post by Tethys »

So I did a little testing of this in latest GALM, I cannot say how much of an improvement in turn time it made but it DID make an improvement. In a new game setting, I have observed no ill effects. The Borg still building bases, and they are conquering minors more effectively (but their expansion is probably more likely due to their new colony values)

Thumbs up from me thus far. Will report back after a proper long game (200+)
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: 1928
Joined: Sun Apr 27, 2008 2:00 am

Re: Turn processing patch (CLOSED)

Post by Spocks-cuddly-tribble »

Be careful, inconsistent results and effect depending on mod, map and game:
thunderchero wrote: Mon Feb 26, 2018 3:53 pmThis patch has a major memory leak, you must restart game every 10 turns or turn time will increase far beyond original (un-patched) TPT.
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 patch (CLOSED)

Post by Tethys »

Spocks-cuddly-tribble wrote: Thu Sep 21, 2023 12:16 pm Be careful, inconsistent results and effect depending on mod, map and game:
thunderchero wrote: Mon Feb 26, 2018 3:53 pmThis patch has a major memory leak, you must restart game every 10 turns or turn time will increase far beyond original (un-patched) TPT.
I did see that, and I have been watching for the issue. However, I have not seen it. My expedited tests are about 75-80 turns per game (to assess empire expansion), by turn 80 my turn times are still roughly 5-7 seconds. On my save game (220 turns) I don't get to play 10 turns before I encountered some crash (less crash now thanks to debug decisions) or issue which required me to reload. Turn times seem to be under 30 seconds. The Borg are wiped out, Dominion have almost 200 ships now, Romulans have only 2 systems left (I am using them for raiding income), and Klingons are being invaded by the Dominion. I will be keeping my eyes open for the turn time increase issue since now I think I will be able to play more turns without crashing. It could be an issue that is isolated to TC's mods, I am not sure. I believe this is the first, and only, turn time enhancement I have used on GALM to date.
Not for the weak of heart...
Galaxies MOD v0.4.0 <--- GALM/Galaxies Mod latest version
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 patch (CLOSED)

Post by Tethys »

I would like to add my "personal" reference material, material which I use almost exclusively and has been invaluable to my code analysis and modifications.

https://www.felixcloutier.com/x86/
Not for the weak of heart...
Galaxies MOD v0.4.0 <--- GALM/Galaxies Mod latest version
Post Reply

Return to “General Modding Information/Questions”