1. Firaxis celebrates the "Asian American and Pacific Islander Heritage Month", and offers a give-away of a Civ6 anthology copy (5 in total)! For all the details, please check the thread here. .
    Dismiss Notice
  2. Old World has finally been released on GOG and Steam, besides also being available in the Epic store . Come to our Old World forum and discuss with us!
    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. 45°38'N-13°47'E

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

    Joined:
    Jun 7, 2008
    Messages:
    5,974
    Location:
    Just wonder...
    Yeah, I got it in the meantime; never experienced negative values because I very seldom use recalc but I see that if I do it multiple times I get negative values. Ok, that's clear now and it looks like your fixes are working. Now I'm trying to understand why percentages of domestic and foreign commerce aren't properly calculated in the help inside the city screen. For example I have

    123 base commerce
    1 from capital connection
    8 from domestic connection
    20 from foreign connection
    -10% from domestic connections from Post Scarcity
    +10% from foreign connections from Post Scarcity
    +10% from Power
    +25% from Civics
    +25% from Capital

    Total is 243.20, which is correct if I don't take into account that -10% domestic and +10% foreign connections (they are different because one is domestic and the other is foreign connectedness commerce). For some reason, it doesn't calculate that percentage coming from domestic and foreign connectedness. At least it looks so, I'm checking the code now.

    Edit: mmm, I think I start to understand; Afforess made this part of the code long ago, from what I can see, there's something weird in
    void CvGameTextMgr::setYieldHelp(CvWStringBuffer &szBuffer, CvCity& city, YieldTypes eYieldType)

    it looks like iDomesticConnectednessCommerce and iForeignConnectednessCommerce already include civics modifiers, as they are calculated in CvCity.cpp. What is displayed inside the city screen are those values without modifiers but in the process it's probably being rounded, so that value is sometimes wrong. And I'm still not sure the calculation is right toward the end of this function. I need more time (which I'm short of, actually)l
     
    Last edited: Apr 10, 2020
  2. valergrad

    valergrad Warlord

    Joined:
    May 26, 2013
    Messages:
    172
    Agree, I had exactly the same impression when I first looked at this part of code.
    If you have 11 and multiply this on 10% and round you will get 12.10 rounded = 12.
    But if then you'll remove this modifier back to calculate 12 / 1.10 = 10.9 and round it you'll get 10. 11 transformed to 10.

    So, with all this roundings it is very easy to get incorrect result. And as all this variables are int - they are rounded. You can try change types to double to them and see.
    This is just reporting of course, but this is masking some other issues.
     
    rtt4a likes this.
  3. 45°38'N-13°47'E

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

    Joined:
    Jun 7, 2008
    Messages:
    5,974
    Location:
    Just wonder...

    Ok, the easiest solution I can find for now is to show connectedness commerce with all its modifiers included inside the city screen, the same values that are used to calculate total commerce. I'll leave alone the part where it says "+/- x% from foreign/domestic connectedness due to (civic)", I'll just add a text which explains "already included above". The underlaying problem is that connectedness calculations are a bit too complicated because they depend on many factors (civics, traits, etc); for example there's a part of the code that explains that more buildings in the same city which provide connectedness commerce aren't counted multiple times, but this is not clear in the values shown in city screen. Also something that is not shown in calculations inside the city screen is commerce change caused by imperium or redevelopment. So the best thing to show matching numbers is to use values with modifiers included, provided everyone knows that those values are correct if you take into account every modifier.
     
    rtt4a and Samson like this.
  4. philipschall

    philipschall Warlord

    Joined:
    Aug 14, 2009
    Messages:
    214
    A fun bug I've found: When loading a custom scenario with already established cities, units, etc, you have to recalc before you gain access to any resources.
     
  5. 45°38'N-13°47'E

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

    Joined:
    Jun 7, 2008
    Messages:
    5,974
    Location:
    Just wonder...
    That's because mod is not designed for scenarios; the last time a scenario was updated was years ago so they're all outdated compared to current revision. :)
     
  6. <Nexus>

    <Nexus> Traveler of the Multiverse

    Joined:
    Jan 23, 2014
    Messages:
    4,850
    Gender:
    Male
    Location:
    In a constant brainstorm...
    Great job guys!
    Maybe valergrad can help with other bugs too? Like Movement Limit not always working.
     
  7. valergrad

    valergrad Warlord

    Joined:
    May 26, 2013
    Messages:
    172
    I am newbie, so it requires for me too much time now... So, can't promise.
    I currently trying to understand this new interesting bug I've faced right now. Let's call it "invisible trebushet".

    On this save that I've attached . If you look at capital - I have two catapults. But if you go to F5 - Military Advisor, you'll see that I actually have also 1 Trebushet.
    How this happened that I don't see it at map and can't select? I don't know. But I just bought this Trebushet from Boudica for 360 gold. Usually buying units works fine - you just get unit in your capital. But not this time.
     

    Attached Files:

  8. 45°38'N-13°47'E

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

    Joined:
    Jun 7, 2008
    Messages:
    5,974
    Location:
    Just wonder...
    Is the updater/launcher working for you all? I didn't change anything in rev1088 but for some reason it keeps checking all files again and again saying there was something wrong in the last updating process, so the launcher doesn't work anymore. And for some reason some system files appeared in the main RAND folder, files that usually are inside the checker folder.
     
  9. valergrad

    valergrad Warlord

    Joined:
    May 26, 2013
    Messages:
    172
    About this Invisible Trebushet issue - Trebushet probably was in transport when I've bought it.
    I've found cycling between units by ',' and '.', and button "unload" was active on him.
    So, we need either change this status somehow during buying, or simple restrict to sell units when they are in transport.
     
  10. philipschall

    philipschall Warlord

    Joined:
    Aug 14, 2009
    Messages:
    214
    Sorry, I didn't make myself clear. You can test this yourself. Load a game that you are playing, go into WB, save it as a scenario. Exit out of game, jump back in, play the scenario you just saved in WB, it will not have resources available to cities until you recalc.
     
  11. Zepolak

    Zepolak Chieftain

    Joined:
    Apr 1, 2020
    Messages:
    10
    No it isn't. I actually posted in the other topic asking the roughly the same question.
    Now... If I do delete the file 0-byte file called "Updating", I can launch the game, and I can load my save, and I can do a recalc to see suddenly all the numbers no longer negative in the city screen (and my science actually skyrocketing to the values I was getting with Leonardo's Workshop "bug") but I can't confirm that yet because ending the turn makes the game crash.
    Which is possibly due to the update creating conflicting files, I don't know. I imagine a clean install is needed at this point.

    But it's my hope & guess that Valergrad fixes actually "fixed" what I was thinking was a bug with Leonardo's Workshop while it actually was just that my old save, on which I did numerous recalcs (especially when I was hoping it'll fix my "imperium" bug problems) created me quite some negative commerce that was real. Not just "fake" in the city screen.
     
  12. CometHalo

    CometHalo Chieftain

    Joined:
    Apr 12, 2020
    Messages:
    6
    Hello,

    Been looking around here for the past few hours, but can't find anything concrete...

    (Not even sure if this is where I should put this) but my AND 2.2 build 1087 Standard Speed Game on a Gigantic map (likely the problem) on turn 907 (even more the problem) crashes on clicking next turn, to get to turn 908. The game speed got really bad on the past 150 or so turns, but had not be crashing 100% consistently until this point.

    Is there something in the .ini I can change? Or could someone point me in the right direction?

    CH
     
  13. rtt4a

    rtt4a Prince

    Joined:
    Mar 3, 2009
    Messages:
    554
    Noup.. cant upadate and I get runtime error for updater
     
  14. <Nexus>

    <Nexus> Traveler of the Multiverse

    Joined:
    Jan 23, 2014
    Messages:
    4,850
    Gender:
    Male
    Location:
    In a constant brainstorm...
  15. valergrad

    valergrad Warlord

    Joined:
    May 26, 2013
    Messages:
    172
    Actually I believe we can fix this and still leave underlying information. We need just to calculate everything correctly, take into account all integer arithmetic and rounding issues, fix all bugs in general.
    I've got this problem now in my game ( after I've converted to imperium), so I spent some time with code and I believe I've fixed this ( at least several bugs ) in this reporting.
    See how it looked before and after:

    upload_2020-4-13_1-26-27.png

    So, before foreign city connections are incorrect. It showed 29, but correct value is 30 - it was rounding issue. When you divide to get "before-modifiers" value you need to round to ceil ( and default convertation to integer rounds to floor ). Also if you have several modifiers, you need to sum up all modifiers and divide it once - olny then you'll get "before-modifiers" value. ( this is the reason I've added in code iDomesticConnectednessModifier and iForeignConnectednessModifier variables ).

    Also total commerce was incorrect because in code they forgot to add to iBaseProduction extra value appeared after modificators ( civics, traits etc. ). So, I've fixed this.
    45°38'N-13°47'E, Could you look? For example check how this works on your complicated save with a lot of traits and modifiers. If it is needed I can explain all changes in skype, for example.

    Also as you see, to this modifiers I am showing not only percentage, but extra value that we got. For example, we have foreign commerce 30, imperium add 33% = this means 9.90 rounded to 9 extra value. So I am showing +33%(9) - this required several small fixes in XML.

    Sending you changed files: CvGameTextMgr.txt it is of course should be renamed to .cpp.
    XMLs are from XML/Text
     

    Attached Files:

    45°38'N-13°47'E and rtt4a like this.
  16. <Nexus>

    <Nexus> Traveler of the Multiverse

    Joined:
    Jan 23, 2014
    Messages:
    4,850
    Gender:
    Male
    Location:
    In a constant brainstorm...
    Great work!

    Just a little cosmetics thing.

    Maybe
    +33% :commerce: from foreign city connections due to Imperium (+9:commerce:)
    would be clearer.
     
  17. valergrad

    valergrad Warlord

    Joined:
    May 26, 2013
    Messages:
    172
    Agree, that looks better. Good part that it can be done just by changing .xml-s. Bad part that there are 17 languages there)
     
  18. <Nexus>

    <Nexus> Traveler of the Multiverse

    Joined:
    Jan 23, 2014
    Messages:
    4,850
    Gender:
    Male
    Location:
    In a constant brainstorm...
    Don't bother with the other languages. Just tag them out using <!-- and --> so the translators will see that they have work with these lines - again.
     
  19. 45°38'N-13°47'E

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

    Joined:
    Jun 7, 2008
    Messages:
    5,974
    Location:
    Just wonder...
    Thanks valergrad, I'll have a look and will run some test to check everything works smoothly. If everything goes well, I'll release a new revision. Thanks again.
     
  20. 45°38'N-13°47'E

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

    Joined:
    Jun 7, 2008
    Messages:
    5,974
    Location:
    Just wonder...
    About the installer/launcher, as @Zepolak suggested above, just delete "updating" file in main RAND folder. The mod gets updated when running the updater, but for some reason that file is not being deleted and hence the launcher thinks the update is not complete (while in fact it is). I'll try to understand what's broken in the launcher/installer/updater but it might take some time. For now, just delete that file after you've updated the mod.
     

Share This Page