View Full Version : Better AI Latest Version


Iustus
Jan 25, 2007, 05:10 PM
You can always find the latest BetterAI builds for both Warlords and Vanilla civ on the Better AI Sourceforge Downloads Page (http://sourceforge.net/project/showfiles.php?group_id=178407)

Latest version 2/12 (http://forums.civfanatics.com/showpost.php?p=5096738&postcount=38)

Iustus
Jan 25, 2007, 05:11 PM
--- reserved ---

Iustus
Jan 25, 2007, 05:11 PM
--- reserved ---

Iustus
Jan 25, 2007, 07:55 PM
New build posted 1/25 (http://sourceforge.net/project/shownotes.php?group_id=178407&release_id=481417)

release notes:

Governor Changes:
- Recognizes the value of high food tiles better.
- More likely to work food tiles under slavery.
- Will put more weight on hammers when near the happy cap.

Military Changes:
- More flexible in training, use and placement of defenders.
- Small attacking groups more likely to pillage
- AI more likely to declare war when it should (wont sit on a large army).
- AI more likely to declare early in the game.
- AI wont commit to large scale military buildups until it has real units, unless forced to.
- Bombard bug fixed.

Economy:
- Tweaked the wonder building, expansion and unit training balance.
- Minor tweaks to building values.
- Workers will team up to improve strategics.

Strategy Changes:
- AI more likely to Missionary in favor of Dagger.
- AI less likely to Dagger in general, especially on aggressive.
- AI more likely to Crush and Vassals now handled consistently.

Exploring Fogbusting:
- General tweaks.
- Fogbusting units less likely to move when enemies are about.
- Can explore with air units.
- Visibility calculations should be faster (less lag)
- All exploring units will attack barbs on huts if the odds are good enough.

Other:
- Out of Sync error should be fixed.
- Bug fixed where AI has no Warplan.
- Several Asserts should be fixed.


Everyone is asked to download the "Assert" version for more comprehensive testing. However, there is a non-assert version provided for those who are experiencing problems (particularly those with some video cards when playing under fullscreen mode).

Assert notes:

This build is intended for testing.

This build contains "asserts" which are statments which should be true, if everything is running properly. These extra checks are done, if any of these asserts fails, then a window is shown displaying which assert failed.

It is very important to capture everything in this message if you get an error. A save game file prior to the assert is ideal, with instructions on what to do to trigger the assert (ie, end turn or move the tank northeast to London).

Please report any asserts on the thread on Civ Fanatics:
http://forums.civfanatics.com/showthread.php?t=204045

The best thing to do is to click the "Ignore (once)" button once you have all the information recorded. If you get the same assert multiple times, you can click the "Always Ignore" button. If you quit your game, you will have to click the always ignore one more time.

If you are playing in fullscreen mode, you should dismiss the assert window (clicking an ignore button) before clicking anywhere else, or your machine may get wedged.


This build is SVN revision 298.

Elhoim
Jan 25, 2007, 09:19 PM
Nevermind... ;)

Airwalk
Jan 25, 2007, 10:05 PM
Hey,

Just been testing out the mod and on muti-player still getting out of sync error. Anything i can try to fix this? i'm going to try to go back to the last test version and see if that fixes it.

Thanks for any help.

torin23
Jan 26, 2007, 04:56 AM
New build posted 1/25 (http://sourceforge.net/project/shownotes.php?group_id=178407&release_id=481417)

Iustus, when you post a build, could you also tell us what revision in Subversion it is? It would really help those of us merging BetterAI into our Mods.

For example, is this build based off of SVN version 297?

Thanks!

marioflag
Jan 26, 2007, 05:54 AM
Can anyone tell me what is the Dagger feature?
The only meaning i can find is knife but i don't understand what does really mean in CIV4 context :)

Arlborn
Jan 26, 2007, 06:32 AM
Can anyone tell me what is the Dagger feature?
The only meaning i can find is knife but i don't understand what does really mean in CIV4 context :)

Means that hte AI will make 'suddenlly' a mass amount of offsensive units, choose target and attack fast(or at least it is suppose to) :)

Mexico
Jan 26, 2007, 07:31 AM
Iustus, when you post a build, could you also tell us what revision in Subversion it is? It would really help those of us merging BetterAI into our Mods.

For example, is this build based off of SVN version 297?

Thanks!
i think (based on my own experiencies, so i can be wrong) that this is based on rev. 297 (or 298 - which is merging all to vanilla)

Iustus
Jan 26, 2007, 09:42 AM
Hey,

Just been testing out the mod and on muti-player still getting out of sync error. Anything i can try to fix this? i'm going to try to go back to the last test version and see if that fixes it.

Thanks for any help.

What we need is a reproducable case of this. Ideally a simple set of instructions which will cause the problem.

There are four different sync checks, which are done in successive turns, so the cause of the out of sync problem might have been something as much as 4 turns previously, but my primary candidate, a random that is not in sync, is checked every turn.

Sit down with one friend, make as small and simple a map as possible, and start keeping track of what you do. Do autosaves work in multiplayer? If so, set it up to autosave every turn for 30 turns or more.

Once you get a sync error, go make a copy of your autosave folder, so you do not lose any of the saves.

Now go back one turn previous autosave, try that save, try to do exactly the same thing. Click the same spots, move the units in the same order, everything. Do you still get the sync error?

If so, try doing something totally different, do you get the sync error?

If so, go back one more turn, and repeat.

Try to determine what action you take that causes the sync error, and what action if you do not take, the sync error does not occur.

It could be something like (perhaps repeating one of these):
(1) turning the build governor on or off
(2) turning the citizen governor on or off
(3) building a unit
(4) putting a unit on automation (explorers, workers, etc)
(5) clicking examine city after completing a build, rather than picking one of the choices, forcing it to give you another suggestion
(6) clicking big picture rather than choosing a tech choice after finishing a previous one, forcing it to give you another tech suggestion
(7) moving a unit somewhere
(8) canceling automation of a unit, perhaps before the unit has moved yet
(9) something else entirely

The more detail you can give, the easier it will be to track this down.

Can you get it to happen with zero AI players? That would make tracking it down even easier.

Whatever is causing it, it has to do somehow with something the human player is doing, some interaction with something one person does, that another does not do.

Every time we generate a random number, we have to do it in a different way if it is being done on every machine on the network, or just on your local machine. I suspect the bug is some case where we are using the wrong function, thus using the network random when we should not, getting that machine out of sync with the others. That is why I suggested those examples above, of course, I poured through the code and could not find any cases in that code that seemed to be wrong, so it might be somewhere else that I do not expect.

-Iustus

DrJambo
Jan 26, 2007, 09:50 AM
Shouldn't this thread have been kept just for BetterAI releases and version tracking and the discussion maintained elsewhere?

snoopy369
Jan 26, 2007, 01:02 PM
From my experience with PTBS games, I highly recommend only playing with BetterAI as a mod, not as a customassets dll. Further, remove it from your custom assets folder.

See if that fixes the OOS. It fixed an OOS for several of us in the PTBS community.

jray
Jan 26, 2007, 01:20 PM
From my experience with PTBS games, I highly recommend only playing with BetterAI as a mod, not as a customassets dll. Further, remove it from your custom assets folder.

See if that fixes the OOS. It fixed an OOS for several of us in the PTBS community.

I wholeheartedly agree. CustomAssets is the middle man that needs to go away. It's just way too error-prone. If I were king, every mod and modpack released on these forums would have instructions to put things in My Games\Warlords\MODS\<mymod>. That would cut down on 90% of "tech support". :cool:

Airwalk
Jan 26, 2007, 02:21 PM
What we need is a reproducable case of this. Ideally a simple set of instructions which will cause the problem.

There are four different sync checks, which are done in successive turns, so the cause of the out of sync problem might have been something as much as 4 turns previously, but my primary candidate, a random that is not in sync, is checked every turn.

Sit down with one friend, make as small and simple a map as possible, and start keeping track of what you do. Do autosaves work in multiplayer? If so, set it up to autosave every turn for 30 turns or more.

Once you get a sync error, go make a copy of your autosave folder, so you do not lose any of the saves.

Now go back one turn previous autosave, try that save, try to do exactly the same thing. Click the same spots, move the units in the same order, everything. Do you still get the sync error?

If so, try doing something totally different, do you get the sync error?

If so, go back one more turn, and repeat.

Try to determine what action you take that causes the sync error, and what action if you do not take, the sync error does not occur.

It could be something like (perhaps repeating one of these):
(1) turning the build governor on or off
(2) turning the citizen governor on or off
(3) building a unit
(4) putting a unit on automation (explorers, workers, etc)
(5) clicking examine city after completing a build, rather than picking one of the choices, forcing it to give you another suggestion
(6) clicking big picture rather than choosing a tech choice after finishing a previous one, forcing it to give you another tech suggestion
(7) moving a unit somewhere
(8) canceling automation of a unit, perhaps before the unit has moved yet
(9) something else entirely

The more detail you can give, the easier it will be to track this down.

Can you get it to happen with zero AI players? That would make tracking it down even easier.

Whatever is causing it, it has to do somehow with something the human player is doing, some interaction with something one person does, that another does not do.

Every time we generate a random number, we have to do it in a different way if it is being done on every machine on the network, or just on your local machine. I suspect the bug is some case where we are using the wrong function, thus using the network random when we should not, getting that machine out of sync with the others. That is why I suggested those examples above, of course, I poured through the code and could not find any cases in that code that seemed to be wrong, so it might be somewhere else that I do not expect.

-Iustus


Will do, right now we had 2 players and 6 AI. And it was happening all the time now little later we did 3 layers and 3 AI and seems to be fine with only 3 AI. Next time this happens i will make a save and test thanks for the all thelp and keep up the great work!

jray
Jan 26, 2007, 02:41 PM
Iustus/Blake, could you please package release notes with the Handicaps file? I finally noticed after all this time that I can click on the "Release Notes" button at SourceForge to see the Handicap changes, and that's the only place I've ever found them.

Also, can you confirm that it's intentional to use the animal attack probabilities from Vanilla 1.61 instead of Warlords? Should there perhaps be separate Vanilla and Warlords versions of the Handicaps file due to these differences?

Thanks!

torin23
Jan 27, 2007, 12:14 AM
New build posted 1/25 (http://sourceforge.net/project/shownotes.php?group_id=178407&release_id=481417)

This build is SVN revision 298.

Thank you!

KHSOLO
Jan 29, 2007, 05:01 PM
Thank you!

Is that build definite or still in beta?

kettyo
Jan 29, 2007, 06:03 PM
Is that build definite or still in beta?

Still experimental (but cool nonethless :))

Iustus
Jan 29, 2007, 08:59 PM
New build 1/29 on SourceForge (http://sourceforge.net/project/showfiles.php?group_id=178407)


Asserts, Sync Problems and Such:
- Many asserts and associated bugs squashed.
- Most out of sync problems related to explore code fixed.
- Added additional logging to MPLog for tracking OOS errors.

AI Economy / Governor:
- AI puts more focus on essential economy builds.
- AI less likely to build useless buildings.
- Trade Routes on buildings properly valued.
- Exp buildings (barracks, dry dock) valued correctely (finally)
- Smarter worker allocation when city is performing a process, especially build culture.
- Build Governor will train workers if there is dire need for them.
- General tweaks to governor (both AI and Build)

AI Military:
- Extra warmongery leaders now "Dagger Harder".
- Barbarians wont whip or draft.
- Fixes to the way unit groups split.


SVN revision 327

cf_nz
Jan 29, 2007, 09:08 PM
-AI less likely to build useless buildingsOut of curiosity, what are considered useless buildings?

phungus420
Jan 29, 2007, 09:18 PM
You should post the latest build in the OP so people can instantly check for a new build, rather then having to scour the thread.

Even though the 1/29 build is available now, it looks like at a glance, the 1/25 is the current build. This will get more annoying as the thread grows, just simpler to post it in the OP or right below the OP in one of the reserved slots.

jkp1187
Jan 29, 2007, 09:20 PM
You should post the latest build in the OP so people can instantly check for a new build, rather then having to scour the thread.

Naah, just set up your account so that the most recent post is the first one you see when you enter a thread. Works like a charm. (Actually, I set it up like this because the old Better AI thread got so huge....) :)

skankerm
Jan 29, 2007, 09:51 PM
- Added additional logging to MPLog for tracking OOS errors.

I am prob gonna test out a multi game tommorow and I didn't know there was a MPLog file(and where it would be located). Is there anything that needs to be done to enable it or just install the new build. And if there is an OOS error "hopefully not" would you want the log file and save(s)

Blake
Jan 29, 2007, 11:49 PM
You need to enable logging. Go to the Warlords folder in My Documents and CivilizationIV.ini, you need to set all the logging options (but particularly LoggingEnabled and RandLogging) to 1, that'll log everything.

If (when?) you get an OOS error, what we need, is MPLog.txt from as many players in the game as possible from that turn - that way we can compare the logs. Note that it is not needed for everyone to have logging enabled (you can still play) but the more people who have logging enabled and the more logs from an OOS event, the better.

We KNOW that there is still one or two OOS events which can happen - however we successfully (TOO successfully) bypassed them by reloading - we simply couldn't reproduce the OOS after reloading. So we judged the build as "stable enough" for MP testing, unfortunately the difficulty of reproducing the remaining OOS's makes them hard to track down - otoh you can actually play MP :).

Iustus
Jan 30, 2007, 04:56 PM
New Build 1/30 (http://sourceforge.net/project/showfiles.php?group_id=178407)on SourceForge.


Governor/Economy:
- Governor should manage being near the happy/health caps much better.
- AI's performing the missionary strat should train more missionaries.
- Minor tweaks to building economic buildings (should manage war better)

Military:
- AI should defend valuable cites more appropriately.
- AI should be smarter about razing.
- AI shouldn't dribble attackers so much.

Other:
- Barbarian Behaivour should be close to 2.08.
- Sea bombard crash fix.


this is SVN revision 333

Mannu
Jan 31, 2007, 08:53 AM
Played with the 1/30 build last night as Tokugawa an a fractal standard map at Epic speed. Shared a medium sized island with Mansa Musa. Some thoughts...

1) Isabella was wiped out astonishingly early (I think by shaka). I don't think it was even 2000 BC and she was gone. Kudos.

2) Shaka is out to a huge early points lead, primarily on pop and power I think. He is a couple of techs up on me (as is most everybody), but it's not too much. I'm not sure if anyone will be able to catch him once all the wilderness is claimed.

