UE Map Editor

Ultimate Editor; support/discussion/questions

Moderator: thunderchero

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

Re: UE Map Editor

Post by Flocke »

I had a look at the treaty file and updated documentation:

--- treaty file ---
hex view width: 116

lists active treaties

0x0-0x3: num treaties
0x4-0x7: next id
[num * treaties]
0x00-0x27: contact race name if player initiated
0x28-0x2B: delay? (1 if waiting on player response, two majors involved, or for gifts to take effect)
0x2C-0x2F: treatyId
0x30-0x33: treatyType (1:peace 2:alliance 3:war pact 4:accepted demand 5:friendship 6:affiliation 7:membership 8:gift)
0x34-0x35: initiator raceId
0x36-0x37: recipient raceId
0x38-0x38: turns (-1 if unlimited)
0x39-0x3B: empty data alignment
0x3C-0x3F: turnStart (first active turn)
0x40-0x43: turnEnd (last active turn)
0x44-0x47: hasGift (0 or 1)
0x48-0x4B: hasDemand (0 or 1)
0x4C-0x4F: hasRepeatedGift (0 or 1)
0x50-0x53: hasRepeatedDemand (0 or 1)
0x54-0x57: credits gift (one time)
0x58-0x5B: credits demand (one time)
0x5C-0x60: cede disputed territories
0x61-0x63: unknown
0x64-0x67: peaceType (for major empires -> 0:non-aggression 1:friendship 2:affiliation)
0x68-0x6B: declareWar? (0 or 1)
0x6C-0x6F: declareWarAsWell? (0 or 1)
0x70-0x71: targetRaceId (for war pact, else -1)
0x72-0x73: empty data alignment
User avatar
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 1883
Joined: Sun Apr 27, 2008 2:00 am

Re: UE Map Editor

Post by Spocks-cuddly-tribble »

- systInfo -
Flocke wrote: Sun Jun 06, 2021 1:35 pm
0x94-0x97 1stBldOrd:   first slot build order type, see bldOrd (new)
0x98-0x99 1st inv:     first slot invested industry (new)
0x9A-0x9B 1st unTrn:   first slot unrest turn (new)
0x9C-0x9D 1st cBldT:   first slot current build structure type (new)
0x9E-0x9F 1st uBldT:   first slot upgrade build structure type (new)
0xA0-0xA3 1stBldCost:  first slot upgradetotal build cost (new)
0xA4-0xA5 1st shpT:    first slot ship type under constuction (new)
0xA6-0xA7 addrPrdQGui: address of player production queue
0xA8-0xAF addrStrcInf: address of strcInfo
0xB0-0xB4 addrPlntLst: address of the planet entries
0xB5-0xB7 addrPlntSpc: address of the planet specials array (new)
                         - unused and always zeroed
                         - in asm code points to an unknown data array of numPlanets * 0x4 bytes,
                           refer systInfo data @ 004379BA load game / @ 00437720 save game
                         - data is written to the save games, but likely garbage, @see planet specials
0xB8-0xBB addrSysSpc:  address of the system specials array (new)
                         - unused and always zeroed
                         - in asm code points to an unknown data array of numSpecials * 0x40 bytes,
                           refer systInfo data @ 004379CC load game / @ 0043777A save game
                         - has no data written to the save games
                         - SCT: Unfinished GUI code implies it was meant for a none-planet system
                           features array, like: asteroid, -belt... (cf. edifice.bst). But only the
                           workaround of the small dilithium icon above sun animation made it into game.
0xBC-0xBF maxPop:      max population * 10 (for a feature of edifice.bst+7A)

0x80-0x93 / 0x94-A7 = GUI preview / effective MODE (same as other areas in systInfo and empsInfo) -> your 'first slot' '1st' should be for effective MODE?

MODE (0 = preview / 1 = effective) displacement 0x14


adr errors:

0xA6-0xA7 addrPrdQGui: address of player production queue
0xA8-0xAF addrStrcInf: address of strcInfo
0xB0-0xB4 addrPlntLst: address of the planet entries
0xB5-0xB7 addrPlntSpc: address of the planet specials array (new)

