Bug Reports

Where is pPlayer being defined? Is it off of the inquisitor unit? Also there doesn't seem to be a check for the city the inquisition is being ran in, at all, which is definatly the problem. Agree this should all be moved into the SDK anyway. The inquisition option is now a gameoption, and the inquistor unit training checks are all in the SDK now. Just need to move the rest of it over. I think this is above my pay grade though, to do this right we'd need to make a new Inquisitisons.h and Inquisitions.cpp file that compiles and set that up in the makefile, all sorts of things to keep in mind with this, what files to import, what other cpp files should import the inquisitions file, etc, etc. If someone sets up the foundation I may be able to get the functions to work, and port over the functionality. But I have no idea how to start on this, also the AI code will be beyond my abilities, but if we can get the functionality ported over to the SDK maybe jdog would be willing to get the AI squared away for it.

jdog/glider thoughts?
 
This isn't nearly as clear cut as it should be. Anyway I can get inquisitions to not happen in foriegn cities finaly, but the inquisition button still shows up. I can't find where that's defined? Any ideas?
 
Also the best way would be to really add the check into the function Afforess posted:
def isInquisitionConditions(playerID):
Unfortunately if you use pCity in there, it doesn't work because pCity is undefined. This is really being a serious PITA, and is quite frustrating.
 
Also the best way would be to really add the check into the function Afforess posted:
def isInquisitionConditions(playerID):
Unfortunately if you use pCity in there, it doesn't work because pCity is undefined. This is really being a serious PITA, and is quite frustrating.

I'm not a python expert, so I don't know how this translates in python, but I would

get the plot the inquisitor is on. If it isn't NULL, continue. Get the city that the plot is on. If the city isn't NULL. That's what I would do anyway, in the SDK, it would look something like this:
Code:
pPlot = getPlotType();
if pPlot != NULL
[TAB]pCity = pPlot->getCityPlot();
[TAB]if pCity != NULL
[TAB][TAB].. rest of code...

I just made that up, the functions may not be exactly right.
 
Yeah, the problem is we have 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

Now I don't see where the inquistor unit, or the city the inquistion is being performed on exists. I don't think it does there, that's just a grand, empire wide check, I don't think it's possible to put there. The best place to add this check is wherever the check to see if the inquistor button appears in the first place, as this button only appears when the inquisitor is in the city. I can't find this function anywhere, and I've tried searching the rest of the python, and still nothing. I'm kind of confused by this.

In the process of trying the above, I did find this in RevInqEvents.py:
Code:
def onModNetMessage(argsList):
	iData1, iData2, iData3, iData4, iData5 = argsList		
	iMessageID = iData1
	if ( iMessageID == m_iNetMessage_Inquisitor ):
		iPlotX = iData2
		iPlotY = iData3
		iOwner = iData4
		iUnitID = iData5
		pPlot = CyMap( ).plot( iPlotX, iPlotY )
		pCity = pPlot.getPlotCity( )
		pPlayer = gc.getPlayer( iOwner )
		pUnit = pPlayer.getUnit( iUnitID )
		inquisitor.doInquisitorPersecution( pCity, pUnit )

Adding an if pCity.getOwner() == pUnit.getOwnder() condition to inquisitor.doInquisitorPersectution functionally succedes. It blocks inquisitions from being performed in non player owned cities. The problem is you still get the button, I just want to add the same check to having the persecution button appear in the first place, but I can't find it.
 
Phungus asked me to post this here:

Afforess said:
phungus420 said:
In bug reporting there are a couple posts where we are discussing the fact inquisitions can be conducted in foreign cities. There simply is no check in the inquisitions code to determine if the city being purged belongs to the player who owns the inquisitor unit. Try as I might, I can't figure out how to add this logic anywhere in the code. Well I can stop foreign inquisitions, but the button to conduct an inquisitions still appears in foreign cities, and most of the ways I went about it caused python exceptions. Please someone take a look at this, it should be a simple fix, but I just can't figure it out.

I just tested it out and RoM does not seem to have this bug. I winmerged and the only real difference between RoM's python and RevDCM's python is this section:

