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

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.

Upload save, as you play WAAAYYY past soft limits - it may be interesting save to study for coders.
Gigantic map is 13000 tiles, pit scenario is 26000 tiles, your map is 41600 tiles.
Gigantic map has 14 or 16 AIs by default.

2750th turn on 20 000 turn gamespeed is early game - tech leader should be in Ancient era.
On Gigantic you would be fine till end game if you had all memory saving options on.
Pits scenario means trouble in Atomic era.

If you want moderately fast turn times and no mafs, then play on Standard/Large sized maps.

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?


I hope you have a Super Computer. Perhaps an i9 cpu with more than 4.2GHz speed, a big SSD, and a video card with more than 8GB of DDR5 vid ram.

You pushed the limits of this Old Game engine that BtS has, a single core 32 bit engine.

And what Difficulty level do you set the Handicap to by the way? Deity?

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:)

This is certainly, as Raxo said, something to look into for numerous reasons.

Still, a hang bug is not likely to have anything to do with system resources or pressing the limits, as if things run out of memory it just MAF crashes and that's it. You've clearly found an actual hang point and that would be interesting to look into. Usually this is a problem in the AI.

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.
 

Attachments

  • AutoSave_September 7, BC-7075.CivBeyondSwordSave
    15.1 MB · Views: 173
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.
 
15.1 MB Save! Yikes!
 
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.
Will take a look this week.
 
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:
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.
 

Attachments

  • 42.CivBeyondSwordSave
    6.2 MB · Views: 141
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.
 
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.
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:
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.
I'll look into it, I think there's some python code for influence driven war mechanic.
 
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.
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.
 
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
 
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
@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:
I could be wrong but I think kTriggeredData is calculated at the beginning of the quest and stays the same till the end.
This happen from 4 to 6 times at row, but no further issues \ errors.
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?
 
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.
I could be wrong but I think kTriggeredData is calculated at the beginning of the quest and stays the same till the end.
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:
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
 
might be interesting to know exactly what ePlayer is. Perhaps masaykh wants to help some more or post save?
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:
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.
 

Attachments

  • Maks January 17, BC-0556.zip
    2.1 MB · Views: 126
Last edited:
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?
 
I found save which have stable replication of the issue.
Just finish the turn.
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.
 
Top Bottom