Ultimate Editor

Ultimate Editor; support/discussion/questions

Moderator: thunderchero

User avatar
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 1929
Joined: Sun Apr 27, 2008 2:00 am

Re: Ultimate Editor

Post by Spocks-cuddly-tribble »

thunderchero wrote: Sat Nov 12, 2022 11:56 pmoriginal race is not controlled by AI (inactive)
Was this ever possible without converting to MP game and doing this (IIRC we failed with a simplifying patch)? viewtopic.php?p=12743#p12743
I don't know how many bugs is too many but that point is reached somewhere before however many in BotF is.
User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 7937
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.

Re: Ultimate Editor

Post by thunderchero »

Spocks-cuddly-tribble wrote: Sun Nov 13, 2022 10:38 am
thunderchero wrote: Sat Nov 12, 2022 11:56 pmoriginal race is not controlled by AI (inactive)
Was this ever possible without converting to MP game and doing this (IIRC we failed with a simplifying patch)? viewtopic.php?p=12743#p12743
correct UE has never been able to switch races properly.

the only switch I know of that worked properly was, single player game -> multiplayer game (loading game changed control of AI -> human player)
User avatar
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 1929
Joined: Sun Apr 27, 2008 2:00 am

Re: Ultimate Editor

Post by Spocks-cuddly-tribble »

thunderchero wrote: Sun Nov 13, 2022 11:30 amthe only switch I know of that worked properly was, single player game -> multiplayer game (loading game changed control of AI -> human player)
Just tested this patch using disabled sub_401080 (DISK_CD_Version_check) with no issues. :wink:

Code: Select all

switching player/AI empires when saving game (disable/unselect F-11 cheat before saving to keep AI empires unknown)

004F003D     E8 3E10F1FF    CALL 401080    manual save -> call new code location - example sub_401080 DISK_CD_Version_check (disabled)

MOV CL,0   -> new player empire
MOV EAX,1
SHL EAX,CL
PUSH EAX
CALL 510BA0
POP EAX
MOV BYTE PTR DS:[5A2B28],AL
MOV BYTE PTR DS:[5A2B2A],CL
CALL 438630
RETN
New player empire must be set in patch code (default cardassians).

For a dynamic patch we could replace the first statement to read strategical timer (options) as new player empire (but will also save the timer setting):

Code: Select all

MOV CL, [5A2B7C]  // gameInfo2A4 Strategical Timer as new player empire
EDIT: We could also change the difficulty level (AI cheats/random events) for a running game:

Code: Select all

before CALL 438630
MOV BYTE PTR DS:[5A2B44],1 (simple - impossible 5) -> -1 deviation later when stored in saved game
I don't know how many bugs is too many but that point is reached somewhere before however many in BotF is.
User avatar
Flocke
BORG Trouble Maker
BORG Trouble Maker
Posts: 3248
Joined: Sun Apr 27, 2008 2:00 am
Location: Hamburg, Germany
Contact:

Re: Ultimate Editor

Post by Flocke »

thunderchero wrote: Sat Nov 12, 2022 11:56 pm You may have not been aware UE has issues switching races
new race is still controlled by AI, original race is not controlled by AI (inactive)
thunderchero wrote: Sun Nov 13, 2022 11:30 am correct UE has never been able to switch races properly.
the only switch I know of that worked properly was, single player game -> multiplayer game (loading game changed control of AI -> human player)
I remember that issue and the multiplayer trick to make the game switch AI control.
Fixing that with UE is rather complicate. When you check the save game documentation, the AI agents consist of many files and not only refer to the race id in multiple locations, but also list systems, ships and tasks and lots of other stuff. Not to mention that the AI files are poorly analysed.
That given an attempt to patch this with UE would be a real hard challenge and is not worth to even try. :sad:

But I'm happy when SCT finds a clever trick to make trek.exe re-assign mismatched AI on game load. :D

