2, ; Retool strictness (0 = Always Free, 1 = Free in Category, 2 = Free if Project, 3 = Never Free)
So, I was looking into the undocumented ability of Skunkworks and it's relation to FREEPROTO flag with Spartans.
The undocumented ability is definitely not a bug and clearly intended feature of Skunkworks. It was most likely added late in development or just forgotten about. If the facility is present in a base, it overrides the default "Retool strictness" value and sets it to 1 or "Free in Category". The default in alpha/x.txt is 2 or "Free if Project".Quote2, ; Retool strictness (0 = Always Free, 1 = Free in Category, 2 = Free if Project, 3 = Never Free)
Now, if the FREEPROTO flag is set that faction isn't given an option to build a Skunkworks because they already have the documented feature of the facility. This is similar to how you don't get an option to build a Skunkworks if you're playing on Citizen or Specialist difficulty. Likewise when using either of these difficulty levels, you don't get a retooling penalty at all and it's treated as "Always Free".
More discussion here: http://www.civgaming.net/forums/showthread.php?t=7453 (http://www.civgaming.net/forums/showthread.php?t=7453)
...
I think best solution for this would be to give FREEPROTO factions this feature of Skunkworks upon discovery of the necessary tech "Advanced Subatomic Theory". This is in line with how code already works with treating retooling and proto features in relation to Skunkworks for other things like the difficulty. It seems like this was just oversight since only one faction is affected by this and it would be easy to miss.
On another note, "Never Free" setting for "Retool strictness" alpha/x.txt is broken in some regards. If isn't parsed correctly when alpha/x.txt is read, it only accepts values 0 to 2. Also, a corresponding script.txt entry is missing. However, it is properly handled in function that determines whether there will be retooling penalty or not. It's simple fix so will enable it in case someone wants to use this setting.
-If the base has a skunkworks, it's treated as if the retooling strictness were 1 (unless it's already 0), i.e. free retooling between things of the same type.
-If changing from one non-unit to another, and either the old or the new one is a facility already present in the base, retooling is free. (There seems to be a bug that afterward changing to a unit is also free, but I'm not sure how you get that situation without the scenario editor anyway.)
I'd say give it to them even beforehand, as though they just got bonus skunkworks in the base. However:
1. Scient, have you figured out which bit is the FREEPROTO flag?
2. What does everyone think about what should be done? It doesn't seem worth making into an option, but there probably shouldn't be a change that people don't want.
00000010 ; enum SPECIAL_RULES_1 (bitfield)
00000010 TECHSTEAL = 10h
00000020 TECHSHARE = 20h
00000040 WORMPOLICE = 40h
00000080 ALIEN = 80h
00000100 AQUATIC = 100h
00000200 FREEPROTO = 200h
00000400 FANATIC = 400h
00000800 MINDCONTROL = 800h
00001000 COMMFREQ = 1000h
00002000 TERRAFORM = 2000h
00004000 INTEREST = 4000h
00008000 MORALE = 8000h
00946F58 ; int faction_special_rules_bitfield
This fix will be present in version 2.0 of my patch.
Yep, that was my conclusion as well. It's not just non-unit, it's buildable facilities only so stuff like "Sky Hydroponics Lab" are considered different from say "Children’s Creche".
As for FREEPROTO, yes.Quote00000010 ; enum SPECIAL_RULES_1 (bitfield)
00000010 TECHSTEAL = 10h
00000020 TECHSHARE = 20h
00000040 WORMPOLICE = 40h
00000080 ALIEN = 80h
00000100 AQUATIC = 100h
00000200 FREEPROTO = 200h
00000400 FANATIC = 400h
00000800 MINDCONTROL = 800h
00001000 COMMFREQ = 1000h
00002000 TERRAFORM = 2000h
00004000 INTEREST = 4000h
00008000 MORALE = 8000h
And for SMACX, it will be ptr into faction struct tho so this address is only good for first faction:Quote00946F58 ; int faction_special_rules_bitfield
Likewise, but make note that you'll have to modify the id value used here or the script.txt display will be messed up since there is nothing for id 3.
So if I understand you correctly, the special rules are at the dword at 00946F58 (for the first faction; the corresponding place in other factions)...What are those numbers, though? Seems they should be the positions of the rules, but those only have room for one bit per rule and stuff like INTEREST has more than that. (Also, what are bits 1,2,4, and 8 for?)
What numbers? It's a bitfield. Those are bits that each of these flags are checked in the dword. These are only the rules that act like boolean flags that can be turned on or off. Other special rules like INTEREST are stored in different areas of faction structure.
Oh, I see. It's boolean whether it was set in faction file and then if set it stores it in faction struct. If you're really interested and I can look into it more
009A64C4 : difficulty_level_value
parsing_alphax_general : 005873C0
Do you use IDA?
As for difficulty, it's only stored in one place afaik and then the AI is handled differently.
parsing_alphax_general : 005873C0
Ok, thanks...when it's time to fix the multiplayer difficulty bug and allow differing difficulties in PBEM games*, that'll help a lot.;b; Not a bad idea at all. ;b;
*Very important as a handicap, for when a better player plays against a not-so-good one.
Ok, thanks...when it's time to fix the multiplayer difficulty bug and allow differing difficulties in PBEM games*, that'll help a lot.;b; Not a bad idea at all. ;b;
*Very important as a handicap, for when a better player plays against a not-so-good one.