3) Mansa Musa adopted an interesting strategy: I settled forward and he had room for only 4 cities. He began to build wonders like nobodies business (he had stone) and this kept him competitive in score and techs, despite his small size.

4) Mansa Musa's strategy did not account for the player being a total backstabbing psycho. We shared a religion and were on friendly terms very early on. I couldn't help myself though, his capital is a holy city of at least one religion and he built all of those wonders. I did feel bad.

5) Mansa Musa defended his cities with an excellent mix of units. I lost 5 swordsmen attacking a city with an axeman, a skirmisher, and an archer. It was on flat land with no walls. Other cities are more heavily defended (though not much)... Still I bee-lined to catapults which I think was an excellent idea. His defense levels are I think appropriate for the situation. We were on friendly terms after all. The only other factors might be that we had very close borders and that I was the human player.

Do AI civs know what the reputation of other AI's are? More importantly is there any way for AI civs to know what the reputation of the player is?

Also, I got an Infinite Loop assert this morning which I will post tonight with a save game and steps to recreate in the bug reports.

Ambreville
Feb 04, 2007, 10:53 AM
Where do I put the dll file after downloading? Does it stay in the donwloaded folder, or do I move it to another location?

-------

EDIT: nevermind. I got the answer to the above elsewhere...

Ambreville
Feb 04, 2007, 11:24 AM
Haven't tried the new AI (yet). Hopefully this will address some of the issues I'm running into.