Beside of this bug, I completed the SonarQube code cleanup as far I could identify any relevant issues. It's all on SAST_cleanup branch and will be merged to master as soon DCER permits. Included are some data corruption fixes not reported by SonarQube but that I found along refactoring the code, that under some circumstances could corrupt the save games. Therefore please retry with latest code when you still experience any other issues when loading a modified save game.
User avatar
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 1929
Joined: Sun Apr 27, 2008 2:00 am

Re: Ultimate Editor

Post by Spocks-cuddly-tribble »

Flocke wrote: Sun Nov 13, 2022 9:41 pmBut I'm happy when SCT finds a clever trick to make trek.exe re-assign mismatched AI on game load. :D
LoadGame would be VERY complicated without MP workaround, so the SaveGame workaround patch has to do for now. :wink:
Can also be used to reset all AI files (switch to player and back). :idea:

Flocke wrote: Sun Nov 13, 2022 9:41 pmother issues when loading a modified save game.
Not sure you need this for save game editing:
GTForceList/GWTForce [dword +0x54] = num way points (number of green arrows displayed in gridmap) sectors to move destination @ +0x30
I don't know how many bugs is too many but that point is reached somewhere before however many in BotF is.
User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 7937
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.

Re: Ultimate Editor

Post by thunderchero »

thunderchero wrote: Wed Sep 21, 2022 10:29 am
Flocke wrote: Wed Sep 21, 2022 2:59 am Simply don't use that flawed patch. SCT should get arrested for even having made that dreadful suggestion! :P
The martial law ID must not be increased above limit, point!

Doing a patch for this is not worth the trouble. If I do a patch it must work for all the id limited buildings, and it should be forcefully applied to all the mods + vanilla, or at least there must be a serious reason, not just for better human readable sorting of those entries. Move the Tribunal and other limited special buildings to the top and you are fine. :)
I went with option 2
I moved the offending code to relocation table leaving the vanilla code in original location.
UE is happy now
I did not have to re-sort structure list
I will add a note, if martial Law structures moved, manual editing of ID's would be required at x locations.

edit;
here is the patch for MUM if you want it for testing

Code: Select all

NAME: moving matrial law id's
AUTHOR: thunderchero
DESC: This patch moves martial law structures id's at 0x0004c4e6 to relocation table
DESC: patch file name: MUM_martial_law.patch
URL: https://www.armadafleetcommand.com/onscreen/botf/viewtopic.php?p=57328#p57328

# >>  = vanilla/original value

# <<  = new value

>> 0x0004c4e6 83 fe 07 75 27
>> 0x0004c4f0 ec
>> 0x0004c4f6 e6
>> 0x0004c4fc e0
>> 0x0004c4fe 81
>> 0x0004c501 00 74 d9 66 bb
>> 0x0004c507 00 66 3b da 74 d0 eb a9 90 90 90
>> 0x001a0000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>> 0x001a002c 00 00 00 00 00 00 00 00 00
>> 0x001a0036 00 00 00 00 00 00 00 00 00 00 00 00 00 00

<< 0x0004c4e6 e9 15 db 23 00
<< 0x0004c4f0 18
<< 0x0004c4f6 12
<< 0x0004c4fc 0c
<< 0x0004c4fe 83
<< 0x0004c501 74 06 66 83 fa
<< 0x0004c507 75 af b8 01 00 00 00 5f 5e 59 c3
<< 0x001a0000 83 fe 07 0f 85 09 25 dc ff 66 83 fa 1d 0f 84 ca 24 dc ff 66 83 fa 6d 0f 84 c0 24 dc ff 66 83 fa 45 0f 84 b6 24 dc ff 66 81 fa 95
<< 0x001a002c 0f 84 ab 24 dc ff 66 bb bd
<< 0x001a0036 66 3b da 0f 84 9e 24 dc ff e9 74 24 dc ff
when testing/editing MUM, UE would allow me to make change in structures, but when I went to set starting technology I got this exception
The changes could not be applied! Discard changes?

