Bug Reports

In the RevInquisition.py there seems to be a victory related section of code:
Code:
    def isVictory(self, argsList):
        eVictory = argsList[0]
        if eVictory == gc.getInfoTypeForString("VICTORY_RELIGIOUS"):
            if RevDCMOpt.isINQUISITIONS_ENABLED():
                return False
        return True

A sidenote, why should having inquisitors disable your chances of religious victory? I'm commenting that out for my mod now.

Brilliant Afforess, that was the cause of the bug. Checking your fix into the SVN now.
 
Not sure if this has been said yet or not but I have a no-name Civ here. Since I have unrestricted leaders and BarbarianCivs checked, the code no doubtedly only checks for leaders to make a barb town turn into a civ instead of civilizations that haven't been used yet. In my game Lenin is a hot-pink civilization without a name.
 

Attachments

  • Civ4ScreenShot0026.JPG
    Civ4ScreenShot0026.JPG
    148.5 KB · Views: 86
Lenin is not in RevDCM, so your bug could not be from a pure copy of RevDCM, it must be in a larger merged mod. You need to report that error to that mod's creator.
 
Yes, it is not a pure copy, that's because I'm playing RoM with AND however neither of those have touched BarbCiv's code and I am complaining here about the bug since it is this mod's area. As I said it checks leaders instead of civs since the debuggers can't always check every scenario and didn't check what would happen if unrestricted leaders was checked and no civs remained unused in the list. Also I already checked this with Afforess and the fault is on this end.

EDIT: nvm, Afforess found two bugged civs that was put there without a name.
 
This isn't the RoM forum. RoM isn't a RevDCM scenario. It's an entirely different mod.
 
I've forwarded a loss of user interface report from LoR to the BUG mod (this is the first critical error reported in LoR in about 2 months, and LoR uses the same python and gamecore as RevDCM --except a minor point with legend units in the civilopedia-- so I didn't even bother having the user try pure RevDCM, as I'm sure they would get the same error). But I don't think it's caused by the BUG mod, since the user can use BUFFY fine. glider could you take a look at the python error logs here and see if there is anything useful you can find in them:

http://forums.civfanatics.com/showthread.php?t=347111
 
EF is trying to be helpful, but I'm lost. glider/jdog could one of you take a look at that thread linked above and explain what I need to do? I'll code it, but I'm not exactly sure what needs to be done.
 
@Afforess/glider1

OK so in the current SVN the victories are all broken. However it seems I've fixed most of the Victory conditions. Simply removed the RevInquisition def isVictory line, don't see what it's purpose is, everything is in the DLL anyway. But the launch button for the spaceship is still missing. I'm confused as to why. Afforess or glider can one of you check out the latest RevDCM SVN, apply the hotfix for LoR (it will also work for RevDCM), and then see what's going on with the space ship launch? I can't figure it out and must leave. You can use LoR as a testbed if you want, but I'm assuming you already have the current RevDCM SVN anyway, and this fix/bug is in the current SVN RevDCM core.
 
Above fixed, checked into SVN


New bug:

Tech Diffusion + No Tech Brokering, causes the AI not to trade techs because it "has nothing to gain" even though there is no trade value in researching the tech itself, and the "investment" it has in the tech isn't noteworthy. This seriously hurts the AI. If it's not the tech the AI is currently researching, it shouldn't have logic blocking it from trading for that tech just because it got some free beakers dumped into it for free from Tech Diffussion. This is actually a major bug in AI logic right now.
 
Above fixed, checked into SVN


New bug:

Tech Diffusion + No Tech Brokering, causes the AI not to trade techs because it "has nothing to gain" even though there is no trade value in researching the tech itself, and the "investment" it has in the tech isn't noteworthy. This seriously hurts the AI. If it's not the tech the AI is currently researching, it shouldn't have logic blocking it from trading for that tech just because it got some free beakers dumped into it for free from Tech Diffussion. This is actually a major bug in AI logic right now.

Can I see the bug reports for this? Can you offer some more details? When exactly is the AI devaluing techs? If it is a simple matter of game options, can't you just start searching for spots where RevDCM has altered one of those two options?
 
No reports, it's something I've noticed.