Recently put together a scenario. It's pretty simple -- more like a large-scale historical battle. The main CIV's start out at war. The problem I run into is that the AI becomes incredibly shy and defensive, whether I run one side or the other. One of the two CIV's has the larger and better army, and after capturing a couple of cities it just runs back to its starting point and hunkers down. That's baffling considering that a couple of minor CIVs are very weak and are just waiting to be conquered... The two main CIV's are set up with -100 in diplomacy. How to I make the AI more aggressive on the field???

Iustus
Feb 06, 2007, 10:06 PM
Haven't tried the new AI (yet). Hopefully this will address some of the issues I'm running into.

Recently put together a scenario. It's pretty simple -- more like a large-scale historical battle. The main CIV's start out at war. The problem I run into is that the AI becomes incredibly shy and defensive, whether I run one side or the other. One of the two CIV's has the larger and better army, and after capturing a couple of cities it just runs back to its starting point and hunkers down. That's baffling considering that a couple of minor CIVs are very weak and are just waiting to be conquered... The two main CIV's are set up with -100 in diplomacy. How to I make the AI more aggressive on the field???

Assuming you have custom xml for your scenario, you probably want to edit the leaderhead xml. Change each leader's maxWarRand to a much lower number. A 50 means that every turn that conditions are sufficient for war, it will declare war. A 200 means a 1 in 200 chance every turn the conditions are right (mostly power comparison). If you want AIs to declare war quickly when they are more powerful, you could make this a much lower number. Making it a 1 would guarantee every turn that a war was possible, it would be declared. A number more like 20-40 might make sense for your scenario. Going lower than about 10 might be a bit too much and unnecessary.

