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

[BTS] Development thread

Discussion in 'Civ4 - Better AI' started by jdog5000, Sep 19, 2008.

  1. bob_d

    bob_d Chieftain

    Joined:
    Sep 21, 2010
    Messages:
    76
    I hope there will be new versions. Civ 4 BTS with this mod is so much better than Civ 5. I played Civ 5 for a few hours, then went back to Civ 4. I still can't beat Civ 4 BTS on Emperor level with version 1.01 of this mod. (I came so close, but my spaceship didn't make it.)

    If someone is going to be adding stuff, I hope you will address corporations. The AI isn't as good at founding them as I am. I find it's a big advantage I have over the AI if I ever make it far enough in the game to found Mining Inc and Sid's Sushi.
     
  2. Fuyu

    Fuyu Emperor

    Joined:
    Nov 5, 2009
    Messages:
    1,225
    Location:
    Austria
    No one has taken over and I have my doubts anyone will, jdog has been maintaining Better BTS AI alone for quite a while now.
    If you don't mind the BUG mod being bundeled with it, there is a very recent version of Better BUG AI available which includes all of those code snippets that were posted.

    Corporations is just one part of one of the major weaknesses left: intelligent GP usage. Humans bulb, start golden ages, use the GP's special bility or found corporations, while the AI still settles a lot into cities. Maybe one day someone will write a Wait-For-Bulb (Afforess already wrote the mission code) and Wait-For-Corportation AI which makes the AI player conserve its GPs for a time when they can be put to better use but I doubt I have the time for any of that anytime soon.
     
  3. MaxCiv

    MaxCiv Warlord

    Joined:
    Apr 7, 2006
    Messages:
    111
    Location:
    Ottawa - Canada
    So has Jdog officially stopped working on BBAI?
     
  4. Cybah

    Cybah Emperor

    Joined:
    Jun 22, 2007
    Messages:
    1,480
    Nobody knows. I hope he will still prefer civ4 over civ5 like many others. ;)
     
  5. Caboose

    Caboose Another Drill IV defender

    Joined:
    May 1, 2008
    Messages:
    302
    Location:
    Norway
    I concur.
     
  6. jdog5000

    jdog5000 Revolutionary

    Joined:
    Nov 25, 2003
    Messages:
    2,601
    Location:
    California
    Yes, unfortunately I have no time. Only played one partial game of Civ5 so far as well, looks great but has a long way to go under the hood ... but the Civ4 AI was pretty terrible when it first shipped as well.
     
  7. razor436

    razor436 Chieftain

    Joined:
    Nov 18, 2005
    Messages:
    44
    I beg to differ. Civ IV BTS is better now, as it is more mature, but I think it would be best to make the switch to civ V.
     
  8. MaxCiv

    MaxCiv Warlord

    Joined:
    Apr 7, 2006
    Messages:
    111
    Location:
    Ottawa - Canada
    All I can say is thank you! In my eyes you are one of the few modders that took retail Civ4 and made it the game it was supposed to be. If it wasn't for your work I would have abandoned it a long time ago.

    I only tried Civ5 briefly and I agree with you. There is lots of potential there, but it's a long way to go.

    Good luck to you for whatever comes next in your life.
     
  9. razor436

    razor436 Chieftain

    Joined:
    Nov 18, 2005
    Messages:
    44
    You speak for us all.
     
  10. Cybah

    Cybah Emperor

    Joined:
    Jun 22, 2007
    Messages:
    1,480
    No. It's too different. I won't wait for a Civ4 Mod for Civ5. Makes no sense (I hate every civ5 graphics, the comic style is terrible). Also, I won't play any Civ5 Mod for Civ4 BTS.

    Civ4 BTS with a good mod is perfect (for me). But I don't want to discuss this here.

    Thanks jdog for your effort. The biggest German mod got updated everytime you have released a new bbai version. :) Will miss it, but my mod for Civ4 will go on. :)
     
  11. bob_d

    bob_d Chieftain

    Joined:
    Sep 21, 2010
    Messages:
    76
    It's understandable that you now have other stuff going on in your life. Thanks for making Civ IV so much better to play.
     
  12. jdog5000

    jdog5000 Revolutionary

    Joined:
    Nov 25, 2003
    Messages:
    2,601
    Location:
    California
    Thanks all.

    The evening after I posted above, the laptop I had done all my BBAI modding on over the last couple years short circuited and died. Guess it decided it's job was over and it was ready for retirement ... it was four years old so it put in its time, but the coincidence of crapping out that night was strange.
     
  13. Ninja2

    Ninja2 Great Engineer

    Joined:
    Nov 17, 2005
    Messages:
    1,142
    Location:
    Denmarkia
    Aye, thanks for all the work, jdog! :beer: And funny coincidence about the laptop! :crazyeye:
     
  14. Yxklyx

    Yxklyx King

    Joined:
    May 7, 2008
    Messages:
    869
    Thanks for all the work you put into this mod jdog! I expect to be using it for months or years to come.
     
  15. Thomas SG

    Thomas SG CCV-designer

    Joined:
    Aug 10, 2007
    Messages:
    1,164
    Location:
    Germany
    Is somebody still working on this project?

    I've got a little job for you. Why the hell does this nation research as first technology "fishing"??? :crazyeye:

    Spoiler :




    EDIT: Here is my solution for CCV (int CvPlayerAI::AI_techValue in CvPlayerAI):

    PHP:
    ...
        
    iValue += iBuildValue;

        
    // does tech reveal bonus resources
        
    for (int iJ 0iJ GC.getNumBonusInfos(); iJ++)
        {
            if (
    GC.getBonusInfo((BonusTypes)iJ).getTechReveal() == eTech)
            {
                
    // Thomas SG
                
    int iRevealValue 50;

                
    bool bOnlyWaterBonus true;
                for (
    int iK 0iK GC.getNumTerrainInfos() && bOnlyWaterBonusiK++)
                {
                    if (
    GC.getBonusInfo((BonusTypes)iJ).isTerrain((TerrainTypes)iK) || GC.getBonusInfo((BonusTypes)iJ).isFeatureTerrain((TerrainTypes)iK))
                    {
                        if (
    iK != GC.getDefineINT("TERRAIN_OCEAN") && iK != GC.getDefineINT("TERRAIN_COAST"))
                        {
                            
    bOnlyWaterBonus false;
                        }
                    }
                }

                
    iRevealValue += ((iCoastalCities == && bOnlyWaterBonus)? 0:100 AI_bonusVal((BonusTypes)iJ) * 50);
                
                
    BonusClassTypes eBonusClass = (BonusClassTypes)GC.getBonusInfo((BonusTypes)iJ).getBonusClassType();
                
    int iBonusClassTotal = (paiBonusClassRevealed[eBonusClass] + paiBonusClassUnrevealed[eBonusClass]);
    ...
     

    Attached Files:

  16. Thomas SG

    Thomas SG CCV-designer

    Joined:
    Aug 10, 2007
    Messages:
    1,164
    Location:
    Germany
    :yup: Me too. But Cybah is absolutly right CCV as the biggest German mod is always up to date. And BASE as the second biggest German mod of course too. :p

    :lol:
     
  17. glider1

    glider1 Deity

    Joined:
    May 29, 2006
    Messages:
    2,796
    Location:
    Where animals hop not run
    Hi Thomas
    Thanks for sharing your code with the project! You may be absolutely correct with your logic I just offer some temperance by saying that fishing leads to sailing, a very important inland technology in some cases. I notice a big river heading southwards in your test case submission.
    Thanks again for staying involved.
    Cheers
     
  18. Borya

    Borya Warlord

    Joined:
    Oct 28, 2005
    Messages:
    103
    Can someone incorporate all the changes since version 1.01 and release a new one? :)
     
  19. LunarMongoose

    LunarMongoose King

    Joined:
    Jan 29, 2006
    Messages:
    731
    Gender:
    Male
    Location:
    Boston, MA, USA
    Irrelevant. If the AI does consider rivers, or anything in a tech that the current tech leads to, then it does it elsewhere in this function. ThomasSG is only changing how revealed resources are valued. Period. Nothing else.

    @ThomasSG: You can't call GC.getDefineINT() on TerrainTypes or FeatureTypes; it's used for accessing settings from the XML GlobalDefines files. Even if it does work - and I don't think it will - it's not how that's done everywhere else in the SDK. It's also minimally more efficient to use a break command than to keep checking the break condition every pass in a loop. Here's my version:

    Code:
    	// does tech reveal bonus resources
    	for (int iJ = 0; iJ < GC.getNumBonusInfos(); iJ++)
    	{
    		if (GC.getBonusInfo((BonusTypes)iJ).getTechReveal() == eTech)
    		{
    			//
    			// Thomas SG (LM Edit) BEGIN
    			//
    			bool bOnlyWaterBonus = true;
    			for (int iK = 0; iK < GC.getNumTerrainInfos(); iK++)
    			{
    				if (GC.getBonusInfo((BonusTypes)iJ).isTerrain((TerrainTypes)iK) || GC.getBonusInfo((BonusTypes)iJ).isFeatureTerrain((TerrainTypes)iK))
    				{
    					if ((iK != GC.getInfoTypeForString("TERRAIN_COAST")) && (iK != GC.getInfoTypeForString("TERRAIN_OCEAN")))
    					{
    						bOnlyWaterBonus = false;
    						break;
    					}
    				}
    			}
    			int iRevealValue = 50 + (AI_bonusVal((BonusTypes)iJ) * 50);
    			if (iCoastalCities > 0 || !bOnlyWaterBonus)
    			{
    				iRevealValue += 100;
    			}
    			//
    			// Thomas SG (LM Edit) END
    			//
    
    			BonusClassTypes eBonusClass = (BonusClassTypes)GC.getBonusInfo((BonusTypes)iJ).getBonusClassType();
    			int iBonusClassTotal = (paiBonusClassRevealed[eBonusClass] + paiBonusClassUnrevealed[eBonusClass]);
    I do agree with this AI change though. So you guys will know: It does nothing different from normal most of the time, and lessens (but not eliminates) the value to an AI of revealing water-only resources if that AI doesn't currently have any coastal cities. I see no reason not to include this. :)
     
  20. Thomas SG

    Thomas SG CCV-designer

    Joined:
    Aug 10, 2007
    Messages:
    1,164
    Location:
    Germany
    It's working fine!

    But sorry. CCV has got the tags TERRAIN_COAST and TERRAIN_OCEAN in GlobalDefines. I forgot that they are not there in BTS. But with a call of SHALLOW_WATER_TERRAIN and DEEP_WATER_TERRAIN it should work for BTS too.

    And the change is especially good for mods like CCV that reveal water resources with fishing (or another tech). In BTS it may be only useful for whales... :hmm:

    And nice change. :goodjob:
     

Share This Page