0xBC-0xBF maxPop: max population * 10 (for a feature of edifice.bst+7A) -> word


adr corrections:

0xA6-0xA7 1st upgT: upgrade type
0xA8-0xAB addrPrdQGui: address of player production queue
0xAC-0xAF addrStrcInf: address of strcInfo
0xB0-0xB3 addrPlntLst: address of the planet entries
0xB4-0xB7 addrPlntSpc: address of the planet specials array (new)

0xBC-0xBD maxPop: max population * 10 (for a feature of edifice.bst+7A)
0xBE-0xBF unk: (unused?)
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: 7848
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 »

Hi Flocke

with latest version of UE I attempted to switch to single player game and switch race and got crash on game load.

here is sav if you are interested in checking it out
game10.sav
(279.02 KiB) Downloaded 78 times
sorry the auto sav I used to create the save above was overwritten. so that save was after change.

I updated files from git tonight and got errors during compile.
User avatar
Flocke
BORG Trouble Maker
BORG Trouble Maker
Posts: 3196
Joined: Sun Apr 27, 2008 2:00 am
Location: Hamburg, Germany
Contact:

Re: UE Map Editor

Post by Flocke »

Spocks-cuddly-tribble wrote: Sun May 01, 2022 6:24 pm 0x80-0x93 / 0x94-A7 = GUI preview / effective MODE (same as other areas in systInfo and empsInfo) -> your 'first slot' '1st' should be for effective MODE?
Well, all analysis I did is from a view perspective, so first slot refers to the first assigned build task and therefore matches the effective value.
I however annotated them both now.
Spocks-cuddly-tribble wrote: Sun May 01, 2022 6:24 pm adr errors:

0xA6-0xA7 addrPrdQGui: address of player production queue
0xA8-0xAF addrStrcInf: address of strcInfo
0xB0-0xB4 addrPlntLst: address of the planet entries
0xB5-0xB7 addrPlntSpc: address of the planet specials array (new)

0xBC-0xBF maxPop: max population * 10 (for a feature of edifice.bst+7A) -> word
Those I obviously completely messed. :o I corrected them now, including the max population that can't be determined from the hex code.
User avatar
Flocke
BORG Trouble Maker
BORG Trouble Maker
Posts: 3196
Joined: Sun Apr 27, 2008 2:00 am
Location: Hamburg, Germany
Contact:

Re: UE Map Editor

Post by Flocke »

thunderchero wrote: Mon May 02, 2022 9:31 pm I updated files from git tonight and got errors during compile.
That's fixed now.

It actually was no compile error, but some failed unit tests for the update checker DCER implemented.
It was caused by the "dev" version suffix I recently introduced, but I missed the failing tests cause I didn't run the Gradle build, but just used the plain Eclipse debug build. :o

It was rather tough to fix cause DCER used some sophisticated library features I troubled to grasp and debug. But I extended it now to support optional development version updates as well.

I will look into the save game issues next.
User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 7848
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: Fri May 06, 2022 5:46 pm That's fixed now.
:up:
User avatar
starfleet
Cadet 2nd Year
Cadet 2nd Year
Posts: 9
Joined: Sun Apr 11, 2010 2:00 am

Re: UE Map Editor

Post by starfleet »

Hello, is there a possibility to add these functions in the editor? Please? It could be a very good tool for translators. Thanks in advance
Image
User avatar
Flocke
BORG Trouble Maker
BORG Trouble Maker
Posts: 3196
Joined: Sun Apr 27, 2008 2:00 am
Location: Hamburg, Germany
Contact:

Re: UE Map Editor

Post by Flocke »

starfleet wrote: Sat May 07, 2022 12:09 pm Hello, is there a possibility to add these functions in the editor? Please? It could be a very good tool for translators. Thanks in advance
No, that kind of stuff is better be done in some real text editor where you can loop through each match, double cursors on each match, see the whole matches and edit them all at once and what not. Therefore I instead implemented an import/export function for the lexicon. :wink:
User avatar
Flocke
BORG Trouble Maker
BORG Trouble Maker
Posts: 3196
Joined: Sun Apr 27, 2008 2:00 am
Location: Hamburg, Germany
Contact:

Re: UE Map Editor

Post by Flocke »

thunderchero wrote: Mon May 02, 2022 9:31 pm with latest version of UE I attempted to switch to single player game and switch race and got crash on game load.
That one is fixed now. Actually UE already sneaked in the fix when you touched the GWTForce file, since it ignored the invalid total slot count but patched in the missing empty slots on write. :mrgreen:

The integrity check message now reads:
total_slot_count.jpg
total_slot_count.jpg (20.31 KiB) Viewed 5014 times

Oh and please next time don't forget to mention the mod you played - although it's not been hard to guess it was MUM. ;)
User avatar
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 1883
Joined: Sun Apr 27, 2008 2:00 am

Re: UE Map Editor

Post by Spocks-cuddly-tribble »

Flocke wrote: Sat May 07, 2022 8:40 pmI instead implemented an import/export function
Hi, can you add a function in the editor to auto-detect and export all trek.exe crap codes and auto-import good/smart codes instead? Please? It would be a VERY good tool. Thanks in advance! :wink: :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: 3196
Joined: Sun Apr 27, 2008 2:00 am
Location: Hamburg, Germany
Contact:

Re: UE Map Editor

Post by Flocke »

Spocks-cuddly-tribble wrote: Sun May 08, 2022 9:59 am
Flocke wrote: Sat May 07, 2022 8:40 pmI instead implemented an import/export function
Hi, can you add a function in the editor to auto-detect and export all trek.exe crap codes and auto-import good/smart codes instead? Please? It would be a VERY good tool. Thanks in advance! :wink: :wink:
LOL, when YOU do the algorithm, sure! But I want to see it first! :D
User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 7848
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 May 08, 2022 4:37 am
thunderchero wrote: Mon May 02, 2022 9:31 pm with latest version of UE I attempted to switch to single player game and switch race and got crash on game load.
That one is fixed now. Actually UE already sneaked in the fix when you touched the GWTForce file, since it ignored the invalid total slot count but patched in the missing empty slots on write. :mrgreen:

The integrity check message now reads:
total_slot_count.jpg


Oh and please next time don't forget to mention the mod you played - although it's not been hard to guess it was MUM. ;)
I duplicated this issue for testing, using latest download "modded_save_detection"

saved game feds (host) cards (join)
save 2 feds MP game save
game2.sav
(224.02 KiB) Downloaded 60 times
save 3 sp feds (UE saved) no issues
game3.sav
(210.02 KiB) Downloaded 68 times
save 4 sp fer (UE saved) crash turn 2 with error log
Game4.sav
(210.02 KiB) Downloaded 55 times
File: ..\..\source\game\ship.c, Line: 968, taskForce != NULL

MUM 1366 beta version 4 (not released yet)
User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 7848
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 »

I was doing a combat test on MUM and wanted to switch single to MP game.

but when I loaded game in MP everything I had done during that turn as single player was removed (ship movements is mainly what I noticed). is this normal behavior/expected?
User avatar
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 1883
Joined: Sun Apr 27, 2008 2:00 am

UE Map & shiplist.sst Editor

Post by Spocks-cuddly-tribble »

Hi guys, here is some more fun facts about map & AI data in save game files and related shiplist.sst data.


AI Task (I updated my AI task info post) - latest IDA database with AI research: https://workupload.com/file/LjLKhQTuBt9

+6C for shiptasks 'grab more ships?' marker (not 2 = check more flight turns away)
+B4 total build cost of TskSh ShipUnits (patrol with station cost) -> all double floats:
+BC average build cost of TskSh ShipUnits (patrol with station cost)
+C4 total build cost (+5% * experience level) of TskSh + station cost
+CC average build cost (+5% * experience level) of TskSh + station cost
+D4 Modifier? vs expBonusAverageGroup * total build cost of TskSh ShipUnits (patrol with station cost)

---