Note, you could instead (or also), change the limitedWarRand or dogpileWarRand.

In addition, you might want to change the noWarRand for various attitudes, and the near and distant power ratios for war.

-Iustus

Ambreville
Feb 07, 2007, 07:00 AM
(...) Note, you could instead (or also), change the limitedWarRand or dogpileWarRand.

In addition, you might want to change the noWarRand for various attitudes, and the near and distant power ratios for war.

Thanks for all that information -- this will be useful. In this particular scenario, however, we have a major battle essentially. Everyone is already at war right from the beginning. What I want to see are CIVs that are way more aggressive on the battlefield. The situation is France 1940, with the Allies set for defense and the Germans poised to unleash their invasion.

There's some fighting on Turn 1. But on turn 2, everyone runs for cover rather than duke it out on the field of honor! How embarrassing! :lol:

Arlborn
Feb 07, 2007, 09:49 AM
Thanks for all that information -- this will be useful. In this particular scenario, however, we have a major battle essentially. Everyone is already at war right from the beginning. What I want to see are CIVs that are way more aggressive on the battlefield. The situation is France 1940, with the Allies set for defense and the Germans poised to unleash their invasion.

There's some fighting on Turn 1. But on turn 2, everyone runs for cover rather than duke it out on the field of honor! How embarrassing! :lol:


I bet its because it is an 'unexpected' war for the AI?

Im probably wrong :crazyeye:

Iustus
Feb 07, 2007, 08:58 PM
Thanks for all that information -- this will be useful. In this particular scenario, however, we have a major battle essentially. Everyone is already at war right from the beginning. What I want to see are CIVs that are way more aggressive on the battlefield. The situation is France 1940, with the Allies set for defense and the Germans poised to unleash their invasion.

There's some fighting on Turn 1. But on turn 2, everyone runs for cover rather than duke it out on the field of honor! How embarrassing! :lol:

Ahh, you want to look at the leaderhead xml for attack odds change:

<iBaseAttackOddsChange>4</iBaseAttackOddsChange>
<iAttackOddsChangeRand>8</iAttackOddsChangeRand>


These both basically increase the tactical aggression (and optimisim) of an AI by increasing the percieved odds an AI sees for a particular battle. Every turn, an AI does a new random, and uses that optimism level for that whole turn. The number is added to every odds check. So, if an AI had an optimism of say, 20% one turn, that would mean that it would consider an attack that really had a chance of 30% success, to really have a 50% chance of success.

The optimisim number is iBaseAttackOddsChange + random(0-iAttackOddsChangeRand) + random(0-iAttackOddsChangeRand)
(yes it does the random roll twice)

If you want them to be always optimisitic, just change the base number, if you want it to vary from turn to turn, change the random number.

The above numbers, 4 and 8 are for Alexander. By default, every AI has an 8 random, except for barbarians, which have a 16 random (only part of the reason why they can be so suicidal, barbarians also have special code that has them attack at much lower percieved odds). Less aggressive AIs (like Gandhi) have a 0 base add, while Napoleon is the most optimisitic, with a 6 base add.

Do not make these numbers too large, a small change will have a large effect.

I bet its because it is an 'unexpected' war for the AI?

Im probably wrong :crazyeye:

It should not be, wars that are created in worldbuilder get a correct plan (the one you have on the left is the one that does the declare, the other is the defender). I do not know how this translates into scenarios.

