UE Map Editor

Ultimate Editor; support/discussion/questions

Moderator: thunderchero

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

Re: UE Map Editor

Post by Spocks-cuddly-tribble »

By default systInfo word +6C and dword +B8 is cleaned up and set to zero i.e. a feature or bug must overwrite the defaults.

+6C is word, +B8 is dword (but 1, 2 or 3 is clearly not a memory adr)? The data area is 40h bytes, not just 4? Do you have a hex dump from file area size X*40h if not zero?


Below is locations where it copies the data from saved game to prepared loaded areas:

@ 437A97 -> planet 'specials'
@ 437AF3 -> system 'specials'


Unfinished GUI code for system_specials @ 004FC993

Tries to add a object feature/ID from byte @ X*40h entry [+3Dh] for some display list.


---

There was also a bug when diplomatic order 'declare war' was given before saving i.e. that saved game was corrupted (not the running game). But one had to reload and click 'turn' to notice. Has this been fixed?
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: 3246
Joined: Sun Apr 27, 2008 2:00 am
Location: Hamburg, Germany
Contact:

Re: UE Map Editor

Post by Flocke »

Spocks-cuddly-tribble wrote: Tue Jun 08, 2021 8:20 am By default systInfo word +6C and dword +B8 is cleaned up and set to zero i.e. a feature or bug must overwrite the defaults.

+6C is word, +B8 is dword (but 1, 2 or 3 is clearly not a memory adr)? The data area is 40h bytes, not just 4? Do you have a hex dump from file area size X*40h if not zero?
You got me wrong here, I referred to the 4byte/planet exta space that comes just after the planet list and is written all the time.
I came up with it cause it comes in between of the planet entry array and the system 'specials' in the asm code you pointed me to, just like I showed in the asm screenshot.

If I got that right, it is pointed to by +B4

In SystInfo Part 6 of 6 / planet padding you find a list on all the values of my game7.sav test save. Given some contain meaningless text and most are zeroed, the easily overlooked 00 00 00 01 .. 02 .. 03 values could as well just be memory garbage.

I think 'specials' is a good fit and I'll update my postings and UE code and for the system specials I will even add a load routine just in case.
Spocks-cuddly-tribble wrote: Tue Jun 08, 2021 8:20 am There was also a bug when diplomatic order 'declare war' was given before saving i.e. that saved game was corrupted (not the running game). But one had to reload and click 'turn' to notice. Has this been fixed?
I actually can't remember ever having heard of that bug before. :roll:
User avatar
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 1926
Joined: Sun Apr 27, 2008 2:00 am

Re: UE Map Editor

Post by Spocks-cuddly-tribble »

Thank you. And sorry for misreading your post.

The allocated byte array for systInfo+B4 (planets * 4 bytes) is set to zero before first usage and before loading and saving games.

After 1C (instead of 1,2,3) follow X*4 byte parts of the first planet name of an other star system (default system name + I = roman 1).

Either there is a sporadic pointer glitch in sub_4B6454 (set system & planet names) or when loading / saving games.

Flocke wrote: Tue Jun 08, 2021 10:32 amI actually can't remember ever having heard of that bug before. :roll:
Nice! So we don't need to take care of it. :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: 3246
Joined: Sun Apr 27, 2008 2:00 am
Location: Hamburg, Germany
Contact:

Re: UE Map Editor

Post by Flocke »

Spocks-cuddly-tribble wrote: Tue Jun 08, 2021 4:52 pm Nice! So we don't need to take care of it. :wink:
Ah well, I don't play any games, and with the frequent epic game gifts, I already have a ton of games I likely never find time to take a look. :lol:
Maybe some day I get into playing BotF again, but whenever I start a game I immediately get the feel I need to patch something.

Never mind, I updated posts and the UE code.
User avatar
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 1926
Joined: Sun Apr 27, 2008 2:00 am

Re: UE Map Editor

Post by Spocks-cuddly-tribble »

They messed up some code pointing to systInfo+8 (system name) i.e. they added +8 to wrong adr pointer.

In your hex dump the positions of the values 1,2,3 or 1C (+name parts) are always a multiple of 8 (-1).

