[SDK MOD] Great Person Thresholds Per City

Wow! I just finally got around to playing a game with this mod, and it was CRAZY! I built some wonders in my cities and I started pumping out tons and tons of great people. Perhaps this mod should raise the threshholds so you don't get 50 GP in a game, but that game was awesome!
 
I've looked at the Schema and done some planing for what we need to change

The output of GPP by a wonder is controled by the
<GreatPeopleUnitClass> and <iGreatPeopleRateChange> tags, the first must hold a GP type such as artist, Scientist ect. The second holds the point total. All we need to do is change the logic to one inwhich any Specialist that produces GPP towards the matching type recives a boost equal to the specified int. This has the advantage of not requiring any XML changes or need to rebalance the system as all wonders produce at most 2 points which I personaly think is well balanced with a dependency on Specialists to get any points at all.

The SDK changes will mostly be the reverse of the process you described earlier (oh by the way I found that WinMerge to be very handy thanks for the tip :goodjob: ) The GreatPerson ThreshHold and counter would become an aspect of the Player rather then the City, all Cities would give their points to the player. It would still be nice to see that little bar on the City Screen as you manipulate your specialists so I propose we keep it exposed to Python but re-route it to display the Players global total, it would be the same in every city but remove the need to have some kind of new screen with the players GP threshold on it (though I think the Improved Domestic Advisor did a nice job at that hopefully it can be updated to include these changes).

The last change I had in mind involved giving specialists more output bonuses, such as Science, Culture and Money. Currently these can only be given out as an across the board bonus to all specialists. Adding a target specialist type shouldn't be too hard as we can mostly copy the Yield type bonus that is used on Angkor Wat. Little bonuses or 1 to many of the common buildings would realy help specialists be more productive and encourage city specialization.
 
Tycoon101 said:
Wow! I just finally got around to playing a game with this mod, and it was CRAZY! I built some wonders in my cities and I started pumping out tons and tons of great people. Perhaps this mod should raise the threshholds so you don't get 50 GP in a game, but that game was awesome!

Dont worry we won't have that many GP's in the next version. Until that, you can easily lower the GP output by decreasing the <iGreatPeoplePercent> in the "CIV4GameSpeedInfo.xml" file, which you can found in your assets\xml\GameInfo folder. Just set it to %300 for example to slow down the GP production to 1/3.

Thanks for your feedback :)
 
Impaler[WrG] said:
I've looked at the Schema and done some planing for what we need to change

The output of GPP by a wonder is controled by the
<GreatPeopleUnitClass> and <iGreatPeopleRateChange> tags, the first must hold a GP type such as artist, Scientist ect. The second holds the point total. All we need to do is change the logic to one inwhich any Specialist that produces GPP towards the matching type recives a boost equal to the specified int. This has the advantage of not requiring any XML changes or need to rebalance the system as all wonders produce at most 2 points which I personaly think is well balanced with a dependency on Specialists to get any points at all.

The SDK changes will mostly be the reverse of the process you described earlier (oh by the way I found that WinMerge to be very handy thanks for the tip :goodjob: ) The GreatPerson ThreshHold and counter would become an aspect of the Player rather then the City, all Cities would give their points to the player. It would still be nice to see that little bar on the City Screen as you manipulate your specialists so I propose we keep it exposed to Python but re-route it to display the Players global total, it would be the same in every city but remove the need to have some kind of new screen with the players GP threshold on it (though I think the Improved Domestic Advisor did a nice job at that hopefully it can be updated to include these changes).

The last change I had in mind involved giving specialists more output bonuses, such as Science, Culture and Money. Currently these can only be given out as an across the board bonus to all specialists. Adding a target specialist type shouldn't be too hard as we can mostly copy the Yield type bonus that is used on Angkor Wat. Little bonuses or 1 to many of the common buildings would realy help specialists be more productive and encourage city specialization.

Great plan :goodjob:
i hope (but unsure) those can be implemented that easily , next weekend will be very fun :) Your idea about keeping the current user interface sounds good. Lets reserve your idea of specialist extra bonuses for version 3. Firstly i want to clarify our main change effects to make sure i understood it correctly:

Lets say i have; (Assume that all specialists produce 2 GP per turn)
City A -> Wonder1 gives %10 bonus to engineers
City B -> Wonder2 gives %20 bonus to artists
City A -> have 5 engineer specialists producing 10 GPs per turn.
have 1 artist specialist producing 2 GPs per turn.
City B -> have 5 artist specialists producing 10 GPs per turn.
have 1 engineer specialist producing 2 GPs per turn.

I run this configuration for 5 turns.
I will receive 50+5 engineer points from City A
I will receive 10 artist points from City A
I will receive 50+10 artist points from City B
I will receive 10 engineer points from City B

So totally: I will have 135 GP consisting of 65 engineer and 70 artist.
Lets assume the threshold for next Great Person is 135. Then;
%52 probability, an artist will born
and %48 probability an engineer will born.