This would be easy to check, turn on chipotle, using better AI alt over the name in the scoreboard. If the war is lising as an 'unplanned' war, rather than total war, limited war, defensive war, or something else, then this could be part of the problem.

-Iustus

Cyrus_the_Great
Feb 09, 2007, 03:59 PM
I see there is no new build. I didn't report an infinite loop because I was planning on down loading the new build. Anyway, the assert was while playing a standard game of Warlords, and not one of the scenarios.

Tonight I am going to start another standard game at the Warlord difficulty level and see what happens.

Iustus
Feb 09, 2007, 04:34 PM
New build 2/09 on SourceForge (http://sourceforge.net/project/showfiles.php?group_id=178407)


Governor/Economy:
- AIs will avoid anarchy when it would cause a strike, due to low gold
and negative foreign trade
- Commerce value increased
- Emphasize great people effect reduced
- Food growth value adjusted (3f 3h 1c should be preferred over 4f now)
- Emphasizing hammers or commerce increases value of growth
- Slavery conversion of food to hammers calculated precisely
- Hammers valued more when building a granary
- Small cities better account for future size when considering value of
buildings
- AIs should train and use settlers more effectively (expanding faster)
- Minor tweaks to other city production choices
- Commerce value adjusted when under extreme conditions
- 'Infinite' loop in governor fixed

Military:
- AI defensive units should sally forth from cities much more frequently
- Defensive siege units should be used more effectively
- AI will train more city defender units
- More UUs are considered good enough for an early rush
- Crush strategy will no longer prevent boats from being built
- Bug where stack would not complete its attack fixed
- Fogbusting units will travel home to get upgraded when upgrades available
- New vassals will correctly abort undeclared wars on both sides

Other:
- Network game "Out Of Sync Error" potential fix
- AIs should correctly choose whether to load a settler on a ship or not
- Redundant workboat issue fixed
- Some erroneous asserts removed
- Some Chipotle mode displays cleaned up


SVN revision 356

Bursk
Feb 09, 2007, 04:41 PM
Yay! Hooray for the team!

Cyrus_the_Great
Feb 09, 2007, 11:20 PM
Glad I checked back one last time. I got it now. Cool.

Iustus
Feb 12, 2007, 06:48 PM
New build 2/12 on SourceForge (http://sourceforge.net/project/showfiles.php?group_id=178407)


- War declarations should be back to their normal level
(was extremely high since 1/24)
- Chipotle war analysis updated to show correct percentages
- Crash fixed that was caused by a unit that wants to upgrade
but cannot path to any city

SVN revision 362

Ambreville
Feb 13, 2007, 12:22 PM
I guess downloading is not available just now...

"Error 504 'sourceforge.n...' Gateway Timeout."

Edit: never mind. It's back up again. :-)

keldath
Feb 17, 2007, 06:54 PM
Iustus
hi,
this is y first post to you,
wanted to say amazing job, just getting to see your mod visa modpack - my guys did hell of a job merging you mod.

keep it up - hoping the mp oos will go away :0

keep up the good work.

(been away for along time)

Mowque
Feb 25, 2007, 02:10 PM
still waiting for this and Rhye's to join together. should be awesome.

Zuul
Mar 03, 2007, 12:01 AM
Taking a break guys? :p

Spocko
Mar 03, 2007, 10:54 AM
I've been more eager to download updates to Better AI than I have been to anticipate new "official" patches or XP's. Hope you guys keep up the good work on this!

JimMac99
Mar 03, 2007, 03:26 PM
Taking a break guys? :p

My guess is that Firaxis has got to them, lets see...they have agreed that their next version is to be included in the next expansion, which they are currently testing, and have signed a NDA preventing them from posting on the forum...possible? :shifty:

Wodan
Mar 03, 2007, 04:11 PM
Not a bad theory. Both have logged on in the past 24 hours. Blake hasn't posted on any forum since the 28th, and Iustus since the 22nd.

OTOH, maybe they're both simply taking a break. If they post something, they'll get bombarded.

It's reasonable however for them to at least log on to see if someone has found something actively broken (as compared to simply b!tching, like that Wodan guy about city placement as he is wont to do).

Wodan

Uncle_Joe
Mar 03, 2007, 07:08 PM
Possible, I suppose, but I wouldnt think any NDA would preclude them from informing people that they were going to cease further work on the mod (which I would imagine that they would do).

I think the current build is quite stable and pretty decent. It still has some problems IMO, but nothing catastrophic. So, if this is the last build for a while, at least its in pretty good shape.

Quagga
Mar 03, 2007, 07:29 PM
I heard that they've been swept up in American Idol fever.

mjs0
Mar 04, 2007, 10:23 PM
I don't play often enough to help much with testing, but I have not played a game without BetterAI in many months. I must admit I am getting some withdrawals from the lack of updates, we were spoilt for a while there!

The activity (or lack of it) on SourceForge is also interesting...
99 checkins of code between Jan5 and Feb12 (the last version), just 7 checkins since then and none since Feb20.

jkp1187
Mar 06, 2007, 09:10 AM
Possible, I suppose, but I wouldnt think any NDA would preclude them from informing people that they were going to cease further work on the mod (which I would imagine that they would do).

I think the current build is quite stable and pretty decent. It still has some problems IMO, but nothing catastrophic. So, if this is the last build for a while, at least its in pretty good shape.

Agreed. Still, if they ARE working on the inside now, I hope they give a shout-out to their peeps on this forum whenever Beta testing is needed!

Iustus
Mar 07, 2007, 02:40 PM
Hi folks,

Some RL things have consumed my time of late. I am looking into the lingering OOS error, but it is not as simple as just changing that 6 back to a 5.

I apologise for the lack of updates.

-Iustus

Wodan
Mar 07, 2007, 03:30 PM
Ha! See there? They weren't abducted by aliens after all. There goes that theory.

Wodan

ps why is there no alien smiley?!?

JimMac99
Mar 07, 2007, 04:34 PM
Hey! Good to see you back. :)

(Though I do hope you guys get to beta the next expansion and it contains a version of Better AI) :)