Basically if the AI has an investment of beakers into a tech and the game option "No Tech Brokering" is on, the AI will not consider trading for it, it's given rejection is "We have nothing to gain". The rational behind this is pretty obvious. If the AI is researching a tech, but then trades for it, all those invested beakers are effectively wasted because it can no longer broker it to other players, as no tech brokering blocks the trading of techs that aren't self researched. This works fine under default BtS rules, but utterly screws the AI with Tech Diffusion on, as it effectively blocks the AI from trading for techs since it "thinks" it's invested research into these and trading for them would harm it due to not being able to then broker the tech. The issue is of course that the AI has invested nothing, and the beakers in the tech have been received by all players, meaning the AI flatly refuses to trade and backfill techs, and is significantly hamstrung by this.
 
No reports, it's something I've noticed.

Basically if the AI has an investment of beakers into a tech and the game option "No Tech Brokering" is on, the AI will not consider trading for it, it's given rejection is "We have nothing to gain". The rational behind this is pretty obvious. If the AI is researching a tech, but then trades for it, all those invested beakers are effectively wasted because it can no longer broker it to other players, as no tech brokering blocks the trading of techs that aren't self researched. This works fine under default BtS rules, but utterly screws the AI with Tech Diffusion on, as it effectively blocks the AI from trading for techs since it "thinks" it's invested research into these and trading for them would harm it due to not being able to then broker the tech. The issue is of course that the AI has invested nothing, and the beakers in the tech have been received by all players, meaning the AI flatly refuses to trade and backfill techs, and is significantly hamstrung by this.

Fix is simple (and save game compatible!). In CvTeamAI change this section in CvTeamAI::AI_techTrade(...) from
Code:
    if (GC.getGameINLINE().isOption(GAMEOPTION_NO_TECH_BROKERING))
    {
        CvTeam& kTeam = GET_TEAM(eTeam);
        
        if (!kTeam.isHasTech(eTech))
        {
            if (!kTeam.isHuman())
            {
                if (2 * kTeam.getResearchProgress(eTech) > kTeam.getResearchCost(eTech))
                {
                    return DENIAL_NO_GAIN;
                }
            }
        }
    }

to

Code:
    if ((GC.getGameINLINE().isOption(GAMEOPTION_NO_TECH_BROKERING)) && (!GC.getGameINLINE().isOption(GAMEOPTION_TECH_DIFFUSION)))
    {
        CvTeam& kTeam = GET_TEAM(eTeam);
        
        if (!kTeam.isHasTech(eTech))
        {
            if (!kTeam.isHuman())
            {
                if (2 * kTeam.getResearchProgress(eTech) > kTeam.getResearchCost(eTech))
                {
                    return DENIAL_NO_GAIN;
                }
            }
        }
    }

The AI will ignore this logic if Tech Diffusion is also enabled. If you want some more precise calculations, you could always tweak the inner comparisons, but this works fairly well....
 
