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: 7824
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.

Turn processing patch (CLOSED)

Post by thunderchero »

Hi Everyone,

With the recent discussion on long turn processing, I started digging though some of my old PM's with QD. A couple years ago QD started working on a patch for turn processing, QD sent me one patch that improved turn processing, but he told me 'the patch could be improved even more"

well unfortunately his focus went to other projects and I forgot all about how good the patch he sent me really was.

on my current saved game I use for testing, un-patched take 1 min 55 sec.
when using this patch it take 40 sec. So this patch will improve turn processing time only, and not fix the issue.

So if you are interested, test it out and report back here.

if this proves to have as much impact as I think it will it will be added to all mods in All in One installer on next update.

NOTE: this patch has a conflict with UDM, so testing should not be done on UDM (all versions) until trek.exe has been corrected.

internal trek.exe patch
turn_processing.patch
(22.08 KiB) Downloaded 204 times
just add this file to "your install location"\tools\QD\patches
then run QD patcher and install this patch.

Note; if used in MP game all players need to apply this patch
Note; this will work on saved games

This patch replaces the heap data structure in BotF with a more appropriate circular buffer implementation.

Note; some mods may show conflicts in QD patcher (patch display red), this is due to overlap of code for "no cd patch" but this is ok since patch also write a new code for no cd.
User avatar
mullet
Cadet 4th Year
Cadet 4th Year
Posts: 18
Joined: Sat Feb 10, 2018 10:30 pm

Re: testers needed for Turn processing patch

Post by mullet »

oh my goodness. I was just on the other day railing about the frustration of long turn times.

The next time i play BOTF, i'm going to try this on an XL map mod, and, i will recount my experiences.

EDIT: OK, i'm on turn 155 of UDML. I'm not timing turns with an egg timer, but, so far, no cause for that. Slow down started creeping in around 130, but, we're still in the 10- 15 second range, so, i'm noticing improvement. Normally: this is when the turns start getting really long, so, its def better.

Its not messing up with the all in one installer download. I also did some slight tweaks with the ultimate editor, so... this bodes well for patch stability at least.

As the turns get longer: i will start using the stopwatch app on my phone to clock them.

If you have a save file: i can overwrite mt install with one not altered by UE, and, do runs with and without patch, and time turns.

Second EDIT: Turn 156-157 = 2.3 seconds / 163-164 = 3 seconds , so, ; first: i was *perceiving* 10 seconds before, which says something to time perception. Second: i am entering the portion where: the empires are starting to encounter, which i believe leads to more ship building and more "careful decision making" in ship movements...
User avatar
mullet
Cadet 4th Year
Cadet 4th Year
Posts: 18
Joined: Sat Feb 10, 2018 10:30 pm

Re: testers needed for Turn processing patch

Post by mullet »

On a side note: i want to commend your efforts for still trying to improve BOTF after all this time.

Its actually a really cool classic game....... or, it would be if its original incarnation was not rife with mechanical flaws that ruin the experience.

Patches and updates and mods i got from this forum are the only thing that make the game playable. Otherwise i would have been like: "pretty neat idea for a Trek game, but...its a shame that.... oh well" and, forgot about this game long ago.

EDIT AGAIN: 179-180 clocks in at 8.3 ; a vast increase from all the previous turns at about 3 seconds. I opened the save in UE to see whats going on in the galaxy.

What i noticed is: Well, my starting position is in a corner, another empire started in a corner on the other side, and the other 3 started fairly close to each other in the center, and, two of those 3 are at war with the other. Lots of ship movements, and, the AI controlled fleets all read "error: no ships in this task force" What the hell is that about?

Anyway: by the looks of things: the war looks like it could be only a couple of turns old. Can i find out exactly when the current war started? I guess it coincided with sudden spike in turn wait time, but, i would love to confirm that.

I was just curious about technical issues, but, i spoiled the game for myself. Me and the other corner empire get to build up while being mostly immune to the 3 way showdown in the center due to range restriction. We carve up the survivor of the galactic center war, and, they most likely declare war when we meet in the middle, or..... this is a likely possibility if long turn time does not stop me from finishing.
User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 7824
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.

