[MODCOMP] AIAutoPlay

Yeah, there are several ways this component could better handle the cruise control role ... I originally intended to have check boxes for various options like "wake on war declaration" and what have you, but couldn't read the selected check boxes from the Python popup. It should be possible to block several of the potential AI changes like civics and religion through Python callbacks too. I'll think about how to best implement that.

I also wanted to have a kind of automation where you could turn over control of units and cities to the AI and take care of all the bigger picture pieces yourself, since it's units and cities that take the most time. That's quite a bit harder than it sounds though so it never really got off the ground.

The "pause" feature though is already in as well as it will be ... you can cancel automation at any time by pressing Ctrl+Shift+X, look around as long as you want, then reinvoke automation for however many turns makes sense.
 
Would that even be possible? To make a python only version?
 
Well, yes and no. The auto play functionality exists in the vanilla SDK, but what it does is kill the human player and then reincarnate them when automation is done. The SDK portion of this mod removes the human player kill and then temporarily disables the check of whether a player is human or not (so the AI plays for you ...).
 
Would it be possible to have an option to see battles occur when in autoplay?
 
I made a version of AI Auto Play as a stand alone modcomp that works with BtS 3.19.

http://forums.civfanatics.com/downloads.php?do=file&id=13183

Both dll and source files included.

I tried using it as a mod. I got a pile of errors when starting the game, (came from loading python). When it finished telling me all the errors, I went into the game and there was no interface and Control Shift X didnt bring up the interface.

In the sources files you only have CvPlayer.cpp and CyPlayer.h, but there is some AI Autoplay code inside CvGame.cpp (Think i saw it in RevDCM or from another file). I tried merging your Player files and the code from CvGame.cpp, it compiles but no interface in game. Ive tried removing and add some python files to get less errors and still no work :/
 
Oh, you need CvGame too. I didn't include it? So sorry for wasting your time. Go ahead and talk about me behind my back. Thanks for the report. I put the sources file together based on which files had backups created by winmerge. On searching the project, this one also had AI AutoPlay components.
 

Attachments

  • CvGame.zip
    40.8 KB · Views: 239
Oh, you need CvGame too. I didn't include it? So sorry for wasting your time. Go ahead and talk about me behind my back. Thanks for the report. I put the sources file together based on which files had backups created by winmerge. On searching the project, this one also had AI AutoPlay components.

There is still a large amount of python errors from when loading the game. I dont think any of it work sir =/ The python files you upload cause trouble.

Am I crazy or does anyone else experience errors when trying to use this ? :(
 
I use this as part of my FutureMod, in fact I made it to playtest my mod, and I use it all the time. I just downloaded my own files, replaced the (now complete) source files in a fresh 319 SDK, compiled, put the dll in the mod folder in the download (including the Python) and put that in the mods folder and started a game just fine. Played ten turns on autoplay. I use Microsoft Visual C++2005. Perhaps my working SDK is a faulty. I would be interested to see.
 
I've been using this to test my mod, and it's great, but I'm a little perplexed by something. In 9 out of 10 games, "my" civ will be in the lower half of the scoreboard. It's almost never on top and usually is close to the bottom and ultimately gets wiped out or vassalized.

Anybody else been finding this? I randomize my civ choice, and I run the autoplay from Turn 1 until the end, so it's not player stupidity ;)

Is there some kind of AI bonus that applies to these other totally AI players that doesn't get applied to an AI-controlled human player? Or have I just randomly drawn a number of unfavorable games?
 
I've been using this to test my mod, and it's great, but I'm a little perplexed by something. In 9 out of 10 games, "my" civ will be in the lower half of the scoreboard. It's almost never on top and usually is close to the bottom and ultimately gets wiped out or vassalized.

Anybody else been finding this? I randomize my civ choice, and I run the autoplay from Turn 1 until the end, so it's not player stupidity ;)

Is there some kind of AI bonus that applies to these other totally AI players that doesn't get applied to an AI-controlled human player? Or have I just randomly drawn a number of unfavorable games?

For one, I assume the bonuses that the AI would normally get do not get applied to the AI controlled human player. For example, the insane upgrade discounts the AI gets at every level.

I too have noticed the same sort of results as you by the way - the controlled civ always falling behind in some way or other.

Maybe it would be handy if there was a mod of the handicaps file where the human player's bonuses always equal the AI's bonuses just so this modcomp would be more useful. :)
 
some bonuses are applied at gamestart (like two starting settlers on deity, free techs). When I use AIAutoplay on higher difficulty levels I use worldbuilder to also give these bonuses to player 0.
 
Rather than a handicap where the human and AI bonuses match, you could add a boolean checkbox to the AI Autoplay screen that lets you choose how many turns to run for which will only appear if you are opening the screen on turn 1, if checked, it will query the game's handicap setting and add whatever is required to the momentarily human player. Then you get to see how the Autoplay goes on each difficulty setting that actually exists. Most all bonuses midgame, like the reduced upgrade prices, are handled with a .isHuman() check, which while being AutoPlayed will state that you are not, thus granting you the bonus.
 
You also get a worse starting position more often on higher difficulty levels, as controlled by iStartingLocPercent in the handicap file.

xienwolf: Good idea, adding AI handicap extra units when automation is invoked on the first turn would definitely help equalize things for testing.
 
Top Bottom