BotF Startup Codes (Command-line arguments)

Startup Codes (Command-line arguments); support/discussion/questions

Moderator: thunderchero

User avatar
QuasarDonkey
Code Analyst
Code Analyst
Posts: 433
Joined: Tue Jul 26, 2011 8:29 pm
Location: Ireland

BotF Startup Codes (Command-line arguments)

Post by QuasarDonkey »

I was doing some reverse engineering last night on the function that checks cheats in Trek.exe. It seemed a little complex for just checking -Mudd, etc., so I did a bit of investigating. Here's what I found.

Trek.exe can be launched with the following command-line arguments:
-Bones -BorgOff -Gorn -Kirk -Mudd -Picard -L -H -C -D -n -c -i

You all probably know the first few, so here's what the new options do:

-n fiddles with the random number seeding, so you always start off on the same galaxy every time you run BotF with a given StartingSeed.

-L starts BotF with the single player mode disabled, allowing only a network game or load game.

-H starts you in the multiplayer screen (H probably being Host).

-c or -C also takes you to the multiplayer game screen (C probably being client).

-c -i <ipaddress> does the same, but by the looks of the code it should enter the IP address for you (the IP address must be 15 characters, e.g. "-c -i 192.168.001.010"). This option doesn't work properly for me.

-d or -D enables a debugging option, where if you run Trek.exe with a debugger, it will trigger a breakpoint (via int 3) right after BotF has initialized.

I'm particularly interested in the -L option. I've been tracing through the code following this setting, and it seems Trek.exe establishes network connections when using this option. I haven't played multiplayer in a few years, but IIRC you can't resume a saved multiplayer game on the network (correct me if I'm wrong). I *believe* that is what this option is for. If anyone would test this out, it could be quite useful if it works. Just get a multiplayer game working, save it, quit, and then run trek.exe -L, load the game, and see if it lets you resume it as a network game.

The other network options -H, -c, and -c -i, seem kind of pointless to me, but if anyone has any ideas of why they exist, I'd like to hear!

The -n option is interesting. Running with -n will reuse the STARTINGSEED value in stbof.ini for generating new galaxies. So if you like a particular galaxy, you can copy the seed value and start with -n. You can test the option by starting a new game, and then starting another new game with the same options. You will indeed get the same galaxy. Or if you're bored, you can manually set different seeds in stbof.ini, starting at 1 and working up til you find a really nice galaxy (I randomly got a galaxy where I started beside the Zakdorn, but I forgot to copy it, lol). There's only about 4 billion seeds to choose from. 8)

For those of you who don't like command lines (ahem), you can enter the options in a shortcut to Trek.exe.

Regards.
Last edited by QuasarDonkey on Sat Aug 20, 2011 7:21 am, edited 2 times in total.
User avatar
Flocke
BORG Trouble Maker
BORG Trouble Maker
Posts: 3197
Joined: Sun Apr 27, 2008 2:00 am
Location: Hamburg, Germany
Contact:

Re: BotF Startup Codes (Command-line arguments)

Post by Flocke »

the cheat ones were known, yes, -H and -L is used for msn and also warzone multiplayer games, the others I didn't know of yet

regarding multiplayer games, I never had a problem to continue by loading a savegame, neither with LAN games nor Internet games, the only thing that's bugging me is that the transfer is that kinda sloooooooooooooow.
I've also rarely heard problems from others continuing a saved game, only if they tried to use buggy warzone bypass option. :o
User avatar
QuasarDonkey
Code Analyst
Code Analyst
Posts: 433
Joined: Tue Jul 26, 2011 8:29 pm
Location: Ireland

Re: BotF Startup Codes (Command-line arguments)

Post by QuasarDonkey »

Flocke wrote:-H is used for msn and also warzone multiplayer games
I did not know this.
Flocke wrote:I never had a problem to continue by loading a savegame
It seems I was wrong about that, it's been a few years... You were saying it's used for online play? Maybe it could also be used for when you load a saved network game turning it into a single player game. Maybe -L could turn it into back into a net game? I'm totally guessing on this. I did see references to comms/conninit.c subroutines being called from the load screen when this option is on.