Spocko
Mar 07, 2007, 08:44 PM
Excellent! Welcome back!
Spocko

khumak
Mar 08, 2007, 03:11 PM
I'm curious what the changes were in the handicaps for the better AI mod. I installed the latest better ai mod plus the handicap changes and started a game as the Incas. Prince/continents/standard/tropical/marathon. From what I'm seeing so far, the AI does build a bigger military than it used to. I built a reasonable defensive force and it was enough that the AI never declared war on me.

One thing I noticed is that the AI doesn't seem to defend against the early rush very well. I started right next to the Vikings and I was surrounded by jungle so his capital looked like a juicy target. I built a few quencha and sent them over to find that he was only defending his city with a single warrior. I lost 1 quencha and took his city. I didn't notice the thread on "aggressive AI" before I started my game so maybe this was because I'm playing on the default "wuss" setting.

Out of curiousity, I reloaded and only built 1 warrior per city. Ragnar quickly decided I looked like a juicy target and attacked me.

Another thing I've noticed is that the AI seems to be very much slower at research and wonderbuilding than it used to be. I conquered 1 city, founded 4 more, built about 10 workers, and built a couple of axemen per city and still had time to build ALL of the early wonders in my capital city. I assumed that I wouldn't be able to get the CS slingshot so I didn't try for it, but it took long enough for me to build the oracle that I definitely could have gotten it.

Another source of amusement is that the vikings founded the first religion before I conquered them and the AIs on other continents have founded all the rest so far so both of my remaining neighbors (Ragnar and Kublai Khan) love me because I own the sole religion on my continent.

I'll have to try Monarch with Aggressive AI and see how it goes. I have "builder" tendencies and Monarch used to be a problem for me using a builder strategy.

Oh, and I LOVE the new governor. He whips my granaries for me without me having to think about it! My main complaint is that he focuses too much on food when I'm at my happyness cap. Food should have a weighting of zero vs hammers and commerce when you're at the cap. What criteria does the governor use for whipping? He whips some buildings before I would have and others that I normally do whip, he doesn't...

Yakk
Mar 08, 2007, 04:00 PM
Having spare citizens is useful even at the happiness cap -- it lets you do things like whip instant troops, and you only lose 1 worker per whipping.

Uncle_Joe
Mar 09, 2007, 12:39 AM
I'm also going to guess that the AI will probably struggle a bit on the Tropical map setting.

Bigben34
Mar 10, 2007, 11:23 AM
Greetings.
I appreciate your work on this mod. Warlords 2.08 I understand owes some credit to this? The computer's economy is managed as well as many expert players, but the field tactics are still not hard to beat, especially with catapults.
I would like to ask what approach you use in your algorithms for a Better AI. Do you set certain 'endpoints' that pre-define the computers success and iterate all the possible permutations until your 'endpoints' are maximized each turn? Or do you simply create a set of priorities for each unit and city and civic and then modify those priorities?
I remember when the chessmaster series first started back in the late 80's. I met someone while working who would set his computer to take it's turn each morning, and the computer would take up to 24 hours to calculate it's best option on the highest levels, then he would come back and take his turn the next morning. I also remember a hand-held chess computer a roommate of mine had that had 64 levels. I once beat it on its highest level, even though it was capable of thinking more turns ahead than I was... I beat it by controlling the middle of the chessboard and pursuing general strategies. Took me 4 hours, but was the crowning ahievement of my strategy gaming...
I don't know exactly how it's done, but I think if a focus was added on taking advantage of the modern desktop's massive computing power, great advances could be made. I think setting endpoints for the computer, like maximizine score, with sub-endpoints added for minimizing opponents economies, etc, might be a wide-open field. The computer could actually be given time to iterate all possible moves, buildings, civics, etc, for several turns in advance, and then choose teh path that heads them best towards their goal. I think battlefield strategies could be broken down like a chessboard and processed much like chessmaster does, despite the added layers of complexity. I think some human players would be willing to give the computer extra time.
I would like to see this Better AI mod take on a broader and more ambitious scope, with specific goals and timelines. Here is my challenge:
-------------------

-Within 6 months develop the AI to the point that it can frequently beat expert players on noble setting, in all the varieties of maps, including small pangea settings.
-Within 8 months develop the AI so that it can frequently beat human experts despite giving them advantages, such as those on Chieftan or Warlord setting.
-Within 10 months develop various AI personalities/tendencies that the AI may choose from or switch between, to minimize players from easily learning the 'modus operandi' of a particular AI opponent

