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

[Religion and Revolution]: Bugs and Todos

Discussion in 'Civ4Col - Religion and Revolution' started by raystuttgart, Dec 13, 2011.

  1. Nightinggale

    Nightinggale Deity

    Joined:
    Feb 2, 2009
    Messages:
    4,355
    I think the "correct" approach is make the AI value lumber differently depending on the number of forests in catchment area. If it's all forests, it starts to clear. If there are just two forests, lumber is one of the most valued yields when viewed from the pioneer. Something like that has been on my wishlist for ages, but I still haven't quite figured out precisely how to do it. While it sounds simple, it suddenly isn't when you realize the AI calls the function so often that counting the number of forests when you need the number really isn't an option. This mean it requires a DLL solution, presumably with a cache and a detailed plan for cache updating and it becomes clear why it isn't implemented.

    Health would require some AI coding as well. However since it doesn't appear that anybody is going to do it the right way, figuring out xml settings to make it at least not completely stupid seems like it's a good idea.
     
  2. Vorpal+5

    Vorpal+5 Venturing in Erebus

    Joined:
    Mar 25, 2008
    Messages:
    633
    If you were to work in the DLL, a good approximation is to always keep/replant forests in the catchment area so to have 1 forest per 5 pop, as lumber is used through the whole life of a colony. Counting once per turn and per colony how many forests tiles are should not take a meaningful time (I program professionally so I'm fairly sure it won't be an issue, calculation wise).
     
  3. raystuttgart

    raystuttgart Civ4Col Modder

    Joined:
    Jan 24, 2011
    Messages:
    5,513
    Gender:
    Male
    Location:
    Stuttgart, Germany
    Hi guys,

    to make this clear again:

    AI does not need to build health buildings.

    Considering that feature AI plays by its own rules and will never suffer by negative effects of that feature.
    (I thoroughly explained that by the way, when I introduced that feature. And I tested it uncounted times !)

    It is a total different situation of course if you as a human Player will take over such an AI City with very low health.
    The negative health AI has accumulated can hit you like a hammer.

    But that is ok in my opinion.
    You will simply have to cope with all the injured Population.

    Having AI prioritize health buildings would negatively impact its overall strategy.

    I know it is fun to speculate about "wrong balancing".
    But without deeply knowing the code, it is nothing more than speculations ...

    Don't go crazy and ruin AI balancing because you did not read the code !
    (Good XML balancing is impossible without knowing the details of the DLL logic)
     
  4. Vorpal+5

    Vorpal+5 Venturing in Erebus

    Joined:
    Mar 25, 2008
    Messages:
    633
    That's good to know, thanks Ray. Nothing to do here, so fine for me :)

    You can't expect us to read the entirety of the code base though. If RaR has a manual or some doc stating that AI don't use health system, then I'll gladly chastise myself with stinging nettle though ;)
    Now, as you are still regularly reading the forum, no harm done, right, you enlightened us and that's enough to settle the non-issue!
     
  5. raystuttgart

    raystuttgart Civ4Col Modder

    Joined:
    Jan 24, 2011
    Messages:
    5,513
    Gender:
    Male
    Location:
    Stuttgart, Germany
    That is not completely correct either. :)

    AI can profit from positive effects of Health. <-- Same Rules as Human Player
    AI can never suffer from the negative effects of that feature though. <-- Special AI Rules

    Most of the time AI will simply ignore the feature but could theoretically build the Buildings and use the Professions. <-- Balancing
    (I have seen AI use the feature, when I gave one of its bigger cities the Buidling and Specialist with World Builder.)

    Generally, AI will profit a lot more by focussing on other features, Units, Buildings and Professions.
    (AI is simply not capable of using situational and adaptive strategies like a Human Player.)

    First of all, I would write myself to death, if I would try to explain again all the logic I wrote and my reasons for doing so.
    I already tried to do that in the forum, when introducing specific features. I admit though, it is a lot of information im many posts.

    Secondly, I don't think players should know all the things that are going on behind the scenes.
    It would destroy the illusion.

    (Mod-)modders however that want to improve AI or simply do a better balancing need to read the code.
    Thus I tried to write my code in a good fashion and also give some commenting.

    And of course, there is always a chance that my code is bugged.
    I did try to do thorough testing though.

    Messing with balancing without reading DLL code might work 50% of the time, when things are very simple.
    In all other cases, it will make things worse.

    Did not want to be rude, sorry.
    But I simply want to prevent that players will jump on false "Bugs and Balancing Problems".

    If potential players don't play RaR because they read "Health completely ruined AI", that is an issue for me.
    If mod-modders negatively impact their AI balancing because they read "I need to have AI Focus on Health" that is an issue for me.

    I know, you did not formulate it that way.
    But you never know what people are interpreting from such a post.

    Just so you understand why I jump on such posts like a bear mother defending its baby bear. :)
    (And there might be weeks between my sporadic visits in the forum. So I don't really visit regularly.)
     
  6. Ag0range

    Ag0range Chieftain

    Joined:
    Apr 12, 2013
    Messages:
    89
    Gender:
    Male
    Dear modders!

    I would like to ask you what is the current development state of the mod. Is RaRE 2.5.1 our only hope? How many are you at the moment, and do you work together? Do you plan or expect to start working together on further development? RaR is awesome at its current state, still many of us would like to dream there is more future for this great project. Hugs to you all!
     
  7. Nightinggale

    Nightinggale Deity

    Joined:
    Feb 2, 2009
    Messages:
    4,355
    RaR "final release" has been announced a few times, but it appears that this time it really happened. Being unable to carry on RaR, I started RaRE. That one seems dead as well. However there are no less than 3 RaR veterans who might suddenly bring it to life.
     
  8. raystuttgart

    raystuttgart Civ4Col Modder

    Joined:
    Jan 24, 2011
    Messages:
    5,513
    Gender:
    Male
    Location:
    Stuttgart, Germany
  9. Marla_Singer

    Marla_Singer United in diversity

    Joined:
    Oct 24, 2001
    Messages:
    12,987
    Location:
    Paris, west side (92).
    I recently started a new game of RAR v2.4. I'm experiencing an annoying systematic crash in 1630AD when I press enter to end the turn. I can't get rid of it.

    Is there a folder with crash report files for Civ4Col? I can't find it. You can download my savegame from this post.

    I have no clue from where it could come from. The game uses RAR standard rules.
     

    Attached Files:

  10. Nightinggale

    Nightinggale Deity

    Joined:
    Feb 2, 2009
    Messages:
    4,355
    Two things are needed for crash reporting bugs: savegame and description of how to crash the game. You provided both and I will see if I can get it to crash in the debugger to see why it crash. Development of RaR stopped, but that will not stop be from applying the fix to RaRE.
     
  11. Marla_Singer

    Marla_Singer United in diversity

    Joined:
    Oct 24, 2001
    Messages:
    12,987
    Location:
    Paris, west side (92).
    Thanks Nightingale!
    That's very welcomed! :goodjob:

    I'm sorry but I can't provide any better information. I've tried many things like coming back earlier in the game by many turns, doing things differently, and even though it can slightly change the exact turn at which it crashes, the crash still comes back.

    Everything seems normal. I'm not even doing something particularly new at this stage of this game. Of course I'll come back on the thread if I eventually find anything relevant.
     
  12. Nightinggale

    Nightinggale Deity

    Joined:
    Feb 2, 2009
    Messages:
    4,355
    A crash or freeze after pressing end turn is usually due to something the AI does. This makes it near impossible to identify the cause for human players. I had one freeze in RaRE which turned out to be triggered when the AI tried to load tools onto a ship. I have absolutely no idea how anybody could figure out that cause without using external tools to examine what the dll is doing.

    Don't be sorry for not providing more info. Once there is enough info to recreate the problem inside the debugger, any other info would likely be useless. It's only when the computer think the code is ok and just carries on that lots of info is really needed, like if you suddenly gained 432465 gold from one turn to anther for no reason. A crash is when the computer says this is very wrong and should never happen.
     
  13. Marla_Singer

    Marla_Singer United in diversity

    Joined:
    Oct 24, 2001
    Messages:
    12,987
    Location:
    Paris, west side (92).
    Thanks a lot Nightinggale for this advice.

    I've done some testing erasing AI opponents and checking what was going on. It turns out the bug is linked to Dutch Royal Light Infantrymen located in Nieuw Amsterdam that I've given to the Dutch through WorldBuilder because they were struggling against the Incas. Alright I confess, to make my games more interesting, I help the AI opponents once in a while. :blush:

    I don't exactly know what the bug is about. Those units have been given a long time ago without any problem. Maybe is it about XP and promotions?

    Anyway, erasing the units have cleared the issue. I don't have the crash anymore. :)
     
  14. Nightinggale

    Nightinggale Deity

    Joined:
    Feb 2, 2009
    Messages:
    4,355
    I will still examine the savegame. First of all we don't know if WB is required to trigger the crash. Secondly even if WB is needed, no function should be able to crash the game. The trade offer from natives crash is a good example of this. If the natives unit/settlement moved or died between making the offer and you answering, then the game crashed. I changed the function to not assume anything and it should now not be able to crash at all, regardless of what the game comes up with. It might cancel the deal if too much of the input data is lost, but that's minor compared to a crash.

    It's good you could avoid the crash and keep playing. It's more enjoyable for you and it makes the fix less urgent :)
     
  15. Beetlebug

    Beetlebug Chieftain

    Joined:
    Jan 24, 2006
    Messages:
    91
    Okay, so I have declared independence and have killed all the Kings troops and recaptured all my towns and there is no more unrest. The King only has one MOW left which floating out there somewhere.

    However, after 3 turns I still get no notice I've won the game - do I have to scour the oceans and sink that one ship to win or what???? :crazyeye:
     
  16. agnat86

    agnat86 Warlord

    Joined:
    Jun 30, 2011
    Messages:
    218
    I've encountered a graphical bug with the selection radius of the Continental Guard. It overlaps the adjacent plots completely, so that I cannot select the unit directly adjacent to it. I can select units three plots away though. You can see what I mean in the screenshots; I can only select the Town Guard on the far right, not the other two.

    BTW, this bug appears in RaR 2.4, without any modifications. I have noticed someone else encountered this bug as well, but I don't think it was solved back then:
    http://forums.civfanatics.com/showthread.php?p=14059514&highlight=continental#post14059514

    It is very similar to a bug in an earlier version where this happened to the heavy artilleries. That was one was solved (http://forums.civfanatics.com/showthread.php?p=13616354#post13616354), but this required some work on the .nif files.

    Has anyone corrected this yet, and if not, is this something an inexperienced modder can solve?
     

    Attached Files:

  17. Nightinggale

    Nightinggale Deity

    Joined:
    Feb 2, 2009
    Messages:
    4,355
    You can order the unit to wait and that way get the other units. However that only works for units with move and not if they are fortified or similar. Also it's a workaround rather than a fix.

    I too would like to know how to fix a problem like that. I honestly have no idea.
     
  18. Marla_Singer

    Marla_Singer United in diversity

    Joined:
    Oct 24, 2001
    Messages:
    12,987
    Location:
    Paris, west side (92).
    The bug wasn't there in version 1.9 and I've kept a copy of it.

    An easy solution is simply to use the unit from that version. Here's what you need to do for this.

    • Go to the folder Religion_and_Revolution/Assets/Art/units/Special_Military and rename the folder "Continental_guard" as "Continental_guard - ORIGINAL". Renaming the folder means it won't be found by the game anymore, but it's always safer to keep a copy rather than deleting it.
    • Then, copy paste this folder at the same location:
      continental_guard.zip
    • Then go to the folder Religion_and_Revolution/Assets/XML/Art and rename the file "CIV4ArtDefines_Unit.xml" as "CIV4ArtDefines_Unit - ORIGINAL.xml".
    • Then, copy paste this file at the same location:
      CIV4ArtDefines_Unit.zip

    This will only change the graphics used by the Continental guard unit (replacing them with those used in version 1.9). It won't have any impact at all on the rest of version 2.4 and the bug would be cleared (that's what I did for my copy).


    There's a better workaround. Press ctrl+left arrow or ctrl+right arrow and you can rotate 360°. You just need to find an angle at which the unit you want to select is in front of the continental guard, then you can select it. Then press ctrl+Home to restore the original view.
     
  19. Nightinggale

    Nightinggale Deity

    Joined:
    Feb 2, 2009
    Messages:
    4,355
    I can do better than that. I imported the entire RaR svn into git, complete with commit history and everything. The computer spent hours downloading every single revision, but it mean the RaRE git server can tell when each file was changed. Even better, RaRE use a public git server, meaning everybody can read the file history, providing they can figure out how to use git.

    Looks like the only candidate are two commits made within minutes on 23-08-2014. Sadly the log entries call them "Improvements" and "Update 2" with no further explanation.

    Sadly this is not entirely true. It breaks the governor and the bugfix to Dutch royal artillery.

    I better look into this. Looks like there are 3 versions to investigate (current, between the commits and before). I should fetch all 3 from git and try replacing one file at a time to see when it works as intended. According to names of the changed files, it would appear that it is the man holding the flag, which cause the issue as it doesn't look like the others were changed.

    I see there are files for each country. It would be interesting to know if this is country specific or something, which affects all of them.
     
  20. Marla_Singer

    Marla_Singer United in diversity

    Joined:
    Oct 24, 2001
    Messages:
    12,987
    Location:
    Paris, west side (92).
    No it doesn't.

    The folder "continent_guard.zip" strictly contains graphical files for the continental guards. As for the "CIV4ArtDefines_Unit.xml". It is exactly the one of version 2.4, I've only corrected the path to make it find the Continental guards graphics.

    The correction I've made for Agnat86 has absolutely no reason to do anything else than to use the past not-bugged version of continental guard graphics.

    There is absolutely no reason why it would affect Dutch artillery, governor or whatever other units as absolutely nothing else is changed.
     

Share This Page