1) Is this correct? And will everybody reading this thread be happy about this?
2) What if we run this configuration more and more turns? Won't the probability of having a great artist converge to %100? Just brainstorming :p
 
I was thinking along the lines of an integer bonus to each specialist, so for example Priests normaly produce 3 GPP (Prophet), if you Build StoneHenge which normaly produces 2 GPP (Prophet) on its own you would insted increesse the output of each priests by 2 so they now produce 5 GPP. Multiple wonders would stack so Say you also get a Shrine that would add an additional 1 so they each produce 6. Note that Philisophical Trait and the Parthanon could be realy powerfull under this system, some balancing might need to be done.

The pooling and thresholding would work just as you described, the same % based probability for GP creation should be keept as well (to keep things simple). The final issue is ware to spawn the GP. I see several options with varying degrees of complexity.

Simplest - Spawn in the Capital (if no capital a random city)
Moderate - Spawn in city with the greatest GPP output (either total or of a particular type, coin toss on a tie)
Harder - Weight each city by its GPP output and use that as probability to spawn their (example City A produces 20 GPP, City B produces 10, probability of spawning in A 66%, in B 33%, again this could be based on total GPP or on just the matching type of GPP)
Hardest - Something which takes into account buildings, Wonders and other factors such as city population, personaly I dont see much benifit to being so picky.
 
If all you want to do is eliminate the Great Person Farm strategy -- there's a simple way to do so. Just change the Wonder XML building file to subtract one happiness point for each wonder. That way, if you build five wonders in a city, that city gets a -5 unhappiness. That will do two things. 1) It forces you to spread your wonders out over many cities and 2) it makes you reconsider whether or not to even try to build the wonder in the first place (is it really worth it or should I wait and build something else?).

I'm doing this right now.

I'm actually dividing the negatives between unhappiness and unhealthiness though. Some wonders make my people less happy -- some make them less healthy.

Some of you may think this unrealistic but really, the health and happiness variables actually represent (in game terms) caps on city growth (before incurring penalties). There seems nothing inherently illogical that the resources devoted to a particular wonder might negatively impact the birthrate or the economy (all those religious wonders might require celibate priest and prestess classes after all!).

To decide how to weight my wonders (health or happiness negatives) I ask whether the wonder in question might benefit most from its pairing with luxuries or with some foodstuff. If the former, I have the wonder negatively impact happiness. If the latter, it negatively impacts health.
 
A great people farm has nothing to do with wonders. It's all about having as many specialists as you can.
 
Im almost done coding the core portions, I found a neat little strategy. I used a simple flag to redirect the function of Cities which returns the GreatPeople points total towards an acumulator in the Player object. Likewise the incrementing function uses the same flag to redirect to a player pool. I created a player equivilent variable and functions that are called when the normal ones get redirected. I'm not entirely shure how GP types are chossen as cities dont actualy seem to keep track of types of points generated, their all pooled together in each city. It seems to involve Python. I'll keep ya updated with my progress.
 
Impaler[WrG] said:
Simplest - Spawn in the Capital (if no capital a random city)
Moderate - Spawn in city with the greatest GPP output (either total or of a particular type, coin toss on a tie)
Harder - Weight each city by its GPP output and use that as probability to spawn their (example City A produces 20 GPP, City B produces 10, probability of spawning in A 66%, in B 33%, again this could be based on total GPP or on just the matching type of GPP)
Hardest - Something which takes into account buildings, Wonders and other factors such as city population, personaly I dont see much benifit to being so picky.

How about Harder, but only weighed with the percent of the special gp type,
so city A produces 20 GPP 50% of engenier, 50% artist, and city B produces 10 GGP 100 engenier then en engeneer wilol spawn with 50/50 chance, an artist will always spawn in city A. if an prophet spawns place him in the capital as no city produces prophet points at the moment.

Oh and about the bonus by wonders. How is this planned exactly? Right now only sources are counted to determine the GPType, not the actual generated points. So right now stonhenge+2 priest would be tree sources of Prophet GPP, 8 points total, with your change 2*(3+2) points and eight sources of gpp? or 10 Points total and 2 sources (one source per prophet)?
Hoe about a city with stonhenge and 2 scientists, what would that produce?

As i understand it now I see no reason to change the old system as the new system might force additional micromanagement on the player (just about the points themselves, the general pool is a great idea).
 
I have things functioning so far, Points are pooling across the whole Empire and Great People are spawning based on that pool. Cities only display their individual outputs on the Meter but each turn the Meters total increeses by the whole Empires output.

I have hit a snag though on determining GreatPerson Type. Its aparently controled in Python and passed back to the C++ layer which actualy creates the GP. Whats happening is that as each City is processed the City which actualy hits the threshold determines the GP and is the spawn location. And the GP type is determined by the point totals in that city alone. I will need to do an acompanying Python changes to get things functioning as I want.
 