Additional Priorities:
-Add separate sliders for AI intelligence level and difficulty level (so a player could use a maximally intelligent AI without having to give the computer 'cheating' advantages, ie, play chieften with a fully enabled AI
-Add an option to allow a player to set the AI to play as if it were a cold, calculating human opponent , disregarding a particular leaders personality(maybe an option to set AI to ruthless instead of aggressive??) . For example, many players playing Ghandhi would attack any other human opponent who leaves nearby cities undefended. In this mode the AI might pull the same dirty tricks that human players pull on the AI.
-Within 12 months add an option called 'remember me' in which the AI will keep track of and assess the human players previous games and alter its strategy accordingly. For example, if the AI knows the player frequently attacks 10 turns after peace treaties, although it might still grant peace, it might stockpile units asap preparing to act accordingly..
-The computer should be set to start iterating/maximizing possibilities during the human players turns


I am a 2nd year medicine resident, so I can only get the ball rolling, but I have a background in Biophysics and am interested in helping with the theory of the AI when I have time. I think there are a lot of great players who could be recruited to help.
In addition, if the AI Leader's interaction and dialogue were souped up with some more character depending on various situations, (even bringing back the advisors from civ II???) This would make for a mod that could serve better than an expansion, and would put CIV IV on the map permanently as a necessary tablepiece for any computer game collection, much as the chessmaster series.
I would recommend re-naming this mod 'Civmaster Challenge'

I hope people will volunteer to take on roles as engineer, programmer, first mate, etc etc for this proposal...

Bigben34

Yakk
Mar 10, 2007, 12:39 PM
The branching factors and unknown information in civilization are far larger than chess. They are possibly far larger than go.

With 50 units, each can move in one of 8 different directions, or do 2 or so actions not-moving. That is on the order of 10^50 possible "next moves".

If you order the movement of the units canonically (which removes some useful strategic options), every turn the first unit movement of units still generates a branching factor of 500: still far larger than chess. (and most units can move more than 1 unit of distance)

So the game has to have lots of heuristics to decide what kinds of moves one should do.

And one can often not determine what the results of a set of actions are: you don't know where the enemy troops are, if the enemy will produce more units, or how the enemy will react to your movements.

Hence heuristic strategies. The AI makes a plan based off of heuristic rules and develops it based off heuristic rules.

To test these rules, you put them up against human and AI players, and see how the AI performs. Does the AI act like you want a nation to act? Is it an effective challenge?

khumak
Mar 10, 2007, 07:16 PM
I tried a new game with Aggressive AI checked and it's quite possible to still play as a builder without building a massive "defense" force. I'm playing Churchill/Monarch/aggressive AI/raging barbs/standard/continents/tropical. I started off on a continent with just 1 other AI. I figured I might be screwed since it was the romans so I beelined for iron working and grabbed all of the iron I could find. Sure enough, when I got to Alphabet, the romans started trying to trade stuff to me for iron... Muhaha, no Praetorians for JOO!!

Actually I didn't go straight for Ironworking due to the raging barbs, I had to make a detour for archery. Churchill's archers are seriously badass... 10 xp gets me Drill IV. I sent my archers out to go sit on forested or jungled hills to cut down on the fog of war and it wasn't long before all of my archers were capped at 10xp. I found it easiest to just park enough archers around the perimeter of my borders to get rid of fog of war so by the time I had made about 15 archers, barb incursions were pretty rare. It's now around 1300AD and fog of war is gone on my continent, and the barbs along with it. The barbs never managed to kill any of my units or pillage any of my improvements. I did keep a lot of forest intact early on though for the combat bonus but I had to protect my cottages and pastures.

My continent had a fairly narrow spot in the middle so I sent a couple of settlers out to choke that off and then refused to agree to open borders so that let me fill in my half of the continent at my own speed whenever my economy caught up enough.

I'm nowhere near the lead in tech but I'm not horribly far behind and I'm ahead of the romans. Neither me nor Caesar got any of the early religions so we both spent a long time as Atheists. I eventually made it to Philosophy first and built a shrine which promptly spread the true faith throughout my continent. The romans love me now. Ocasionally he'll demand stuff and I always turn him down. He mostly refuses to trade any tech. He's refused all of my offers. He did trade me some fish for something but resources are the only thing he's really open to trading.

My military is still small enough that it costs nothing to support and consists of a mix of drill 4 archers and newly minted crossbowmen. I disbanded my warriors shortly after I got archery since Churhill gets such badass archers. Based on what I can see of Caesars cities from my religious spies, he has a mix of about 20 longbows, cats, and axemen in the 2 or 3 cities closest to mine and 1 longbow in all the rest. Seems we've both built up to the point where both of us could easily fend off an attack from the other guy but neither of us could launch a successful assault. All of my cities built castles since it seems the AI takes that into account when deciding how "strong" you are.

Is it the aggressive AI or the Monarch level that's making him refuse to trade tech with me? Our relations are at "Pleased" and have been since shortly after I discovered Philosophy. Seems like it would benefit both of us to trade since we're both behind the other AIs in tech.

Wodan
Mar 11, 2007, 09:41 AM
You rufused open borders for a couple thousand years, and have refused many many trades, and you're surprised that he's refusing your trade offers? Geez, some people. :)

Try giving him some iron for free. You surely don't care by this point. In 30 turns or so you'll start getting some favorable trade dip bonuses. He'll agree to your "real" trade offers then.

Wodan

