
New Resource & Building-Output Types Discussion
Moderator: thunderchero
- Tethys
- Past Administrator
- Posts: 2341
- Joined: Fri Jul 18, 2008 2:00 am
- Location: Your mom's bed ;)
- Contact:
Re: New Resource & Building-Output Types Discussion
I just got around to testing this in GALM. So far so good, only issue is with the blackhole so far. I will let you know if I have any other issues (that I can't fix) Great work once again. Those artifacts are pretty neat 

- Spocks-cuddly-tribble
- Code Master
- Posts: 1797
- Joined: Sun Apr 27, 2008 2:00 am
Re: New Resource & Building-Output Types Discussion
For your mod its confusing since you have e.g. two different black hole cases/types:
- real anomaly (stellInfo) in adjacent sector of the star system
- habitable 'pseudo' anomaly planet system (systInfo)
In in the latter case you set the value of the replaced star type in edifice.bst (+ different label for star e.g. habitable BH):
12 - Red Giant 13 - Orange Star 14 - Yellow Star 15 - White Star 16 - Green Star 17 - Blue StarNew star IDs might be a bit tricky. Source is [systInfo+31h] (red giant=04, orange=05, yellow=06, white=07, green=08, blue=09)
The original anomaly IDs in stellInfo are unsorted and all over the place (coding this part of the patch was no fun).
I don't know how many bugs is too many but that point is reached somewhere before however many in BotF is.
- Tethys
- Past Administrator
- Posts: 2341
- Joined: Fri Jul 18, 2008 2:00 am
- Location: Your mom's bed ;)
- Contact:
Re: New Resource & Building-Output Types Discussion
Pleased to report that star types allowing buildable structures (not adjacent, but inhabited)Spocks-cuddly-tribble wrote: ↑Tue Oct 03, 2023 11:59 amFor your mod its confusing since you have e.g. two different black hole cases/types:
- real anomaly (stellInfo) in adjacent sector of the star system
- habitable 'pseudo' anomaly planet system (systInfo)
In in the latter case you set the value of the replaced star type in edifice.bst (+ different label for star e.g. habitable BH):
12 - Red Giant 13 - Orange Star 14 - Yellow Star 15 - White Star 16 - Green Star 17 - Blue StarNew star IDs might be a bit tricky. Source is [systInfo+31h] (red giant=04, orange=05, yellow=06, white=07, green=08, blue=09)
The original anomaly IDs in stellInfo are unsorted and all over the place (coding this part of the patch was no fun).
I cant remember what ID i used, but I tested all my current cases in game with new building and the blackhole doesnt match any of the preexisting 04-09 ID's. I retain all 6 star types with an additional 7th as both blackhole types, with them being shared for the purpose of I believe space was the reason? Regardless, I am fond of them being shared for some reason, probably because they can share the blackhole "frequency" value so it becomes up to the game to decide whether it's going to have planets or not. Like a random variable, you could probably end up with all of one type or the other (but probably super rare)New star IDs might be a bit tricky. Source is [systInfo+31h] (red giant=04, orange=05, yellow=06, white=07, green=08, blue=09)

- Spocks-cuddly-tribble
- Code Master
- Posts: 1797
- Joined: Sun Apr 27, 2008 2:00 am
Re: New Resource & Building-Output Types Discussion
Then you need to know the used star/object IDs in systInfo for your habitable 'pseudo' anomalies. I think Flocke asked me to assist with the random code for this (can't recall right now). Should be same as the original anomaly IDs in stellInfo

Once you know the IDs you need to edit my patch with extra code to set the systInfo bitmask right for them (right now they set wrong bits = bug

This is a bit work and has the same effect as a real anomaly in an adjacent sector (for buildings).
I don't know how many bugs is too many but that point is reached somewhere before however many in BotF is.
- Flocke
- BORG Trouble Maker
- Posts: 3120
- Joined: Sun Apr 27, 2008 2:00 am
- Location: Hamburg, Germany
- Contact:
Re: New Resource & Building-Output Types Discussion
I remember, some while back you asked me to extend the system requirements list in UE, and it is still on my list...Spocks-cuddly-tribble wrote: ↑Tue Oct 03, 2023 4:06 pmI think Flocke asked me to assist with the random code for this (can't recall right now). Should be same as the original anomaly IDs in stellInfo![]()
viewtopic.php?p=57648#p57648
BTW, since GALM messed alot with anomaly types, and I implemented to auto-replace messed code with UE, any further changes likely will break UE compatibility again.
- Spocks-cuddly-tribble
- Code Master
- Posts: 1797
- Joined: Sun Apr 27, 2008 2:00 am
Re: New Resource & Building-Output Types Discussion
It's not about changing the object IDs again, but just about knowing them to set the systInfo bitmask right in the patch variant for GALM. 
We both wrote a code for random selection of the new 'star' types during galaxy generation for your UE feature IIRC?

We both wrote a code for random selection of the new 'star' types during galaxy generation for your UE feature IIRC?
I don't know how many bugs is too many but that point is reached somewhere before however many in BotF is.
- Tethys
- Past Administrator
- Posts: 2341
- Joined: Fri Jul 18, 2008 2:00 am
- Location: Your mom's bed ;)
- Contact:
Re: New Resource & Building-Output Types Discussion
Well I must report a problem, probably something on my end or perhaps something unaccounted for ?
edifdesc.bst broke itself somehow. I did add some descriptions to a few new buildings for adjacent anomalous and artifacts. They worked fine last night, but today UE is having an absolute fit with structures.
edifdesc.bst:
"String at address XX XX XX XX not found."
"String at index 297 not found."
I'm wondering if I had hit some limit for adding structures and backed them off a bit before perhaps? But I did not add, only edited old entries.. strange
Edit: I have restored a previous auto backup and everything seems to be back to normal, just the warning about improperly set requirement.
edifdesc.bst broke itself somehow. I did add some descriptions to a few new buildings for adjacent anomalous and artifacts. They worked fine last night, but today UE is having an absolute fit with structures.
edifdesc.bst:
"String at address XX XX XX XX not found."
"String at index 297 not found."
I'm wondering if I had hit some limit for adding structures and backed them off a bit before perhaps? But I did not add, only edited old entries.. strange
Edit: I have restored a previous auto backup and everything seems to be back to normal, just the warning about improperly set requirement.

Last edited by Tethys on Tue Oct 03, 2023 6:12 pm, edited 1 time in total.
- Spocks-cuddly-tribble
- Code Master
- Posts: 1797
- Joined: Sun Apr 27, 2008 2:00 am
Re: New Resource & Building-Output Types Discussion
edifdesc.bst issues should be unrelated and OT. 

I don't know how many bugs is too many but that point is reached somewhere before however many in BotF is.
- Tethys
- Past Administrator
- Posts: 2341
- Joined: Fri Jul 18, 2008 2:00 am
- Location: Your mom's bed ;)
- Contact:
Re: New Resource & Building-Output Types Discussion
The issue could have been: Editing the description while UE ( 1.8 ) still thinks the requirement index is improper > possibly leading to jumbled up mess in the edifdesc.
I think you would have to change the index to a vanilla value first, then save stbof.res, then edit the building description, add in your edited edifice and all should be well... but I haven't tested it, since reverting the backup is currently working with most current edifice and star gif palette combination.
Otherwise, I may need to upgrade GALM to using the UE latest public release.
Edit: I am wondering why resource level "Asteroid Belt Dilithium" is not showing up in any system in game. Had a look at your asm notes (very handy) and didn't see anything odd. Did I miss something? Seems I might be misunderstanding the Asteroid function: it only comes into play after a comet strike/assimilation/planet destruction event?
I think you would have to change the index to a vanilla value first, then save stbof.res, then edit the building description, add in your edited edifice and all should be well... but I haven't tested it, since reverting the backup is currently working with most current edifice and star gif palette combination.
Otherwise, I may need to upgrade GALM to using the UE latest public release.
Edit: I am wondering why resource level "Asteroid Belt Dilithium" is not showing up in any system in game. Had a look at your asm notes (very handy) and didn't see anything odd. Did I miss something? Seems I might be misunderstanding the Asteroid function: it only comes into play after a comet strike/assimilation/planet destruction event?
- Spocks-cuddly-tribble
- Code Master
- Posts: 1797
- Joined: Sun Apr 27, 2008 2:00 am
Re: New Resource & Building-Output Types Discussion
Low probability, many vanilla random default maps won't have any Asteroid Belt Dilithium systems.
This decreases even further for systems with more planets. An unused BotF original feature for the System Resource Level.

You can lower the planets value (lowering probability for useful asteriod features) here:
004B7ADB fild dword ptr [esp+0Ch] ; number of planets 004B7ADF fmul ds:Planets_Impact_ResourceLevel_0_02 ; planets * 0.02 (0x17D9FC) 004B7AE5 fsubr ds:dilithium_frequnency_0_1 ; ST(0) = 0.1 - ST(0) -> new value 4B7A48 (5* Planets_Impact) 0xB6E48 004B7AEB faddp st(1), st ; random 0-1 + (0.1 - planets * 0.02) 004B7AED fst qword ptr [esp] ; random 0-1 + (0.1 - planets * 0.02)E.g. 0.2 -> 0.15 will give you more asteriod systems, with Asteroid Belt Dilithium still being lowest.
But there is also an anchor value and barrier values, so much testing is needed to get this right if you extended max number of random planets per system (vanilla default max 7 planets).
I don't know how many bugs is too many but that point is reached somewhere before however many in BotF is.
- Tethys
- Past Administrator
- Posts: 2341
- Joined: Fri Jul 18, 2008 2:00 am
- Location: Your mom's bed ;)
- Contact:
Re: New Resource & Building-Output Types Discussion
Redacted. You are absolutely right, its a frequency thing. The asteroid systems frequency is fine, I just want to adjust the one with dilithium and asteroids to be a little more frequent.
This one?
Ty for the fast reply, and sorry to bother
This one?
Code: Select all
004B7AF4 DC1D 04FC5700 FCOMP QWORD [57FC04] // 0.5 for dilithium ResourceLevel 2
- Spocks-cuddly-tribble
- Code Master
- Posts: 1797
- Joined: Sun Apr 27, 2008 2:00 am
Re: New Resource & Building-Output Types Discussion
Easiest approch is editing System Resource Level 5 to also feature "Asteroid Belt Dilithium":
004B7B92 804D 71 0E OR BYTE PTR SS:[EBP+71],0EHere is also System Resource Level 4 if only 10 and 5 is still too low for you:
004B7B71 804D 71 0E OR BYTE PTR SS:[EBP+71],0E
I don't know how many bugs is too many but that point is reached somewhere before however many in BotF is.
- Tethys
- Past Administrator
- Posts: 2341
- Joined: Fri Jul 18, 2008 2:00 am
- Location: Your mom's bed ;)
- Contact:
Re: New Resource & Building-Output Types Discussion
Code: Select all
0057FBF4 dilithium_frequnency_0_1 dq 1.0e-1 ; DATA XREF: dilithium_0_1__ResourceLevel+64r
0057FBF4 ; dilithium_0_1__ResourceLevel+95r
0057FBFC Planets_Impact_ResourceLevel_0_02 dq 2.0e-2 ; DATA XREF: dilithium_0_1__ResourceLevel+8Fr
0057FC04 ResourceLevel2__0_5 dq 5.0e-1 ; DATA XREF: dilithium_0_1__ResourceLevel+A0r
0057FC0C ResourceLevel3__0_7 dq 7.0e-1 ; DATA XREF: dilithium_0_1__ResourceLevel+C5r
0057FC14 ResourceLevel4__0_8 dq 8.0e-1 ; DATA XREF: dilithium_0_1__ResourceLevel+EAr
0057FC1C ResourceLevel5__0_9 dq 9.0e-1 ; DATA XREF: dilithium_0_1__ResourceLevel+10Fr
This calls for another set of planet animations. I was thinking: Brown Dwarf?

Edit: I see what's going on now and why its less frequent. You can build all types of dilithium required buildings in that system. Very interesting and I think 0.15 on the frequency is going to be just right (just tested 0.1 and it was a bit much). I think I got it set to what I would like it to be. I had to reduce slightly the overall dilithium frequency from 0.25 to 0.225 and used 0.1 because there was so little difference from 0.11-0.15 and a massive increase at 0.1 I decided to try something else, luckily it seems to be working. Thanks again
- Tethys
- Past Administrator
- Posts: 2341
- Joined: Fri Jul 18, 2008 2:00 am
- Location: Your mom's bed ;)
- Contact:
Re: New Resource & Building-Output Types Discussion
Not sure if you're interested or not @SCT but:
no popup text for asteroid in system
shared popup text for asteroid in system with other resources
lexicon 242 change: % sent dilithium to % > Resource Present
Galaxy map (show system bonus) will still show "Dilithium Present" in system square popup text, in system view you will have resource text for asteroid as well
ps. You left one byte.. its not enough to do what I was hoping, which was make the asteroids a popup text for you
I needed at least 4
Code: Select all
004FCAA5 EB 3B JMP SHORT 004FCAE2
Code: Select all
004FCAA5 EB 06 JMP SHORT 004FCAAD
Code: Select all
004FCAAD B0 F2 MOV EAX, 0F2h
Galaxy map (show system bonus) will still show "Dilithium Present" in system square popup text, in system view you will have resource text for asteroid as well
ps. You left one byte.. its not enough to do what I was hoping, which was make the asteroids a popup text for you

- Tethys
- Past Administrator
- Posts: 2341
- Joined: Fri Jul 18, 2008 2:00 am
- Location: Your mom's bed ;)
- Contact:
Re: Extending System Bonuses & Sun Icons - edifice.bst+71h requirements
Here I have created some alternate d.tga and id.tga files in case anyone wants more flavors to taste.
Files soon to follow. Most obviously is there is now a brown dwarf in the less common systems. Less obvious is I brightened the asteroids up in the less common, and darkened them in the more common and reduced the number of asteroids in the tga as IMO they were too clustered together. Furthermore I will be retiring the stationary asteroid field planet animation and using solely the animated belt, in favor of asteroids near the star (not entirely proper but cleans up the UI a bit). Also added faux stellar/planet type "T" for hot Jupiters/Brown dwarves and D for asteroids; cosmetic feature built into the tga file.
Files soon to follow. Most obviously is there is now a brown dwarf in the less common systems. Less obvious is I brightened the asteroids up in the less common, and darkened them in the more common and reduced the number of asteroids in the tga as IMO they were too clustered together. Furthermore I will be retiring the stationary asteroid field planet animation and using solely the animated belt, in favor of asteroids near the star (not entirely proper but cleans up the UI a bit). Also added faux stellar/planet type "T" for hot Jupiters/Brown dwarves and D for asteroids; cosmetic feature built into the tga file.
Last edited by Tethys on Fri Oct 06, 2023 7:12 pm, edited 2 times in total.