Re: testers needed for Turn processing patch

Post by thunderchero »

Good to hear you are having lower turn times with patch, but as I said before this is an improvement patch not a fix. so as you rack up more turns, time will continue to increase.

just as a note the saved game I was using was UM5 at turn 240 using Mudd to test. but I was not playing game only pressing turn after turn until I had a long enough turn time for testing.
mullet wrote: Fri Feb 16, 2018 9:49 pm the AI controlled fleets all read "error: no ships in this task force" What the hell is that about?
UE does not recognize 18 ship taskforce patch. so this is expected

plus UE has always had issues with saved game files. also just by opening and saving a save file with UE could corrupt the save file.

UE has been in need of an update for more than 4 years, if anyone has experience with java coding...... it is open source gpl :grin:
User avatar
mullet
Cadet 4th Year
Cadet 4th Year
Posts: 18
Joined: Sat Feb 10, 2018 10:30 pm

Re: testers needed for Turn processing patch

Post by mullet »

"just by opening and saving a save file with UE could corrupt the save file. " copying the file and pasting into an empty folder would be a safe guard to that, yes?
User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 7824
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.

Re: testers needed for Turn processing patch

Post by thunderchero »

mullet wrote: Sat Feb 17, 2018 12:29 am "just by opening and saving a save file with UE could corrupt the save file. " copying the file and pasting into an empty folder would be a safe guard to that, yes?
yes it would, also not saving when asked by UE will prevent corruption.
mullet wrote: Fri Feb 16, 2018 9:49 pm Anyway: by the looks of things: the war looks like it could be only a couple of turns old. Can i find out exactly when the current war started? I guess it coincided with sudden spike in turn wait time, but, i would love to confirm that.
not without prior saved games to examine.

I would expect one of the races at war signed a war pact or alliance, this would give them a larger area for there ships to explore.
User avatar
mullet
Cadet 4th Year
Cadet 4th Year
Posts: 18
Joined: Sat Feb 10, 2018 10:30 pm

Re: testers needed for Turn processing patch

Post by mullet »

Ok, it never prompts me to save unless i make a change, so, i'm straight.
User avatar
mullet
Cadet 4th Year
Cadet 4th Year
Posts: 18
Joined: Sat Feb 10, 2018 10:30 pm

Re: testers needed for Turn processing patch

Post by mullet »

264 - 265 = 38 seconds. Its getting rough in terms of turn wait.

I removed the patch, and... 38.4 seconds. Also: the margin of difference could be my timing of hitting the stopwatch.

265-266 W/O patch = 35.5 seconds. 265-266 with patch = 35.7 seconds.

It seems my earlier accounts might have been overly optimistic; wishful thinking perhaps.

When i *actually test* it, it appears to not be working.

Either: its ineffective, or, its not actually running the patch for me in particular for some reason. I hope some more people step up to try it.
User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 7824
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.

Re: testers needed for Turn processing patch

Post by thunderchero »

I would be happy to test your saved game, but since you stated you have made edits to mod you would also have to upload your changes.

UE keep track of all changes it make, by selecting edit/other/list of modified files
then select "export all" create a new folder then zip folder to upload.

problem is forum is limited to less than 1mb (999 kib) so you might have to split files or upload to external server.

but to be honest at 38 sec (and not changing at all) at turn 240 it sounds like patch is not be removed.
User avatar
mullet
Cadet 4th Year
Cadet 4th Year
Posts: 18
Joined: Sat Feb 10, 2018 10:30 pm

Re: testers needed for Turn processing patch

Post by mullet »

I moved the patch to a folder on the desktop, and, moved it back for the other test. I doubt the game could find it there, but......not by any means being a computer expert, i could buy that properties of the patch could remain in the save file.

anyway: this is trek.exe, and, botf.res, and, two of the saves.

http://www.mediafire.com/file/o92y1c9cs ... 20UDML.rar
User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 7824
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.

Re: testers needed for Turn processing patch

Post by thunderchero »

mullet wrote: Sat Feb 17, 2018 2:41 pm but......not by any means being a computer expert, i could buy that properties of the patch could remain in the save file.
I would not BS you like that.

