Ok, i had a glance at the codes and project is definitely on 'go, albeit too much work for the moment.
Reading the suggestions in this thread we have 3 sub-projects:
1. Fixing the unfinished global resource for ship construction (default dilithium, almost broken)
2. Using the system resource level (unused; default range 1-10 for dilithium only)
3. Activating more non-planet system features for e.g. building requirements (default only dilithium)
Before commenting please note that a.) the term dilithium is swappable to any other resource and b.) the points 1, 2 & 3 are technically different topics!
# 1
I found unused broken code almost doing what we need. When MicroProse ran out of time, they just switched dilithium pool to turn output resp income to ships-under-construction but forgot to change effective code, resulting in the phantom dilithium bug. Probably [shiplist.sst+11A] was meant to be the dilithium price of ships (test default 10 due to resource level default range 1-10 resp for major ships only since for minor/monster ships unneeded by default).
-> Since we're going to use this for unique weapon animations, could we use 1 byte each from the ship class & type -string for the weapon prefix? (we still have no complete shiplist.sst structure description here on AFC - know that really sucks!)
Also there is a broken feature a second time loading the local dilithium output (i.e. building output) for ship building purposes, despite of the fact it's already added to the global pool. I'm not 100% sure what's good for (yet). Need another look at this when more time available.
Looking at the vanilla ship price progression (industry) I'd say it's possible that the 4th value of the starting pop/credits datafield was meant to be the dilithium starting pool, like thunderchero suggested above (with an increased income due to using resource level).
And of course, we could e.g. change intel event 'destroy credits' to 'steal dilithium'.
# 2
System resource level -> word [systInfo+6E] default 0 resp for dilithium systems 1-10. Major home systems always 5 (due to a bug not always set for space faring minors -> easy to fix)
Default range 1-10 indicates it's a broken extraction multiplier (like Martok said above). Maybe meant for refineries only (by building ID) not prison-mine / singularity-plant?
The value gets set with the dilitium flag (for dilithium icons and building restrictions) but is technically unrelated. Default restriction to dilithium systems should be easy to extend.
# 3
More system features
-Building restrictions:
[edifice.bst+0x71h] = System requirement (1 byte)
0 - Arctic planet
1 - Barren planet
2 - Desert planet
3 - Gas Giant
4 - Jungle planet
5 - Oceanic planet
6 - Terran planet
7 - Volcanic planet
=> vs. [systInfo+70h] = planet types bitmask (resp. anomaly bit -> bug?, see below)
8 - None
9 - Asteroid (not working)
A - Asteroid belt dilithium (not working)
B - Dilithium
C - Worm hole (not working)
D - Radio Pulsar (not working)
E - X-Ray Pulsar (not working)
=> vs. [systInfo+71h] = or 0x8 i.e. 4th bit -> dilithium flag
I just run a test with only bit 3 set at [systInfo+71h], all dilithium sources scrapped & build queue = auto:
-> game freeze at turn 10 (missing dilithium flag vs. AI code or the bugged build queue code)
After that 0xFF i.e. all 8 bits set for up to 7 missing system features:
-> no crash so far, dilithium icon map -> resource level (minor bug), system view (sun animation) -> bitmask
Conclusion: With searching, adapting and testing all codes, this is going to be a 5+ hours time waster i.e. way to much for the moment.
Thus, in the meantime, here is plan 9-b from outer space:
byte[systInfo+31h] = star type (red giant=04, orange=05, yellow=06, white=07, green=08, blue=09)
dword[systInfo+32h] = name of the star picture i.e. s-X- with X being first letter of star color
Say there is e.g. a 5% chance for a star system special feature depending on the star type(i.e. star color). For example for red stars this could be ancient ruins/technologies increasing local research output by e.g. resouce level *2%, for an other star type a rare metal increasing industry output, latinum deposits for local credit output or an asteroid belt increasing dilithium refinery output by the system resource level.
The main point is that the resource icon and/or info text will be part of the sun animations.
-> When system feature present [systInfo+32h] s-X- = e.g. s
1X-
s
1X-.ani -> sX
1b1.gif & sX
1b2.gif -> resource icon / info text part of the sun gif files
s
1X-map.tga & s
1X-maps.tga -> F1 maap icons (unchanged, just renamed copies)
Still unknown in systInfo:
Offset 0x006C to 0x006D = number of ? (cf. 0x00B8)
Offset 0x0072 to 0x0077 -> below the system bitmask for buildings
Offset 0x00B4 to 0x00B7 = address of ???, length 4bytes/planet
Offset 0x00B8 to 0x00BB = address of ???, length 0x40 * unknown at [0x006C]
xDx wrote:I am trying to change what dilithium value is required to finish a star ship on completed turn. Currently vanilla and all currently released mods is +1 dilithium.
First of all, the phantom dilithium topic and my PM box are two entirely different things^^.
As said #1 above, since there is no dilithium pool, just a current turn output, consequently there's no dilithium price. BotF just compares number of ships under construction with the current total dilithium output. Some broken parts of the unfinished feature use simple inc & dec commands (i.e. +/-1) in a count loop. Translation: Your request is part of project #1.
I don't know how many bugs is too many but that point is reached somewhere before however many in BotF is.