UE Map Editor

Ultimate Editor; support/discussion/questions

Moderator: thunderchero

User avatar
Flocke
BORG Trouble Maker
BORG Trouble Maker
Posts: 3258
Joined: Sun Apr 27, 2008 2:00 am
Location: Hamburg, Germany
Contact:

Re: UE Map Editor

Post by Flocke »

Spocks-cuddly-tribble wrote: Fri Mar 31, 2023 2:12 pm Even if the EDO are part of a player empire and not AI, there still might be a connection with one-per-empire structures and your wonder build order type 8?
I have no clue, but it doesn't matter for when I remove a system. I just update the system id of all the wonder build orders present, and remove those with a matching id. :roll:
User avatar
Flocke
BORG Trouble Maker
BORG Trouble Maker
Posts: 3258
Joined: Sun Apr 27, 2008 2:00 am
Location: Hamburg, Germany
Contact:

Re: UE Map Editor

Post by Flocke »

thunderchero wrote: Mon Mar 27, 2023 9:00 pm 2. did adding ships on different resolution get put on back burner?
While refactoring the code, I found a Bug with one Talarian ship image in Vanilla 1366x768 :eek:
incompatible_talarian.jpg
incompatible_talarian.jpg (11.33 KiB) Viewed 3364 times
I'm still working on it, so you have to wait one more week I guess.
User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 7960
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.

Re: UE Map Editor

Post by thunderchero »

Flocke wrote: Sun Apr 23, 2023 6:44 pm
thunderchero wrote: Mon Mar 27, 2023 9:00 pm 2. did adding ships on different resolution get put on back burner?
While refactoring the code, I found a Bug with one Talarian ship image in Vanilla 1366x768 :eek:
Image

I'm still working on it, so you have to wait one more week I guess.
no problem with recent report of other files needed for UM5 waiting 1 more week or more would be a good idea

as for Talarian ship image i_m10170.tga will be fixed in update also
it took me a few to realize issue was the "improved" build images option not the original image.

just on a side note integrity check also flag that issue on that image, as well as 3 other vanilla image wrong size
Info: in edifice.bst: Image size 270x226 of Cun_b.tga deviates from default 270x225 pixels.
Info: in edifice.bst: Image size 270x226 of Fun_b.tga deviates from default 270x225 pixels.
Info: in race.rst: Image size 159x170 of antidean.tga deviates from default 160x170 pixels.

UM5 latest issue make me ask about different resolutions for structures?
should UE also check this during integrity check?
User avatar
Flocke
BORG Trouble Maker
BORG Trouble Maker
Posts: 3258
Joined: Sun Apr 27, 2008 2:00 am
Location: Hamburg, Germany
Contact:

Re: UE Map Editor

Post by Flocke »

thunderchero wrote: Mon Mar 27, 2023 9:00 pm but will note in "Add and remove ship models"
1. MUM uses the "TMP" slot for almost 50% of it's models. would there be any way to read shiplist (prefix of ship) instead of phaser slots? example if no dedicated slot use TMP slot for phaser data.
I didn't want to, but with the broken export reported by Benman2785 in viewtopic.php?p=59034#p59034 I had to revisit and investigate the complete ship model import / export.

And while I cleaned up the code and fixed a bunch of issues, I couldn't stop myself but also implemented the requested TMP slot support. :lol:
To get this work, I implemented a new ship model search routine, that both searches for available model HOBs and in addition also for TGA files using some pattern matching. I'm amazed how many unused hidden ships there are included with mods. :grin:
thunderchero wrote: Mon Mar 27, 2023 9:00 pm 2. did adding ships on different resolution get put on back burner?
Ah well, I already mentioned it somewhere, but to give some more details, by default now all the ship images are detected by the WDF image name selectores stored in trek.exe I identified for each of the views.
Given another request, I however also implemented to optionally search and import matching images by a pattern matching algorithm. That one checks used image prefixes "i_", file name length (max 12), model name length (max 3) and non-zero leading number suffix if not "w".

Given that many mods sadly use numbers for the model names, there sadly are some potential false positives or even conflicts. E.g. ship model "m" and "m1" could both be referencing texture "i_m160.tga". Which one is correct, on bad luck both are.
Most of the time this however won't be much of an issue, you just get some redundant image copies. :wink:
thunderchero wrote: Sun Apr 23, 2023 8:50 pm UM5 latest issue make me ask about different resolutions for structures?
should UE also check this during integrity check?
I had to check on it again, but I implemented this one as well. All the edifice.bst structures are checked for missing images and wrong image sizes, with requirements loaded from WDF files and image name patterns read from trek.exe, similar to the ship models.
:cool:
User avatar
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 1955
Joined: Sun Apr 27, 2008 2:00 am

