(Download) ST:BotF Galaxies MOD v0.3.0a

Galaxies MOD; showcase and support/discussion/questions/suggestions/reviews

Moderator: thunderchero

User avatar
Tethys
Past Administrator
Past Administrator
Posts: 2104
Joined: Fri Jul 18, 2008 2:00 am
Location: Your mom's bed ;)
Contact:

Re: (Download) ST:BotF Galaxies MOD v0.3.0a

Post by Tethys »

Flocke, Avast has become bloated in recent years, but still works well for me most of the time. Constant hacking of trek.exe however seems to isolate trek.exe from the system while Avast decides it wants to scan it with realtime shields. Solution is to just turn those shields off until you're done trekking around in the exe. I tried to add some screenshots on Drive but they don't seem to work, I'd have to find independent hosting for images.

I recommend starting on T2 (2280) unless you're playing a small or medium galaxy. Stars are spread out more in large galaxy now and you'll need the range to get the more desirable systems.
Not for the weak of heart...
Galaxies MOD v0.3.6a <--- GALM/Galaxies Mod
User avatar
Flocke
BORG Trouble Maker
BORG Trouble Maker
Posts: 2641
Joined: Sun Apr 27, 2008 2:00 am
Location: Hamburg, Germany
Contact:

Re: (Download) ST:BotF Galaxies MOD v0.3.0a

Post by Flocke »

Oh well, I guess Avast is no better option then.

I started to play the Federation with default setting, so tech 2 indeed and medium ring galaxy. Only thing I changed was to enable the vendetta mode like recommended.

What I noticed first is I'm missing more plasma reactors on Sol to enable all energy buildings. But that's fine to me, I got enough power to get the main ones powered.

Second, with Utopia Planitia enabled I guess I'll never do anything other on Sol than to build ships. Well, actually I buy them and still have more income than I could sell.

Third I noticed that from the stats the Destroyer II have way more fire power than any other ship I could build, given it has 16 phaser arrays with 50 damage each, while e.g. the Cruiser Fast just has 12 with 12 damage each.

But this all might be inteded, only the further play time can tell on the balance. :)

edit: one other thing I found is that to get the Galaxies Mod shortcut work, I had to change the dxwnd start params from
C:\botf\tools\dxwnd_windowed\dxwnd.exe /R:11 to C:\botf\tools\dxwnd_windowed\dxwnd.exe /R:13
User avatar
Tethys
Past Administrator
Past Administrator
Posts: 2104
Joined: Fri Jul 18, 2008 2:00 am
Location: Your mom's bed ;)
Contact:

Re: (Download) ST:BotF Galaxies MOD v0.3.0a

Post by Tethys »

Flocke, you are right, the phaser stats are incorrect. I forgot to redo the Feds because I thought they were all set, guess I was wrong. I'll fix it by next release. I believe scrapping a ship will only net the max income of the system, or is disabled but I can't remember tbh. Maintenance cost are supposed to curb large fleets, the solution is to colonize more systems.

Also I found that Scout Exploratory upgrades to both Scout Light and Scout Surveyor so I'll need to fix that as well. I am rearranging the ship list a little bit, so next update iwll be incompatible with any saves unfortunately. Sorry :(

EDIT: I did a quick rework of the Fed shiplist. Keep an eye on how Fed scout class ships upgrade, I've stacked them so newest is always built first, until it is replaced with newer. Some command and destroyer classes are upgrades for some cruisers, this is intentional. Ive fixed the phaser stats, and slightly adjusted accuracy values on early tech ships.

Links updated GALM_0.3.6a
Last edited by Tethys on Wed Mar 31, 2021 1:12 am, edited 1 time in total.
Not for the weak of heart...
Galaxies MOD v0.3.6a <--- GALM/Galaxies Mod
User avatar
Tethys
Past Administrator
Past Administrator
Posts: 2104
Joined: Fri Jul 18, 2008 2:00 am
Location: Your mom's bed ;)
Contact:

Re: (Download) ST:BotF Galaxies MOD v0.3.0a