But I can't find the bug in the code. It could also affect other files....
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: 7934
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 don't expect any changes for this but wanted to note issue.

when running "integrity check" on an UDM saved games, this will edit saved game so it will no longer load.

this is due to the 18 fleet task force patch that improperly writes the taskforce files (total number of ships in taskforce)
check.jpg
check.jpg (422.09 KiB) Viewed 4813 times
User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 7934
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 »

here is a corrected Dcer's old "wishlist.txt" (most of the links would fail).
wishlist.txt
(3.1 KiB) Downloaded 80 times
User avatar
Flocke
BORG Trouble Maker
BORG Trouble Maker
Posts: 3246
Joined: Sun Apr 27, 2008 2:00 am
Location: Hamburg, Germany
Contact:

Re: UE Map Editor

Post by Flocke »

thunderchero wrote: Thu Jun 10, 2021 7:56 pm here is a corrected Dcer's old "wishlist.txt" (most of the links would fail).

wishlist.txt
The main point of using a web-based git repository hoster is collaboration. So set up your GitLab account, join the team and just edit or replace the file.
Of course you could make use of branches and pull requests or set up your local git clone and stuff, but it is ok when you just go ahead and edit the file and then click on commit like you do a post in this forum here. There is no magic about it. :wink:

And have no fear to mess anything. With the commit history we still can go back or split off some branch.

Btw, continuing my tests, I experienced a crash when I moved away a system for that an invasion is taking place, and found that I missed to properly update the task force missions. That is what I still need to put some little work before release. :)
User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 7934
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 »

ok made minor change, let me know if I did it correctly lol

I guess I did not since I got an e-mail "pipeline failed" :sad:

Ok I verified account and error is gone now I guess...
User avatar
Flocke
BORG Trouble Maker
BORG Trouble Maker
Posts: 3246
Joined: Sun Apr 27, 2008 2:00 am
Location: Hamburg, Germany
Contact:

Re: UE Map Editor

Post by Flocke »

thunderchero wrote: Fri Jun 11, 2021 10:18 am ok made minor change, let me know if I did it correctly lol

I guess I did not since I got an e-mail "pipeline failed" :sad:

Ok I verified account and error is gone now I guess...
Your commit looks fine, I however didn't configure any automatic build pipeline, so it's no surprise it failed.
Now, every change that is noticable to the user should be added to the change log. I'll put a line for it. :wink:
User avatar
Flocke
BORG Trouble Maker
BORG Trouble Maker
Posts: 3246
Joined: Sun Apr 27, 2008 2:00 am
Location: Hamburg, Germany
Contact:

Re: UE Map Editor

Post by Flocke »

Flocke wrote: Fri Jun 11, 2021 3:37 am Btw, continuing my tests, I experienced a crash when I moved away a system for that an invasion is taking place, and found that I missed to properly update the task force missions. That is what I still need to put some little work before release. :)
That issue is now fixed and went into the UE 0.8.0 release along with all the other fixes and sav editing analysis from above.
User avatar
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 1926
Joined: Sun Apr 27, 2008 2:00 am

Re: UE Map Editor

Post by Spocks-cuddly-tribble »

Some research data on AI files that mustn't be lost in event of technical system failures on my part:

AISysUnt size C bytes
+0 starID
+2 task next -> confirmed
+4 task current -> confirmed
+6 ? -> area not initialized (unusual for BotF) might be unused & just data garbage
+8 unlock build shipyard marker -> cf AITask+10h task data -> similar data structure for sys dev tasks -> e.g. @ +8 sys dev plan

AIShpUnt(size 18h)
+0 Gshiplist ID
+2 shipfunction
+4 task next -> confirmed
+6 task current -> confirmed
+8 FF ?
+C FF -> monster code implies unused coordinate 1
+10 FF -> monster code implies unused coordinate 2
+14 ignore marker (eg after scrap order) -> cf AITask+10h task data -> similar data structure for ship tasks -> @ +14 same ignore marker after range loss

AITask(size EC)