Bigben34
Mar 11, 2007, 09:43 AM
The branching factors and unknown information in civilization are far larger than chess. They are possibly far larger than go.

With 50 units, each can move in one of 8 different directions, or do 2 or so actions not-moving. That is on the order of 10^50 possible "next moves".

If you order the movement of the units canonically (which removes some useful strategic options), every turn the first unit movement of units still generates a branching factor of 500: still far larger than chess. (and most units can move more than 1 unit of distance)

So the game has to have lots of heuristics to decide what kinds of moves one should do.

And one can often not determine what the results of a set of actions are: you don't know where the enemy troops are, if the enemy will produce more units, or how the enemy will react to your movements.

Hence heuristic strategies. The AI makes a plan based off of heuristic rules and develops it based off heuristic rules.

To test these rules, you put them up against human and AI players, and see how the AI performs. Does the AI act like you want a nation to act? Is it an effective challenge?

Hahah, been awhile since I took Probability and Statistics!!

Aye, the number of possibilities is certainly prohibitive. But I can't help but think there's not a way to break it down into simpler models. Perhaps on a local battlefront using just the units present, and making an educated guess about what units might be just out of sight based on the enemy's tech levels, production levels, etc. Also, instead of iterating based on 50 specific units, use small stacks based on types, such as spearmen, archer, mounted, axemen, siege weapons.

Another possibility is to creat a cut-off for how many units the Ai may calculate iterations for. Many skirmishes occur with perhaps a handful of units, and the AI often blunders woefully. I see no reason in these situations that iterations couldn't be used instead of strict heuristics. I suspect there has to be a way to make at least some better use of the computing power available. Instead of iterating all the specific units and specific move combinations, perhaps find a way to iterate outcomes with various 'power assignments' such as occupying a forrested hill with access to a nearby road, or a nearby contested town or resource.

Bigben34

Yakk
Mar 11, 2007, 03:36 PM
That's combinatorics, not probability/statistics. :)

Crunch-based AI is seriously limited in a high-branching factor game. The hard part is the heuristics, not the combinatorics.

That is why, if you read the design docs, they talk about strategies and tactics, not the searching of game trees.

Knowing that a location is more strategically important isn't a matter of CPU time. It is a matter of formulas that tell you it is more important.

As it happens, the fact that "stack of death" is a really effective civ4 strategy makes the problem simpler for the AI. Most of the AI's units are in a handful of large stacks, the rest of the "offence" (pillaging teams) are small and designed to be more costly to kill than they cost to build. Defence (be they fortified units, or counter-attack units) is more "respond to attack by shifting enough resources to defend against the attack and/or take out the units". Running a simulation on "can that stack take that city" isn't CPU intensive, and "what will be the expected harm and costs of attacking that stack" isn't CPU intensive.

...

Does cesear have trade connections with other empires? At least the default AI refuses to trade away technology that nobody else has.

klokwerk
Jun 11, 2007, 03:47 AM
I made an unofficial modded version of BetterAI, where the agression level is much higher. For a complete list of bug fixes and changes, see the thread below 'New experimental BetterAI version'. Any feedback or comment would be welcome ;)

The link to the new version (same install as before) :

http://forums.civfanatics.com/uploads/99614/BetterAI_Warlords_Asserts_Unofficial_07-06-04.zip

jdog5000
Jul 03, 2008, 06:24 PM
The latest release of Better BTS AI (http://forums.civfanatics.com/downloads.php?do=file&id=9819) from the CFC downloads directory.

Better BTS AI is also available on sourceforge at http://sourceforge.net/projects/civ4betterai/ where you can both download the release versions and checkout the current code.

auldian
Aug 21, 2008, 06:22 AM
The file at the sourceforge was updated earlier this month, to version .036.

NP300
Dec 14, 2008, 01:47 AM
Hi all,

I've just decided to have a look at Better BTS AI. But I am interested in the source code to add my own mods to it. I can't seem to find the source code on Source Forge. The posted download seems to have a zip file with the compiled DLL but no source code. Where can I get the source code? Am I missing something? I may not be familiar enough with sourceforge.

Thanks.

Dresden
Dec 14, 2008, 02:26 AM
The source can be downloaded or viewed from http://civ4betterai.svn.sourceforge.net/viewvc/civ4betterai/

NP300
Dec 14, 2008, 01:26 PM
The source can be downloaded or viewed from http://civ4betterai.svn.sourceforge.net/viewvc/civ4betterai/

Thank you.

Yakk
Dec 15, 2008, 03:22 PM
Note that that is a delta against the Civ4 BTS latest patch source, not a complete set of source. (It contains only the files that changed vs the standard source)

Civ4 ships with the standard source, and patches upgrade it.

Rhye
Dec 16, 2008, 05:39 AM
The source can be downloaded or viewed from http://civ4betterai.svn.sourceforge.net/viewvc/civ4betterai/

can't download it. the archive seems to be empty or broken

Yakk
Dec 16, 2008, 09:53 AM
Try this link:
http://sourceforge.net/project/showfiles.php?group_id=178407&package_id=286917

jdog5000
Dec 18, 2008, 08:39 PM
The sources for 0.45 are now included in a zip in the CFC download. If you want to work with the sources frequently, I would recommend getting the TortoiseSVN client and checking out the sources from SourceForge ... you can read more about that here (https://sourceforge.net/svn/?group_id=178407).