Exception:
ue.exception.SegmentException: Validation error at segment 0x0004C4DD [ martialLawBld3 ]: ♦ Read unknown code modification 'E915DB2300' [hex] ♦ but expected '83FE077527' [hex].
User avatar
ijustwanttodownload
Cadet 1st Year
Cadet 1st Year
Posts: 3
Joined: Tue Sep 18, 2012 5:46 pm

Re: Ultimate Editor

Post by ijustwanttodownload »

Hi,

I have a fresh installed botf from disc and original release 1.02 patch applyed. I was hoping to get round securom using ultimate editor but when i point it at trex.exe it says "unsupported version or not trek.exe"

Any ideas?

Edit: Im on win 7 64bit and apparently restarting securom service no longer works.
User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 7937
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.

Re: Ultimate Editor

Post by thunderchero »

ijustwanttodownload wrote: Fri Nov 25, 2022 7:22 pm I have a fresh installed botf from disc and original release 1.02 patch applyed. I was hoping to get round securom using ultimate editor but when i point it at trex.exe it says "unsupported version or not trek.exe"
UE should support trek.exe from 1.0.2 patch

If it says it is still unsupported 1.0.2 patch was not applied properly.

Note; just tested trek.exe from patch (botf102e.exe form atari) and UE was able to open it.
User avatar
ijustwanttodownload
Cadet 1st Year
Cadet 1st Year
Posts: 3
Joined: Tue Sep 18, 2012 5:46 pm

Re: Ultimate Editor

Post by ijustwanttodownload »

Im certain that the patch is right and i cant see any way it would not install properly. Have you got a link to the atari patch? Ill try reinstalling.
User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 7937
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.

Re: Ultimate Editor

Post by thunderchero »

all of the outdated patches no one uses any more can be found here

https://www.armadafleetcommand.com/get- ... file_id=21
User avatar
ijustwanttodownload
Cadet 1st Year
Cadet 1st Year
Posts: 3
Joined: Tue Sep 18, 2012 5:46 pm

Re: Ultimate Editor

Post by ijustwanttodownload »

Ah right i already have that old files folder. But every patch i have ever tryed installs a modified version of the game. Like your all in one installer, last i tryed which was some years ago, doesnt install the original patch. The game is changed, the AI can hardly play, the ships individual orders turned off, that kind of thing. I wanted the game how i remember it.

Edit: Nvr mind i was wrong about the file names.
User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 7937
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.

Re: Ultimate Editor

Post by thunderchero »

did not want this to get lost in wrong topic

latest MUM release from BOTF_Top_10_mods_2.0.2_Beta 1366 (but any installed res should work on saved game now?)

game10.sav

new code for "Extending System Bonuses & Sun Icons - edifice.bst+71h requirements" is flaged on every system that has Asteroid Belt Dilithium and Asteroid system
viewtopic.php?p=57639#p57639
Image
User avatar
Flocke
BORG Trouble Maker
BORG Trouble Maker
Posts: 3248
Joined: Sun Apr 27, 2008 2:00 am
Location: Hamburg, Germany
Contact:

Re: Ultimate Editor

Post by Flocke »

Spocks-cuddly-tribble wrote: Mon Nov 14, 2022 5:01 pm Not sure you need this for save game editing:
GTForceList/GWTForce [dword +0x54] = num way points (number of green arrows displayed in gridmap) sectors to move destination @ +0x30
It doesn't seem necessary but is a great finding though! :up:

So far I assumed it to be a military order id since it is always same for assigned militar orders at 0x34+0x24 ( viewtopic.php?p=54174#p54174 ), but it isn't unique so I always was in doubt. I'll check on it. The number of way points is a far better explanation. :!:
User avatar
Flocke
BORG Trouble Maker
BORG Trouble Maker
Posts: 3248
Joined: Sun Apr 27, 2008 2:00 am
Location: Hamburg, Germany
Contact:

Re: Ultimate Editor

Post by Flocke »

thunderchero wrote: Tue Nov 15, 2022 8:13 am when testing/editing MUM, UE would allow me to make change in structures, but when I went to set starting technology I got this exception
The changes could not be applied! Discard changes?

Exception:
ue.exception.SegmentException: Validation error at segment 0x0004C4DD [ martialLawBld3 ]: ♦ Read unknown code modification 'E915DB2300' [hex] ♦ but expected '83FE077527' [hex].
I fixed the code to skip some unnecessary conflicting asm validations there. On 'vscode' branch the error doesn't show up anymore, the custom code you relocated to some whole new extension segment however is ignored and needs to be patched manually.

Now if you apply changes in UE the ignored former code section will be patched but the effective ids in new code section are left unchanged!
Given you put a jump statement infront of the MartialLawBld code, the original code is skipped completely. You might have done so with intent to keep it UE compatible, but actually it makes things worse unless we agree to use same new segment location for it with every mod.

From the code changes I'm also not sure why this was needed.
MUM_relocated_MartialLawBld.jpg
MUM_relocated_MartialLawBld.jpg (55.79 KiB) Viewed 789 times
Affected buildings are: 29: Inquisition, 69: Martial Law, 109: Festival of Fun, 149: Police State and 189: Tribunal

Edit: I now remember more about the space issue for unsigned byte comparison and implemented to sneak in and replace this outdated MUM fixture.
There is enough space when reusing the return statement from the preceding routine, and I already implemented an automatic code fixture with UE when the signed building id limits are exceeded. :wink:
User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 7937
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.

Re: Ultimate Editor

Post by thunderchero »

Hi Flocke,

I just downloaded latest "ultimate-editor-vscode" and get this error when loading saved games
error.jpg
error.jpg (30.37 KiB) Viewed 725 times
UE error log

Code: Select all

Ultimate Editor 0.8.1dev - 15.01.2023 (19:47:06)
java.lang.NoSuchMethodError: java.nio.ByteBuffer.position(I)Ljava/nio/ByteBuffer;
	at ue.util.data.MemoryTools.reserve(MemoryTools.java:16)
	at ue.util.stream.StreamTools.reserveBufferSize(StreamTools.java:293)
	at ue.util.stream.StreamTools.readNullTerminatedBotfString(StreamTools.java:250)
	at ue.edit.res.stbof.files.desc.StringFile.load(StringFile.java:32)
	at ue.edit.res.stbof.Stbof.loadFile(Stbof.java:675)
	at ue.edit.common.FileArchive.getInternalFile(FileArchive.java:191)
	at ue.edit.res.stbof.files.desc.DescDataFile.<init>(DescDataFile.java:24)
	at ue.edit.res.stbof.files.rst.RaceRst.<init>(RaceRst.java:28)
	at ue.edit.res.stbof.Stbof.createFile(Stbof.java:767)
	at ue.edit.res.stbof.Stbof.loadFile(Stbof.java:665)
	at ue.edit.common.FileArchive.getInternalFile(FileArchive.java:191)
	at ue.gui.sav.stats.GameStatsPanel.init(GameStatsPanel.java:58)
	at ue.gui.sav.stats.GameStatsPanel.<init>(GameStatsPanel.java:51)
	at ue.gui.sav.stats.GameInfoGUI.<init>(GameInfoGUI.java:85)
	at ue.gui.menu.SavMenu.edit(SavMenu.java:139)
	at ue.gui.common.MainWindow.showEditPanel(MainWindow.java:86)
	at ue.gui.common.MainWindow.updateFileView(MainWindow.java:346)
	at ue.gui.common.MainWindow.openFileImpl(MainWindow.java:316)
	at ue.gui.common.MainWindow.openFile(MainWindow.java:296)
	at ue.gui.menu.MainMenu.onOpen(MainMenu.java:694)
	at ue.gui.menu.MainMenu.actionPerformed(MainMenu.java:283)
Post Reply

Return to “Ultimate Editor”