Ultimate Editor

Ultimate Editor; support/discussion/questions

Moderator: thunderchero

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

Re: Ultimate Editor

Post by Flocke »

I will take a look next weekend but am am a little busy again with other things too, so UE DEV release might have to wait another week or two. Well, anyone eager ofc always can build it himself and talk back on me when there are issues. :)

Above patch doesn't look hard to be implemented with UE, the critical part will be me understanding the patch and why it is necessary. With my limited receptivity this evening, if I get above image right, UE needs to detect whether the table deviation fix is applied to set correct max number? or should that patch be applied always and maybe already be fixed for vanilla botf right away?
User avatar
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 1884
Joined: Sun Apr 27, 2008 2:00 am

Re: Ultimate Editor

Post by Spocks-cuddly-tribble »

Flocke wrote: Tue Oct 11, 2022 5:17 pmthe critical part will be me understanding the patch and why it is necessary.
Never mind me asking :!:
The patch failed in stress tests with the worst map for this annoying vanilla readrace crash/bug (large/elliptical/many minors from larger maps by TC). :sad:

Fix with max 30 -> issue still there, just slightly reduced frequency (correct number of minors in game)
no fix (31 or 30) -> both settings sometimes read-race crash & max -1 minors in game (vanilla default issue)
fix with 31 -> sometimes loop/freeze instead of crash and too few minors in 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
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: Ultimate Editor

Post by thunderchero »

while testing new patches it gave me a few ideas,

If you have time and it is not too much effort I have a couple requests for UE

in saved game,
could you add sort by subjugated and membered in "systems" screen?
sort.jpg
sort.jpg (128.62 KiB) Viewed 1036 times
also in "Empires" screen add current tech levels for each major?
not sure where but maybe below "Empire Morale"
tech.jpg
tech.jpg (111.2 KiB) Viewed 1036 times
User avatar
Flocke
BORG Trouble Maker
BORG Trouble Maker
Posts: 3197
Joined: Sun Apr 27, 2008 2:00 am
Location: Hamburg, Germany
Contact:

Re: Ultimate Editor

Post by Flocke »

thunderchero wrote: Tue Oct 18, 2022 10:39 am while testing new patches it gave me a few ideas,
implemented, at your command :cool:

I further fixed a couple of bugs, including the switched system and built structure menu entries and the broken save game save you geniously pointed me at with these suggestions without saying a word.

Regarding stellar object galaxy generation I made progress too. Think I have all the necessary values but will have to refactor some further asm code to make it properly work.
User avatar
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 1884
Joined: Sun Apr 27, 2008 2:00 am

Re: Ultimate Editor

Post by Spocks-cuddly-tribble »

I read your other post but didn't notice the question.
AFAIK there is no global anomaly 'type counter', just different code switches, jump tables and stbof file references (e.g. edifice.bst unused requirements).

A discarted project intended using anomalies in adjacent sectors as building requirements: viewtopic.php?p=50804#p50804
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: 7851
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 »

awesome, just downloaded and it looks great.
ran integrity check on my latest test game. With AI running only.
it had the shortest integrity check list I have ever seen

Note: the check took a very long time so many files "TskSh3237" (AI is doing very good)

Code: Select all

Check results:

Info: in AIShpUnt: Found ship id 1398, that is missing from GShipList. (common, but removed)
Info: in AgtSh3: Bolian AIAgent3 <13> lists ship id 1398, that is missing from GShipList. (common, but removed)
EDIT;
funny thing is Bolians don't have any ships in MUM :shock:
User avatar
Flocke
BORG Trouble Maker
BORG Trouble Maker
Posts: 3197
Joined: Sun Apr 27, 2008 2:00 am
Location: Hamburg, Germany
Contact:

Re: Ultimate Editor

Post by Flocke »

Spocks-cuddly-tribble wrote: Tue Oct 18, 2022 9:28 pm I read your other post but didn't notice the question.
AFAIK there is no global anomaly 'type counter', just different code switches, jump tables and stbof file references (e.g. edifice.bst unused requirements).
I already implemented to rewrite:
  • the stellar tooltippanel names at 0x0003CC2B / loc_43D826,
  • the stellar details panel names at 0x000B5C27 / loc_4B6827,
  • the stellar details descriptions at 0x000FA694 /off_4FB2A0 + sub_4FB2D0