Post by Tethys »

Updated version GALM 0.3.6a

Fixed Dominion early tech scout ship size. Also, it's entry was not showing in Add/Remove models; fixed that.

Experimental changes: Stellar hobs now use 2 character filenames (solary.hob -> sy.hob). This is for a future feature, I hope to add the first true additional stellar object to BotF (not simply replacing an existing object). Please do report any issues, since ship models also use 1, 2, or 3 character hob filenames I have done my best to avoid conflicts here, as I could not find any hidden/more ship model names that would conflict. (Character limit may change to 4 depending how much space is available for new stellar objects versus if there are issues with the 2 character names)
Not for the weak of heart...
Galaxies MOD v0.3.6a <--- GALM/Galaxies Mod
User avatar
Tethys
Past Administrator
Past Administrator
Posts: 2104
Joined: Fri Jul 18, 2008 2:00 am
Location: Your mom's bed ;)
Contact:

Re: (Download) ST:BotF Galaxies MOD v0.3.0a

Post by Tethys »

Developmental update: Thanks to Thunderchero's helpful debugging and codespace reorganization, I am pleased to report than we have successfully added a 13th stellar object to the game in the form of an Anomaly; and with space for at least one more!.. possibly two more?

The hardest part of this project was shifting 25% of code into align 10h while also condensing whichever E9 jumps to EB jumps could we could, shifting those jumps left and adjusting the offset tables accordingly.. I think it took us about a week to fully integrate, and a special version of UE had to be compiled to read the new object lexicon and give ani/map functionality.

I plan to do this with planets also, if possible, so I am open to planet type suggestions. I was thinking Gas Supergiant, but I keep having this vision where the Bajoran Wormhole actually sits in the Bajor system.. with a traversible endpoint.. At the very least, we may be able to add a research bonus to systems with wormhole "planets", but my aim is to be able to somehow link them to Wormhole anomaly, or other wormhole "planets". The project may take more time than adding new stellar objects, since there is far more involved adding a planet type, and I have not yet even looked at planet generation code. But I expect a similar setup with similar results, so we should net 2-4 new planet types (maybe more if we are clever enough ?)

Tethys
Not for the weak of heart...
Galaxies MOD v0.3.6a <--- GALM/Galaxies Mod
User avatar
Flocke
BORG Trouble Maker
BORG Trouble Maker
Posts: 2641
Joined: Sun Apr 27, 2008 2:00 am
Location: Hamburg, Germany
Contact:

Re: (Download) ST:BotF Galaxies MOD v0.3.0a

Post by Flocke »

congratz to your progress!
Tethys wrote: Wed Apr 07, 2021 1:19 amThe hardest part of this project was shifting 25% of code into align 10h while also condensing whichever E9 jumps to EB jumps could we could, shifting those jumps left and adjusting the offset tables accordingly.
When shifting and compressing the code to free some space becomes too hard, don't forget we can also extend the exe and add another code section to the end of the exe with whatever free code space you need. The only issues I see is compatibility with UE and QD patcher. But both can be resolved for sure.

For UE I think it is a simple size check on trek.exe that needs to be disabled. Possibly there is also some buffer size to calculate from file size in case it is hard-coded.
And for the QD patcher, we'd always have to patch the exe size prior to applying a patch that exceeds the regular exe size. Plus we better maintain a global list of code extension space used to not trouble on conflicts of multiple such patches.
User avatar
Tethys
Past Administrator
Past Administrator
Posts: 2104
Joined: Fri Jul 18, 2008 2:00 am
Location: Your mom's bed ;)
Contact:

Re: (Download) ST:BotF Galaxies MOD v0.3.0a

Post by Tethys »

UE 14 objects
UE.png
UE.png (12.35 KiB) Viewed 327 times
UE1.png
UE1.png (14.75 KiB) Viewed 327 times
Small Galaxy 13 objects
Stellar.png
Stellar.png (380.87 KiB) Viewed 326 times
Not for the weak of heart...
Galaxies MOD v0.3.6a <--- GALM/Galaxies Mod
User avatar
Tethys
Past Administrator
Past Administrator
Posts: 2104
Joined: Fri Jul 18, 2008 2:00 am
Location: Your mom's bed ;)
Contact:

Re: (Download) ST:BotF Galaxies MOD v0.3.0a

Post by Tethys »

Flocke wrote: Wed Apr 07, 2021 5:26 am congratz to your progress!

When shifting and compressing the code to free some space becomes too hard, don't forget we can also extend the exe and add another code section to the end of the exe with whatever free code space you need. The only issues I see is compatibility with UE and QD patcher. But both can be resolved for sure.

For UE I think it is a simple size check on trek.exe that needs to be disabled. Possibly there is also some buffer size to calculate from file size in case it is hard-coded.
And for the QD patcher, we'd always have to patch the exe size prior to applying a patch that exceeds the regular exe size. Plus we better maintain a global list of code extension space used to not trouble on conflicts of multiple such patches.
Sorry for the late reply Flocke, I've been very busy; thank you for the compliments! I did not know the exe itself could be extended ?? This has always been an issue, one that I wasn't aware was solved... We could do alot of things with a few thousand bytes of space. Does anyone know if a long jump (E9) can span the length of the trek.exe?

CANDY!
candy.png
candy.png (31.92 KiB) Viewed 309 times
Not for the weak of heart...
Galaxies MOD v0.3.6a <--- GALM/Galaxies Mod
User avatar
Flocke
BORG Trouble Maker
BORG Trouble Maker
Posts: 2641
Joined: Sun Apr 27, 2008 2:00 am
Location: Hamburg, Germany
Contact:

Re: (Download) ST:BotF Galaxies MOD v0.3.0a

Post by Flocke »

Tethys wrote: Thu Apr 08, 2021 1:35 am Sorry for the late reply Flocke, I've been very busy; thank you for the compliments! I did not know the exe itself could be extended ?? This has always been an issue, one that I wasn't aware was solved... We could do alot of things with a few thousand bytes of space. Does anyone know if a long jump (E9) can span the length of the trek.exe?
I somewhat feared you missed my hint on the unlimited trek.exe container when I messaged you Feb 27 :)

In a side project of mpr++ I figured how to create an exe with the gcc compiler that has exact same code section layout but could be extended by further sections. By that the whole asm or hex code from trek.exe 0x400 to file end simply could be copied over to the new exe and it would work. But while I reported on it and provided details in some modder discussions, I think I never made a public post on it in favor of my other code extension project.

And yes, you simply could use a long jump not only to reach the extended code, but also to call routines from loaded dlls when you figured the offset.
Shame on me, I should have provided more public details on these projects.

I'll see that I provide some details later.
User avatar
Flocke
BORG Trouble Maker
BORG Trouble Maker
Posts: 2641
Joined: Sun Apr 27, 2008 2:00 am
Location: Hamburg, Germany
Contact:

Re: (Download) ST:BotF Galaxies MOD v0.3.0a

Post by Flocke »

I added a summary on what extension approaches I know over here:
viewtopic.php?f=4&t=4038

It should not be too hard to fix the PE header to your needs and add some additional code sections, but you can also choose some other approach ofc.
If you need further details and instructions let me know. ;)
Last edited by Flocke on Fri Apr 09, 2021 2:37 am, edited 1 time in total.
User avatar
Tethys
Past Administrator
Past Administrator
Posts: 2104
Joined: Fri Jul 18, 2008 2:00 am
Location: Your mom's bed ;)
Contact:

Re: (Download) ST:BotF Galaxies MOD v0.3.0a

Post by Tethys »

