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

K-Mod: Far Beyond the Sword

Discussion in 'Civ 4 - K-Mod: Far Beyond the Sword' started by karadoc, Jan 8, 2011.

  1. karadoc

    karadoc AI programmer

    Joined:
    Oct 3, 2005
    Messages:
    1,568
    Location:
    Australia
    Ok. I'm looking into it, but only in short and scatter sessions - so it might take me awhile to get to the bottom of it.

    So far I've discovered that the assertion failure happens because team 7 is being assigned starting techs, but there are no players assigned to team 7. So that looks like a problem in the scenario file. Normally I'd say that a problem like that should not never cause the game to crash; but to be frank, the code for loading and saving scenarios is built with bad coding practices which make it very unstable. Pretty much any change in the game or the scenario files could break everything...

    In any case, my suggestion is to edit the scenario either to give team 7 a player, or to not give them starting techs.

    On another day I'll try to work out why it _does_ work with the previous version. It could just be a fluke that it works at all; or it could be that something minor has changed to prevent it from working. I don't particularly want to rewrite all of the scenario loading code to make it more robust, but I might be able to tweak a few things to help it.

    [Edit]
    By the way. In all of my previous releases, asserts have been disabled. It was only enabled mistakenly in that 48 civ dll because I always have them enabled when I play my test games. So, although this version is the first time you've seen that assertion failure, it's probably the case that it actually has been silently failing for every version of the game so far and we just didn't know about it.

    [edit 2]
    After continuing my test, and rechecking my post, I realise that you didn't say the game crashed or anything like that - only that you couldn't get rid of the assert message. Usually those messages aren't a major issue for me. (I alt-tab out of the game, and press "ignore always"). So I assumed that wasn't the main issue for you and that it was actually crashing. (Those assertion failures usually mean there's a significant bug happening which may or may not cause the game to crash.)

    Anyway, if you want to try the normal version with asserts disabled, it will probably 'work' just as well is it did in the first place. The bug will still be there; but it will be hidden - just like in every previous version.
     

    Attached Files:

    Last edited: Oct 24, 2016
  2. TheOnlyDJCat

    TheOnlyDJCat Warlord

    Joined:
    Dec 31, 2006
    Messages:
    118
    Location:
    Germany
    Ahh, that looks like the problem. Indeed it didn't 'crash' but Civ didn't continue with initializing the game, because of the assertion and I could not close the assertion window, because Civ still captured the mouse. I couldn't even click on tasks in the task manager, so I had to restart windows (perhaps windows 10 has a different mouse handling?). But your advice with disabling the missing team completely (or at least the techs) sounds good. I'll check that tomorrow. Thanks for looking into that.
    (And I really should start to look for the cpp files myself...)
     
  3. keldath

    keldath LivE LonG AnD PrOsPeR

    Joined:
    Dec 20, 2005
    Messages:
    6,921
    Location:
    israel
    Hey karadoc,

    So, can we expect you to keep working on the mod?
    How do you feel about civ6?
     
  4. Axios

    Axios Warlord

    Joined:
    Oct 19, 2009
    Messages:
    126
    Location:
    Italy
    First of all, a huge "Thank you!" to Karadoc for his mod.

    Questionable behaviour (I suppose an heritage from vanilla BtS) (sorry, forgot to copy the save file).

    Continents, 7 players, Noble, Kmod 1.45

    AI sent 2 suicidal catapults for wound a musketeer on my border and then finish him with a maceman. Musketeer was on a plain tile, no resources on it.

    Wonded enemy maceman was killed by a my knight.

    Strategic consideration: AI lost 3 units, I lost one.

    Also my 30+ units SoD found 2 catapults less approaching AI capital.

    On the other side, a stack of 8 caravels not even try to send 1-2 suicidal caravels in order to damage a single c1 pirate ship that basically is blocking enemy capital since 20 turns...

    ------------

    Another situation: I approach a coastal city with 8 trebuchets, 12 maceman and 5 musketeers. I rip off defenses in one turn. At the next turn I start the "collateral damage" party.

    Enemy have only 4 longbowmen and 2 horse archers. 6 caravels inside the city where not evacuated and AI lost them.

    Even if AI saw city defenses from 100% to 0% in a turn and the double of attackers / defenders ratio, no naval units evacuation.

    Hoping that Kmod will improve these behaviors.

    Thanks.
     
  5. f1rpo

    f1rpo plastics

    Joined:
    May 22, 2014
    Messages:
    998
    Location:
    Germany
    I think this is something I've fixed. I had seen a dozen or so Triremes unwilling to engage a single Privateer. It's, apparently, a known issue in the BBAI mod; a comment in CvUnitAI::AI_attackSeaMove says "TODO: Make odds scale by # of blockaders vs number of attackers". I'm posting my fix below, in case anyone wants to merge it. That said, I'm not sure why there is dedicated code for breaking blockades in the first place; simply applying the normal rules for stack attack might be a cleaner solution.
    Spoiler :
    BBAI code:
    Code:
    if( iAttackers > (iBlockaders + 2) )
      if( iAttackers > GC.getGameINLINE().getSorenRandNum(2*iBlockaders + 1,
          "AI - Break blockade") )
        if (AI_anyAttack(1, 15)) return;
    My code:
    Code:
    if( iAttackers > (iBlockaders + 2) )
      if( iAttackers > GC.getGameINLINE().getSorenRandNum(2*iBlockaders + 1,
          "AI - Break blockade") ) {
        int oddsThresh = 8 * (5 - iAttackers / iBlockaders);
        /* If the blockaders aren't outnumbered
           at least 2:1, use 32% as the threshold. In most cases,
           the previous conditions already ensure 2:1, and then
           it's 24%. At 3:1, 4:1 etc., the threshold
           decreases in decrements of 8 all the way to 0 (attack
           regardless of individual odds). */
        oddsThresh = std::max(oddsThresh, 0);
        if(AI_anyAttack(1, oddsThresh)) return;
      }
     
  6. keldath

    keldath LivE LonG AnD PrOsPeR

    Joined:
    Dec 20, 2005
    Messages:
    6,921
    Location:
    israel
    thank you, i will use it.
     
  7. Axios

    Axios Warlord

    Joined:
    Oct 19, 2009
    Messages:
    126
    Location:
    Italy
    Thanks! Hoping to see this soon in Kmod...
     
  8. ChaosSlayer

    ChaosSlayer King

    Joined:
    Feb 3, 2011
    Messages:
    608
    Hello and a Question.
    I like a lot of AI improvements made in Kmod, but don't I like that it incorporates BUG - I hate BUg interface (I believe its cheating too, because it shows you info you not suppose to know).
    What are my options? How could I get better AI only?

    Thank You!
     
  9. Zholef

    Zholef Warlord

    Joined:
    Feb 20, 2014
    Messages:
    192
    BUG has a lot of options. Can't you just turn off the parts of it you don't want?
     
  10. keldath

    keldath LivE LonG AnD PrOsPeR

    Joined:
    Dec 20, 2005
    Messages:
    6,921
    Location:
    israel
    Ive made a kmod version with platypings ui.
    Removed bug's.
    Kmod+++ its called.

    Also my mods have it.
     
  11. karadoc

    karadoc AI programmer

    Joined:
    Oct 3, 2005
    Messages:
    1,568
    Location:
    Australia
    I haven't been looking closely at civ6, but at a glance it does seem a lot better than 5. Maybe I'll buy it if it shows up in a humble bundle or something... It's probably a decent game, but I doubt it is better than what we're playing.

    As for civ4 and K-Mod, I will probably continue to tinker with it; but it will be a lot slower than it was in the past. My situation has changed such that it is a lot harder than it use to be for me to make and test stuff. So it's unlikely that there will be a new version in the near future. (I've already changed couple of things on my own version; but I like to wait until there are noticeable improvements before uploading.)
     
  12. Zholef

    Zholef Warlord

    Joined:
    Feb 20, 2014
    Messages:
    192
    I took the liberty of adding/fixing some German translations to/in the text files used by K-Mod. See attached file.
     

    Attached Files:

    f1rpo likes this.
  13. IronCrown

    IronCrown Black Foe of the World

    Joined:
    Jun 21, 2007
    Messages:
    674
    I had been playing on version 1.42b for a long time, thinking that you stopped updating this amazing mod a long time ago. Now I came back here after a long while and see that there have been three updates. Great!

    What you did to improve on the pitiful Firaxis AI is simply amazing. I wonder if you are just a genius, or Firaxis are incredibly lazy. Every single one of their otherwise great games has horrible, horrible AI. Basically non-existent. Every Civ game as well as the XCOM games. But if one man alone can create such a good AI, shouldn't a team of pros backed by millions in sales be capable of delivering something similar when the game ships? Instead, Firaxis never even tries. It seems obvious that they simply do not regard AI as important. Which is a complete mystery to me, although I'm afraid their success with players (and reviewers!) proves them right – most people do not actually want to be challenged by the AI. In reviews, this topic usually doesn't even come up!
     
  14. ChaosSlayer

    ChaosSlayer King

    Joined:
    Feb 3, 2011
    Messages:
    608
    Ha, Civ4 even considered one of the better AI in Civ series. Civ5 AI was twice as bad. Highest difficulty Civ5 is only as good as Civ4 Prince.
    Its because the game companies today are too lazy/incompetent to actual sit down and code the AI, they make money by putting together a graphical theme park and shipping it off asap so they can start on the next product.
     
  15. DarkLunaPhantom

    DarkLunaPhantom Prince Supporter

    Joined:
    Feb 4, 2013
    Messages:
    465
    AI is the same for any difficulty level, only AI bonuses ("cheating") are increased on higher difficulty levels.
     
  16. VanitysFiend

    VanitysFiend Chieftain

    Joined:
    Oct 27, 2016
    Messages:
    32
    Gender:
    Male
    Location:
    Antrim
    Ok, so CiVI brought me back to CIV, which brought me back to K-mod (seriously, I've payed more K-mod since VI's release than VI itself) and I just want to ask one question and make one suggestion...

    So, my question is about the culture changes, is there anyway to reset those to BTS standard via the XML? Is the 'free culture' bonus modable? I think the changes to culture make it to too hard for conquered cities to become useful because culture pressure is basically not counterable without genocide, u have to go for complete kills. The old system had value in that it weighted things in favour of the closest city, expanding your borders mattered more than how much culture you generated per turn.

    My suggestion is one that I think has been made before but I'm gonna make it again. I think, given the awesome global warming system you've added, that planting forests should be an option late game, probably on ecology. If they offset ecodamage sufficiently, there won't be much risk of a plant then chop abuse cycle, hopefully...
     
  17. Zholef

    Zholef Warlord

    Joined:
    Feb 20, 2014
    Messages:
    192
    Agreed, partial conquests are rendered pointless, which isn't good. The stock BtS culture system had its problems too though. Anyway, 'free culture' can be set in GlobalDefinesAlt.xml, but most of the changes to how tiles are infused with culture are in the DLL and can't be changed without a recompile.
     
  18. ScorpionWasp

    ScorpionWasp Chieftain

    Joined:
    Nov 19, 2016
    Messages:
    8
    Gender:
    Male
    I have a bit of an unfair question and it's ok if you don't know the answer, but maybe you can help me out nevertheless.

    A loooong time ago when it seemed the Better BTS AI Mod was here to stay and nothing better would ever replace it, stupid me installed it over the original game files, rather than as a mod. Then I went and made further customizations to a myriad of files which I'd rather not lose if possible (thus why I'd rather avoid a fresh reinstall).

    So, my question is... do you know if installing K-mod (as a mod) on top of a Better BTS AI Mod - installed as a replacement to the original game files - would create any problems?

    Alternatively, is there a quick and easy way to disable Better AI - maybe a root file that boots everything else - without having to restore all of the files?
     
    Last edited: Nov 19, 2016
  19. Zholef

    Zholef Warlord

    Joined:
    Feb 20, 2014
    Messages:
    192
    Depends on what exactly you did. Basically there's three ways to customize Civ4. Firstly, you can install things in separate directories under "Mods", that way the various modifications can exist independently and don't bother one another. Secondly, you can install things under "CustomAssets", that way these changes are available to all mods, but the mods can be set to ignore them in their respective .ini files. K-Mod happens to have that set by default. Lastly, you can add to or change the game's original files, but that has no advantages and should never be done. In this specific case, if you ran K-Mod as a mod on top of this, for the lack of a better word, damaged install, you wouldn't get to play K-Mod as everyone else, but some hybrid between K-Mod and whatever changes you've made, unless K-Mod coincidentally were to overwrite all of the files you changed, which from the sound of it is unlikely. However, by doing that you could at least find out in a safe way whether that Frankensteinish monster of a game you seem to be planing to create would still be playable. Not that there was any point or need to installing yet another mod's files into your base game.

    As for a quick and easy way out of your predicament, sorry, but unless I'm understanding you incorrectly, you've deprived yourself of that option when you decided against using the "CustomAssets" method.

    I'd recommend making a backup of your game's installation, reinstalling the game and running a comparison (there's programs for that) between the two directories. Then you can copy the changed files (preserving directory hierarchy) into a newly created mod directory to create your own personal mod that you could even share with us here on the forum.
     
    Last edited: Nov 20, 2016
  20. Fuyu

    Fuyu Emperor

    Joined:
    Nov 5, 2009
    Messages:
    1,225
    Location:
    Austria
    Back up everything that you changed, and if you don't know which files those were, the entire assets folder, and reinstall the game plus latest update, then folder comparison as Zholef suggested.
    We can also provide you with original game files if you no longer have the install medium/files but that would definitely take longer.
     

Share This Page