Firaxis: Corruption Breakdown

Any chance you might be able to provide the relevant parts of the code? I know this might be sensitive, but I think it will help to ensure a clean release with so many programmers we have here in civfanactics to look at it.
 
Originally posted by Qitai
Any chance you might be able to provide the relevant parts of the code? I know this might be sensitive, but I think it will help to ensure a clean release with so many programmers we have here in civfanactics to look at it.

:lol: :rotfl:

The phrase "give them an inch and they will take a mile" comes to mind.

@Qitai--not meant as a personal attack...it just struck me funny--after all, we are fanatics :crazyeye:
 
You know, no harm trying (as long as you remain friendly while requesting). Surely, all of us do not want another disappointed release. And as I understand, we do have alot of programmers here in civfanatics. I think we can sure use them.
 
I want to show it ASAP! I just want to clarify a couple of things 1st.

These corruption bugs need to end so I won't finalize the update until the community has said their piece about the inner workings of the final code!
 
The current 1.12 implementation of the FP helps the AI in the late game where it needs the most help, it reduces the advantage of warmongering over peaceful building, and it all but eliminates the usefulness of the Palace jump, which many consider an exploit.

I know I'll be flamed for this, but please keep the 1.12 Forbidden Palace!

:)
 
So the distance is calculated twice - both to determine distance related corruption and so that the distances can be compared to generate city rankings for city number / OCN related corruption? It's not really a big deal, but it seems a little inefficient.

Wouldn't it be easier to store the distance to the nearest capital and city rank as member variables in each city's class / structure? Sure corruption / waste need to be calculated each turn (since shield and commerce production change constantly), but the distances and ranks would only need to be calculated when a city is gained or lost or palace / FP / SPHQ built. Everything else (WLTKD, city structures, government type, civ type (commercial or not)) just gets plugged into the local city calculations without the need for the empire wide distance/ranking calculations.
 
Yeti: what you are doing sounds like part of my job description - pointing out possible problems/inefficiences in other people's code! (Also known as the Peer Review. ;) )

Along those lines, even assuming the values are stored as part of the class/structure, what happens when a new city gets built? They all have to be recalculated. Especially if the city is *closer* than other cities to the Palace/FP/SPHQ.

(Okay, so they move that calculation to the end of the "Build a New City" function .... :p )
 
Originally posted by alexman
The current 1.12 implementation of the FP helps the AI in the late game where it needs the most help, it reduces the advantage of warmongering over peaceful building, and it all but eliminates the usefulness of the Palace jump, which many consider an exploit.

I know I'll be flamed for this, but please keep the 1.12 Forbidden Palace!

:)
:worship: :worship: :worship: :worship:

hehe. I knew we'd get a few converts! So far The Last Conformist, alexman and myself like the FP as it is. 3 down, 40,000 to go!
 
Thank you for the explanation Jesse.

I also like the way the FP works in 1.12. If you are going to change it back, then you need to add code so the AI won't build thier FP too close to the Palace.
 
Ugh. Peer reviews. I never seem to have time prior to deadlines to get my stuff reviewed.

Right - the values (city rank and distance to closest capital) would get recalculated for all cities in response to certain actions (city change - built, abandoned, captured, lost, destroyed, culture flip, diplomatic trade or palace change - FP, SPHQ, Palace built, destroyed, or moved), but would ONLY need to be calculated after those events, not every turn.

The recalc should be handled by the setting of a flag (in response to any of those events taking place) which causes the values to be calculated at the beginning of the next turn (before then determining the per city waste / corruption). This way it is only performed at most once per civ, per turn, even if multiple cities are built or captured during the turn.

The other benefit is that by storing the distance value (which would be calculated first), you don't need to repeat the calculation when you determine city ranks.
 
I like the FP the way it worked in PTW (where it gives you a new core of productive cities), but I agree that the AI needs to be smarter about placing it well.

The palace jumping doesn't affect my games though - I don't use that strategy / trick / exploit (whatever you prefer to call it).
 
I think you need more than storing the distance. You need to store which is the closest capital as well. Storing the distance only may mess up the rank again.
 
Originally posted by anarres
:worship: :worship: :worship: :worship:

hehe. I knew we'd get a few converts! So far The Last Conformist, alexman and myself like the FP as it is. 3 down, 40,000 to go!
4 down. :) So far it hasn't bothered me a bit.
And Yeti's right:
but I agree that the AI needs to be smarter about placing it well.
That's a needed fix under either corruption model.
 
Oh dear, and I thought I was confused before.

I just want to clarify (I haven't installed the 1.12b patch yet, I will wait for the final patch, no offense, but I prefer to wait for the final result.)

1) Corruption is the 1.12b patch is working as it should (the calculations anywawy, corruption never actually "works")

2) Building the FP and the SPHQ will NOT increase corruption, they are working as they should and DECREASE corruption.

3) Not to sound impatient, but is there an estimation as to when the final patch will be out?
 
Originally posted by Qitai
I think you need more than storing the distance. You need to store which is the closest capital as well. Storing the distance only may mess up the rank again.

Good point Qitai! That item of data would be needed during those turns when the full empire calculations need to be performed.

That is... unless those pushing to have the FP left the way it is now so that location doesn't matter convince Firaxis that that is the best solution. :)
 
The final patch should be out sometime in March. You are correct on the first two points, RealGoober, except for the fact that one of the corruption calculators is not working as it should. The distance calculator is just fine.
 
Originally posted by RealGoober
Oh dear, and I thought I was confused before.

I just want to clarify (I haven't installed the 1.12b patch yet, I will wait for the final patch, no offense, but I prefer to wait for the final result.)

1) Corruption is the 1.12b patch is working as it should (the calculations anywawy, corruption never actually "works")

2) Building the FP and the SPHQ will NOT increase corruption, they are working as they should and DECREASE corruption.

3) Not to sound impatient, but is there an estimation as to when the final patch will be out?
I can answer 2 of them. :)

1) No. The 1.12 beta patch is not calculating corruption "correctly". At the moment part of the corruption calculation (city rank) is calculated from the Palace. What it "should" do is calculate a rank from the nearest Palace-like improvement. It's because of this the FP doesn't give the minimum 5% corruption. This is also (maybe suprisingly) what a few of us prefer.

2) Correct. Although the FP isn't working quite like it "should" (it doesn't reduce corruption as much as in Civ3/PTW), it still does reduce corruption and will never negatively impact your empire.

3) This one is for Jesse....


Edit: Beaten by Cube...
 
If I were a Firaxis developer, I would be dreading publishing any code on this thread at this point. Even in advance of publishing the code people are throwing around ideas as to how the code might be "better".

I have a suggestion for all the programmers here: if/when Jesse publishes the relevant bit of code here, could we please confine our comments to correctness issues? (Correct for the FP to function as Jesse has described it is intended to function. Nothing else :) ) I think that following this rule will improve our odds of ever being involved again :)
 
Indeed Sir Pleb. :)

Most the suggestions are about optimisation anyway, and that would never be considered at this stage...
 
Back
Top Bottom