+0 TaskID
+2 sequel TaskID (eg Colonize if Tform 'improve false') -> cf CHILD TASKS feature @ +68; IDs @ +58 ff (Tform shoud be Colonize child task)
+4 Task Type (eg attack)
+8 TaskCategory Ship(1) System(2) Diplomacy(3)
+C AgentID
+10 adr special Task data - size variable (eg sys dev C bytes @ +8 plan)
+14 14 code pointer for 9 functions (5 unused, pattern most 4...3..2) adr 14h-4Bh
+4C Task modifier via agenda
+50 TskSh shipIDs (ShipUnits)
+54 TskSy starIDs (SysUnits)
+58 base for child task IDs -> loaded via [AITask+58h+2*(value at +68h)]
+5A ID child task 1
+5C ID child task 2
+5E ID child task 3
+60 ID child task 4
+62 ID child task 5
+64 ID child task 6
+66 ID child task 7
+68 num CHILD TASKS (max 7)
+6C Task Status (shiptasks) 0 = hold/insufficient ships, 1 = gather Source sector, 2 = GO Target sector
+70 source sector row
+74 source sector column
+78 target sector row
+7C target sector column
+80 can build something marker
+82 build order active marker
Allocations (word) 41873A/426449
+86 scout -number shiptypes:
+8A destroyer
+8E cruiser
+92 artillery
+96 command
+9A colony
+9E TT
-build tasks:
+A0 MINCR cost
+A2 CRALLOC
+A4 MINNETCR maintenance
+A6 NCRALLOC (ships NETCRALLOC)
+A8 1 dil cost?
+AA DILALLOC
+B0 desired ship functions bitmask
- double floats each:
+B4 total build cost of OWN TskSh ShipUnits (patrol with station cost)
+BC average build cost of OWN TskSh ShipUnits (patrol with station cost)
+C4 total build cost (+5% * experience level) of ENEMY fleet in specified area + station cost
+CC average build cost (+5% * experience level) of ENEMY fleet in specified area + station cost
+D4 total build cost of OWN TskSh ShipUnits (patrol with station cost) * Modifier for average ENEMY expBonus
+DC clear lower modifier tasks marker (colonize, bldbase, invade, attack = 1) see sub_426A10
+E0 TurnNumber when set


AIAgent(size A0)

+0 Agent ID
+4 1 major, 2 minor, 3 alien
+8 race ID
+C eg sub_4073D0 prepare AI_major_mapViews
+10 eg sub_407250 AI_control_major
+14 adr special Agent data - size variable (empires 28h -> agenda/personality, production focus, map data...)
+18 AgtTk TaskIDs
+1C some TaskIDs sorted by modifier
+20 some starIDs sorted by 'can build something' Floats?
+24 some shipIDs sorted by function values
+28 starIDs sorted by population
+2C AgtSh shipIDs (ShipUnits)
+30 AgtSy starIDs (SysUnits)
+34 AgtDp diplomatics
-resources:
+38 +0 pop support + effective income
+3C +4 credits
+40 +8 fleet support cost + treaty costs pending? + all system Credits effective preview BUG?
+44 +C 0 ???
+48 +10 ship support cost
+4C +14 station support cost
+50 +18 treaty costs pending?
+54 +1C all system Credits effective preview
+58 +20 dilithium sources
+5C +24 sum CRALLOC (add to 5* real support costs)
+60 +28 sum NETCRALLOC (sub from max support left)
+64 +2C max credits left
+68 +30 max support left
+6C +34 sum DILALLOC (sub from dilithium sources)
+70 +38 dilithium sources free
+74 +3C rest to spend for buy
+78 +40 allotment bonus for buy Ships
+7C +44 ? allotment bonus for buy 2? unused?
+80 +48 allotment bonus for buy Gifts/Proposals
+84 +4C allotment bonus for buy Buildings
+88 ?
+8C ?
+90 ?
+94 ?
+98 0 ?

-> special Agent data empires 28h