OT, but kind of related: viewtopic.php?p=55981#p55981
Flocke wrote: Sun Mar 20, 2022 1:38 pmOffset 0x0038 to 0x003B = sector row (GTForceList => next turn, GWTForce => actual turn)
Offset 0x003C to 0x003F = sector column (GTForceList => next turn, GWTForce => actual turn)
It's like a preview/effective mode feature as in empsInfo and systInfo.

GTForceList => next turn (preview mode) -> on turn progress update GWTForce reading new temp IDs of re-gouped TFs resp. remove disolved
GWTForce => actual turn (effective mode)

Another related feature is sector.lst+38/+3C: (note the confusing similarity with TF coordinates)

sector.lst+38 = adr list of TF IDs with sector move destination (next turn?) (preview mode)
sector.lst+3C = adr list of TF IDs in the sector (effective mode)

When re-loading a saved game and changing TF move direction, sector.lst+38 somehow goes out of sync (not a re-grouping issue).

The developers noticed the issue and disabled most codes using the feature, except e.g. to prevent different monsters from moving to the same sector.

sub_42BB60 is a funny relict enabling AI Raid task ships to anticipate any player moves, unless counter-cheated by re-loading saved game and changing flight direction (this classified data shouldn't be readable for other parties anyway).


---

Testing the below AI TskSh fix I wondered whether UE shiplist.sst editor could be updated to support the AI values, correct errors like 'beam min range' and 'plasma' stats or even edit trek.exe phaser slot bitmasks for phaser firing arcs?

Code: Select all

NAME: AI ShipUnits Crew Experience Bonuses Bug FIX 2 (@ 1 see combat.bin AI ship sorting fix)
DESC: Fixes the calculation of the total/average build cost of AI TskSh with crew experience bonuses.
AUTHOR: Spocks-cuddly-tribble
URL: 

>> 0x00007ce9 94
>> 0x00007cfc 89 94 24 2c 01 00 00 e8 cc 4d 11 00 db 9c
>> 0x0002a3ef 94
>> 0x0002a400 89 94 24 48 01 00
>> 0x0002a407 89 e8 de c1 89 ca e8 c2 26 0f 00 db 9c 24 48 01 00 00

<< 0x00007ce9 84
<< 0x00007cfc e8 d3 4d 11 00 db 1c 24 8b 14 24 90 01 94
<< 0x0002a3ef 84
<< 0x0002a400 de c1 e8 cd 26 0f
<< 0x0002a407 db 1c 24 8b 14 24 01 94 24 48 01 00 00 90 8b c5 8b d1

# set AI Task +C4/+ CC total/average build cost of TskSh/station with crew experience bonuses

#004088E8     898424 30010000    MOV [ESP+130],EAX  // build cost

#004088FC     E8 D34D1100        CALL 51D6D4
#00408901     DB1C24             FISTP DWORD [ESP]  // build cost +5%*(crew experience level)
#00408904     8B1424             MOV EDX,[ESP]
#00408907     90                 NOP
#00408908     019424 2C010000    ADD [ESP+12C],EDX  // update total cost TskSh ShipUnits with crew experience bonuses

# Patrol defense task

#0042AFEE     898424 40010000    MOV [ESP+140],EAX  // build cost

#0042B000     DEC1               FADDP ST(1),ST
#0042B002     E8 CD260F00        CALL 51D6D4
#0042B007     DB1C24             FISTP DWORD [ESP]  // build cost +5%*(crew experience level)
#0042B00A     8B1424             MOV EDX,[ESP]
#0042B00D     019424 48010000    ADD [ESP+148],EDX  // update
#0042B014     90                 NOP
#0042B015     8BC5               MOV EAX,EBP
#0042B017     8BD1               MOV EDX,ECX
Same game turn 63 - vanilla vs patch (vanilla starbases due to 'threat level' triggered 'defensive' code - patch card/kling AI did better):
vanilla_turn_63.png
vanilla_turn_63.png (165.98 KiB) Viewed 4784 times
patch_turn_63.png
patch_turn_63.png (167.97 KiB) Viewed 4784 times
---


UE shiplist.sst Editor suggestions:


1.) AI indicators for offensive and defensive capabilities of ships: viewtopic.php?p=50855#p50855