Nice find. That was really fast on finding it. OK the fix I was thinking would be more like:
Code:
	if (GC.getGameINLINE().isOption(GAMEOPTION_NO_TECH_BROKERING)
	{
		if (GC.getGameINLINE().isOption(GAMEOPTION_TECH_DIFFUSION))
		{
			CvTeam& kTeam = GET_TEAM(eTeam);
			
			if (!kTeam.isHasTech(eTech))
			{
				if (!kTeam.isHuman())
				{
					[b]if eTech isCurrentResearch[/b]
					{
						if (2 * kTeam.getResearchProgress(eTech) > kTeam.getResearchCost(eTech))
						{
							return DENIAL_NO_GAIN;
						}
					}
				}
			}
		}
		else
		{
			CvTeam& kTeam = GET_TEAM(eTeam);
		
			if (!kTeam.isHasTech(eTech))
			{
				if (!kTeam.isHuman())
				{
					if (2 * kTeam.getResearchProgress(eTech) > kTeam.getResearchCost(eTech))
					{
						return DENIAL_NO_GAIN;
					}
				}
			}
		}
	}

The problem is the bolded line "if eTech isCurrentResearch" as that's obviously incorrect syntax. Basically though the AI should respond the same way when Tech Diffusion is on if it's considering trading a tech it is researching (ie it shouldn't trade for that tech, it should research it so it may broker it), but it should still consider trading for techs that it just has beakers in due to the mechanics of Tech Diffusion, and this denial should not trip in such instances.
 
Nice find. That was really fast on finding it. OK the fix I was thinking would be more like:
Code:
    if (GC.getGameINLINE().isOption(GAMEOPTION_NO_TECH_BROKERING)
    {
        if (GC.getGameINLINE().isOption(GAMEOPTION_TECH_DIFFUSION))
        {
            CvTeam& kTeam = GET_TEAM(eTeam);
            
            if (!kTeam.isHasTech(eTech))
            {
                if (!kTeam.isHuman())
                {
                    [B]if eTech isCurrentResearch[/B]
                    {
                        if (2 * kTeam.getResearchProgress(eTech) > kTeam.getResearchCost(eTech))
                        {
                            return DENIAL_NO_GAIN;
                        }
                    }
                }
            }
        }
        else
        {
            CvTeam& kTeam = GET_TEAM(eTeam);
        
            if (!kTeam.isHasTech(eTech))
            {
                if (!kTeam.isHuman())
                {
                    if (2 * kTeam.getResearchProgress(eTech) > kTeam.getResearchCost(eTech))
                    {
                        return DENIAL_NO_GAIN;
                    }
                }
            }
        }
    }
The problem is the bolded line "if eTech isCurrentResearch" as that's obviously incorrect syntax. Basically though the AI should respond the same way when Tech Diffusion is on if it's considering trading a tech it is researching (ie it shouldn't trade for that tech, it should research it so it may broker it), but it should still consider trading for techs that it just has beakers in due to the mechanics of Tech Diffusion, and this denial should not trip in such instances.

One problem. The function you want is in CvPlayer, called getCurrentResearch() and it does return a techtype... but...You can get the team # from a player, but you can't separate an individual player from the team... so things get complicated really fast.

We need to loop through all the players, and if the player is on our team, get it's current research tech. But if we just do that, we will just end up with the last player on the team's current tech progress. Not an issue, unless we have vassals or allys. So, I am going to make an assumption that the most powerful player on the team is the one we care about. So here is what you need now. It could do with a lookover by someone more proficient in C++, but I believe it is correct, and it compiles.


Code:
    TechTypes eCurrentResearch;
    TeamTypes eStrongestTeam = (TeamTypes)0;
    for (iI = 0; iI < MAX_PLAYERS; iI++)
    {
        if (GET_PLAYER((PlayerTypes)iI).getTeam() == getID())
        {
            if (GET_TEAM((GET_PLAYER((PlayerTypes)iI)).getTeam()).getPower(true) > GET_TEAM(eStrongestTeam).getPower(true))
            {
                eCurrentResearch = GET_PLAYER((PlayerTypes)iI).getCurrentResearch();
                eStrongestTeam = GET_PLAYER((PlayerTypes)iI).getTeam();
            }
        }
    }
    
    
    if (GC.getGameINLINE().isOption(GAMEOPTION_NO_TECH_BROKERING))
    {
        CvTeam& kTeam = GET_TEAM(eTeam);
            
        if (!kTeam.isHasTech(eTech))
        {
            if (!kTeam.isHuman())
            {
                if ((eTech == eCurrentResearch) || (!GC.getGameINLINE().isOption(GAMEOPTION_TECH_DIFFUSION)))
                {
                    if (2 * kTeam.getResearchProgress(eTech) > kTeam.getResearchCost(eTech))
                    {
                        return DENIAL_NO_GAIN;
                    }
                }
            }
        }
    }
 
Looks good thanks. Also compiled the Python callbacks code. It works. Now I need to get all this stuff, plus the recent code changes in LoR that normalizes the loading of the Revolution.ini file with BUG's system, and package it all into the RevDCM SVN.
 
In RevDCM the Manhattan Project has been changed into a National wonder. I assumed that this meant that each civ had to build its own project in order to build nukes, but in playtesting any civ building it still enables nukes for all players. Is this WAD or a bug?
 
In the current SVN I was able to purge religions in a vassal that was running pacifism . I don't think you should be able to conduct inquisitions in other player's cities period. But that's really wrong that I could do it in a civ that was running pacifism. I think this, like the victory bug recently reported and fixed is a longstanding bug in Inquisitions, probably ported over accidentally due to Orion Veteran's foreign inquisition component in his inquisition modcomp (the base used for RevDCM's inquisitions).
 
In the current SVN I was able to purge religions in a vassal that was running pacifism . I don't think you should be able to conduct inquisitions in other player's cities period. But that's really wrong that I could do it in a civ that was running pacifism. I think this, like the victory bug recently reported and fixed is a longstanding bug in Inquisitions, probably ported over accidentally due to Orion Veteran's foreign inquisition component in his inquisition modcomp (the base used for RevDCM's inquisitions).

I thought foreign inquisitions were disabled in the global defines, with a long warning message next to it. Did someone re-enable it?
 
From LoR's GlobalDefinesAlt.xml file:

Code:
  <Define>
    <!-- Highly recommended to keep off. AI is clueless about it. -->
    <DefineName>OC_FOREIGN_INQUISITIONS</DefineName>
    <iDefineIntVal>0</iDefineIntVal>
  </Define>

Also this shouldn't make a lick of difference anyway, since glider moved all the global defines alt options to be toggle-able in the BUG interface, or in the Config.xml folder. I'm holding to the theory this was accidentally introduced a long time ago, and was just never reported before. Much like the broken religious victory, that's been broken since Inquisitions were moved into their own Python folder, under the RevInquisitions folder specifically. I'm willing to wager this is another unexpected introduced bug of splitting Inquisitions into their own folder there, and foreign inquisitions were accidentally re-enabled. Also they were re-enabled incorrectly, as I was able to purge a city that was in an empire running pacifism. Orion's foreign inquisitions component only allowed purging in foreign Theocracies. In fact the most likely thing that's going on is that when the code was shifted over a line that checked the city's owner was removed or something, and now only the inquisitor unit itself is checked; it certainly seems a good bet this is just a bug and not related to foreign inquisitions at all.
 
From LoR's GlobalDefinesAlt.xml file:

Code:
  <Define>
    <!-- Highly recommended to keep off. AI is clueless about it. -->
    <DefineName>OC_FOREIGN_INQUISITIONS</DefineName>
    <iDefineIntVal>0</iDefineIntVal>
  </Define>
Also this shouldn't make a lick of difference anyway, since glider moved all the global defines alt options to be toggle-able in the BUG interface, or in the Config.xml folder. I'm holding to the theory this was accidentally introduced a long time ago, and was just never reported before. Much like the broken religious victory, that's been broken since Inquisitions were moved into their own Python folder, under the RevInquisitions folder specifically. I'm willing to wager this is another unexpected introduced bug of splitting Inquisitions into their own folder there, and foreign inquisitions were accidentally re-enabled. Also they were re-enabled incorrectly, as I was able to purge a city that was in an empire running pacifism. Orion's foreign inquisitions component only allowed purging in foreign Theocracies. In fact the most likely thing that's going on is that when the code was shifted over a line that checked the city's owner was removed or something, and now only the inquisitor unit itself is checked; it certainly seems a good bet this is just a bug and not related to foreign inquisitions at all.

<rant>
Honestly, why isn't Inquisition code in the SDK? Python is next to useless when it comes to anything the AI should know about. It's 10x slower, more cumbersome and terrible for the AI. I can't believe that Inquisitions aren't a custom game option with the AI code integrated in the SDK already. Then we wouldn't be having this issue
</rant>

Since the Inquisition code is in python, I'm pretty much useless. The only thing I can say is that this function:


Code:
def isInquisitionConditions(playerID):
    if not game.isOption(GameOptionTypes.GAMEOPTION_INQUISITIONS):
        return False
    pPlayer = gc.getPlayer(playerID)
    if not gc.getTeam(pPlayer.getTeam()).isHasTech(gc.getInfoTypeForString('TECH_THEOLOGY')):
        return False
    if pPlayer.getStateReligion( ) < 0:
        return False
    if pPlayer.getCivics(gc.getInfoTypeForString('CIVICOPTION_RELIGION')) == gc.getInfoTypeForString('CIVIC_PACIFISM'):
        return False
    if pPlayer.getCivics(gc.getInfoTypeForString('CIVICOPTION_RELIGION')) == gc.getInfoTypeForString('CIVIC_PAGANISM'):
        return False    
    return True

Doesn't seem to check if the unit is inside your cultural borders or not. Maybe it doesn't need to check. I don't know. :sad:
 
Back
Top Bottom