1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Single Player bugs and crashes v39 download - After July 20th, 2019

Discussion in 'Bugs and Crashes' started by Thunderbrd, Jul 21, 2019.

  1. Uriel246

    Uriel246 Chieftain

    Joined:
    Aug 18, 2014
    Messages:
    16
    Wow I didn't expect so much attention. I will try to answer everything in parts, since it costs me a little to write in English.

    I upload the last save i have.

    What dou yo mean with "pit scenarios"? I guess I was too ambitious with the map size :p, I didn't know the equivalence of those values with the map size either (I should have left it in "no override").

    And yes, is Ancient Era, maybe some AI player are near Classical Era. I don't care too much about turn times, I usually watch some movie or read while I wait :lol::lol:.

    Next game will be in gigantic or that "pit scenarios", should I have Barbarians civs disabled, right?


    Poor and veteran engine :lol::lol:. Currently ryzen 5 2500, 16gb and amd rx 580 8gb and small ssd (but the game is in the HDD).

    I can access to somewhat higher PC, could I go further in the game? Much more?

    Affects the SSD to turn times??

    And yes, Deity difficulty (my first game in this difficulty :cool:)

    It also seemed weird to me. I've played this mod a lot and MAF or CTD are things common to me (each version improving thanks to the great work you all do with this mod), but this is the first time happend to me.
     

    Attached Files:

    raxo2222 and billw2015 like this.
  2. Dancing Hoskuld

    Dancing Hoskuld Deity

    Joined:
    Jul 5, 2004
    Messages:
    23,539
    Gender:
    Male
    Location:
    Canberra, Australia
    If you have the option on that limits unit stack size it can cause infinite turn times when a new unit can't find a place to move to. The code just keeps testing the next possible plot but does not keep track of what plots it has tested before. Increasing the stack size limit for a few turns usually "fixes" the problem.
     
    KaTiON_PT and TaylorItaly like this.
  3. JosEPh_II

    JosEPh_II TBS WarLord

    Joined:
    Jun 20, 2007
    Messages:
    16,210
    Gender:
    Male
    Location:
    Western IL. cornfields
    15.1 MB Save! Yikes!
     
  4. Thunderbrd

    Thunderbrd C2C War Dog

    Joined:
    Jan 2, 2010
    Messages:
    27,816
    Gender:
    Male
    Location:
    Las Vegas
    Will take a look this week.
     
  5. Tajo

    Tajo Warlord

    Joined:
    Jun 26, 2017
    Messages:
    195
    Gender:
    Male
    Now playing at renaissance era with immortal, standard map size and marathon speed. AI eagerly incites and declares war but is very inept to mount any kind of sensible attempt of attack but does react pretty well defensively. Attacks with weird dog armies against impossible odds and feeds small unit stacks for lunch. Far far far too much money, otherwise still fine, I read something about factories being very broken, I really hope that it isn't so. I really do. Not something like this to break the game, not again.

    Wonder if there is something wrong in IDW. Does happen only occasionally around borders but not when attacking a city close to a border for example. Results in veeeery slow conquests as the border and thus culture does not move. 1 tile city starts is on, maybe it is related to that.

    Edit : It seems that there might be something wrong with emergeny draft and pillage influence too. All these are activated in options.
     
    Last edited: Aug 12, 2019
  6. Tajo

    Tajo Warlord

    Joined:
    Jun 26, 2017
    Messages:
    195
    Gender:
    Male
    IDW feels very broken. I just conquered Maori capital. There were quite a lot of units there as it took two turns to take it with full 50 unit stack but not once I received an IDW effect from these battles, not once. This results the kind of 'conquests' that can be seen in a save. Veeeery slow as the culture does not follow like it should in IDW. There were and are random stacks of Maori forces as I arrived to the city and still are. They do not do any meaningful opposition, instead the AI produces large and small dog/cat stacks and randomly attacks with one or few units in them. I know that the work on AI has been delayed long, too long it feels at least in the case of this Maori. Clearly far, far too much money also in the game now.

    IDW effect happens rarely and it seems totally random when it triggers.
     

    Attached Files:

  7. Tajo

    Tajo Warlord

    Joined:
    Jun 26, 2017
    Messages:
    195
    Gender:
    Male
    Just conquered another Maori city full of defenders. Again, not a single influence change during that. IDW happens very rarely and randomly, it feels that I'm practically playing without it. Surely it can't be like this but it seems that no one is interested or remembers their reading. Waste of effort to report bugs here so why even bother.

    Last log out, thanks for another broken C2C experience and 200h playing hours down the drain.
     
  8. raxo2222

    raxo2222 Time Traveller

    Joined:
    Jun 10, 2011
    Messages:
    7,637
    Location:
    Poland
    That is because nobody knows how to fix/balance IDW stuff.
    Generally no one touches things found in RevDCM tab of BUG settings.
     
    Last edited: Aug 21, 2019
  9. Toffer90

    Toffer90 C2C Modder

    Joined:
    Oct 16, 2011
    Messages:
    7,025
    Location:
    Norway
    I'll look into it, I think there's some python code for influence driven war mechanic.
     
    KaTiON_PT likes this.
  10. Thunderbrd

    Thunderbrd C2C War Dog

    Joined:
    Jan 2, 2010
    Messages:
    27,816
    Gender:
    Male
    Location:
    Las Vegas
    I don't know of any changes that have taken place in the code that would do anything to IDW but I will also admit it was a pre C2C mod project we inherrited and I feel no attachment to whether it works or not and would not consider it more than a trivial mod element. I might investigate some if Toffer cant find anything.
     
    MattCA likes this.
  11. masaykh

    masaykh Prince

    Joined:
    Jan 16, 2012
    Messages:
    446
    Latest SVN
    On every save load I have the following error:


    Traceback (most recent call last):
    File "CvRandomEventInterface", line 2668, in expireMasterBlacksmith1
    AttributeError: 'NoneType' object has no attribute 'getCity'
    ERR: Python function expireMasterBlacksmith1 failed, module CvRandomEventInterface

    This happen from 4 to 6 times at row, but no further issues \ errors.

    Relevant part of python:


    Code:
    def expireMasterBlacksmith1(argsList):
      iEvent = argsList[0]
      kTriggeredData = argsList[1]
      player = GC.getPlayer(kTriggeredData.ePlayer)
      city = player.getCity(kTriggeredData.iCityId)
      if city == None or city.getOwner() != kTriggeredData.ePlayer:
        return True
    
      return False
     
  12. raxo2222

    raxo2222 Time Traveller

    Joined:
    Jun 10, 2011
    Messages:
    7,637
    Location:
    Poland
  13. Toffer90

    Toffer90 C2C Modder

    Joined:
    Oct 16, 2011
    Messages:
    7,025
    Location:
    Norway
    @billw2015, @Anq, @alberts2
    This is similar to another quest ending error I fixed about 10 days ago. (LINK)
    I think something changed in the dll after v39 that made it so that these events can be triggered for non valid players... or that the dll is not properly setting the player attribute to the EventTriggeredData object.that is sent to the python code that handles events.

    50 < EventTriggeredData.ePlayer < 0 never happened for these events before v39, I doubt PPIO could cause this as it didn't modify this python file and no other python files interact with this one at all.

    Firaxis didn't write CvRandomEventInterface.py code to check whether that player variable was valid on the python side for any events; and we never got similar bug reports before v39.
     
    Last edited: Sep 11, 2019
  14. MattCA

    MattCA Prince

    Joined:
    Jan 25, 2019
    Messages:
    315
    Gender:
    Male
    I could be wrong but I think kTriggeredData is calculated at the beginning of the quest and stays the same till the end.
    Do you know if you got an error when this quest began? and if you did not get an error was your Python error messages on at the time?
     
  15. Toffer90

    Toffer90 C2C Modder

    Joined:
    Oct 16, 2011
    Messages:
    7,025
    Location:
    Norway
    I mean, this python code that is producing that error is vanilla python code, it isn't modified from BtS..... And it never gave off errors like that before. The same is true with the other similar error that I fixed recently, well fixed is not the right word, I simply changed the code to abort if the ePlayer value was invalid, which is to hide the deeper problem instead of fixing anything really.

    Spoiler How I fixed the last report similar to this :
    Code:
    From:
    def expireAlternativeEnergy1(argsList):
      iEvent = argsList[0]
      kTriggeredData = argsList[1]
      pPlayer = GC.getPlayer(kTriggeredData.ePlayer)
      i3Gorges = GC.getInfoTypeForString("BUILDING_GREAT_DAM")
    
      if pPlayer.getBuildingClassCountWithUpgrades(GC.getBuildingInfo(i3Gorges).getBuildingClassType()) > 0:
        return True
    
      return False
    
    To:
    def expireAlternativeEnergy1(argsList):
    
        CyPlayer = GC.getPlayer(argsList[1].ePlayer)
    
        # A player reported a 'NoneType' object has no attribute 'getBuildingClassCountWithUpgrades' exception in this function on SVN 11024.
        if not CyPlayer:
            print "[WARNING] CvRandonEventInterface.expireAlternativeEnergy1\n\tEVENTTRIGGER_ALTERNATIVE_ENERGY triggered for a non valid player (iPlayer not in range(51) == True)"
        else:
            if CyPlayer.getBuildingClassCountWithUpgrades(GC.getBuildingInfo(GC.getInfoTypeForString("BUILDING_GREAT_DAM")).getBuildingClassType()):
                return True
        return False

    CvRandomEventInterface.py is an isolated python file that does not interact with any other python files, and the functions inside CvRandomEventInterface.py are only called from the dll, this is why I believe there's a deeper problem on the dll side atm. Perhaps related to the change to how uninitialized variables are handled, how save recalc is doing its stuff, or how xml is parsed or something similarly technical stuff that has changed on the dll side since the release of v39.
    That may be the case, and may mean that the ePlayer value got corrupted in memory at some point before the quest was completed.
     
    Last edited: Sep 11, 2019
    MattCA likes this.
  16. MattCA

    MattCA Prince

    Joined:
    Jan 25, 2019
    Messages:
    315
    Gender:
    Male
    might be interesting to know exactly what ePlayer is. Perhaps masaykh wants to help some more or post save?

    Code:
    def expireMasterBlacksmith1(argsList):
      iEvent = argsList[0]
      kTriggeredData = argsList[1]
      player = GC.getPlayer(kTriggeredData.ePlayer)
      CyPythonMgr().errorMsg("ePlayer: %d" %(kTriggeredData.ePlayer,))
      city = player.getCity(kTriggeredData.iCityId)
      if city == None or city.getOwner() != kTriggeredData.ePlayer:
        return True
    
      return False
    
     
  17. Toffer90

    Toffer90 C2C Modder

    Joined:
    Oct 16, 2011
    Messages:
    7,025
    Location:
    Norway
    ePlayer is a number between 0 and 50 and is an enumeration for the possible player slots in the game, if the number is outside that number range we get the error that masaykh reported above, because there are no player object instances with enumerations outside that range.

    This is a new error that I'm 99% sure can only be fixed properly on the dll side, the 1% is that I'm not entirely sure ignoring invalid values on the python side is an adequate fix to the problem as it only hides what I think is a much greater bug.

    I'm guessing the value of ePlayer when that error happened for masaykh is something like 3845671846158 (un-allocated RAM location with a random value), or possibly only -1 (could be a clue to what may be wrong too)
     
    Last edited: Sep 11, 2019
    MattCA likes this.
  18. masaykh

    masaykh Prince

    Joined:
    Jan 16, 2012
    Messages:
    446
    sure, i`m ready to help.
    I can modify python code to get some additional output
    just tell me what to change

    I will check if save do not overwritten.

    Blacksmith quest was started...i think (not sure).

    I found save which have stable replication of the issue.
    Just finish the turn.
     

    Attached Files:

    Last edited: Sep 12, 2019
  19. masaykh

    masaykh Prince

    Joined:
    Jan 16, 2012
    Messages:
    446
    Additional question:
    I researched ancient lifestyle and got message that i researched it first - so i got free tech.

    After this after some amount of turns i see " barbarians have the first to research ancient lifestyle "
    the same happened with Classical and Mediaval

    And all the times it was barbarians..

    Should be like this?
     
  20. Toffer90

    Toffer90 C2C Modder

    Joined:
    Oct 16, 2011
    Messages:
    7,025
    Location:
    Norway
    The PythonExpireCheck expireMasterBlacksmith1 gets this player id as an input argument.
    ePlayer = NO_PLAYER = -1​

    Spoiler Here's all the EventTriggeredData attributes for event id 216 (EVENT_MASTER_BLACKSMITH_1) :
    eBuilding = NO_BUILDING
    eCorporation = NO_CORPORATION
    eOtherPlayer = NO_PLAYER
    ePlayer = NO_PLAYER
    eReligion = NO_RELIGION
    eTrigger = NO_EVENTTRIGGER
    iCityId = 0
    iId = 4956192
    iPlotX = 0
    iPlotY = 0
    iTurn = 0
    iUnitId = 0
    So most of these are supposed to be like they are, though I think iTurn should have held the turn when the quest was started for this player, so that the expire quest check can expire the quest after a set amount of turns since it was started.
    ePlayer should have held the player id that the event was triggered for, the player the quest is active for.

    Maybe the bug is in the event XML's, I'll have a look at that soon, though I've never evaluated quest event xml before.
     

Share This Page