Happy Golden Age

platyping

Sleeping Dragon
Joined
Oct 22, 2010
Messages
4,626
Location
Emerald Dreams
Happy Golden Age

Features:



Civ V Golden Age System
Ever wondered what is the point of excess Happiness?
A city with 100 Excess Happiness has no difference compared to one with 5 Excess Happiness?

New Golden Age System
Every excess happiness adds towards the Happy Golden Age Bar.
When bar is filled, Golden Age is triggered and bar is empty again.
Threshold is set at 250 (adjusted by GameSpeed) and increases by 250 every time it is full.
Does not change during Anarchy or Golden Age

Healthcare System
Every excess healthiness adds towards the Happy Healthcare Bar.
When bar is filled, +1 Population to All Cities is triggered and bar is empty again.
Threshold is set at 250 (adjusted by GameSpeed) and increases by 250 every time it is full.
Does not change during Anarchy
 
Thanks. Not really an innovation though, since it is just a porting of civ v feature.
Can't really remember whether the bar is still filling up or not during golden age.
And I think civ v does not have anarchy?
 
This is cool, I'll look at putting it into the next version of HR. Good work!

Incidentally, if you're up for a challenge, one of the changes Civ5 made that was excellent was each Great Person type having their own separate progress bar. Reckon something like that might be possible to emulate?
 
Can you add AI for civic choice rutine.

Example if AI calculates that 5 turns more and GA will begin then decide to wait to GA and than change civic.
 
And... how do you do that in python

I am not a python/sdk modder (xml only) so everything is simple for me :D
 
Incidentally, if you're up for a challenge, one of the changes Civ5 made that was excellent was each Great Person type having their own separate progress bar. Reckon something like that might be possible to emulate?

Only possible via SDK

What about doGreatPeople in CvGameUtils? My understanding is by setting the return value to true that will override BTS's default routine in CvCity.cpp. We could then rewrite the routine in Python, perhaps storing each GPP pool using the city's script data. Am I overlooking something?
 
doGreatPeople I believe is to spawn Great People.
Nothing to do with the bar
 
doGreatPeople I believe is to spawn Great People.
Nothing to do with the bar

Yes, but what I'm wondering is if we override doGreatPeople and hide the standard bar in the interface, then no Great People would ever be spawned and we could therefore replace it with a different system. The bar would still accumulate some GPP but it would for all intents and purposes have no effect. I'm just trying to think of there are any other mechanics that would break if we did this, i.e, anything that relies on checking the progress of GPP that is unrelated to generating great people.

EDIT: If I'm reading the function correctly, doGreatPeople() does handle per turn GPP generation, just not from specialists or buildings which are handled elsewhere.

Spoiler :
Code:
void CvCity::doGreatPeople()
{
	CyCity* pyCity = new CyCity(this);
	CyArgsList argsList;
	argsList.add(gDLL->getPythonIFace()->makePythonObject(pyCity));	// pass in city class
	long lResult=0;
	gDLL->getPythonIFace()->callFunction(PYGameModule, "doGreatPeople", argsList.makeFunctionArgs(), &lResult);
	delete pyCity;	// python fxn must not hold on to this pointer 
	if (lResult == 1)
	{
		return;
	}

	if (isDisorder())
	{
		return;
	}

	[COLOR="Red"]changeGreatPeopleProgress(getGreatPeopleRate());

	for (int iI = 0; iI < GC.getNumUnitInfos(); iI++)
	{
		changeGreatPeopleUnitProgress(((UnitTypes)iI), getGreatPeopleUnitRate((UnitTypes)iI));[/COLOR]
	}

	if (getGreatPeopleProgress() >= GET_PLAYER(getOwnerINLINE()).greatPeopleThreshold(false))
	{
		int iTotalGreatPeopleUnitProgress = 0;
		for (int iI = 0; iI < GC.getNumUnitInfos(); iI++)
		{
			iTotalGreatPeopleUnitProgress += getGreatPeopleUnitProgress((UnitTypes)iI);
		}

		int iGreatPeopleUnitRand = GC.getGameINLINE().getSorenRandNum(iTotalGreatPeopleUnitProgress, "Great Person");

		UnitTypes eGreatPeopleUnit = NO_UNIT;
		for (int iI = 0; iI < GC.getNumUnitInfos(); iI++)
		{
			if (iGreatPeopleUnitRand < getGreatPeopleUnitProgress((UnitTypes)iI))
			{
				eGreatPeopleUnit = ((UnitTypes)iI);
				break;
			}
			else
			{
				iGreatPeopleUnitRand -= getGreatPeopleUnitProgress((UnitTypes)iI);
			}
		}

		if (eGreatPeopleUnit != NO_UNIT)
		{
			changeGreatPeopleProgress(-(GET_PLAYER(getOwnerINLINE()).greatPeopleThreshold(false)));

			for (int iI = 0; iI < GC.getNumUnitInfos(); iI++)
			{
				setGreatPeopleUnitProgress(((UnitTypes)iI), 0);
			}

			createGreatPeople(eGreatPeopleUnit, true, false);
		}
	}
}
 
If you want to do away with bts system and do an individual bar for each gp, it is just not worth the trouble.

This mod comp does a check every turn for every player and updates the bar.
What you want have to update bars of 7 GPs of every city of every player.

Pointless to do with python
 
Updates

1) Bar shifted to left side, since it is usually covered when built list pop up
2) Brand new color unused elsewhere
3) Added a GA rate
4) Added GA rate colors
5) New Bar display during Golden Age and Anarchy
 

Attachments

  • Civ4ScreenShot0006.JPG
    Civ4ScreenShot0006.JPG
    194.3 KB · Views: 287
  • Civ4ScreenShot0007.JPG
    Civ4ScreenShot0007.JPG
    194.7 KB · Views: 295
  • Civ4ScreenShot0008.JPG
    Civ4ScreenShot0008.JPG
    185.9 KB · Views: 309
  • Civ4ScreenShot0009.JPG
    Civ4ScreenShot0009.JPG
    126.2 KB · Views: 344
Afforess in AND added new future to gameplay called Dark Ages (opposite to golden age)

I wondering is it be possible to collect unhapinnes also and and some level of unhapinnes starts anarchy or in other mods Dark Age
 
Pretty easy to do the opposite.
But generally, what is the point?
Chance of encountering excess nationwide unhappiness is too low, since there are so many sources of happiness.
Just Globe Theatre alone is too lame.
 
The point is if you will neglect your citizens needs they will revolt against you and that revolt can spread on entire nation (anarchy).

Mod components are used by mods so amount of happy giving stuff depends on modder
 
Top Bottom