For the 4 stellar object type num counters limits I identifed in 0xAF810 / sub_4B0410 Star_Anomaly_Generation I still need to rewite the two jump switches at loc_4B078B.
While for the other fixes there was a bit more available space I'm a bit limited here. The other jump switches I replaced by some mov word ptr load routines writing a more compact list of the lexicon ids to be mapped. Here I might go lucky with some bit shifting mask.
The bit mask would be used by UE to specify which stellar objects are "systems" (the 6 stars) and which are not.

But when you have time, you are welcome to take a look. The other minimum limit right now is 30 stellar type description entries, each having their own lexicon id (which further could be tweaked if necessary).
Spocks-cuddly-tribble wrote: Tue Oct 18, 2022 9:28 pm A discarted project intended using anomalies in adjacent sectors as building requirements: viewtopic.php?p=50804#p50804
Nice one, but that's a feature that I'd rather not implement with UE for now unless there is serious demand.
Last edited by Flocke on Thu Oct 20, 2022 4:48 am, 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: Ultimate Editor

Post by Spocks-cuddly-tribble »

Flocke wrote: Wed Oct 19, 2022 1:17 amI'm a bit limited here.

...bit mask would be used by UE to specify which stellar objects are "systems" (the 6 stars) and which are not.

The other minimum limit right now is 30 stellar type description entries
1. No you're not
2. Not a good idea -> a shared mask would break star/anomaly ratio feature
3. Typo for 'max' I guess

remove this:

Code: Select all

004B07A6           cmp   eax, 2
004B07A9           jz    short loc_4B07D6
004B07AB           cmp   eax, 1
004B07AE           jz    short loc_4B07D6
004B07B0           cmp   eax, 0Bh
004B07B3           jz    short loc_4B07D6
004B07B5           cmp   eax, 3
004B07B8           jz    short loc_4B07D6
004B07BA           cmp   eax, 0Ah
004B07BD           jz    short loc_4B07D6
replace with:

Code: Select all

jl 4B07BF  skip negative random values
cmp   eax, 3
jle 4B07D6 set anomaly
cmp   eax, 0Ah
jl 4B07BF  skip
cmp eax, (max anomaly ID B -> X)
jle 4B07D6 set anomaly
nop
But there is way more anomaly codes hidden in trek.exe, e.g.: 4B7940 wormhole_pulsar_s code to check anomalies in the star system sector (for building bits - used if we allow sectors with multiple stellar objects or check adjacent sectors). Needs to be edited for my project.

thunderchero wrote: Tue Oct 18, 2022 9:35 pmfunny thing is Bolians don't have any ships in MUM :shock:
They hide their ships from you in their flowing hair, using their special structure to sabotage your sensor software (terran MS Windows trojan)... :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: 3197
Joined: Sun Apr 27, 2008 2:00 am
Location: Hamburg, Germany
Contact:

Re: Ultimate Editor

Post by Flocke »

Spocks-cuddly-tribble wrote: Wed Oct 19, 2022 12:50 pm
Flocke wrote: Wed Oct 19, 2022 1:17 amI'm a bit limited here.

...bit mask would be used by UE to specify which stellar objects are "systems" (the 6 stars) and which are not.

The other minimum limit right now is 30 stellar type description entries
2. Not a good idea -> a shared mask would break star/anomaly ratio feature
I rather thought of something like this:

Code: Select all

004B074D | 83 CA FF                      | or edx,FFFFFFFF                         | flag that we're looking for stars
004B0750 | EB 39                         | jmp trek.4B078B                         |

