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

Shared AND/C2C Debug codes

Discussion in 'Bugs and Crashes' started by Thunderbrd, May 5, 2014.

  1. Thunderbrd

    Thunderbrd C2C War Dog

    Joined:
    Jan 2, 2010
    Messages:
    26,107
    Gender:
    Male
    Location:
    Las Vegas
    Yeah... um... I'm :dunno: on this subject but I think Koshling knew more about it and he'd probably respond to a PM on it.

    In my experience, it appears the AI vastly UNDERstaffs its defenses and attack forces. It's spending a lot on property control though but probably not much more than I do when playing. From what I can tell, some of the AIs are really just too excited to grow and don't do so with enough care. Then when they get in a panic about their economic situation they start building research and such and it's a total waste of time as they aren't investing into their nation's potential but rather end up grasping for the immediate needs. Since they stop the long term investing, even though it won't solve their problems within a few rounds, they hit that wall and fall behind and get more and more nervous about being behind in tech and trying to make up with it by building research which puts them yet further behind.

    What bugs me about this is I haven't been able to figure out how they can build research while they have other things they can do... the construction selection routine doesn't seem to allow it until the last evaluation which I find very odd since they are seen doing this when they clearly would have better things to do!
     
  2. Afforess

    Afforess The White Wizard

    Joined:
    Jul 31, 2007
    Messages:
    12,239
    Location:
    Austin, Texas
    Sounds like C2C specific features are probably out of balance with the rest of the AI priorities. The AI in RAND is not better than in BTS, but is acceptably good. Probably just 1 difficulty weaker.
     
  3. alberts2

    alberts2 Chieftain

    Joined:
    Aug 16, 2012
    Messages:
    1,939
    Gender:
    Male
    Location:
    Germany
    There might also be some C2C specific features without proper code for the AI to handle them and others are out of balance or not complete. RAND is simpler and that is a good thing in terms of AI, performance.....
     
  4. 45°38'N-13°47'E

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

    Joined:
    Jun 7, 2008
    Messages:
    5,852
    Location:
    Just wonder...
    I've seen it to 0% in AND, while pushing 100% culture, usually in modern era for many consecutive turns. I don't think it has anything to do with units production, possibly is caused by AI trying to keep up in terms of culture when Mastery Victory is active because of the points you get for legendary cities. I haven't tried with Mastery off anyway.

    Edit: I've checked it with autoplay
     
  5. Afforess

    Afforess The White Wizard

    Joined:
    Jul 31, 2007
    Messages:
    12,239
    Location:
    Austin, Texas
    That's another story - the AI's economy is fine, it's just going for victory.
     
  6. Koshling

    Koshling Vorlon

    Joined:
    Apr 11, 2011
    Messages:
    9,254
    It's used to reduce memory footprint. It disables the creation of entities that are off-screen, and dynamically loads/unloads them as different regions become visible. The upside is a significant memory reduction. The downside is some rendering lag as you scroll around. The main problem i that the EXE doesn't inform the DLL what the visible region is, so it has to try to dead-reckon it on each timeslice.
     
  7. Dancing Hoskuld

    Dancing Hoskuld Warlord

    Joined:
    Jul 5, 2004
    Messages:
    23,289
    Gender:
    Male
    Location:
    Canberra, Australia
    Is it also the bit causing the problems with Event Signs on the map? They sometimes appear and sometimes don't.
     
  8. Koshling

    Koshling Vorlon

    Joined:
    Apr 11, 2011
    Messages:
    9,254
    Possibly, but I always thought that was viewports (do you have them turned on?). However, they do have some code in common - the issue is that signs are handled somewhat outside of the DLL and the coordinate remapping seems to get confused sometimes because the EXE has no concept of it, so the DLL is basically trying to fool it all the time (and not always getting it right/able to do so in some residual cases it seems)
     
  9. Dancing Hoskuld

    Dancing Hoskuld Warlord

    Joined:
    Jul 5, 2004
    Messages:
    23,289
    Gender:
    Male
    Location:
    Canberra, Australia
    No viewports. My testing to replicate the problem was when I tried to set up a picture of the alternate terrains. I went into WorldBuilder to place the terrains then back to game to add event signs on each terrain. I figured that once I did that I could then just switch the terrain sets to show them side by side but only need to do the labeling once.

    There are two different sets of signs. The personalised map signs are done in the dll while the event signs are done in python.
     
  10. alberts2

    alberts2 Chieftain

    Joined:
    Aug 16, 2012
    Messages:
    1,939
    Gender:
    Male
    Location:
    Germany
    I found a classic copy&paste error in CvCultureLinkInterface.py causing the civ with the id 0 to fail all the time.

    Example:
    Code:
    if (gc.getInfoTypeForStringWithHiddenAssert("CIVILIZATION_ABORIGINES") > 0)
    must be > -1
    Code:
    if (gc.getInfoTypeForStringWithHiddenAssert("CIVILIZATION_ABORIGINES") > -1)
     

    Attached Files:

  11. Afforess

    Afforess The White Wizard

    Joined:
    Jul 31, 2007
    Messages:
    12,239
    Location:
    Austin, Texas
    I added new diplomacy trade options and fixed some bugs with old advanced diplo features, in case you are interested:

    Diff View
     
  12. alberts2

    alberts2 Chieftain

    Joined:
    Aug 16, 2012
    Messages:
    1,939
    Gender:
    Male
    Location:
    Germany
    Why did you go back to the old PathGenerator?
     
  13. Thunderbrd

    Thunderbrd C2C War Dog

    Joined:
    Jan 2, 2010
    Messages:
    26,107
    Gender:
    Male
    Location:
    Las Vegas
    I like the sound of the diplo stuff. Are you putting those in Alberts? I just don't want to overlap any efforts unnecessarily here.
     
  14. alberts2

    alberts2 Chieftain

    Joined:
    Aug 16, 2012
    Messages:
    1,939
    Gender:
    Male
    Location:
    Germany
    I like it too but i don't have plans to merge it because of time issues. If you do it you should also merge their trading for war allies CONTACT_TRADE_BUY_WAR.
     
  15. Thunderbrd

    Thunderbrd C2C War Dog

    Joined:
    Jan 2, 2010
    Messages:
    26,107
    Gender:
    Male
    Location:
    Las Vegas
    Alright... I think we should probably wait til after the release anyhow so it gets some playtesting before the next release anyhow. I trust Afforess but just to make sure the release is solid and stable... it IS a freeze at the moment (and I'm almost done with all freeze tasks.)

    But I'll get it when I can and if you do the same one of us will get it in soon.
     
  16. Afforess

    Afforess The White Wizard

    Joined:
    Jul 31, 2007
    Messages:
    12,239
    Location:
    Austin, Texas
    Issues with crashes due to stack overflows with Koshlings. I don't have the familiarity with C++, or time and energy to debug the CvPathGenerator code.
     
  17. God-Emperor

    God-Emperor Chieftain

    Joined:
    Jul 18, 2009
    Messages:
    3,551
    Location:
    Texas
    In this thread I there is some info on the sign issue, along with a partial fix. The fix covers every sign done via the Python, which should be everything except player added signs.

    As mentioned in that thread, the underlying cause of the signs going away is that the code that should restore them after they are cleared (which is done when a viewport moves or an autosave is made, and probably some other places).

    An addition to the fix given it is probably possible to fix the user placed signs as well by moving them over to be Python based signs. You don't necessarily have to replace the current sign placement system, just do the transfer whenever the signs would be cleared. The method could be similar to the fix in that thread, which restores all the signs to the map when the sign adding python is called with specific arguments (NULL plot, NO_PLAYER player, and 0 length text). Before actually clearing the signs it could call the add sign python with a specific set of arguments that are defined to mean "copy any sign the game knows about that you don't already have in your list". Setting it up to also delete any sign that has been deleted could also be a good thing since those are often not intended to hang around forever. As far as I can recall the only signs that ever get removed are player placed signs and the ones from the "personalized map" option on features that are removed, like chopping down a named forest should removed the name sign.
     
  18. Dancing Hoskuld

    Dancing Hoskuld Warlord

    Joined:
    Jul 5, 2004
    Messages:
    23,289
    Gender:
    Male
    Location:
    Canberra, Australia
    Thanks, I'll amend and test our code.

    Edit changed the code, the sign stayed for awhile then disappeared. reloading the game did not bring it back.
     
  19. God-Emperor

    God-Emperor Chieftain

    Joined:
    Jul 18, 2009
    Messages:
    3,551
    Location:
    Texas
    Not sure what changes you made but...

    The change I suggest would not be just a Python change where the above fix is. That happens after the signs are already cleared in order to show them again (so the player signs are already gone). It needs a DLL change in the function used to clear the signs to call the add sign Python with some identifiable and not normally useful set of arguments (like maybe NULL plot, player -2, and 0 length text) to trigger the "update user signs" Python.
     
  20. Afforess

    Afforess The White Wizard

    Joined:
    Jul 31, 2007
    Messages:
    12,239
    Location:
    Austin, Texas

Share This Page