Alpha Centauri 2

Sid Meier's Alpha Centauri & Alien Crossfire => Modding => Bug/Patch Discussion => Topic started by: Dio on June 29, 2015, 09:15:35 PM

Title: Children's Creche and Brood Pit Bug(s) Thread
Post by: Dio on June 29, 2015, 09:15:35 PM
As of Yitzi's unofficial patch version 3.4, the Children's creche morale bonus for units attacking in the base square equals 1 - (negative morale Modifier). For example, with -4 MORALE, all units in the base square get +4 Morale while attacking. In addition, this bug allows units to exceed the usual limit of +50% on attacks. As an example, a elite unit owned by a faction that has -4 MORALE, and is in a base with a Children's Creche, gets +100% while attacking. This particular bug applies to both the Brood Pit and Children's Creche Facilities. Presently, I know the operation at address 005016AA controls the application of the attack bonus for the Children's Creche Facility.
Title: Re: Children's Creche and Brood Pit Bug(s) Thread
Post by: Dio on June 29, 2015, 09:27:59 PM
The method I used to make the Children's Creche Facility morale bonus function as described in the help.txt file was to replace all commands from 0050167A to 005016AB with nop's. However, this still leaves the (+) morale display to fix.
Title: Re: Children's Creche and Brood Pit Bug(s) Thread
Post by: Dio on June 29, 2015, 10:08:12 PM
The method I used to make the Brood Pit Facility Morale Bonus function as described in the help.txt file was to replace all commands from 00501789 to 00517BA with nop's. In addition, I also needed to replace the operation at address 005171C with an nop because sporelaunchers and other psi units were getting an additional +1 Morale on top of the bonus recieved by the bugged children's creche. This again still leaves the (+) display aspect to fix.
Title: Re: Children's Creche and Brood Pit Bug(s) Thread
Post by: Dio on June 29, 2015, 10:54:32 PM
It appears as though my changes will not fix this particular problem because they cause negative morale modifier for Social, MORALE to not operate. Regardless, this problem gave me knowledge about the location of the procedure that controls the morale bonus and penalities.
Title: Re: Children's Creche and Brood Pit Bug(s) Thread
Post by: Dio on June 30, 2015, 05:06:01 PM
After some reconfiguring, I have figured out a method that will for the most part work based upon the code from the original SMAX game. The way that the Children's Creche effects morale currently is that it negates all negative morale modifiers for units that are produced at the base. However, it does negate the halved + modifiers from -2 MORALE or lower. As an example, first take a base controlled by a faction with -4 MORALE. If a base owned by the above faction has a command center, children's creche and bioenchancement center; when the faction builds a land unit at that base, the unit will start out at Disciplined. In addition, with the changes I plan to implement, units in any base with a children's creche would then receive +1 Morale. This means a Disciplined unit would receive a +12% morale bonus while attacking from within the base.
   This leads to my question. This particular change would still allow any elite units to exceed the +50% bonus. However, it is far better than it was before I fixed the bug because elite units controlled by a faction with -2 MORALE or less would only get at most +62%. Is this feature a bug? What is your opinion on the matter?
Title: Re: Children's Creche and Brood Pit Bug(s) Thread
Post by: Dio on July 02, 2015, 06:45:53 PM
I found where the Graphics for Morale + and - signs are controlled :). This means I should have all the information required to correct the bug. The procedure starts at 004B3FD0.
Title: Re: Children's Creche and Brood Pit Bug(s) Thread
Post by: Dio on July 03, 2015, 04:39:49 PM
I also noticed that in scient's last unofficial patch that combining a children's creche with +2 or +3 MORALE bonuses causes the bonus to become negated. I find these bugs annoying to manage because fixing one causes another to appear ;clenchedteeth.
Title: Re: Children's Creche and Brood Pit Bug(s) Thread
Post by: Buster's Uncle on July 03, 2015, 04:45:06 PM
Ain't that always the way with this, though?
Title: Re: Children's Creche and Brood Pit Bug(s) Thread
Post by: Nevill on July 04, 2015, 06:10:33 AM
Quote
This leads to my question. This particular change would still allow any elite units to exceed the +50% bonus. However, it is far better than it was before I fixed the bug because elite units controlled by a faction with -2 MORALE or less would only get at most +62%. Is this feature a bug? What is your opinion on the matter?
It is, since it leads to the faction that has negative morale to be more efficient in combat than a faction with a positive one.

But if that is the only way to fix a bigger bug, maybe it is still worth it?

