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

Bug Reports and Discussion

Discussion in 'More Naval AI Modmod' started by Tholal, Jan 3, 2013.

  1. clarkcd

    clarkcd Chieftain

    Joined:
    May 23, 2009
    Messages:
    27
    Location:
    Washington
    Has anyone else noticed that invisible units aren't invisible to the AI? No matter where I am or who I'm attacking (Basium and Dain so far) my shadows always get counter attacked the next turn. I know it's not Dies Diei since I own it.
     
  2. Folket

    Folket Deity

    Joined:
    Jan 7, 2010
    Messages:
    3,740
    Location:
    Sweden
    I remember a change in MNAI that made hawks see invisible units.
     
  3. lfgr

    lfgr King

    Joined:
    Feb 6, 2010
    Messages:
    721
  4. Tholal

    Tholal Emperor

    Joined:
    May 19, 2009
    Messages:
    1,676
    No change to Hawks in MNAI in regards to sighting. I just made it so that the AI will build Hawks.
     
  5. Tholal

    Tholal Emperor

    Joined:
    May 19, 2009
    Messages:
    1,676
    Thanks! I'll merge this soon.
     
  6. Bad Player

    Bad Player Deity

    Joined:
    Oct 31, 2005
    Messages:
    3,531
    Location:
    (Bris)Vegas!
    Always war prevents the AI from building new cities (played for >250 turns, gifted 1100 gold, built towns, gifted a few settlers).
     
  7. FlyingSwan

    FlyingSwan King

    Joined:
    Aug 11, 2009
    Messages:
    620
    I put this Q in FAQ,but was asked to put it here.Playing as Flauros and cant build the command post with my great commander(I have military strategy),not sure if its a bug(the guy who sent me here seemed to think so I guess) or im missing something.save enclosed.thanks.Well it would be but I cant work out how to remove it from the FAQ thread to here.sorry.

    EDIT;ignore me,im a total muppet-didnt realise the diffrence between great commander and great generals.doh
     
  8. FlyingSwan

    FlyingSwan King

    Joined:
    Aug 11, 2009
    Messages:
    620
    I believe this would class as a bug.When a divided soul explores a lair and gets the trap event,if you sever soul the following turn to escape from the the trap your divided soul remains "unable to move" even after you,ve teleported to rejoin the soul.
     
  9. lfgr

    lfgr King

    Joined:
    Feb 6, 2010
    Messages:
    721
    I was finally able to track down a CTD when playing Kuriotates with my local ExtraModMod version (but the same should apply to MNAI). Here is the fix and an explanation:

    In CvCity.cpp, CvCity::setPlotRadius(int iNewValue):

    Spoiler :
    Code:
    		m_iPlotRadius = iNewValue;
    		CvPlot* pLoopPlot;
    
    //>>>>Unofficial Bug Fix: Modified by Denev 2010/07/13
    //		if (iNewValue < getPlotRadius())
    		if (iNewValue < iOldPlotRadius)
    //<<<<Unofficial Bug Fix: End Modify
    		{
    //>>>>Unofficial Bug Fix: Modified by Denev 2010/07/13
    //			for (int iI=8; iI<NUM_CITY_PLOTS; iI++)
    			for (int iI = 0; iI < iOldPlotRadius; iI++)
    //<<<<Unofficial Bug Fix: End Modify
    			{
    				/*That workers in outliing plots are not struck there...*/
    				if (isWorkingPlot(iI) == true)
    				{
    					setWorkingPlot(iI, false);
    				}
    			}
    		}
    
    //>>>>Unofficial Bug Fix: Modified by Denev 2010/07/13
    //		for (int iI=8; iI<NUM_CITY_PLOTS; iI++)
    		for (int iI = 0; iI < iOldPlotRadius; iI++)
    //<<<<Unofficial Bug Fix: End Modify
    		{
    			pLoopPlot = plotCity(getX_INLINE(), getY_INLINE(), iI);
    			if (pLoopPlot != NULL)
    			{
    				pLoopPlot->updateWorkingCity();
    			}
    		}
    


    should be

    Spoiler :
    Code:
    		[B]//m_iPlotRadius = iNewValue;[/B]
    		CvPlot* pLoopPlot;
    
    //>>>>Unofficial Bug Fix: Modified by Denev 2010/07/13
    //		if (iNewValue < getPlotRadius())
    		if (iNewValue < iOldPlotRadius)
    //<<<<Unofficial Bug Fix: End Modify
    		{
    //>>>>Unofficial Bug Fix: Modified by Denev 2010/07/13
    //			for (int iI=8; iI<NUM_CITY_PLOTS; iI++)
    			for (int iI = 0; iI < [B]calculateNumCityPlots( iOldPlotRadius )[/B]; iI++)
    //<<<<Unofficial Bug Fix: End Modify
    			{
    				/*That workers in outliing plots are not struck there...*/
    				if (isWorkingPlot(iI) == true)
    				{
    					setWorkingPlot(iI, false);
    				}
    			}
    		}
    		
    		[B]m_iPlotRadius = iNewValue;[/B]
    
    //>>>>Unofficial Bug Fix: Modified by Denev 2010/07/13
    //		for (int iI=8; iI<NUM_CITY_PLOTS; iI++)
    		for (int iI = 0; iI < [B]calculateNumCityPlots( iOldPlotRadius )[/B]; iI++)
    //<<<<Unofficial Bug Fix: End Modify
    		{
    			pLoopPlot = [B]GC.getMapINLINE().plotINLINE((getX_INLINE() + GC.getCityPlotX()[iI]), (getY_INLINE() + GC.getCityPlotY()[iI]))[/B];
    			if (pLoopPlot != NULL)
    			{
    				pLoopPlot->updateWorkingCity();
    			}
    		}
    


    The iOldPlotRadius in the loop is obviously wrong, and also disguises the other bug, that m_iPlotRadius should be updated only after isWorkingPlot() is used (otherwise triggering an assert). Since m_iPlotRadius has to be updated before pLoopPlot->updateWorkingCity() is called, I had to change the selection of pLoopPlot to a plotRadius-agnostic method.

    In CvPlot.cpp, CvPlot::updateWorkingCity():

    Spoiler :
    Code:
    	pOldWorkingCity = getWorkingCity();
    
    	if ( pOldWorkingCity != pBestCity )
    	{
    	// lfgr bugfix 06/2015
    	// The old city may have a smaller radius by now.
    	//	if (pOldWorkingCity != NULL)
    		if ( pOldWorkingCity != NULL && pOldWorkingCity->getCityPlotIndex( this ) != -1 )
    		{
    			
    			pOldWorkingCity->setWorkingPlot(this, false);
    		}
    	// lfgr end
    
    		if (pBestCity != NULL)
    


    This is for the call at the end of the code above.
     
  10. Bad Player

    Bad Player Deity

    Joined:
    Oct 31, 2005
    Messages:
    3,531
    Location:
    (Bris)Vegas!
    This could just be due to something weird in my programming in 2.61 but I have 1 Elohim city and it has no holy city in it. However I have 2 of each 3 starting mana types for some unknown reason...
     
  11. Bad Player

    Bad Player Deity

    Joined:
    Oct 31, 2005
    Messages:
    3,531
    Location:
    (Bris)Vegas!
    IMHO (and I'm bad player for a reason...) the AI shouldn't build forts adjacent to their cities because it gives enemies a safe place to attack from.
     
  12. Bad Player

    Bad Player Deity

    Joined:
    Oct 31, 2005
    Messages:
    3,531
    Location:
    (Bris)Vegas!
    I've got 6 mana of each type and no holy cities. I don't *think* it has anything to do with my programming, is anyone else getting this bug?
     

    Attached Files:

  13. Bad Player

    Bad Player Deity

    Joined:
    Oct 31, 2005
    Messages:
    3,531
    Location:
    (Bris)Vegas!
    Again, it might just be my python but when the Avatar of Wrath came, I lost 2 of my 3 prophets and I got an altar of the lunnator without me asking for it to be built (and the game congratulated me on building my first national wonder).

    EDIT: 1 of my prophets remained normal, 1 became enraged (I don't think great people should become enraged), and one built the Altar of the Lunnotar without my permission
     
  14. MagisterCultuum

    MagisterCultuum Great Sage

    Joined:
    Feb 14, 2007
    Messages:
    16,109
    Location:
    Kael's head
    I was just trying to use the PyHelp tag in Civ4SpellInfos.xml (to make my version of the Drown spell warn the player about how much gold it will cost), and found that python expressions placed there do not seem to be evaluated at all. Nothing I put there seems to make any difference in the game. Even when I intentionally place bugs there they won't know up in the error logs.

    I think Tholal must have borrowed the XML schema and python code for this mechanism from lfgr without copying essential sections of C++ code needed to make those do anything.
     
  15. Tholal

    Tholal Emperor

    Joined:
    May 19, 2009
    Messages:
    1,676
    That damn Cage effect has been the source of so many problems...

    Thanks! I'll have to look at the explanation later but this is something that had been bothering me (never saw a CTD but have seen those assert errors). Glad to have it fixed!

    Agreed. This is one of those issues that I have tried to fix with no success.

    Havent seen this.


    I think lfgr has a fix for this. I'll merge it when I get things setup again.
     
  16. MagisterCultuum

    MagisterCultuum Great Sage

    Joined:
    Feb 14, 2007
    Messages:
    16,109
    Location:
    Kael's head
    He does. I have been using his dll for my last few releases, and have PyHelp tags working to explain essentially every spell now.

    There was some discussion about possibly switching some of those PyHelp tags to be automatically generated in the dll instead. It would probably be more efficient for C++ to handle showing the details of xml-only spells.


    I was recently thinking might be best for the <PyHelp> tags to override the <Help> tag when mousing over a unit. I would like to be able to include more general descriptions of spells in the 'pedia but not have redundant or irrelevant details clutter the screen when using a PyHelp tag to show what the spell will actually do in that context.

    PyHelp tags for promotions would also be a nice touch, so we can explain what their <PyPerTurn> effects will do.
     
  17. Azhral

    Azhral Let's get Tactical!

    Joined:
    Jul 9, 2008
    Messages:
    622
    Location:
    Dunedin, New Zealand
    Hey all, just found a new, rather annoying bug.

    Had an HN privateer turn up, and run a blockade mission. My Vicar cast Revealing Light, or whatever, and revealed it as Shieam, whom I am at war with. My frigate then proceeded to destroy it, but the blockade remained. Won't go away, nothing in worldbuilder to turn it off, making peace with the Shieam does nothing, and the blockade remains with no ship.
     
  18. MagisterCultuum

    MagisterCultuum Great Sage

    Joined:
    Feb 14, 2007
    Messages:
    16,109
    Location:
    Kael's head
    I find it really annoying that forming a Permanent Alliance with a player (or at least forcing such alliances in python) cancels the open borders agreement between the teams first and ejects the new ally's units from your territory rather than letting them stay there.



    I'm afraid I don't have a saved game, but on a few rare occasions I have found that my hidden nationality units were able to capture neutral player's forts and cities.
     
  19. jackal1234

    jackal1234 Chieftain

    Joined:
    Jul 11, 2010
    Messages:
    96
    Location:
    127.0.0.0
    i've had similar happen quite a few times. barbarian tortoises do the same thing. kill em and the blockade still there. definite reproducible common bug. and it never goes away, that's the worst part. "oh your civ is dead and gone but you still have a blockade. so cool"
     
  20. omegaflames

    omegaflames Warlord

    Joined:
    Sep 21, 2012
    Messages:
    134
    I had that blockade thing myself maybe a year or 2 ago. At the time I was running an old version of the mod and just updated and haven't seen it since, guess the bug is still there somewhere thou.

    A couple of issues I've seen recently (in the past couple days) I found a stack of 10 orthus' axes (a few tiles away a barb axeman had an 11th one) right beside Acheron's city that is on the border to the Svartalfar lands. From where orthus died I think it's highly likely that the svartalfar are the ones who killed him (the bannor and elohim are also on that landmass but they are pretty far away and orthus died only a few tiles from the svartalfar capital). Thing is the svartalfar don't have poisons or sorcery yet so no world hero nor illusionist so I don't know how they could have made any copies of the axe (unless anyone has any ideas?).

    I had a cultist that was able to release himself from a cage, is that intended?
     

Share This Page