Code:
def isInquisitionConditions(playerID):
    if not RevDCMOpt.isINQUISITIONS_ENABLED():
        return False
    pPlayer = gc.getPlayer(playerID)
# Rise of Mankind 2.81 fix start
    if not gc.getTeam(pPlayer.getTeam()).isHasTech(gc.getInfoTypeForString('TECH_FUNDAMENTALISM')):
        return False
    if pPlayer.getStateReligion( ) < 0:
        return False
    if pPlayer.getCivics(gc.getInfoTypeForString('CIVICOPTION_RELIGION')) == gc.getInfoTypeForString('CIVIC_INTOLERANT'):
        return True
    else:
        return False    
# Rise of Mankind 2.81 fix end
In RevDCM, if none of the if statements are evaluated as true, the end result is that it the function returns true. The opposite occurs in RoM. Perhaps this means nothing, perhaps everything. It's a start anyway.
 
The button display should be in CvMainInterface I think, I'll look around and see if I can find it.

You are correct on this.

Code:
if ( pCity.getOwner( ) == pUnit.getOwner( ) ) or ( gc.getTeam( pCityPlayer.getTeam( ) ).isVassal( gc.getPlayer( pUnit. getOwner( ) ).getTeam( ) ) ):
	ProceedWithInquisition = True

So the issue is that it lets you conduct inquisitions in vassal cities, regardless of the Vassal's state religion and civics. I think that's a poor implementation.

Should this change to:

1)Inquisitions only in player's own cities
2)Inquisitions allowed in vassal's cities if their State Religion matches the Master, and the vassal is in Theo/OR


As far as I can see those are the only two logical choices. I'm wondering what you guys think we should change it to, but it can't stay the way it is now.


Also does the fact this blocks the button mean that it effects the AI as well, or do these inquisitions rules only apply to a human player? If it's the former, it's all good, otherwise if the AI isn't effected by this check the code is setting things up for AI inquisitor bugs down the road.
 
Personally, I think foreign inquisitions SHOULD be allowed.

After all, that's how it worked historically. The Spanish Inquisition pretty much spread to all of Catholic Europe.

I'm happy to compromise and say "vassal only", but I wouldn't limit it otherwise.
 
Personally, I think foreign inquisitions SHOULD be allowed.

After all, that's how it worked historically. The Spanish Inquisition pretty much spread to all of Catholic Europe.

I'm happy to compromise and say "vassal only", but I wouldn't limit it otherwise.

I don't mind foreign inquisitions, but the AI are unaware of it, and really, it should have diplomatic consequences. If those aren't changed, I vote to nix it.
 
If the AI has no inclining of how to use it, then I suppose it has to go.

If the AI could just be taught "treat vassal turf as your turf for consideration on sending inquisitors", then it should stay. But only if they're trying for a religious victory.

And it shouldn't have diplomatic consequences, because the only time it would matter would be in a master/vassal relationship. Have it check for the vassal having the same state religion and there are no issues there.
 
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;
                    }
                }
            }
        }
    }

Was going to add this in, but I have no idea where in the SDK this goes, there is no reference anywhere. What file, and where in the file do I drop this code into? I'm assuming it is replacing some existing code, but I can't find anything similar in CvPlayer, or CvPlayerAI. Need more specifics, a copy of the current RevDCM SVN with this merged in would be the most optimal thing for me.
 
Was going to add this in, but I have no idea where in the SDK this goes, there is no reference anywhere. What file, and where in the file do I drop this code into? I'm assuming it is replacing some existing code, but I can't find anything similar in CvPlayer, or CvPlayerAI. Need more specifics, a copy of the current RevDCM SVN with this merged in would be the most optimal thing for me.

For reference:

Code:
DenialTypes CvTeamAI::AI_techTrade(TechTypes eTech, TeamTypes eTeam) const
{
    PROFILE_FUNC();

    AttitudeTypes eAttitude;
    int iNoTechTradeThreshold;
    int iTechTradeKnownPercent;
    int iKnownCount;
    int iPossibleKnownCount;
    int iI, iJ;

    FAssertMsg(eTeam != getID(), "shouldn't call this function on ourselves");

/************************************************************************************************/
/* Afforess                      Start         01/14/10                                               */
/*                                                                                              */
/*                                                                                              */
/************************************************************************************************/
    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;
                    }
                }
            }
        }
    }
    