Is there a way not to apply any of the "+" bonuses to Elite units and cap them at 50%?
Title: Re: Children's Creche and Brood Pit Bug(s) Thread
Post by: Dio on July 17, 2015, 02:47:12 AM
In the present version (3.4) of Yitzi's Unofficial Patch, Children's Creches also give Mind Worms attack bonuses in bases  ;deidre;.
Title: Re: Children's Creche and Brood Pit Bug(s) Thread
Post by: Dio on July 17, 2015, 02:53:39 AM
Quote
This leads to my question. This particular change would still allow any elite units to exceed the +50% bonus. However, it is far better than it was before I fixed the bug because elite units controlled by a faction with -2 MORALE or less would only get at most +62%. Is this feature a bug? What is your opinion on the matter?
It is, since it leads to the faction that has negative morale to be more efficient in combat than a faction with a positive one.

But if that is the only way to fix a bigger bug, maybe it is still worth it?

Is there a way not to apply any of the "+" bonuses to Elite units and cap them at 50%?
The way I understand this particular section of the code works in its original form is that the procedure first negates any negative morale modifiers for any units produced at the base. Then, it simply inclements the morale bonus value. However, the bug involves the addition of moral bonuses equal to the negated value.
Title: Re: Children's Creche and Brood Pit Bug(s) Thread
Post by: Dio on July 18, 2015, 12:33:07 AM
How do you want Children's Creche's and Brood Pits to operate? The way it works currently technically meets the description in the Datalinks which states "All negative $LINK<MORALE=130004> effects are cancelled for units in base square; instead such units receive a +1 MORALE modifier." The negation of negative morale effects appears as the along with an additional +1 sign. However, as stated above, this makes children's creches and Brood Pits hideously broken when combined with negative Morale Modifiers.
Title: Re: Children's Creche and Brood Pit Bug(s) Thread
Post by: Nevill on July 18, 2015, 12:45:39 AM
For a unit in base tile, if the unit's Morale < Hardened => Set the bonuses so that it fight as is it was Hardened (at a +12% bonus).
Meaning Very Green units get +++, Green units get ++, and Disciplined get + modifiers to Morale.

Should not affect Native units.

Brood Pits should act in a similar way for Native units.

The building bonuses should not be affected in any way by the faction's MORALE setting. The description does not mention anything about the units produced in the base, only about the ones that are stationed there. Factions with very low MORALE score would still get their Very Green units, it's just they are going to fight better while inside the bases with Creches.
Title: Re: Children's Creche and Brood Pit Bug(s) Thread
Post by: Yitzi on August 28, 2015, 11:42:39 PM
So: Clearly -MORALE should not give a bonus to units attacking from a base with a creche, but should they have the MORALE penalty negated, or should that be for defenders only?  (I'll add a poll on the topic.)
Title: Re: Children's Creche and Brood Pit Bug(s) Thread
Post by: Nevill on September 03, 2015, 01:22:49 PM
I have delved a bit deeper in the morale business, and created my own poll about (+/-) signs.

As it seems to be connected with the issue in question, I'd like to re-evaluate my stance on this poll and vote for the second option, if only to have some measure of consistency across the game:
"The unit should get the penalty as well; the creche effect should be for defenders only."

The Cheche description specifically talks about defense:
Quote
Proper care and education for our children remains a cornerstone of our entire colonization effort. Children not only shape our future; they determine in many ways our present. Men and women work harder knowing their children are safe and close at hand. And never forget that, with children present, parents will defend their home to the death.
Title: Re: Children's Creche and Brood Pit Bug(s) Thread
Post by: Yitzi on September 03, 2015, 02:31:14 PM
I have delved a bit deeper in the morale business, and created my own poll about (+/-) signs.

As it seems to be connected with the issue in question, I'd like to re-evaluate my stance on this poll and vote for the second option, if only to have some measure of consistency across the game:
"The unit should get the penalty as well; the creche effect should be for defenders only."

The Cheche description specifically talks about defense:
Quote
Proper care and education for our children remains a cornerstone of our entire colonization effort. Children not only shape our future; they determine in many ways our present. Men and women work harder knowing their children are safe and close at hand. And never forget that, with children present, parents will defend their home to the death.

I've changed the poll to allow users to change their votes.
Templates: 1: Printpage (default).
Sub templates: 4: init, print_above, main, print_below.
Language files: 4: index+Modifications.english (default), TopicRating/.english (default), PortaMx/PortaMx.english (default), OharaYTEmbed.english (default).
Style sheets: 0: .
Files included: 33 - 892KB. (show)
Queries used: 20.

[Show Queries]