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

AND2 and SVN Bug Reports - A New Dawn 2 ONLY

Discussion in 'Rise of Mankind: A New Dawn' started by 45°38'N-13°47'E, Aug 31, 2012.

  1. Afforess

    Afforess The White Wizard

    Joined:
    Jul 31, 2007
    Messages:
    12,239
    Location:
    Austin, Texas
    No. My change simply passes more information to pythons events. There is no change in the AI.

    It's far more likely the recent C2C changes caused this.
     
  2. 45°38'N-13°47'E

    45°38'N-13°47'E Deity

    Joined:
    Jun 7, 2008
    Messages:
    5,904
    Location:
    Just wonder...
    Yep, I'm checking those changes now, although I didn't think they were altering any AI behaviour
     
  3. 45°38'N-13°47'E

    45°38'N-13°47'E Deity

    Joined:
    Jun 7, 2008
    Messages:
    5,904
    Location:
    Just wonder...
    Yeah, definetely looks like something I've done in rev838; in rev837 everything looks fine; I'm checking what's causing this issue.
     
  4. 45°38'N-13°47'E

    45°38'N-13°47'E Deity

    Joined:
    Jun 7, 2008
    Messages:
    5,904
    Location:
    Just wonder...
    Ok, I've pinpointed the problem; it's in the code imported from rev 7694 and some others earlier revisions.


    Code:
    	//Safely escape the Occasional an inf loop here.
    
    	if (m_iLastUnitUpdated != m_iID)
    	{
    		m_iLastUnitUpdated = m_iID;
    		m_iSameUnitUpdateCount = 0;
    	}
    	else if (m_iSameUnitUpdateCount > 0 && 
    		((m_contractualState == CONTRACTUAL_STATE_AWAITING_ANSWER || m_contractualState == CONTRACTUAL_STATE_AWAITING_WORK) || 
    		(m_contractualState == CONTRACTUAL_STATE_NONE && getGroup()->getMissionType(0) == -1)))
    	{
    		m_iSameUnitUpdateCount = 0;
    		getGroup()->pushMission(MISSION_SKIP);
    		return false;
    	}
    	else
    	{
    		m_iSameUnitUpdateCount++;
    		if (m_iSameUnitUpdateCount > 99)
    		{
    			FAssertMsg(m_iSameUnitUpdateCount <= 99, "A Unit has hit an infinite loop in its AI and triggered a loop escape");
    			m_iSameUnitUpdateCount = 0;
    			getGroup()->pushMission(MISSION_SKIP);
    			return false;
    		}
    	}
    I've copied this part of the code from C2C but I don't know if it's causing the same issue in C2C (early development is slowed down a lot, cities are being founded much more slowly); this is because I'm not sure how contractual state is working in AND and in C2C. I'm not sure if this can be fixed, I mean if it's possible to avoid loops this way without killing settler expansion.
     
  5. Afforess

    Afforess The White Wizard

    Joined:
    Jul 31, 2007
    Messages:
    12,239
    Location:
    Austin, Texas
    Why not just remove that code and revert to the old code? I haven't seen any reports of infinite loops in RAND, it's possible the problem is C2C specific and we don't need their code.
     
  6. alberts2

    alberts2 Emperor

    Joined:
    Aug 16, 2012
    Messages:
    1,942
    Gender:
    Male
    Location:
    Germany
    We have this problem in C2C also, i tried to work around it because i wasn't able to locate a possible change causing it. Wrong changes at that area could explain some issues with the ContractBroker.
     
  7. 45°38'N-13°47'E

    45°38'N-13°47'E Deity

    Joined:
    Jun 7, 2008
    Messages:
    5,904
    Location:
    Just wonder...
    I've removed it and I'll upload the old code in the next minutes. I had some infinite loops some weeks ago while autoplaying, next time I'll upload some logs. Anyway from what I understand of the code that looked a clever way to avoid infinite loops. Well, whatever, sometimes a fix is worse than the problem.
     
  8. alberts2

    alberts2 Emperor

    Joined:
    Aug 16, 2012
    Messages:
    1,942
    Gender:
    Male
    Location:
    Germany
    Sadly i don't remember why thunderbrd added this code and why i added the 'else if' but there must have been a issue.

    That code breaks the ContractBroker i just did a test without it and it looks good. If we get a infinite loop problem again there must be another way to fix it.
     
  9. Afforess

    Afforess The White Wizard

    Joined:
    Jul 31, 2007
    Messages:
    12,239
    Location:
    Austin, Texas
    I'm surprised the code even solves the problem. Pushing a mission skip does not consume a units turn, in my experience, it may still continue to look for a mission. Only a finishMoves() call to a unit will consume the remaining moves and force it to end its turn.
     
  10. ciadude2

    ciadude2 Chieftain

    Joined:
    Oct 31, 2009
    Messages:
    37
    I'm not sure if this technically counts as a bug, but I've noticed that the AI has a tendency to send out a lot of artillery unprotected starting around the late Renaissance.
     
  11. Vokarya

    Vokarya Deity

    Joined:
    Mar 25, 2011
    Messages:
    6,145
    I've noticed that too, and it's happening earlier than the Renaissance; I have seen quite a few unprotected Catapults and Trebuchets, which I can quickly capture and then use as suicide units or disbanded for gold (if I can get them to my territory).
     
  12. IPEX-731BA5DD06

    IPEX-731BA5DD06 Deity

    Joined:
    Dec 15, 2005
    Messages:
    2,721
    Location:
    Melbourne, Victoria, Australia
    In the Industrial era, or late earlier, when Galleons are unlocked.

    The A.I. will send lots of Galleons only, and only provide backup support of Frigates 1 turn behind, if at all.

    It will also Obstantaly attack 1 city, to total exclusion of all others.

    So once this city is found, place navy and army about it, and let the slaughter begin.
     
  13. IPEX-731BA5DD06

    IPEX-731BA5DD06 Deity

    Joined:
    Dec 15, 2005
    Messages:
    2,721
    Location:
    Melbourne, Victoria, Australia
    Another potential bug, when you build the Independence hall, it not only unlocks all the Legistlative Civics, but it allows you to change civics, with out any anarchy, and not the 50% reduction, that it say's.

    Is it only me, or do others recieve the same, no anarchy for civic changes.??

    Save is attached this time.
     
  14. IPEX-731BA5DD06

    IPEX-731BA5DD06 Deity

    Joined:
    Dec 15, 2005
    Messages:
    2,721
    Location:
    Melbourne, Victoria, Australia
    Oh yeah, while I'm at it,

    Could you please scale the rewards/Demerits to game speed.

    Here's one example.

    Spoiler :


    Now this really needs updating.

    Spoiler :


    It's really small Potatoes, even if it could be scaled to game speed+Empire size/Number of cities.

    Really the possibilites are endless, as is the requests.

    Thanks
     
  15. Rezca

    Rezca The Greatest Jaggi

    Joined:
    May 3, 2013
    Messages:
    1,990
    Location:
    United States
    Those 'bonuses' were always borderline-useless, even in BTS. Which was really unfortunate - especially when the game text made it seem like they were a big deal.
     
  16. Rezca

    Rezca The Greatest Jaggi

    Joined:
    May 3, 2013
    Messages:
    1,990
    Location:
    United States
    On the topic of Random Events... The 'Slow news week / compulsonary Voting' event has long since had broken dialogue, and it seems even in rev838 it's displaying odd behavior.

    Option 1 - No change
    Option 2 - ??? ("Will change Government Civic to ____"
    Option 3 - ??? (Completely blank)

    View attachment 384800


    I've never clicked on Options two or three since I have no idea what they'd be putting me into, if anything :lol:
     
  17. 45°38'N-13°47'E

    45°38'N-13°47'E Deity

    Joined:
    Jun 7, 2008
    Messages:
    5,904
    Location:
    Just wonder...
    That event depends on your current civics. Since we removed Fascism, the event is broken
     
  18. Rezca

    Rezca The Greatest Jaggi

    Joined:
    May 3, 2013
    Messages:
    1,990
    Location:
    United States
    This event's always confused me really, and seeing two of the choices have blank responses makes it even more confusing :lol:

    Civic-dependent huh? Might be why I've always seen the event throw some odd looking results whenever I've gotten it!
     
  19. nionios

    nionios Prince

    Joined:
    Sep 29, 2013
    Messages:
    427
    I've noticed that too.The AI uses siege weapons like Catapults or Trebuchets even as defending units.
     
  20. IPEX-731BA5DD06

    IPEX-731BA5DD06 Deity

    Joined:
    Dec 15, 2005
    Messages:
    2,721
    Location:
    Melbourne, Victoria, Australia
    I've a save and screen shot of the A.I.'s

    Saladin has just RE-DECLARED war on Perciles, whom I'm also at war with (Ho hum)

    Saladin has 3 THREE troops stationed in a Greek city, Najrun, that's >95% Babylonian.

    By my reconning, it should shift to Saladin, or revolt to Babylon.

    Sakadin even has 2 workers in the city BFC. Maybe taken from Perciles??

    Another ex Arabian city, Mecca, has Greek troops stationed, and is being assulted by Saladin, all's correct there. Perciles is defending with all his troops stationed there, and Saladin, is attacking with 2 or 3 not an overwhelming stack of offence.

    Pic

    Spoiler :


    save attached.

    *Edit* - Perciles has retaken the city, replacing the Arabian Garrison with 3 Greek rifles.
     

Share This Page