Announcement

Collapse
No announcement yet.

Pollution Problem

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Pollution Problem

    I have a curious (and annoying) problem that has cropped up since I've been editing CTP. For quite a while now I've been modifying CTP with generally good success --adding units, wonders, improvements, advances, changing goods and government values, etc.

    Just recently, though, after adding a few new advances (my tech tree is considerably more developed than the original and much more fun)I've run into a problem with pollution. Now, instead of pollution in a city increasing by +1 or so for a city increasing to size 9, it says the pollution is +197! Needless to say this creates an instant pollution problem that no possible improvement can fix (especially in the Renaissance). Also, when I then build a factory it adds another +197 pollution. Pollution levels are then, of course, toxic.

    Where in the world did THAT number come from? Does anybody have any ideas? I have no idea why that has changed. The only out of the ordinary thing I've done is modify the "Age" text file so that each age requires different advances than in the original game. Could this possibly create such an obscure problem? I'd appreciate any help I could get.

  • #2
    I experienced a very bad pollution bug that really ruined a very fun game at which point I stopped playing CTP for a long time. In fact I just decided to play my first game since July 12. If I get this bug again I will just probably wait for Civ III. I also made some mods to the age and changed the cost of some of the techs and also added some new techs, units, and buildings, but basically was playing CD's mod.

    Here is the letter on sent to Activision on July 12. I also posted it on this site and asked Mark G. to see if he could get a response from Activision. I even sent them the game file and the error files. I received no reply from anyone.

    July 12, 1999

    Pollution Bug:

    Scenario: No Factories built although numerous being built. No pollution to speak off. Researched 'Steel', next turn half my cities revolted and numerous tiles damaged due to pollution.

    Research: Pollution controls occur in two files, Const.txt and diff.txt. In Const.txt, pollution occurs because of population and production. For every population greater than 8 receive .5 pollution. If my case, my most polluting city had 24 pop, (24-8) x .5, resulting in 8 pollution from pop. Production pollution is .01 of everything greater than 300. For production take the total modified production, subtract 300 and multiply by .01 or in my case 320 x 1.25 (10 hrs) x 1.25 (Republic) * 1.5 (mill) = 750 total modified production (different than net because of loss due to crime) -300 =450 x .01 = 4.5 and CTP rounds down to 4. Total city pollution is 8 (population) + 4 (production) or 12. Diff.txt takes this number and multiplies by 1 for pollution and for UV_pollution (ozone?). Pollution is calculated each turn as the numbers can change, but my understanding is that pollution is refigured (complied?) after every advance or at least the advances like oil refinery that can greatly effect pollution. Maybe an advance calls one pollution subroutine to run while each turn calls a different subroutine.

    Error: City population was being multiplied by 164 instead of 1. This same city now had (24-8) x 164 x .5 or 1312 pollution from population. Production pollution still correctly stated 4, so total pollution was 1312 + 4 or 1316. Max pollution before damage is 100, so 1316 will damage numerous tiles. This high pollution also gave my cities a -52 happiness rating resulting in the revolt.

    Further research: Steel only took one turn to research and should have taken at least 2 (compared to other available techs with the same research cost). I initially thought it was part of game but after this problem determined that research cost for steel had lost a place, meaning instead of showing 10000 (playing CD's mod) it showed 2000. I know there is a cumulative science additive but this was not the simple case of losing a digit in base 10 system. Maybe in base 8 or base 2 I don't know. I changed the cost of steel back to 9375, backed up a few turns (most being 5) and tried again - same exact error. No matter what I changed the research cost the same error occurred. Conclusion: Difference in research cost is a result of the same error that caused the pollution error but not the cause. Game did crash when I set the research cost very low (780). Unable to view the number because the game would immediately crash.

    Checked other techs and found two others, Chemistry and Explosives, that had incorrect research costs although no errors (at least that I saw) occurred upon research.

    Hypothesis: When the game was first loaded/created/complied, some digit (hex, binary) was stolen from the research cost and added to the pollution calculation cost, so when steel is researched it passes the wrong pollution numbers to the pollution subroutine.

    Test: Raised the pop level from 8 to 23 and then researched steel (now pollution was 24-23)x164x.5 or 82. Since it was below 100 I was able to maintain control and monitor the city. Researched next tech, but pop pollution was not recalulated.
    Conclusion: Only certain tech advances will call the pollution subroutine. Advances that have the additional pollution modifiers like oil refinery or the later advances will call the pollution subroutine. Makes sense. The turn pollution subroutine normally calculates pollution. Only when some advance effects pollution that changes the parameters would the advance call the pollution subroutine.

    Test: I tried to add pollution modifiers to steel or other techs that I could quickly research to see if the parameters (164) would be reset (to 1), but the game would immediately crash upon loading.

    Current Hypothesis: When the game was first loaded/created/complied some error caused steel to have a population pollution modifier of 164, as if that line of code had been added to the test file. This error may or may not be related to the error which caused an incorrect research cost for Steel, Chemistry, and Explosives.

    Have not replayed game another game to see if problem reoccurs at steel as the first game had a lot of time invested and a 2nd one would have at least the same. Reset pop pollution to 30 and tried to continue. Researched steel but the game than totally crashed when I research explosives (another tech that had an incorrect research cost). Gave up and haven't played since. Hope Activision can fix with next patch.

    Comment


    • #3
      Wow, what a pain! What I decided to do is delete CTP from my hard drive and start over. (I defragmented the drive first) It seems to have fixed the problem for now, but I am implementing changes to CTP slowly. So, I haven't added my tech tree changes back in. Although the game does crash at random intervals (I've always experienced this, even with the most minor of changes and have learned to tolerate it) it is not something I can't deal with. I have implored Activision to make an official game editor in their next game, but I doubt it will happen. (see CTP II new discussion threads)

      Comment


      • #4
        Hey...

        Yeah, I had similar problems--esp. when moving up in map sizes and playing with 32 civs. If nothing else works, increase the values in pollution.txt, maybe make a few adjustments to gw.txt--if you're having terrible flooding troubles (also, you might want to look at decreasing the units' pollution settings, esp. the heavy producers), and there's a bunch of stuff in Const.txt which can be tweaked. There's no telling what will work (esp. in Const.txt), so it may take some testing and retesting.
        Existence is Futile.

        Comment

        Working...
        X