right now I can not explain why it is not showing any time differences patched or un-patched. I am getting slightly quicker time at 33 sec.

from examining your save, processing time should be around 2 min with that many ships on the map.

The funny thing was when I was first given this patch, I tested on UDML and had no improvement either, but all other mods had a 50%+ time improvement. That was main reason it was not released at that time.

I suggest you continue playing and testing, But tbh most player would be happy to see a 33 sec turn processing at turn 260, Since most of my games would be 2 min plus at turn 260+.

there must be a trigger that greatly increase turn time at some point in game. finding this could narrow down issue. strange thing is next turn of your saved game increase to 55 sec patched or un-patched could you comfirm increase? So what changed on next turn AI agenda changed?

so far on your save I have tested resolution (increased to 1024 x 768) and edited AI scan range settings to vanilla (they have been edited in UDML).

I will continue testing just not sure what to test next.
User avatar
mullet
Cadet 4th Year
Cadet 4th Year
Posts: 18
Joined: Sat Feb 10, 2018 10:30 pm

Re: testers needed for Turn processing patch

Post by mullet »

"most player would be happy to see a 33 sec turn processing at turn 260, Since most of my games would be 2 min plus at turn 260+."

True: there is some forward progress even after all these years, and, that is nothing to sneeze at. I am pleasantly surprised to see work on turn processing still ongoing.

Staying even just a little under a minute throughout makes it more playable by far. As for actual player experience. Its just that screen with the cursor spinning. I think if: there was a status prompt on the screen saying things like "Federation moving ships....%5 complete.......Romulans building structures....%33 complete..." It would *feel* more forgivable. I'm by no means suggesting a mod to that effect. Its just a what if.

"there must be a trigger that greatly increase turn time at some point in game" yeah, its like you suddenly hit a wall to get a REALLY long turn, and, you wonder what gives.

"could you comfirm increase? "

166 - 167 = 32 seconds. 167 - 168 = 52.3 seconds. this was with the patch properly positioned.

"AI agenda changed?"

IDK how to check for that, but, the war / alliance statuses didn't change since the dominion declared war on feds; about half a dozen turns prior.

I don't see any drastic differences in ship numbers or movements.

The closest theory i could pull out of my bum: The Cards are very close to losing. If there is an equation where: an empire at verge of loss sues for peace and new alliances every turn, there could a process of weighing the value of the remaining territories to gain over the effort and resources needed to continue the war. Maybe: if the values are fairly close to equal, or, equal exactly, it takes more time to "think" it.

Its like when the Voyager EMH has to pick between saving one of two equally injured patients.

I can see how it goes after cards lose. turn time should perk up after that, if only from one less simulated opponent to run.
User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 7824
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.

Re: testers needed for Turn processing patch

Post by thunderchero »

I did a little more testing today on your saved game.

This patch had 2 versions, version above was internal patch (all code added to trek.exe)
here is an external dll version. (you still need to patch the trek.exe to read dll)

(external dll patch caused error see this post)

first remove internal patch (Speeds up turn processing by optimizing the gHeap functions.) with QD patcher
next install external patch with QD patcher from dll_inject.zip (Injects a DLL called "injected.dll")
add injected.dll to install path of version to be tested.

in my tests on your saved game at turn 270 - 271 unpatched was 1:04
using dll inject was 51 sec. this is only a slight improvement but better than nothing
User avatar
mullet
Cadet 4th Year
Cadet 4th Year
Posts: 18
Joined: Sat Feb 10, 2018 10:30 pm

Re: testers needed for Turn processing patch

Post by mullet »

I got similar result. I would like to see more people check in and see if it improved the conditions for them.

If you have managed to actually find the factors that are regulating turn processing resource use: this would be a big breakthrough in BOTF modding.
User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 7824
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.

Re: testers needed for Turn processing patch

Post by thunderchero »

mullet wrote: Mon Feb 19, 2018 4:25 am I would like to see more people check in and see if it improved the conditions for them.
I also would like to hear from other players testing.
Post Reply

Return to “General Modding Information/Questions”