unchanged ->
004B0752 | 8B 44 24 56                   | mov eax,dword ptr ss:[esp+56]           |
004B0756 | C1 F8 10                      | sar eax,10                              |
004B0759 | 6B C0 0C                      | imul eax,eax,C                          |
004B075C | 8B 5C 24 04                   | mov ebx,dword ptr ss:[esp+4]            |
004B0760 | 8B 54 24 3E                   | mov edx,dword ptr ss:[esp+3E]           |
004B0764 | 8B 74 24 58                   | mov esi,dword ptr ss:[esp+58]           |
004B0768 | 01 C3                         | add ebx,eax                             |
004B076A | 8A 44 24 14                   | mov al,byte ptr ss:[esp+14]             |
004B076E | C1 FA 10                      | sar edx,10                              |
004B0771 | 88 43 08                      | mov byte ptr ds:[ebx+8],al              |
004B0774 | 8B 44 24 66                   | mov eax,dword ptr ss:[esp+66]           |
004B0778 | 46                            | inc esi                                 |
004B0779 | C1 F8 10                      | sar eax,10                              |
004B077C | 66 89 74 24 58                | mov word ptr ss:[esp+58],si             |
004B0781 | E8 0A FC FF FF                | call trek.4B0390                        |
004B0786 | E9 77 FF FF FF                | jmp trek.4B0702                         |
<- unchanged

004B078B | 8B C8                         | mov ecx,eax                             |
004B078D | B8 01 00 00 00                | mov eax,1                               |
004B0792 | 83 F9 40                      | cmp ecx,40                              | if 64 or above
004B0795 | 73 1A                         | jae trek.4B07B1                         | use 2nd bit mask
004B0797 | D3 E0                         | shl eax,cl                              | shift 1 by build type
004B0799 | 25 00 00 00 01                | and eax,1000000                         | compare with bitmask1, editable by UE
004B079E | 83 F8 00                      | cmp eax,0                               |
004B07A1 | 74 07                         | je trek.4B07AA                          | check whether we have a match
004B07A3 | 83 FA 00                      | cmp edx,0                               | read back if anomaly or system
004B07A6 | 75 AA                         | jne trek.4B0752                         | jmp type is system
004B07A8 | EB 15                         | jmp trek.4B07BF                         | jmp type is no anomaly
004B07AA | 83 FA 00                      | cmp edx,0                               |
004B07AD | 75 8B                         | jne trek.4B073A                         | jmp type is no system
004B07AF | EB 25                         | jmp trek.4B07D6                         | jmp type is anomaly
004B07B1 | 83 E9 40                      | sub ecx,40                              | sub 64 for 2nd bit mask comparison
004B07B4 | D3 E0                         | shl eax,cl                              |
004B07B6 | 25 00 00 00 01                | and eax,1000000                         |
004B07BB | EB E1                         | jmp trek.4B079E                         | jmp back to proceed comparison
004B07BD | 90                            | nop                                     |
004B07BE | 90                            | nop                                     |

unchanged ->
004B07BF | 8B 54 24 10                   | mov edx,dword ptr ss:[esp+10]           |
004B07C3 | 8B 44 24 0C                   | mov eax,dword ptr ss:[esp+C]            |
004B07C7 | E8 04 61 00 00                | call trek.4B68D0                        |
<- unchanged

004B07CC | 33 D2                         | xor edx,edx                             | flag that we're looking for anomalies
004B07CE | 89 44 24 14                   | mov dword ptr ss:[esp+14],eax           |
004B07D2 | EB B7                         | jmp trek.4B078B                         |
004B07D4 | 90                            | nop                                     | the mov edx, eax I replaced by the xor above looks to be unused
004B07D5 | 90                            | nop                                     | so I moved the jmp and nopped this code
stellType_systemBitMask.jpg
stellType_systemBitMask.jpg (95.28 KiB) Viewed 964 times
This should allow for 64 individually configurable stellar types.
Spocks-cuddly-tribble wrote: Wed Oct 19, 2022 12:50 pm But there is way more anomaly codes hidden in trek.exe, e.g.: 4B7940 wormhole_pulsar_s code to check anomalies in the star system sector (for building bits - used if we allow sectors with multiple stellar objects or check adjacent sectors). Needs to be edited for my project.
I bet so, but I leave further analysis to you and Tethys. I just wanted to get the basics working on request of Tethys. :cool:
User avatar
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 1884
Joined: Sun Apr 27, 2008 2:00 am

Re: Ultimate Editor

Post by Spocks-cuddly-tribble »