The unused combat.bin is a ship vs ship odds table (pointless unless 1vs1), so instead the AI reads stats like shipfunction, build cost and:

dword shiplist.sst

+9C AI offensive capability
+A0 AI defensive capability

=> In UE auto calculate e.g. (just needed to get a general idea, see vanilla shiplist defaults)

+9C = (weapon num * damage * multiplier * accuracy * 0.01) [modifier/X? ] added for each weapon type: Phaser + Torpedo + Third hidden beam stats
+A0 = (shields + hull) * defense * 0.01 * modifier X?

Hidden stats mistakenly labeled as 'plasma'(ignored for stations/monster) -> change label 'plasma' to e.g. 'unfinished second beam weapon (ships only)'?


2.) 'Beam minimum range' is an unused feature for ship firing arc (forward direction) in degree (BotF label 'FIELD'): viewtopic.php?p=52676#p52676

I don't know how much work it would be to implement UE support for my 'Aft Torpedo Launcher' exploit code: viewtopic.php?p=54576#p54576

no weapons = 0.0 -> UE auto set as default after weapons check?
no torpedo aft launcher = 360.0 -> UE auto set as default after weapons check when patch option selected?
else = 360.0 - (aft torpedo firing arc) -> e.g. for extra 60 degree aft torpedo firing arc = 300
360 degree torpedo firing arc -> just set 1.0 -> e.g. as option for strike cruiser (trek.exe patch setting for stations, not read from shiplist.sst)


3.) Support for phaser firing arcs (shared for unfinished second beam weapon and/or plasma animations [if phaser/plasma switch in trek.exe slot is set]).

Since UE already edits the trek.exe ship slots and the bitmask is hard to understand for noobs: viewtopic.php?p=52676#p52676

I think the order of the phaser slot values matches the order of the phaser slots in the HOB file -> direction/orientation

C0h = 360 degree (Turret -> lazy workaround used for broken/unfinished ships like vanilla Vor'cha)

else orientation with 45 degree accuracy (lower four bits horizontal, next two bits vertical, last two bits narrow/wide firing arc).

Default arcs are 60, 120, 180 or 360 degree (each phaser slot), see my link.

Example: (doublecheck left/right up/down - not certain from code analysis)

01h = forward 120 degree
02h = aft 120 degree
41h = forward 60 degree
81h = forward 180 degree
10h = up (straight) 120 degree


I would also trouble you with an UE auto-set feature for weapon efficiencies against shields and hull (shield-level, weapon damage & multiplier), but the semi implemented features and uneven figures do require intricate workarounds: viewtopic.php?p=54617#p54617

---


Old post:
thunderchero wrote: Fri May 13, 2022 10:08 amwhen I loaded game in MP everything I had done during that turn as single player was removed (ship movements is mainly what I noticed). is this normal behavior/expected?
It's been almost 20 years, but I think MP saves do not store player preview data i.e. pre-set actions unlike in single player. So converting a save to MP might delete this data.
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: 3196
Joined: Sun Apr 27, 2008 2:00 am
Location: Hamburg, Germany
Contact:

Re: UE Map Editor

Post by Flocke »

Thx for the IDA update and nice suggestions!

I'm currently still investigating some bugs and got a bit side tracked. I noticed I broke the StringFile translation mappings for mods that failed to update the entry addresses. Older UE versions simply overwrote these addresses, but I disliked that it silently patched it on load. Further there was no notice that ingame the text would show up incorrect. So I changed it to load the text like it is shown ingame but added an optional description fixture tools menu instead.

Having done so, I realized there was no option to reset your changes and started to refactor the code to add one. While at first that seemed to be a good idea, I found lots of code mess I needed to refactor along with it. :)

Before I look into new additions, I really must complete the current release and focus on remaining serious issues. E.g. I found that I can't view the MUM buildings of stbof.res. This issue however is present with old UE versions as well, so I'm not sure whether I'll address this one any soon.

I havn't checked the last save uploaded by TC yet either. :???:
Post Reply

Return to “Ultimate Editor”