Whats happening is that as each City is processed the City which actualy hits the threshold determines the GP and is the spawn location.
That one is actually kind of good as it ensures that GP a distributet Randomly and with greater chance for cities that produce man GPP. The type needs to be adressed two. How about simply changig the percentages of each city to the global percentages an resetting all on creation. Then the global chance for the GP can be viewed in every city even without Phython change, can't it?
 
The C++ layer dose not currently "know" what the percentages are, it only knows the total number of points. It Could be redone to know this and deside for itself what kind of GP to create but thats a significant change, I would look to Python first before making such a change.

I will hope to have this mod ready and released in the first verion of the CivCoreComunity Mod which should happen later this month.
 
Hi,

First of all, it is a great idea to mod those GP. I like the idea, allthough I havn't played it yet.

I have a question about the backwards compatibility of the save games, because I saw you changed the load/write methods. Did you tested that? Were you able to load an old savegame? Were you able to load a moded savegame with the standard version?

Also, I would like to merge your mod into another SDK mod, but I have some problems to identify your changes in the code. Some of the provided sources contains a "// SERKAN" comment, but most of them not. Did you add unchanged files as well? Did you use different comments than "SERKAN"?

12m
 
I have made quite a bit of progress today, I now have GP type being determined by the Point totals across the whole Empire rather then just one City. Acordingly when you view the GP type probability information it will be the same in every city. The Spawn point is still rather random, its possible to get GP to spawn in cities that dont even have any specialists (this :confused: me as I didn't think it was possible).

Also I have the Great People Rate display working off the total Empire wide output so when you increese and decresse specialists you see the new total output. Example I have 3 cities A,B and C. City B has 2 specialists and produces 6 GPP these are currently the only specialists, I open up City A and its bar shows +6, I add a specialist their, bar show +9. I move over to City C, its bar shows +9. Note that the "Base Specialists Rate" and "Final Specialist Rate" have been left alone to alow you to see specificaly what each city is producing. At some later date I would like to change the bar to show local/global output. So with the prior example City A is +3 / +9, City B is +6 / +9 and C is +0 / +9.

I have one little Bug which I will hopefully quash tommorrow, the totals are acumulating too fast indicating I have a mix up when changing the Empire wide rate of points.
 
I'm not working with Shaded's source code, I am developing my own Mod along the lines I described earlier in this thread. Because my Mod is esentialy doing the opposite of his did none of his Sorce was usable though it was instructive (thanks Shaded). He moved player atributes into the City I am moving City atributes into the Player and putting toggles on all the city gets/sets to redirect them to the player.

To find every change in the sorce code I sugjest you use WinMerge and do a whole directory diff between his code and a virgin unpack of the SDK, that will find every line that differs (you might set it to ignore whitespace for efficiency though). I find this is good for running on my own code to make shure I commented everthing I did.

EDIT: Bug quashed, everything is working acording to plan "MWAHAHAH!!", This mod is finished for the time being and will be avalibe in the CoreComunity projects first release, now on to other things.
 
As stated earlier the mod will be in the CoreComunity Project, the CCP will have a number of mods in it and will feature an options menu alowing the mods to be turned on and off by the user at run time. First release is schedualed for later this month. You will have to wait untill then.
 
Someone may have already posted something like this already but I haven't read through the entire topic.

However, I would like to point out that the description of the original game's GP threshold is not how it actually is.

If we go by what you said in the first post:

City 1 makes 10 GP pts per turn.
City 2 makes 3 GP per turn.

GP threshold is 100.

So yes on turn 10, city 1 gets a GP.
On turn 30 City 1 also gets a GP. (20 turns later)

However, the next limit is actually 300, not 400. (It keeps increasing by 100)

By turn 30 City 1 will have 0/300 points as it just got another GP.
However, City 2 will have 90/300 points. It doesn't get reset.

However, your analogy is still effective as City 2 in this case will not be able to get to 300 points before city 1. But it will eventually get a GP before city one. Some hundred or so turns later.

Example: Turn 60 will be the next GP generated by city 1. Making the GP threshold go to 400. This will make City 2 have 180/400 GP

Then, it will take 40 more turns, (or turn 100) for city 1 to generate another GP, making the threshold go to 500.

40*3= 120 + 180 = 300/500. (City 2's GP threshold at turn 100)

So with this in mind the next 50 turns (turn 150) will be needed for City 1 to generate another GP. 50 * 3 = 150 + 300 = 450/600 (City 2's GP threshold at turn 150.)

Then, 60 turns later again, (or turn 210) technically City 1 would get another GP at 600, however, it will only take 50 turns for City 2 to get it's GP. (600 - 450 = 150/3) = 50

So, as you can see it isn't impossible for a city less generating GP pts than another to end up generating a GP in the original game, it just takes a bit longer. ;)

Regardless of that long speech. :p I still think this is an awesome mod. :goodjob:
 
Top Bottom