Flocke wrote: Thu Oct 20, 2022 3:54 amI rather thought of something like this:
In a trice I don't get the point. This code seems to set star/anomaly ratio and random types only. So why would you make it that complicated?
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: 7851
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: Thu Oct 20, 2022 12:28 pm
Flocke wrote: Thu Oct 20, 2022 3:54 amI rather thought of something like this:
In a trice I don't get the point. This code seems to set star/anomaly ratio and random types only. So why would you make it that complicated?
simple answer would be.....
Tethys - galaxy mod code changes
User avatar
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 1884
Joined: Sun Apr 27, 2008 2:00 am

Re: Ultimate Editor

Post by Spocks-cuddly-tribble »

It's about the unneeded effort put into refactoring ugly asm code. This keeps Flocke from joining our endless and bitter war against AI stupidity. :twisted:

E.g.:

Code: Select all

004B6827           jmp   4B6424[eax*4] -> anomaly names jump table
004B682E           mov   eax, 5Eh

replace with:

mov   eax, XXXX[eax*4]    (movzx   eax, word XXXX[eax*2] for two byte lexicon IDs = double code space)
nop

@  XXXX set index table with used lexicon entries -> plenty of unused/disabled code
Done!
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: 3197
Joined: Sun Apr 27, 2008 2:00 am
Location: Hamburg, Germany
Contact:

Re: Ultimate Editor

Post by Flocke »

I already implemented a little more sophisticated solution to the anomaly names jump at asm_4B6827 you refer that also supports the star name default handling by checking for ids set to -1. Like posted above, replacements for
  • the stellar tooltippanel names at 0x0003CC2B / loc_43D826,
  • the stellar details panel names at 0x000B5C27 / loc_4B6827,
  • the stellar details descriptions at 0x000FA694 /off_4FB2A0 + sub_4FB2D0
are already implemented.

After having implemented details panel description and name replacement codes, for the tooltip code I realized there was no defaults for the star names so I needed to differentiate it in UE by adding a checkbox option. Only thereafter, I found above code location and realized Tethys moved whole subroutine partially messing the code to only add another two anomalys with no space left for further additions.

I think above code patch does really great in that it restores old vanilla subroutine alignment and allows for another 50 stellar names at the same time. Since I already added the needed system stellar type checkbox to UE, it further would have felt incomplete when I do some lame hacks here that depend on the type numbers.

It's not important to me to complete the full feature, but stellar types was a menu UE already had before but was pretty limited if not to say broken. With having fixed the entry names by reading the lexicon ids from trek.exe instead, and with the added options to edit the names and add further entries to the objstruc.smt file, the galaxy generation routine is the key routine that still is missing from UE to complete that particular feature.

Furthermore I found it a great target since I'm out of practice in asm coding. But what am I arguing to two silly chaps that still try to fix that super broken AI by asm coding. You definitivly should do some C++ code injection for any serious improvement on the AI! :mrgreen:
User avatar
Flocke
BORG Trouble Maker
BORG Trouble Maker
Posts: 3197
Joined: Sun Apr 27, 2008 2:00 am
Location: Hamburg, Germany
Contact:

Re: Ultimate Editor

Post by Flocke »

Here is the refined code patch I finally implemented for UE and proofed working:
stellargen2.jpg
stellargen2.jpg (137.36 KiB) Viewed 887 times
With the refinement I'm indeed not short on space and it looks much cleaner too, don't you think so? :cool:
To give a better idea on what it's used for, here a screenshot of the improved UE stellar objects menu:
edit_stell.jpg
edit_stell.jpg (58.64 KiB) Viewed 887 times
User avatar
Tethys
Past Administrator
Past Administrator
Posts: 2392
Joined: Fri Jul 18, 2008 2:00 am
Location: Your mom's bed ;)
Contact:

Re: Ultimate Editor

Post by Tethys »

Ah, I see now, there is a 50 stellar limit. Would it be fair to assume if you copy the Nebula object, it creates another Nebula object, without the map functions? Just curious how far you have gone with this :)
Not for the weak of heart...
Galaxies MOD v0.4.0 <--- GALM/Galaxies Mod latest version
Post Reply

Return to “Ultimate Editor”