Seconded. Am I correct in assuming these will be hex fixes? Or do you plan on giving us asm to decode?thunderchero wrote:QuasarDonkey wrote:I actually have a few patches in the works for various parts of BotF. I'll start releasing them soon enough.
sounds interesting I can't wait
thunderchero
Standard Trek.exe IDA Database
Moderator: thunderchero
- Tethys
- Past Administrator
- Posts: 2392
- Joined: Fri Jul 18, 2008 2:00 am
- Location: Your mom's bed ;)
- Contact:
Re: Standard Trek.exe IDA Database
Re: Standard Trek.exe IDA Database
^^ hopefully both QD so those who understand asm can pour over the ideas and concepts while those who don't can type and play
- Tethys
- Past Administrator
- Posts: 2392
- Joined: Fri Jul 18, 2008 2:00 am
- Location: Your mom's bed ;)
- Contact:
Re: Standard Trek.exe IDA Database
^ yeah what he said I try not to delve to much into asm code, hex code is alooooooooooot easier.
- thunderchero
- Site Administrator aka Fleet Admiral
- Posts: 7852
- Joined: Fri Apr 25, 2008 2:00 am
- Location: On a three month training mission, in command of the USS Valiant.
Re: Standard Trek.exe IDA Database
I know you are afraid you might learn something new lolTethys wrote:^ yeah what he said I try not to delve to much into asm code, hex code is alooooooooooot easier.
thunderchero
- Tethys
- Past Administrator
- Posts: 2392
- Joined: Fri Jul 18, 2008 2:00 am
- Location: Your mom's bed ;)
- Contact:
Re: Standard Trek.exe IDA Database
I dont have time to learn anything new, so I suppose u are right
- QuasarDonkey
- Code Analyst
- Posts: 433
- Joined: Tue Jul 26, 2011 8:29 pm
- Location: Ireland
Re: Standard Trek.exe IDA Database
Sorry guys, I was away for a few days (still am actually).
I had started two patches already, and I've done preliminary research for a few more. One patch I built should allow playing BotF using a folder instead of STBOF.RES. It seems to work for reading the first twenty or so files, but crashes out when reading aibldreq.bin. No idea why yet.
A second patch is to get BotF running in windowed mode. But it's not been entirely successful yet either
A third patch I'm doing some research on is replacing trek.exe's complex random number generators with something more predictable for research/diagnostic purposes (I'm thinking AI research).
Most of my patches have failed so far, so I think I'll do some simpler ones first. I'm gonna try make a patch to lower CPU usage.
Hopefully I'll get some of the patches working soon. If anyone has requests/ideas for specific patches (simple ones for now), please mention them. I wanna get some practice in ASM coding.
I had started two patches already, and I've done preliminary research for a few more. One patch I built should allow playing BotF using a folder instead of STBOF.RES. It seems to work for reading the first twenty or so files, but crashes out when reading aibldreq.bin. No idea why yet.
A second patch is to get BotF running in windowed mode. But it's not been entirely successful yet either
A third patch I'm doing some research on is replacing trek.exe's complex random number generators with something more predictable for research/diagnostic purposes (I'm thinking AI research).
Most of my patches have failed so far, so I think I'll do some simpler ones first. I'm gonna try make a patch to lower CPU usage.
Tethys wrote:Am I correct in assuming these will be hex fixes? Or do you plan on giving us asm to decode?
I'll provide ASM and hex, and I might use diablo's Universal Patcher too for easy patching.Peter1981 wrote:^^ hopefully both QD so those who understand asm can pour over the ideas and concepts while those who don't can type and play
Hopefully I'll get some of the patches working soon. If anyone has requests/ideas for specific patches (simple ones for now), please mention them. I wanna get some practice in ASM coding.
- Tethys
- Past Administrator
- Posts: 2392
- Joined: Fri Jul 18, 2008 2:00 am
- Location: Your mom's bed ;)
- Contact:
Re: Standard Trek.exe IDA Database
Well, since you offered
Would it be possible to create a zoomable under/overlay for the galactic map? It could be a small step towards creating 'quadrants'. It would show up similar to the way ship ranges show up, but maybe as a white or blue line for quadrant dividers. I dont know if its possible but I think it would be a great cosmetic feature if you are up to the task
Also, if you are up to it, could you find a way to keep empire borders unlocked after signing a non aggression treaty? It would be a nice twist to the game (I remember several episodes where ships crossed into demilitarized space such as the DMZ and RNZ)
Im interested to see BotF maybe use MORE CPU and memory, maybe to speed things up a bit? But ive heard Botf doesnt exactly like 'fast'
Would it be possible to create a zoomable under/overlay for the galactic map? It could be a small step towards creating 'quadrants'. It would show up similar to the way ship ranges show up, but maybe as a white or blue line for quadrant dividers. I dont know if its possible but I think it would be a great cosmetic feature if you are up to the task
Also, if you are up to it, could you find a way to keep empire borders unlocked after signing a non aggression treaty? It would be a nice twist to the game (I remember several episodes where ships crossed into demilitarized space such as the DMZ and RNZ)
Im interested to see BotF maybe use MORE CPU and memory, maybe to speed things up a bit? But ive heard Botf doesnt exactly like 'fast'
- thunderchero
- Site Administrator aka Fleet Admiral
- Posts: 7852
- Joined: Fri Apr 25, 2008 2:00 am
- Location: On a three month training mission, in command of the USS Valiant.
Re: Standard Trek.exe IDA Database
Not sure how easy this would be....
But I would like for structures when set to upgrade an older structure it replaces the older structure instead of having both of them.
currently the scanner structures and main manned structures do this but no other structure set to upgrade will.
thunderchero
But I would like for structures when set to upgrade an older structure it replaces the older structure instead of having both of them.
currently the scanner structures and main manned structures do this but no other structure set to upgrade will.
thunderchero
Re: Standard Trek.exe IDA Database
I would like to see AI empires able to be set at different diplomatic stances for beginning game. Currently only minors can be adjusted with major empires. It would be a great addition to be able to do this for the mod I am working on but also make the current game/mods more interesting besides just making a team game. Great work with this database I dont understand a lot of it but I have been looking at every version you uploaded and hopefully in time we can solve the memory issue with BotF which is I think one of the biggest problems with the game.
- Flocke
- BORG Trouble Maker
- Posts: 3197
- Joined: Sun Apr 27, 2008 2:00 am
- Location: Hamburg, Germany
- Contact:
Re: Standard Trek.exe IDA Database
see pseudo windowed modeQuasarDonkey wrote:A second patch is to get BotF running in windowed mode. But it's not been entirely successful yet either
mpr97 (CreateDevice or something) also has an option to render in windowed mode, but for some reason it didn't work in my tests either.
Since you asked, that would be lots of work and if you want to do it well you need a new engine. *cough*Tethys wrote:Would it be possible to create a zoomable under/overlay for the galactic map? It could be a small step towards creating 'quadrants'. It would show up similar to the way ship ranges show up, but maybe as a white or blue line for quadrant dividers. I dont know if its possible but I think it would be a great cosmetic feature if you are up to the task
Maybe multiple zoom levels could be added.
Good idea, I often wondered on this, too. AI complaints about flying through their territory anyway.Tethys wrote:Also, if you are up to it, could you find a way to keep empire borders unlocked after signing a non aggression treaty? It would be a nice twist to the game (I remember several episodes where ships crossed into demilitarized space such as the DMZ and RNZ)
should be a simple fix but might need some more analysis to find, it's at least in turn processing as well as in shiprange calculation
Unlike java with it's virtual machine, in c++ botf isn't restricted in ressources, but the algorithms are just that slow (and not much multi-threaded). To speed up the game you've to figure what functions are causing the slow downs (like ai ship movement) and reimplement faster alternatives.Tethys wrote:Im interested to see BotF maybe use MORE CPU and memory, maybe to speed things up a bit? But ive heard Botf doesnt exactly like 'fast'
I'd not take this as a first task, ai programming can be quite complex.
Lessening CPU usage doesn't seem much useful to me either. BotF already uses sleep calls, only video playback and turn processing doesn't and for current turn processing it can't be changed cause it's not loop based but a bunch of massive functions executed one after another.
this should be easy to fix but requires some asm search/debuggingthunderchero wrote:Not sure how easy this would be....
But I would like for structures when set to upgrade an older structure it replaces the older structure instead of having both of them.
currently the scanner structures and main manned structures do this but no other structure set to upgrade will.
somewhere must be a check for the buildings and it's known how data is stored by savegame analysis
I expect the whole turn processing calculation can be rewritten, but better not all at once
I once had some idea on a savegame generator, but it would be much simpler to just do some makeover to the galaxy generation.xDx wrote:I would like to see AI empires able to be set at different diplomatic stances for beginning game. Currently only minors can be adjusted with major empires.
This should be a pretty simple thing in terms of programming.
To adjust start attitude a configurion file like an ini could be used.
another nice idea would be to finally fix the minor's upgrade bug, sometimes loosing their factories and research centers
alot of research has been done on minor development but a final fix is still missing
also it would be great to make the minor's evolution relate better to the game settings
shall we reopen a wishlist?
- QuasarDonkey
- Code Analyst
- Posts: 433
- Joined: Tue Jul 26, 2011 8:29 pm
- Location: Ireland
Re: Standard Trek.exe IDA Database
Okay, I'm back home now. Seems there's been quite a discussion
Oh, thanks for the link on windowed mode. I wanted to create something easier that just works. It may turn out to be impossible without rewriting MPR
I'm not sure if that's necessary yet. Anyway I don't want to get inundated with too many requests.Flocke wrote:shall we reopen a wishlist?
If you're a laptop user, I think you can understand the overheating problems when running at 100% CPU. The sleep calls are what I was gonna look at. Trek.exe consumes 100% CPU even when idle. That's not right. Looking at the MSDN documentation for sleep():Flocke wrote:Lessening CPU usage doesn't seem much useful to me either. BotF already uses sleep calls, only video playback and turn processing doesn't and for current turn processing it can't be changed cause it's not loop based but a bunch of massive functions executed one after another.
AFAIK system clock resolutions vary somewhere between 10 and 40 ms. In Trek.exe, sleep is called for 0 or 1 ms. I'm gonna play around with the time delays, to see if Trek.exe can use less CPU when doing nothing, without affecting game performance.MSDN wrote:If dwMilliseconds is less than the resolution of the system clock, the thread may sleep for less than the specified length of time.
Oh, thanks for the link on windowed mode. I wanted to create something easier that just works. It may turn out to be impossible without rewriting MPR
Having quadrants wouldn't be impossible, but I don't have the needed information yet.Tethys wrote:Would it be possible to create a zoomable under/overlay for the galactic map?
You're saying you want energy structures (other than scanners) to be upgradeable like standard manned structures? I can see how that would be useful. I would have thought it'd be in edifice.bst. Have you tried editing different building parameters like GROUP? I'll take a look into the code if it's confirmed that there's nothing in edifice.bst that controls this. Maybe DCER would know more about it.thunderchero wrote:I would like for structures when set to upgrade an older structure it replaces the older structure instead of having both of them.
I'm thinking aiempire.wtf. Ideas anyone?xDx wrote:I would like to see AI empires able to be set at different diplomatic stances for beginning game.
Tethys wrote:could you find a way to keep empire borders unlocked after signing a non aggression treaty?
Thanks SCT, that takes a load off Seems like we're already making progress.Spocks-cuddly-tribble wrote:That's easy via empsInfo or sector.lst. Code locations are known from ferengi trade route code & territorial claims -projects.
- QuasarDonkey
- Code Analyst
- Posts: 433
- Joined: Tue Jul 26, 2011 8:29 pm
- Location: Ireland
Re: Standard Trek.exe IDA Database
Update on the lower-CPU patch:
As as test, I changed 2 calls to sleep(0) to sleep(10) with no noticeable decrease in performance. On the opening, diplomacy, and intelligence screens, CPU usage is < 10% when idle versus 100% with the vanilla trek.exe. Moving the mouse makes CPU usage spike. CPU goes to 100% when moving the mouse on the main galactic map, but falls slightly when not moving (well I have a pretty slow computer, so it'd be better on new machines). I'll continue fiddling with the different calls to sleep() to try find optimal values.
This may actually be a bug in BotF, depending on how you look at it. There's no reason why any program should run at 100% CPU when doing nothing. When I get the patch done, BotF will only use as much CPU as it needs, when it needs it. This should allow for cooler CPUs and lower electricity bills
As as test, I changed 2 calls to sleep(0) to sleep(10) with no noticeable decrease in performance. On the opening, diplomacy, and intelligence screens, CPU usage is < 10% when idle versus 100% with the vanilla trek.exe. Moving the mouse makes CPU usage spike. CPU goes to 100% when moving the mouse on the main galactic map, but falls slightly when not moving (well I have a pretty slow computer, so it'd be better on new machines). I'll continue fiddling with the different calls to sleep() to try find optimal values.
This may actually be a bug in BotF, depending on how you look at it. There's no reason why any program should run at 100% CPU when doing nothing. When I get the patch done, BotF will only use as much CPU as it needs, when it needs it. This should allow for cooler CPUs and lower electricity bills
- thunderchero
- Site Administrator aka Fleet Admiral
- Posts: 7852
- Joined: Fri Apr 25, 2008 2:00 am
- Location: On a three month training mission, in command of the USS Valiant.
Re: Standard Trek.exe IDA Database
I have tested many of the used and unused code (up to 29) from DCER edifice.bst list below with no success.QuasarDonkey wrote:You're saying you want energy structures (other than scanners) to be upgradeable like standard manned structures? I can see how that would be useful. I would have thought it'd be in edifice.bst. Have you tried editing different building parameters like GROUP? I'll take a look into the code if it's confirmed that there's nothing in edifice.bst that controls this. Maybe DCER would know more about it.thunderchero wrote:I would like for structures when set to upgrade an older structure it replaces the older structure instead of having both of them.
even changing scanner output type seems to break upgrade code so I think it might be linked to output type in trek.exe.
Offset 0x0074 to 0x0074 group
Values:
00 - Main Cardassian food
01 - Main Federation food
02 - Main Ferengi food
03 - Main Klingon food
04 - Main Romulan food
06 - Main Cardassian industry
07 - Main Federation industry
08 - Main Ferengi industry
09 - Main Klingon industry
0A - Main Romulan industry
0C - Main Cardassian energy
0D - Main Federation energy
0E - Main Ferengi energy
0F - Main Klingon energy
10 - Main Romulan energy
12 - Main Cardassian intel
13 - Main Federation intel
14 - Main Ferengi intel
15 - Main Klingon intel
16 - Main Romulan intel
18 - Main Cardassian research
19 - Main Federation research
1A - Main Ferengi research
1B - Main Klingon research
1C - Main Romulan research
1E - Scanners
22 - Other
thunderchero
- Flocke
- BORG Trouble Maker
- Posts: 3197
- Joined: Sun Apr 27, 2008 2:00 am
- Location: Hamburg, Germany
- Contact:
Re: Standard Trek.exe IDA Database
Ah, you want to lower energy consumtion by it.QuasarDonkey wrote:Update on the lower-CPU patch:
As as test, I changed 2 calls to sleep(0) to sleep(10) with no noticeable decrease in performance. On the opening, diplomacy, and intelligence screens, CPU usage is < 10% when idle versus 100% with the vanilla trek.exe. Moving the mouse makes CPU usage spike. CPU goes to 100% when moving the mouse on the main galactic map, but falls slightly when not moving (well I have a pretty slow computer, so it'd be better on new machines). I'll continue fiddling with the different calls to sleep() to try find optimal values.
This may actually be a bug in BotF, depending on how you look at it. There's no reason why any program should run at 100% CPU when doing nothing. When I get the patch done, BotF will only use as much CPU as it needs, when it needs it. This should allow for cooler CPUs and lower electricity bills
Well, as you said, the sleep call is very unreliable and can vary - it's variation is also operation system specific. That's especially an issue for 3D rendering cause it can result in noticable hiccups, so it's not a bug in BotF.
Sleep(0) is a special sleep call that immediatly returns when there are no other applications waiting in the operation system's process cycle, and is often used to get the highest fps possible out of windows, while still not blocking other applications.
But if you codecave it to a dll, using 'WaitableTimer' is a better alternative to the sleep call, it has a higher resolution.
I already implemented that approach, refer to KSystem::wait, you know where to find.
- thunderchero
- Site Administrator aka Fleet Admiral
- Posts: 7852
- Joined: Fri Apr 25, 2008 2:00 am
- Location: On a three month training mission, in command of the USS Valiant.
Re: Standard Trek.exe IDA Database
here is a suggestion that might be a little easier.
Gowron has been able to edit some code to allow tech level multipliers for food, industry, and enegry
viewtopic.php?f=9&t=238&p=2834&hilit=Te ... db2b#p2834
I looked at Assembly code only, but when looking at this I saw this sub 461930 This sub has "the Cardassian bonus for manned intel" as well as the 3 above. But has others I do not know what they are for but look very similar.
viewtopic.php?f=9&t=761&p=10388&hilit=t ... b2b#p10388
It would be nice to have tech level multipliers for all 5 main building types.
thunderchero
Gowron has been able to edit some code to allow tech level multipliers for food, industry, and enegry
viewtopic.php?f=9&t=238&p=2834&hilit=Te ... db2b#p2834
I looked at Assembly code only, but when looking at this I saw this sub 461930 This sub has "the Cardassian bonus for manned intel" as well as the 3 above. But has others I do not know what they are for but look very similar.
viewtopic.php?f=9&t=761&p=10388&hilit=t ... b2b#p10388
It would be nice to have tech level multipliers for all 5 main building types.
thunderchero