I'd be interested to see if the -c and -c -i options have any effects on network play. Anything that would improve networking would be awesome.
Last edited by QuasarDonkey on Sat Aug 20, 2011 7:15 am, edited 1 time in total.
User avatar
Flocke
BORG Trouble Maker
BORG Trouble Maker
Posts: 3197
Joined: Sun Apr 27, 2008 2:00 am
Location: Hamburg, Germany
Contact:

Re: BotF Startup Codes (Command-line arguments)

Post by Flocke »

I edited last post, immediatly remembered on -L after posting, -H ist used when you launch a game yourself, -L is used for clients, maybe also some other options were set, I'm not sure about right now.
User avatar
QuasarDonkey
Code Analyst
Code Analyst
Posts: 433
Joined: Tue Jul 26, 2011 8:29 pm
Location: Ireland

Re: BotF Startup Codes (Command-line arguments)

Post by QuasarDonkey »

Yeah I kinda looked and looked again, and edited my post at the same time, ha.
User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 7851
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.

Re: BotF Startup Codes (Command-line arguments)

Post by thunderchero »

-L is part of registry for direct play

Root: HKLM; Subkey: Software\Microsoft\DirectPlay\Applications\Birth of the Federation; ValueType: string; ValueName: CommandLine; ValueData: -L

I wonder if changing this would have any effect on playing in warzone.

thunderchero
User avatar
SunWuKong
Cadet 1st Year
Cadet 1st Year
Posts: 4
Joined: Tue Oct 18, 2011 4:51 pm

Re: BotF Startup Codes (Command-line arguments)

Post by SunWuKong »

HI QD

I'm familiar with Mudd but what do the other switches do?

-Bones
-BorgOff (might have an idea about this one :)
-Gorn
-Kirk
-Picard

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

Re: BotF Startup Codes (Command-line arguments)

Post by thunderchero »

content page has info on that :wink:


To view intermission scenes, start the game with one

of the following command line parameters:


  • RESULT

    COMMAND LINE PARAMETER


    Alliance formed

    -bones


    Planet destroyed

    -kirk


    Game lost

    -gorn


    Game won

    -picard
thunderchero
User avatar
SunWuKong
Cadet 1st Year
Cadet 1st Year
Posts: 4
Joined: Tue Oct 18, 2011 4:51 pm

Re: BotF Startup Codes (Command-line arguments)

Post by SunWuKong »

Ah, cheers for that - missed the original post.
User avatar
Benman2785
Lieutenant-Commander
Lieutenant-Commander
Posts: 224
Joined: Fri Mar 20, 2009 2:00 am

Re: BotF Startup Codes (Command-line arguments)

Post by Benman2785 »

i want to force -n1705714077 - but it uses different seed
i have to add it to stbof.ini :(
User avatar
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 1884
Joined: Sun Apr 27, 2008 2:00 am

Re: BotF Startup Codes (Command-line arguments)

Post by Spocks-cuddly-tribble »

Benman2785 wrote: Fri Jan 19, 2024 11:31 pmi want to force -n1705714077 - but it uses different seed
i have to add it to stbof.ini :(
Yes, enter/edit the seed in stbof.ini, launch trek.exe with -n and start a new game.
Since you can't combine startup parameters you need save that game and restart trek.exe with -Mudd if you want to use it for diagnostics.

OT: I see your delta wing has many downloads, so people seem to enjoy it very much. :up:
I don't know how many bugs is too many but that point is reached somewhere before however many in BotF is.
User avatar
Benman2785
Lieutenant-Commander
Lieutenant-Commander
Posts: 224
Joined: Fri Mar 20, 2009 2:00 am

Re: BotF Startup Codes (Command-line arguments)

Post by Benman2785 »

ok - i wrote a "launcher" via bat:

Code: Select all

@echo off
title "BotF Launcher"
mode 39,12
cd %~dp0
cls

:no-trek
if exist %trek.exe GOTO choose
echo --------------------------------------
echo -   trek.exe not found by Launcher   -
echo -      ========================      -
echo -   place Launcher in BotF folder    -
echo --------------------------------------
ping localhost -n 6 >NUL
cls
exit

:choose
echo -------------------------------------- 
echo - Star Trek: Birth of the Federation - 
echo -           ---------------          -
echo - 1) play without changes            - 
echo - 2) play with canon starting-seed   - 
echo - 3) play with MUDD (Cheats)         - 
echo - 4) Video: Game won                 - 
echo - 5) Video: Alliances formed         - 
echo - 6) Video: Planet destroyed         - 
echo - 7) Video: Game lost                - 
echo -------------------------------------- 
CHOICE /C 1234567 /M "- Enter your Choice ="