Thank you for that informative topic Flocke, the process of importing functions into a container does sound intriguing these days. I would probably want to retain as much compatibility with UE and Patcher as possible, as they are both heavily relied upon still in the year 2021. I think having a dll filled with non-editable code.. the underlying stuff that UE doesn't touch.. if enough code can be moved into these containers, the resulting null exe space could then be used to write some editable code (as was done with stellar project). I assume a dll can be any size yes? So one container can be for critical (non-editable) "vanilla" code (whatever that may be), and one container for separate non editable projects (such as jump switches, corresponding tables, stuff like that). Patcher I fear would be difficult to save in this case; it would be a shame to lose such a useful tool. It could still work, but container based mods would likely see a high volume of incompatibility wrt to the patches themselves, and it would be very unwise to try to install or uninstall ANY patches without knowing if they would overwrite a container call or some other important or supporting function. I am looking forward to trying this out in the near future :)
Not for the weak of heart...
Galaxies MOD v0.3.6a <--- GALM/Galaxies Mod
User avatar
Flocke
BORG Trouble Maker
BORG Trouble Maker
Posts: 2641
Joined: Sun Apr 27, 2008 2:00 am
Location: Hamburg, Germany
Contact:

Re: (Download) ST:BotF Galaxies MOD v0.3.0a

Post by Flocke »

Edit2: see post below, there actually is no need to move any code cause trek.exe left enough empty space to add another 10 sections!
free_sections.jpg
free_sections.jpg (149.11 KiB) Viewed 252 times
------------
Tethys wrote: Fri Apr 09, 2021 12:27 amI would probably want to retain as much compatibility with UE and Patcher as possible, as they are both heavily relied upon still in the year 2021.
I bet you do! Well, beside moving all the code when you add another section, you probably just can move or shrink first section as well. The rest of the code then still can be patched as usual. Ofc this needs to be tested.
Tethys wrote: Fri Apr 09, 2021 12:27 amI think having a dll filled with non-editable code.. the underlying stuff that UE doesn't touch.. if enough code can be moved into these containers, the resulting null exe space could then be used to write some editable code (as was done with stellar project).
Sure you can move code around as well to free the needed file space for extending the section header. That likely is the best option indeed. Move first whole section or just some portion of it. I havn't looked what it actually contains, but as long as you patch all code references and all callls and jumps, this should be fine. No need to mess with dlls here, just move it to the beginning of the new coding space.
Tethys wrote: Fri Apr 09, 2021 12:27 amI assume a dll can be any size yes?
Well, quite, as long you don't break the memory and 32bit allocation boundaries - well, subtract that the app is not large address aware and also needs memory itself. But like mentioned, no need to mess with dlls here.
Tethys wrote: Fri Apr 09, 2021 12:27 amSo one container can be for critical (non-editable) "vanilla" code (whatever that may be), and one container for separate non editable projects (such as jump switches, corresponding tables, stuff like that).
You will want to have sections for executable code and for data you operate on, but you are free to add as many you like. But you better avoid to move too much code. An option here also is to split some section and just adjust the virtual address of the section header, so the split section is loaded to exactly where the code has been located before once the app is loaded. That way I guess you can avoid to patch the code even on cross section near jumps. All that counts is where the sections are loaded in the virtual memory space.
The only issue I see is memory alignment. Sections always include some alignment at the end of the section and possibly can't be loaded to not aligned locations. Not sure what alignment it needs but sections may not overlap so you possibly are forced to move some code that locates at the cut.

Edit: Re-viewing my ld linker script I attached, I found a note on that "to match the virtual memory pages, sections are aligned to 0x1000 (4KB)".
Further, checking with ida and CFF Explorer, the first section indeed is the large 'AUTO' section containing all the executable code. So this one needs to be shrinked possibly moving some leading code to a new section:
trek_sections.jpg
trek_sections.jpg (136.69 KiB) Viewed 269 times
Tethys wrote: Fri Apr 09, 2021 12:27 amPatcher I fear would be difficult to save in this case; it would be a shame to lose such a useful tool. It could still work, but container based mods would likely see a high volume of incompatibility wrt to the patches themselves, and it would be very unwise to try to install or uninstall ANY patches without knowing if they would overwrite a container call or some other important or supporting function.
Yep indeed, but if other approaches don't work, you still can workaround by copying the code around when you need to apply a patch.
But yes with above we have better options here. :up:

p.s. these both posts make a good addition to above topic, so to my feeling they are better be moved ;)
Edit2: a bit much mess now to move these posts, I better add some clean info..
Last edited by Flocke on Fri Apr 09, 2021 8:12 am, edited 2 times in total.
User avatar
Flocke
BORG Trouble Maker
BORG Trouble Maker
Posts: 2641
Joined: Sun Apr 27, 2008 2:00 am
Location: Hamburg, Germany
Contact:

Re: (Download) ST:BotF Galaxies MOD v0.3.0a

Post by Flocke »

Edit4: Scrap what I posted on moving the sections. Investigating my files I found that this is a non-issue cause trek.exe left enough empty space from 0x268 hex file offset to 0x400 to add another 10 sections without having to move any code! :grin:

-----

My first try to free the needed space would be to
  • move all before sub_401EF0, so sub_401000 to sub_401DE0, to a new section that loads to 401000 like before
  • add another section that I move sub_401EF0 to, which overlaps the virtual memory page alignment
  • patch the single caller reference for it:
    sub_401EF0.jpg
    sub_401EF0.jpg (57.7 KiB) Viewed 268 times
  • cut the leading AUTO section by 1000 (4KB hex notation)
  • extend the section table to list the new sections

If then the application still works, you are fine to do further extensions.
File offsets for anything between sub_401000 and sub_402360 then ofc still are broken, so UE and the Patcher tools need to be checked as well.



Edit: Alternatively to separating sub_401EF0, my real first try would be to reduce the section alignment:
section_alignment.jpg
section_alignment.jpg (52.23 KiB) Viewed 265 times
That way you possibly can reduce alot what needs to be moved and patched!

Edit2: Note the MS PE header documentation:
https://docs.microsoft.com/en-us/windows/win32/debug/pe-format wrote:
Offset (PE32/ PE32+)Size (PE32/ PE32+)FieldDescription
32/324SectionAlignmentThe alignment (in bytes) of sections when they are loaded into memory. It must be greater than or equal to FileAlignment. The default is the page size for the architecture.
36/364FileAlignmentThe alignment factor (in bytes) that is used to align the raw data of sections in the image file. The value should be a power of 2 between 512 and 64 K, inclusive. The default is 512. If the SectionAlignment is less than the architecture's page size, then FileAlignment must match SectionAlignment.
According to https://stackoverflow.com/questions/185 ... -alignment windows doesn't allow for section sizes below 4KB, but worth a try though. Possibly they missed the documentation hint that it must match the FileAlignment then.

Edit3: I just gave it a try to change the section alignment, but whatever values I try, I get:
forced_section_alignment.jpg
forced_section_alignment.jpg (22.92 KiB) Viewed 260 times
So you need to stick to the 4KB sections and move conflicting code.
User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 6635
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.
Contact:

Re: (Download) ST:BotF Galaxies MOD v0.3.0a

Post by thunderchero »

Tethys wrote: Fri Apr 09, 2021 12:27 am I think having a dll filled with non-editable code.. the underlying stuff that UE doesn't touch..
problem is what does UE not touch? UE changes so many small locations though out the trek.exe. most of these location are edited without warning of location. Only warning is a message "do you want to update trek.exe"
User avatar
Tethys
Past Administrator
Past Administrator
Posts: 2104
Joined: Fri Jul 18, 2008 2:00 am
Location: Your mom's bed ;)
Contact:

Re: (Download) ST:BotF Galaxies MOD v0.3.0a

Post by Tethys »

thunderchero wrote: Fri Apr 09, 2021 9:46 am problem is what does UE not touch? UE changes so many small locations though out the trek.exe. most of these location are edited without warning of location. Only warning is a message "do you want to update trek.exe"
But as long as the popup does not show, the exe is not written, am I correct? There should not be any little changes here and there without receiving a trek.exe update notification.
Not for the weak of heart...
Galaxies MOD v0.3.6a <--- GALM/Galaxies Mod
Post Reply

Return to “Galaxies MOD”