--- result.lst / ordInfo ---

Post by Spocks-cuddly-tribble »

Flocke wrote: Thu May 20, 2021 12:36 pm
0x00-0x03 resultId:     incremented unique result number, starting at different offsets for the races:
                          card: 01 00 00 00 (little endian) = 1
                          fed:  AA AA AA 2A (little endian) = max_uint * 1/6
                          ferg: 55 55 55 55 (little endian) = max_uint * 2/6
                          klng: FF FF FF 7F (little endian) = max_uint * 3/6
                          rom:  AA AA AA AA (little endian) = max_uint * 4/6
                          max_uint (unsigned) = 0xFFFFFFFF = 4294967295 decimal
                          The klingon 0x8000004D here ofc flipped all F when it reached 0x80000000.
Hi Flocke, could the klingon value cause bugs with the result.list? viewtopic.php?p=60642#p60642

And if so, can we change the defaults in loc_459410 result_lst_defaults to fix this (same for ordInfo loc_457E00) ?

They use 'lea new, [old+1]' for the next number, but a simple 'inc' for the global count.
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: 3258
Joined: Sun Apr 27, 2008 2:00 am
Location: Hamburg, Germany
Contact:

Re: --- result.lst / ordInfo ---

Post by Flocke »

Spocks-cuddly-tribble wrote: Tue Oct 31, 2023 4:03 pm Hi Flocke, could the klingon value cause bugs with the result.list? viewtopic.php?p=60642#p60642
No, already the first increment switches the F digits, so if it caused issues, it already should happen very early and after the jump over possibly stop.

The default value should only be used for initialization. Furthermore the number is only used as an identifier, and therefore just needs to be unique.
If there was any issue, it would equally affect any result message and be much more noticable. Once it goes out of sync, any event of same race should be affected.
User avatar
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 1955
Joined: Sun Apr 27, 2008 2:00 am

Re: UE Map Editor

Post by Spocks-cuddly-tribble »

Thanks, I see, I misread the redundant comment about flipping all F :wink: -> 0x7FFFFFFF + 1 = 0x80000000
I don't know how many bugs is too many but that point is reached somewhere before however many in BotF is.
User avatar
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 1955
Joined: Sun Apr 27, 2008 2:00 am

Re: UE Map Editor

Post by Spocks-cuddly-tribble »

Hi Flocke, I hope you're doing well. Some additions/corrections:
Flocke wrote: Thu May 20, 2021 12:36 pm--- treaty file ---
0x30-0x33: treatyType (1:peace 2:alliance 3:war pact 4:accepted demand 5:friendship 6:affiliation 7:membership 8:gift)
0x70-0x71: targetRaceId (for war pact, else -1)
treatyType 9 = Bribe aka request to minor race to terminate treaty with empire targetRaceId X (can be combined with credit offer)
treatyType 4 is for every demand (credits & contested territory claims), not only accepted ones
AI_Diplomacy.png
AI_Diplomacy.png (44.77 KiB) Viewed 2847 times
Flocke wrote: Thu May 20, 2021 12:36 pm--- GTForceList/GWTForce ---
ability mask 0x0008 (08 00) = ?? never seen used
sub_4485D8 SetTaskForceAbilities -> see IDA: https://workupload.com/file/4yVDdUwcf7T

Indicates at least one ship has zero hull points in GShipList (possible due to vanilla bugs e.g. orbital batteries and neutron stars).
For an unused feature I guess (TF features crippled, repair, forced scrap?)

Also @ +50 -> greatest colony ship production value, so your 'contains colony ships' = 1 doesn't work for patches (but greater null will).
+44 = colony ship ID with greatest production value (vanilla different values possible due to missed upgrade bug) Both values should be unused by default.

Using the info I implemented a workaround for a TF NULL crash problem due an unknown AI colony ship task issue in one of my patches.
00448D7E     8078 50 01     CMP BYTE PTR DS:[EAX+50],1  // greatest colony ship production value
00448D82     7D 5B          JGE SHORT 448DDF     //  contains colony ships
It won't relocate stranded fleets containing colony ships anymore, but better than sporadic crashes or no patch: viewtopic.php?p=57729#p57729