IF ERRORLEVEL 7 GOTO gorn
IF ERRORLEVEL 6 GOTO kirk
IF ERRORLEVEL 5 GOTO bones
IF ERRORLEVEL 4 GOTO picard
IF ERRORLEVEL 3 GOTO mudd 
IF ERRORLEVEL 2 GOTO seed
IF ERRORLEVEL 1 GOTO van

:van
cls
echo --------------------------------------
echo - Star Trek: Birth of the Federation -
echo -           ---------------          -
echo -          no commands added         -
echo --------------------------------------
ping localhost -n 5 >NUL
cd %~dp0
start trek.exe
exit

:seed
cls
echo --------------------------------------
echo - Star Trek: Birth of the Federation -
echo -           ---------------          -
echo -   play with canon starting-seed    -
echo -           ---------------          -
echo -    Car:3 Fed:5 Fer:3 Kli:1 Rom:2   -
echo -    map: irregular, big, many       -
echo --------------------------------------
cd %~dp0
ping localhost -n 8 >NUL
rem adds "STARTINGSEED=1705714077" to stbof.ini
echo STARTINGSEED=1705714077>> stbof.ini
ping localhost -n 2 >NUL
rem notepad stbof.ini
start trek.exe -n
exit

:mudd
cls
echo --------------------------------------
echo - Star Trek: Birth of the Federation -
echo -           ---------------          -
echo - F9  = 100%% Reseach to all          -
echo - F10 = adds 10.000 credits          -
echo - F11 = shows full map               -
echo --------------------------------------
ping localhost -n 5 >NUL
cd %~dp0
start trek.exe -MUDD
exit

:picard
cls
echo --------------------------------------
echo - Star Trek: Birth of the Federation -
echo -           ---------------          -
echo -           Video: Game won          -
echo --------------------------------------
ping localhost -n 5 >NUL
cd %~dp0
start trek.exe -picard
exit

:bones
cls
echo --------------------------------------
echo - Star Trek: Birth of the Federation -
echo -           ---------------          -
echo -      Video: Alliances formed       -
echo --------------------------------------
ping localhost -n 5 >NUL
cd %~dp0
start trek.exe -bones
exit

:kirk
cls
echo --------------------------------------
echo - Star Trek: Birth of the Federation -
echo -           ---------------          -
echo -       Video: Planet destroyed      -
echo --------------------------------------
ping localhost -n 5 >NUL
cd %~dp0
start trek.exe -kirk
exit

:gorn
cls
echo --------------------------------------
echo - Star Trek: Birth of the Federation -
echo -           ---------------          -
echo -           Video: Game lost         -
echo --------------------------------------
ping localhost -n 5 >NUL
cd %~dp0
start trek.exe -gorn
exit
-picard etc dont work for me :/
Last edited by Benman2785 on Tue Jan 23, 2024 7:16 pm, edited 1 time in total.
User avatar
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 1884
Joined: Sun Apr 27, 2008 2:00 am

Re: BotF Startup Codes (Command-line arguments)

Post by Spocks-cuddly-tribble »

Benman2785 wrote: Mon Jan 22, 2024 5:41 pmi wrote a "launcher" via bat
Nice! :up:
Benman2785 wrote: Mon Jan 22, 2024 5:41 pm-picard etc dont work for me :/
You need to start or load a game and end turn. After the battles it will end the game and play the selected video (unless all videos are disabled). :wink:
I don't know how many bugs is too many but that point is reached somewhere before however many in BotF is.
User avatar
Benman2785
Lieutenant-Commander
Lieutenant-Commander
Posts: 224
Joined: Fri Mar 20, 2009 2:00 am

Re: BotF Startup Codes (Command-line arguments)

Post by Benman2785 »

Spocks-cuddly-tribble wrote: Mon Jan 22, 2024 8:43 pm You need to start or load a game and end turn. After the battles it will end the game and play the selected video (unless all videos are disabled). :wink:
this works - nice