/************************************************************************************************/
/* Afforess                         END                                                            */
/************************************************************************************************/    

    if (isHuman())
    {
        return NO_DENIAL;
    }

    if (isVassal(eTeam))
    {
        return NO_DENIAL;
    }
.....
 
Stalin is confused:confused:...


In a recent revolution in Russia Cathrine took over for herself, and naturally thought that was wierd, so I contacted "Cathrine" only to see the Stalin leaderhead.
 

Attachments

  • Civ4ScreenShot0006.JPG
    Civ4ScreenShot0006.JPG
    125 KB · Views: 82
Stalin is confused:confused:...


In a recent revolution in Russia Cathrine took over for herself, and naturally thought that was wierd, so I contacted "Cathrine" only to see the Stalin leaderhead.

This happens under Revolutions when a leader is defined in the scenario file and the leader is changed due to revolution. It keeps the original name.

Happens all the time in the scenarios I uploaded.
 
Forwarding a bug report from LoR:

http://forums.civfanatics.com/showpost.php?p=8824283&postcount=585


Basically the user had the gameoption "choose religions" set and the religious founding behavior wasn't working correctly. In this report the user states that researching meditation did not found a religion, yet when they researched polytheism, they were offered the choice to found two religions at once. Obviously this isn't correct behavior.

I remember reading a similar report a few months back. And glider responded there was some issue with the python choose religions option not playing nice with the game options. I assumed this had been fixed but obiously was not.

@glider

Any ideas in the code about what could be messing this up? Destroying a BtS gameoption just isn't good, so it would be best to just rip out the python choose religions functionality if this isn't fixable.
 
I'm getting some python exceptions with Barbarian Civ, and my python files are identical to RevDCM's SVN as of yesterday.(I just updated). Here's the error:

Traceback (most recent call last):
File "BugEventManager", line 349, in _handleDefaultEvent
File "BarbarianCiv", line 142, in onBeginGameTurn
File "BarbarianCiv", line 895, in checkBarbCities
File "BarbarianCiv", line 948, in createMinorCiv
RuntimeError: unidentifiable C++ exception

I looked at line 948, but didn't see anything obvious, at least not for me.
 
After Merging in the latest RevDCM SVN source to LoR I am getting a reproduceable CTD. LoR's source is slightly different as it is missing my Inquisitions and new tags code since I wanted to maintain save game compatibility with the other 0.9.8 versions and update to 0.9.8d. The only difference between the current LoR SVN and the "official" available 0.9.8c version is the addition of the recent BBAI source code. I have played 1 game through with this setup with no problems (and dozens before merging in the latest BBAI source, plus there are at least 1000 users playing LoR and no reported CTDs --well there was one, but I'm certain that user has done something funky to their game and the report was not reproduceable). I may also switch to the current 0.9.8c version, load the save, and get no CTD; I'm fairly certain the crash here is caused by the latest BBAI code.

Edit: This crash simply drops the user back to desktop, no lagg and no logging message that is usual for a Civ4 crash. Same behavior with a debug dll, no message or nothing, just drops back to the desktop. SVN locations and save below:

https://civ4lor.svn.sourceforge.net/svnroot/civ4lor/Trunk/LoR/
--There is also a LoRlight on the SVN, just replace the /LoR/ above with /LoRLight/ just remember to take the Light off the foldername when playing it.
https://civ4lor.svn.sourceforge.net/svnroot/civ4lor/Trunk/LoRSource/CvGameCoreDLL/
 
I think you're right that this is the same issue reported in the BBAI forums ... an infinite loop of some kind. If I can't get it to happen easily in BBAI, I'll try in LoR. Thanks.

Oh Good, I'm not crazy. I'm getting the loop too, after updating to BAI .83... Hopefully you can find a fix soon. ;)
 
Back
Top Bottom