More than that I fixed an annoying bug with AI fleets keeping old/bad stats after re-deploying. Limping with speed 1 (and/or short range) to the next staging point after some tasks can cause massive delays between the AI fleet tasks (worse in larger maps). :dwn:

Example for the vanilla AI Fleets glitch (note wrong speed 1, TT with scout scan value and scout with med range):
AI_Fleets_Glitch.png
AI_Fleets_Glitch.png (52.59 KiB) Viewed 2952 times
► Show Spoiler

Also upcoming:

- Disable AI Fleet Buildup Support Limit in Peacetime for Affluent AIs
-> Fed AI with 1.5+ Mio. credits but -3k income (without AI cheats) stopped after only 3 Defiants in one of my test games :dwn:
► Show Spoiler
- AI Rejecting Alliance Fix to allow Domination team Victory -> Example for the issue: viewtopic.php?p=57051#p57051
-> this one was tricky, default requires 20+ 'Good' special events (my klingons have only 6 with the feds in below pic):
map_ai_data_types_E_F_12.png
map_ai_data_types_E_F_12.png (11.58 KiB) Viewed 2952 times
► Show Spoiler
► Show Spoiler
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: 3258
Joined: Sun Apr 27, 2008 2:00 am
Location: Hamburg, Germany
Contact:

Re: UE Map Editor

Post by Flocke »

I totally missed to answer above posting. Been a stressful time when last year ended.
Spocks-cuddly-tribble wrote: Sat Nov 18, 2023 12:16 am treatyType 9 = Bribe aka request to minor race to terminate treaty with empire targetRaceId X (can be combined with credit offer)
treatyType 4 is for every demand (credits & contested territory claims), not only accepted ones
updated
Spocks-cuddly-tribble wrote: Sat Nov 18, 2023 12:16 am sub_4485D8 SetTaskForceAbilities -> see IDA: https://workupload.com/file/4yVDdUwcf7T

Indicates at least one ship has zero hull points in GShipList (possible due to vanilla bugs e.g. orbital batteries and neutron stars).
For an unused feature I guess (TF features crippled, repair, forced scrap?)
added
Spocks-cuddly-tribble wrote: Sat Nov 18, 2023 12:16 am Also @ +50 -> greatest colony ship production value, so your 'contains colony ships' = 1 doesn't work for patches (but greater null will).
That is long fixed, what location did I miss?
Spocks-cuddly-tribble wrote: Sat Nov 18, 2023 12:16 am +44 = colony ship ID with greatest production value (vanilla different values possible due to missed upgrade bug) Both values should be unused by default.
updated
Spocks-cuddly-tribble wrote: Sat Nov 18, 2023 12:16 am AI Fleets with wrong Speed/Range after redeploy (Fix)
for UE I only accept valid and reproducable save uploads :lol:

Nice proggress on the patches and thx for the updates! :up:
User avatar
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 1955
Joined: Sun Apr 27, 2008 2:00 am

Re: UE Map Editor

Post by Spocks-cuddly-tribble »

Flocke wrote: Sat Mar 09, 2024 9:57 am
Spocks-cuddly-tribble wrote: Sat Nov 18, 2023 12:16 am Also @ +50 -> greatest colony ship production value, so your 'contains colony ships' = 1 doesn't work for patches (but greater null will).
That is long fixed, what location did I miss?
Just from the wiki, if UE already sets 'greatest colony ship production value in the fleet' (not always 1 if CS), then you're fine.
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: 3258
Joined: Sun Apr 27, 2008 2:00 am
Location: Hamburg, Germany
Contact:

Re: UE Map Editor

Post by Flocke »

Spocks-cuddly-tribble wrote: Sat Mar 09, 2024 1:09 pm Just from the wiki, if UE already sets 'greatest colony ship production value in the fleet' (not always 1 if CS), then you're fine.
Flocke wrote: Thu Jan 05, 2023 9:38 am The wiki on the other hand I don't care on for now. There is too much waiting for update and given the little usage I rather move the info to AFC at some point, or I set up a new wiki..
I see, at some point I need to update it again. Maintaining a wiki for so little use however is not much reasonable. :lol:
For now I have better to do.
User avatar
Flocke
BORG Trouble Maker
BORG Trouble Maker
Posts: 3258
Joined: Sun Apr 27, 2008 2:00 am
Location: Hamburg, Germany
Contact:

Re: UE Map Editor

Post by Flocke »

thunderchero wrote: Sun May 08, 2022 9:08 pm with latest version of UE I attempted to switch to single player game and switch race and got crash on game load.
I duplicated this issue for testing, using latest download "modded_save_detection"

saved game feds (host) cards (join)
save 2 feds MP game save
save 3 sp feds (UE saved) no issues
save 4 sp fer (UE saved) crash turn 2 with error log
File: ..\..\source\game\ship.c, Line: 968, taskForce != NULL

MUM 1366 beta version 4 (not released yet)
That save games tempt to crash when you switch AI with player race I think is nothing new, given that the AI is not removed but keeps messing with the player race.

I however went into analysing this turn 11 game some little and managed to fix 2nd turn crash. Now it crashes when ending turn 53 instead with:
Ausnahmecode: 0xc0000005
Fehleroffset: 0x00005f60

But it is progress and with further analysis and testing might be possible to fix.

The cause to 2nd turn crash was that the Ferengi AI in some routine fails to lookup task force 00 01 00 00 with the two transports 41 00 and 42 00 that build a starbase in Ferenginar. When resetting the AIShpUnt task and TskSh60, the AI skips to mess with the task force and you get to turn 53.
resetAITask.jpg
resetAITask.jpg (163.46 KiB) Viewed 221 times
I added two new task force map menu options to either reset or completely remove AI tasks.
The cleanup options also allow to remove all ship AI tasks, but that only delayed above 0x00005f60 crash a few more turns.

Removing the task force instead, it crashes at turn 51 with same old taskForce != NULL error.
This however misses to remove AI task 3C 00 (tsksh60, aitask98, tsksy60.cnt, tsksy60, tsksh60.cnt) and update AgtTk1 for the removed AI task.
An optimization implemented for the player race in UE, so no surprise.

Having first reset AI ship tasks and then removed the task force, it now crashed ending turn 54. Again with:
Ausnahmecode: 0xc0000005
Fehleroffset: 0x00005f60

Think I will try some integrity check to remove all player AI tasks next. Including non task force related ones.

Edit: Wait, we have the map cleanup options. When I remove all AI ship tasks it fixes above turn 53 crash and I managed to play up to turn 74 before it crashed with same offset error again. :lol:
Same like turn 53 crash it can't be continued without removing the AI ahip tasks again. Next it crashed ending turn 81, and guess what, same error again.

Edit2: Ok, the second crash is caused either by the Romulans meeting the Terran empire, or by the Klingons meeting the Cardassians. This is a bug I can't fix in UE in reasonable time. I'd first have to figure how to add a whole AI agent back.
But I'll improve integrity checks and task force removal to at least address the taskForce != NULL crash.
Last edited by Flocke on Sun Mar 10, 2024 3:51 pm, edited 2 times in total.
User avatar
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 1955
Joined: Sun Apr 27, 2008 2:00 am

Re: UE Map Editor

Post by Spocks-cuddly-tribble »

Just tell them to use one of the two methods to switch the player empire: viewtopic.php?p=57851#p57851 (instead of UE) :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
Flocke
BORG Trouble Maker
BORG Trouble Maker
Posts: 3258
Joined: Sun Apr 27, 2008 2:00 am
Location: Hamburg, Germany
Contact:

Re: UE Map Editor

Post by Flocke »

Spocks-cuddly-tribble wrote: Sun Mar 10, 2024 3:47 pm Just tell them to use one of the two methods to switch the player empire: viewtopic.php?p=57851#p57851 (instead of UE) :wink:
Yes will do. :lol:

Same issue however bugged me before when I tried to investigate some MP savegames. And I refuse to install any patches for this.
Given I already had AI cleanup routines in place for ship removal and stuff, I at least needed to check on what can be done. :)
User avatar
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 1955
Joined: Sun Apr 27, 2008 2:00 am

Re: UE Map Editor

Post by Spocks-cuddly-tribble »

It might help to look at the BotF player/AI takeover codes:

sub_43A200 player_takeover_empire_AL (ex-AI)
sub_43A160 AI_takeover_empire_AL (ex-player)

Related to our other conversation:
43A1D2 mov dword [eax+54h], 0 ; ?(mislabeled as numWayPoints) zero for all ex-player fleets now AI (ex-AI to player keep entry)
I don't know how many bugs is too many but that point is reached somewhere before however many in BotF is.
Post Reply

Return to “Ultimate Editor”