here my "better" launcher
EDIT: updated

Code: Select all

@echo off
title "BotF Launcher"
mode 39,12
cd %~dp0
cls

:no-trek
if exist %trek.exe GOTO choose
echo --------------------------------------
echo -   trek.exe not found by Launcher   -
echo -      ========================      -
echo -   place Launcher in BotF folder    -
echo --------------------------------------
ping localhost -n 6 >NUL
cls
exit

:choose
echo -------------------------------------- 
echo - Star Trek: Birth of the Federation - 
echo -           ---------------          -
echo - 1) play without changes            - 
echo - 2) play with canon starting-seed   - 
echo - 3) play with MUDD (Cheats)         - 
echo - 4) Video: Game won                 - 
echo - 5) Video: Alliances formed         - 
echo - 6) Video: Planet destroyed         - 
echo - 7) Video: Game lost                - 
echo -------------------------------------- 
CHOICE /C 1234567 /M "- Enter your Choice ="

IF ERRORLEVEL 7 GOTO gorn
IF ERRORLEVEL 6 GOTO kirk
IF ERRORLEVEL 5 GOTO bones
IF ERRORLEVEL 4 GOTO picard
IF ERRORLEVEL 3 GOTO mudd 
IF ERRORLEVEL 2 GOTO seed
IF ERRORLEVEL 1 GOTO van

:van
cls
echo --------------------------------------
echo - Star Trek: Birth of the Federation -
echo -           ---------------          -
echo -          no commands added         -
echo --------------------------------------
ping localhost -n 5 >NUL
cd %~dp0
start trek.exe
exit

:seed
cls
echo --------------------------------------
echo - Star Trek: Birth of the Federation -
echo -           ---------------          -
echo -   play with canon starting-seed    -
echo -           ---------------          -
echo - adds seed 1705714077 to stbof.ini  -
echo --------------------------------------
cd %~dp0
ping localhost -n 4 >NUL
rem adds "STARTINGSEED=1705714077" to stbof.ini
echo STARTINGSEED=1705714077>> stbof.ini
ping localhost -n 2 >NUL
rem notepad stbof.ini
start trek.exe -n
exit

:mudd
cls
echo --------------------------------------
echo - Star Trek: Birth of the Federation -
echo -           ---------------          -
echo - F9  = 100%% Reseach to all          -
echo - F10 = adds 10.000 credits          -
echo - F11 = shows full map               -
echo --------------------------------------
ping localhost -n 5 >NUL
cd %~dp0
start trek.exe -MUDD
exit

:picard
cls
echo --------------------------------------
echo - Star Trek: Birth of the Federation -
echo -           ---------------          -
echo -           Video: Game won          -
echo --------------------------------------
ping localhost -n 5 >NUL
cd %~dp0
start trek.exe -picard
exit

:bones
cls
echo --------------------------------------
echo - Star Trek: Birth of the Federation -
echo -           ---------------          -
echo -      Video: Alliances formed       -
echo --------------------------------------
ping localhost -n 5 >NUL
cd %~dp0
start trek.exe -bones
exit

:kirk
cls
echo --------------------------------------
echo - Star Trek: Birth of the Federation -
echo -           ---------------          -
echo -       Video: Planet destroyed      -
echo --------------------------------------
ping localhost -n 5 >NUL
cd %~dp0
start trek.exe -kirk
exit

:gorn
cls
echo --------------------------------------
echo - Star Trek: Birth of the Federation -
echo -           ---------------          -
echo -           Video: Game lost         -
echo --------------------------------------
ping localhost -n 5 >NUL
cd %~dp0
start trek.exe -gorn
exit
Last edited by Benman2785 on Tue Jan 23, 2024 6:56 pm, edited 2 times in total.
User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 7851
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.

Re: BotF Startup Codes (Command-line arguments)

Post by thunderchero »

just wondering what makes starting seed "1705714077" cannon?

what was that based on (mod and resolution and map size) these will all effect starting seed :wink:

is your "cannon" map majors only or are minors also in cannon location?

note; if map edited with UE starting seed will not reflect changes
Post Reply

Return to “Startup Codes (Command-line arguments)”