Shqype
Shqyptar
Rival Tech Progress Fails to Update in CTRL+Z Debug Mode
I tested out some code I created by going into the CTRL+Z debug mode. The code was supposed to give a random amount of tech points to each civilization in the game. I tested to see if it worked by going into the technology screen (while in debug mode) and using the pull-down menu to change the leader so I could check their civ's progress on the tech that I had randomly given them points for. At first glance, what I found led me to believe that my code was faulty, because every civ had the same amount of tech points for the technology.
I asked TheLopez to help me out, and he gave me a new version of the code which he claimed worked (although he said it was odd that mine didn't). I tried with his, and got the same results: each civ was seemingly given the same amount of tech points for the technology. But the logs said otherwise!
Here is TheLopez's version of the code. You can reproduce this bug by copying the code into CvEventManager.py at the end of the onGameStart method:
Of course, PyGame = PyHelpers.PyGame
Now, according to the PythonDbg.log, each civ was given a random number of tech points:
But if you test this in the game how I did it (by going into CTRL+Z and opening up the Technology screen and checking the progress for each rival) you will be misled. Here are a few pictures:
This was me:

My rivals:

Notice how although they have different starting technologies, "their" progress for Fishing (the tech for which they were randomly gifted beakers) remains the same as mine? This leads me to believe that either tech progression is not updated for the AI in this screen in debug mode, or it does not refresh, or something else of the sort.
I expected their tech progression (their beakers/tech cost) instead of mine.
Obviously these leaders are not from vanilla civ (they're from TAM), but the problem is with the vanilla implementation and coding of the CTRL+Z debug mode and/or the technology screen.
If someone has a fix, please let me know. Otherwise, I hope Firaxis can remedy this
I tested out some code I created by going into the CTRL+Z debug mode. The code was supposed to give a random amount of tech points to each civilization in the game. I tested to see if it worked by going into the technology screen (while in debug mode) and using the pull-down menu to change the leader so I could check their civ's progress on the tech that I had randomly given them points for. At first glance, what I found led me to believe that my code was faulty, because every civ had the same amount of tech points for the technology.
I asked TheLopez to help me out, and he gave me a new version of the code which he claimed worked (although he said it was odd that mine didn't). I tried with his, and got the same results: each civ was seemingly given the same amount of tech points for the technology. But the logs said otherwise!
Here is TheLopez's version of the code. You can reproduce this bug by copying the code into CvEventManager.py at the end of the onGameStart method:
Code:
playerList = PyGame().getCivPlayerList()
for objPlayer in playerList:
iCivilizationType = objPlayer.player.getCivilizationType()
iPlayer = objPlayer.getID()
objTeam = objPlayer.getTeam()
iRandNum = CyGame().getSorenRandNum(80, "Bob")
iTechCost = objTeam.getResearchCost(gc.getInfoTypeForString("TECH_FISHING"))
iBeakersGiven = (iTechCost * iRandNum) / 100
objTeam.setResearchProgress(gc.getInfoTypeForString("TECH_FISHING"), iBeakersGiven, iPlayer)
CvUtil.pyPrint("iBeakersGiven/iTechCost = %s/%s" %(iBeakersGiven, iTechCost))
Now, according to the PythonDbg.log, each civ was given a random number of tech points:
Code:
PY:iBeakersGiven/iTechCost = 29/128
PY:iBeakersGiven/iTechCost = 54/117
PY:iBeakersGiven/iTechCost = 44/117
PY:iBeakersGiven/iTechCost = 40/117
PY:iBeakersGiven/iTechCost = 77/117
PY:iBeakersGiven/iTechCost = 46/117
PY:iBeakersGiven/iTechCost = 59/117
But if you test this in the game how I did it (by going into CTRL+Z and opening up the Technology screen and checking the progress for each rival) you will be misled. Here are a few pictures:
This was me:

My rivals:



Notice how although they have different starting technologies, "their" progress for Fishing (the tech for which they were randomly gifted beakers) remains the same as mine? This leads me to believe that either tech progression is not updated for the AI in this screen in debug mode, or it does not refresh, or something else of the sort.
I expected their tech progression (their beakers/tech cost) instead of mine.
Obviously these leaders are not from vanilla civ (they're from TAM), but the problem is with the vanilla implementation and coding of the CTRL+Z debug mode and/or the technology screen.
If someone has a fix, please let me know. Otherwise, I hope Firaxis can remedy this