004075F1 mov [edi], eax adr list ??
004E5174 mov eax, [edx+4] ; agenda 1 (minor personality)
0040761B mov dword ptr [edi+8], 1 ?? (0 skips some stuff?)
+Ch ??
004075FC mov [edi+10h], eax VIEW_1__Threat_Level__distance_lower_10
00407608 mov [edi+14h], eax VIEW_2__Base_Placement
00407629 mov [edi+18h], eax VIEW_3__System_Colonization_Priority
00407670 mov dword ptr [edi+1Ch], 0 unk AI difficulty level feature 1=ON
0040D7F9 mov [edi+20h], eax ; 'should be'(bug) Turn_Number last 'one per empire' build order 0
004E523A mov eax, [esi+24h] ; production focus 0


Latest IDA database with AI research: https://workupload.com/file/LjLKhQTuBt9
Last edited by Spocks-cuddly-tribble on Wed Nov 30, 2022 2:58 pm, edited 5 times in total.
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: 3246
Joined: Sun Apr 27, 2008 2:00 am
Location: Hamburg, Germany
Contact:

Re: UE Map Editor

Post by Flocke »

Implementing some statistical sheets I stumbled on a strange data anomaly that made me wonder.
By SystInfo documentation there is a credits entry:
0x1A4-0x1A7 crds: + credits (blg output 0x4 = tradegoods -> unused)
Initially I thought it was the system's raw credit income, but nope, for the analysed game7.sav sample, it is at max 1, no more. Further I found it to be set on almost every ai system, but not on any of my own. It however is no AI flag either, and for some reason it must have been noted to be 'credits'.
So I went ahead and guess what I found being build on all related ai systems but none of my own:
tradegoods.jpg
tradegoods.jpg (76.08 KiB) Viewed 3683 times
Yay, +1 trade goods! :lol: :lol:

Yes, doing a quick search, there already exists a fix:
viewtopic.php?p=6205#p6205
Still it gave me a good laugh.

edit: I change documentation to "+ credits (unused building output, 1 = ai trade goods)" if that's ok.
User avatar
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 1926
Joined: Sun Apr 27, 2008 2:00 am

Re: UE Map Editor

Post by Spocks-cuddly-tribble »

Flocke wrote: Sat Feb 19, 2022 8:24 amedit: I change documentation to "+ credits (unused building output, 1 = ai trade goods)" if that's ok.
You can do that, but it isn't understandable for noobs.

systInfo+0x1A4 "+ credits (blg output 0x4 = tradegoods -> unused)" gives 4 Infos: output type description '+ credits', output ID '0x4', source building name 'tradegoods' & status unused


+1 is meaningless and doesn't determine AI, the AI bug in aibldreq.bin is mere coincidence via building ID 0x12:
Gowron wrote:The output value for trade goods in edifice.bst (+1 by default) is meaningless. Changing it doesn't have any effect on the cash output.
viewtopic.php?p=404#p404
Gowron wrote:When the ID 0x12 (trade goods) is reached, the system will explicitly build "trade goods" for one turn, then move on the next building.
viewtopic.php?p=420#p420
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: 3246
Joined: Sun Apr 27, 2008 2:00 am
Location: Hamburg, Germany
Contact:

Re: UE Map Editor

Post by Flocke »

Spocks-cuddly-tribble wrote: Sat Feb 19, 2022 12:36 pm
Flocke wrote: Sat Feb 19, 2022 8:24 amedit: I change documentation to "+ credits (unused building output, 1 = ai trade goods)" if that's ok.
You can do that, but it isn't understandable for noobs.

systInfo+0x1A4 "+ credits (blg output 0x4 = tradegoods -> unused)" gives 4 Infos: output type description '+ credits', output ID '0x4', source building name 'tradegoods' & status unused
You say the previous description was noob friendly? I didn't even know there was an 'output type' and got mislead by 0x4 that a value of 0x4 would mean there are trade goods being build. The info that tradegoods are blg output type 0x4 is irrelevant here cause it is not data related. And that 'blg' refers to 'building' wasn't clear to me either. I totally got confused on the previous description so I changed it. Furthermore, looking at the actual hex values it was missing an explanation why there is 01 00 00 00 listed for almost all ai systems. Not any noob friendly at all! :shock:
Post Reply

Return to “Ultimate Editor”