Better BUG AI

Discussion in 'Civ4 - Modpacks' started by Fuyu, Feb 18, 2010.

  1. Fuyu

    Fuyu Emperor

    Joined:
    Nov 5, 2009
    Messages:
    1,225
    Location:
    Austria
    The only part I don't enable is Global Warming. But since BAT now has new female units, which will probably kill all savegame compatibility anyway, I guess I can compile you a dll with that option on too.
     
  2. Lemon Merchant

    Lemon Merchant Hall Monitor Super Moderator

    Joined:
    Jun 27, 2008
    Messages:
    8,728
    Gender:
    Female
    Location:
    Red Sector A
    I think that option is automatically enabled in the standard BULL compile. If you're using EF's latest build, the female units are enabled by default. I'll check, but I don't think that I use a compiler switch when I compile BAT's DLL.
     
  3. Fuyu

    Fuyu Emperor

    Joined:
    Nov 5, 2009
    Messages:
    1,225
    Location:
    Austria
    Female Units SDK part isn't even optional, and the makefile for BULL will only switch on AIAutoplay by default, everything else you have to turn on yourself.
    In Better BUG AI's standard dlls every option is either on (or not optional, which has the same effect) except for GlobalWarmingMod.
     
  4. Lemon Merchant

    Lemon Merchant Hall Monitor Super Moderator

    Joined:
    Jun 27, 2008
    Messages:
    8,728
    Gender:
    Female
    Location:
    Red Sector A
    In that case, it should be quite easy. Thanks for the help. :)
     
  5. LunarMongoose

    LunarMongoose King

    Joined:
    Jan 29, 2006
    Messages:
    731
    Gender:
    Male
    Location:
    Boston, MA, USA
    Alright, got a minor code mistake with big consequences for ya Fuyu, that I just found (and mistakenly posted in the BUG forum for a few minutes, heh).

    In CvGame.cpp

    In void CvGame::doGlobalWarming()

    You tried to extend the UP gamespeed scaling JDog did for Mine coughups, Forest growths, Nuclear Plant meltdowns (edit - okay you did that one yourself :)), etc to Global Warming and this awesome new Nuclear Winter effect. HOWEVER, you failed to notice that the random roll for these, which you correctly based on vanilla's format, is BACKWARDS from the others. Instead of "if random(range) == 0", they used "if random(100) < range" for this one. SO! You are actually making the Warming/Winter LESS likely on FASTER gamespeeds, and MORE likely on SLOWER gamespeeds, which is the OPPOSITE of what you want. Done with caps now, just trying to be clear. :p

    Here's my fix, just reverse the numerator and denominator:

    Code:
    /************************************************************************************************/
    /* UNOFFICIAL_PATCH                                                               jdog5000      */
    /*                                                                                              */
    /* Gamespeed scaling                                                                            */
    /************************************************************************************************/
    /* original bts code
    		if (getSorenRandNum(100, "Global Warming") + iGlobalWarmingDefense < GC.getDefineINT("GLOBAL_WARMING_PROB"))
    		{
    */
    		int iOdds = GC.getDefineINT("GLOBAL_WARMING_PROB") - iGlobalWarmingDefense;
    
    		//
    		// Mongoose GamespeedScalingFix BEGIN
    		//
    		iOdds = (iOdds * 100) / GC.getGameSpeedInfo(GC.getGameINLINE().getGameSpeedType()).getVictoryDelayPercent();
    		//
    		// Mongoose GamespeedScalingFix END
    		//
    
    		if (getSorenRandNum(100, "Global Warming") < iOdds)
    		{
    /************************************************************************************************/
    /* UNOFFICIAL_PATCH                        END                                                  */
    /************************************************************************************************/
    and

    Code:
    /************************************************************************************************/
    /* UNOFFICIAL_PATCH                                                               jdog5000      */
    /*                                                                                              */
    /* Gamespeed scaling                                                                            */
    /************************************************************************************************/
    /* original Global Warming Mod code
    		if (getSorenRandNum(100, "Nuclear Fallout") + iGlobalWarmingDefense < GC.getDefineINT("NUCLEAR_WINTER_PROB"))
    		{
    */
    		int iOdds = GC.getDefineINT("NUCLEAR_WINTER_PROB"); //Fuyu: iGlobalWarmingDefense does no longer protect from nuclear winters
    
    		//
    		// Mongoose GamespeedScalingFix BEGIN
    		//
    		iOdds = (iOdds * 100) / GC.getGameSpeedInfo(GC.getGameINLINE().getGameSpeedType()).getVictoryDelayPercent();
    		//
    		// Mongoose GamespeedScalingFix END
    		//
    
    		if (getSorenRandNum(100, "Nuclear Fallout") < iOdds)
    		{
    /************************************************************************************************/
    /* UNOFFICIAL_PATCH                        END                                                  */
    /************************************************************************************************/
    I personally thought the vanilla occurance rates for all these things were about right for Marathon speed btw, so I use a value of 300 instead of 100 everywhere to keep Marathon and Vanilla chances equivalent (which results in higher chances on all the faster speeds), but that's just me. I haven't played many games ON any of the faster speeds so I could be wrong.
     
  6. Fuyu

    Fuyu Emperor

    Joined:
    Nov 5, 2009
    Messages:
    1,225
    Location:
    Austria
    Heh. Ooops.
    That happens when you just copy-paste it all .. good catch, thx.
    To increase occurance rate I'd go for the GLOBAL_WARMING_PROB / NUCLEAR_WINTER_PROB defines instead of hardcoding 300 but that's just me.
    I have yet to play a game where GW actually occurs, and I'm always on normal speed, so I don't know either.
     
  7. PieceOfMind

    PieceOfMind Drill IV Defender Retired Moderator

    Joined:
    Jan 15, 2006
    Messages:
    9,319
    Location:
    Australia
    Could this be the reason why in PIG mod I've never seen global warming? Whatever you guys happen to figure out, I'm eargerly listening.
     
  8. LunarMongoose

    LunarMongoose King

    Joined:
    Jan 29, 2006
    Messages:
    731
    Gender:
    Male
    Location:
    Boston, MA, USA
    Thank you too for all the code in here Fuyu, there's a lot of great stuff, your Civic AI revamp and this inspired update to the GW mod in particular. :)

    The only way this bug would make GW less likely than whatever the baseline rate for this mod is, is if you were playing on Quick. That's it. Normal speed would be unaffected, and Epic and Marathon would see way MORE warming than they're supposed to.

    If you guys aren't seeing any (I don't know myself b/c I haven't played any games with this code yet), then my initial guess would be that the GWDefense is too powerful, and is keeping the odds on each roll clamped at zero. This would be especially likely if you ARE seeing Nuclear Winter trigger occasionally, since the main difference with that is GWDefense is not used.
     
  9. algieba

    algieba Chieftain

    Joined:
    Dec 23, 2010
    Messages:
    5
    Hello

    I played a game with bug and better bts AI, you can find it

    here

    I wanted to thank everyone who worked on BUG and better BTS AI, give them some feedback and encourage them to continue, even though CIV V is out.

    The game, but also these mods provided my with great entertainment and mental challenge.

    I read better BTS AI is dead, I learned of Fuyu's merge after starting this game, and I'm going to use it for my next game, this is why I post here, even though i didn't actually use this mod.

    THanks to everyone
     
  10. Todd Hawks

    Todd Hawks Warlord

    Joined:
    Nov 13, 2005
    Messages:
    228
    Hey Fuyu!

    Do you think it is possible to do a merge of BAT v3 with your BUG Better AI? I don't know how difficult that would be, but since BAT includes BUG, I hope it's not too demanding. Lemon Merchant wanted to do it but now she's gone (for at least a while) so I'm wondering if you can help. If you can, thank you in advance. :)
     
  11. CaptTightpants

    CaptTightpants Chieftain

    Joined:
    Dec 18, 2009
    Messages:
    36
    Thank you Fuyu! This is almost the combo of mods that I need!!

    I am trying to merge Better BUG AI with BAT and I tried to follow the instructions in the OP. But it couldn't load. I then realized that I have the latest version of BAT (3.0.1) and that might be the problem. (Your instructions talk about using BAT 2.3)

    But I can't seem to find the older version of BAT 2.3 :(

    Is there no way to merge this with the latest BAT 3.0.1?

    EDIT: I see that the poster above me has the exact same question. :lol:

    And since BAT makes the graphics "sexier," maybe we can call the Better AI / BAT / BUG merge "SASSY BUG" = Smart And Sexy BUG :cool:

    Also btw I was able to find the BAT 2.3 mod here
     
  12. Lemon Merchant

    Lemon Merchant Hall Monitor Super Moderator

    Joined:
    Jun 27, 2008
    Messages:
    8,728
    Gender:
    Female
    Location:
    Red Sector A
    Lemon just got married, and she is overloaded at school right now. :( I'm still working on the merge, but I have a seriously bad time deficit atm, so it's rather slow progress. Take heart, it's coming. :)

    You can call it what you wish, but the official release from the BUG team will be called "Better BAT AI", so please don't use that name if you release it as an actual mod. There is also one component of BAT 3.0.1 that I would prefer not to be in any merged release of the BAT Mod that isn't done by me and the BUG boys. You can PM me for the details if you like.
     
  13. Afforess

    Afforess The White Wizard

    Joined:
    Jul 31, 2007
    Messages:
    12,239
    Location:
    Austin, Texas
    That's terr...er, Congratulations! :beer:
    :lol:
     
  14. entwood

    entwood Warlord

    Joined:
    Sep 14, 2007
    Messages:
    187
    I truly hope Lemon's spouse loves CIV :please:
    or else there may be nagging about time spent :whipped:
     
  15. Sensational

    Sensational Chieftain

    Joined:
    Nov 30, 2003
    Messages:
    6
    Location:
    Berlin, Germany
    Got the same Problem.
     
  16. Lemon Merchant

    Lemon Merchant Hall Monitor Super Moderator

    Joined:
    Jun 27, 2008
    Messages:
    8,728
    Gender:
    Female
    Location:
    Red Sector A
    I finally got angry enough to get even! :lol:

    She doesn't get Civ at all. But I don't get her love for gluing things together and calling it "crafting", so it works out, I suppose. :crazyeye:

    Glue and sparkly things. Hah! I thought I was weird! :mischief:
     
  17. Edorf

    Edorf Chieftain

    Joined:
    Sep 29, 2010
    Messages:
    9
    I want to merge Better BUG AI with the Varietas Delectat mod. Does anyone know how I can do that? I just want a simple mod so I thought this would be a nice one.
     
  18. J@ckRB

    J@ckRB Chieftain

    Joined:
    Mar 26, 2011
    Messages:
    63
    Location:
    England/Wales Border
    I'm currently having trouble with this mod. I reinstalled CIV 4 Complete after seeing that the mods (that came with the game) aren't compatible. I made a copy of Civ 4 to play the mods, and one for regular use. I installed this mod and now, it won't run at all. I'm running Win 7, but I don't think that should matter (It was running perfectly before) The only thing I can think could affect it was a. I've got 2 copies (1 installed and 1 completely copied) and b. I installed the BUG mod beforehand. Any tips?

    Edit: Never mind. It's just the shortcut that crashes the game, and running the .exe runs the mod. Seems strange that the shortcut doesn't work, but it's only a minor issue.
     
  19. Fuyu

    Fuyu Emperor

    Joined:
    Nov 5, 2009
    Messages:
    1,225
    Location:
    Austria
    That's interesting, I certainly didn't know that calling the exe with mod="Better BUG AI" would crash it on win7. Maybe mod=\Better BUG AI works better? Idk, no win7 mashine yet.
     
  20. keldath

    keldath LivE LonG AnD PrOsPeR

    Joined:
    Dec 20, 2005
    Messages:
    6,943
    Location:
    israel
    hey fuyu!

    im glad to see your still around,

    im playing bbai bug that present in my mod on an multi-player game,
    all is fine, but the ai seem kinda peaceful, can something be done to increase aggression?

    plus - are we gonna see another update of this great mod sometime?

    thanks in advance,
    a fan.
     

Share This Page