Coding an AI player

That's really cool. Confirms my impression that board game designers generally are much more thorough and rigorous about their game design.
 
I think this is because Tim is on to something here, warfare is among the hardest aspects of the game for AI (and also one where blunders have immediate consequences that are noticeable to a human). Since Civ5 took the direction of being a poor man's wargame, problems grew.
You certainly won't find me defending the utter garbage that is Civ5 in general, and its whole combat system in particular.
That's really cool. Confirms my impression that board game designers generally are much more thorough and rigorous about their game design.
The difference is, game board designers have basically only the design to consider. The physical construct can be done rather lately once everything is decided, and its constraints are more or less predictable from day one. They also have much less marketing pressure.

Video game is much more demanding when it comes to project management, and the product itself takes a much larger part of the work, and has a less predictable influence on the design. Also, the complexity tend to be orders of magnitude higher.
 
I think this is because Tim is on to something here, warfare is among the hardest aspects of the game for AI (and also one where blunders have immediate consequences that are noticeable to a human). Since Civ5 took the direction of being a poor man's wargame, problems grew.

This may come back to that same "design an AI to play this game that we haven't gotten programmed yet so you can't play it and have to program the AI blindly." Civ4 suffers less from it than most because even though the game was new the lessons of previous Civ games did somewhat apply.* Civ5 with the advent of !upt made all previous lessons not applicable, with predictable 'starting from scratch' results.





*As a negative example, I think the complete inability of the SMAX AI to deal with air units contributes greatly to air units in Civ4 having no particular effect. I think the developers looked at all the player feedback that air units were game breakingly unbalanced because the AI didn't know how to use them and rather than try to produce a decent AI they just opted for no dynamic air units.
 
While Civ is complex, I suspect you could develop drastically better AI by simply funding the AI team better. If you gave a high-end 15-person (including testers, admin, PM, etc.) team five years, you're looking at the $15m range, which is more time or money than game publishers can realistically spend on AI.

Another issue is I think that some Civ dynamics aren't well understood until after the game has been released and Civ gamers play the game over and over and over and figure out the exploits and strategies. So building an AI for a game that doesn't exist yet because it's in development would prove challenging as well.. at least one as relatively complex as Civ.

Then there's the question of maintenance. Each time you release a new patch that balances gameplay (or a new DLC), the AI code would have to be updated so that it is able to keep the new dynamics in mind when making decisions. This is a lot easier to do if you're working with a simple model (i.e. what they have now) compared to something far more complex
 
Sure, but in the case of a well-funded team, you've got AI playing games 24/7 with varying parameters, so any time you push a balance change you automatically get results from a bunch of games telling you which parameters work best. You've also got staff who spend their time figuring out ways to beat the AI, submitting detailed reports for their strategies, and those strategies and counters being added to the AI.
 
any time you push a balance change you automatically get results from a bunch of games telling you which parameters work best.

To do that you'd need to update the code which determines what institutes a "good move" vs a "bad move" and how to rate a move better than another move. Each time the gameplay dynamics change, you will have to update this code, test it, etc. This would not be very easy to do quickly, especially considering that the gameplay you're building your AI around is not yet even built. Ideally you'd wait until everything is done to begin your work, but that wouldn't really be feasible.

It would be far more feasible to hire a bunch of Civ addicts and let them play through the new changes and figure out exploits and strategies.
 
You have the AI playing entire games. "Good moves" are those that result in victories as per the game design. You've got a thousand VMs (or whatever number you need) on AWS/Azure just running games 24/7. When you push to your QA branch your AI servers finish their current game and then pull the new build from your build server.

With this approach you won't be able to optimize more than maybe a dozen parameters that control the AI (like aggressiveness, expansionism, etc.). A whole civ game is a highly dimensional problem and pure machine learning approaches fail at this kind of problem. To have any kind of success, you would either need to precode much of the behavior with some parametrization that can be learned. Or you have to break down the game into smaller problems, like having small scale combat scenarios that the AI plays against itself or the AI just trying to traverse the tech tree as fast as possible.
 
With this approach you won't be able to optimize more than maybe a dozen parameters that control the AI (like aggressiveness, expansionism, etc.). A whole civ game is a highly dimensional problem and pure machine learning approaches fail at this kind of problem. To have any kind of success, you would either need to precode much of the behavior with some parametrization that can be learned. Or you have to break down the game into smaller problems, like having small scale combat scenarios that the AI plays against itself or the AI just trying to traverse the tech tree as fast as possible.

I'm not suggesting machine learning to any significant degree. I'm saying precode everything traditionally, backed up with AI games to avoid regressions, with vs. human play for new strategies. I'm saying that game studios could take this approach much further if they just threw far more money at he problem.

Yeah, you don't just need "This was a good game with a quotient of 0.8 gooditrons", you need "The last move was good with a quotient of 0.78 gooditrons"

Okay?
 
Your system would never lead to any sort of decent AI if the only metric you were using was "Was the final outcome any good?"

You have to be able to weigh each individual decision and have algorithms in place that tell you if it was a good move or not, and to be able to compare a move to other moves. And with a game like Civ that would be incredibly hard to do.

Like I said the far easier solution would be to hire (non-offtopic) Civ fanatics and get them to figure out the exploits and strategies. Then program your AI using what you've learned via your game playing minions.
 
You have the AI playing entire games. "Good moves" are those that result in victories as per the game design. You've got a thousand VMs (or whatever number you need) on AWS/Azure just running games 24/7. When you push to your QA branch your AI servers finish their current game and then pull the new build from your build server.

The AI playing entire games generates an AI that will collapse immediately when confronted by the unpredictably human opponent. I suspect that's part of the problem. The SMAX AIs do fine against each other, because none of them use air power worth a snap. As soon as a human player gets an aircraft unit the game might as well just end. The AI masturbation process never developed any defenses against air units because the AIs never used air units well anyway.
 
Your system would never lead to any sort of decent AI if the only metric you were using was "Was the final outcome any good?"

You have to be able to weigh each individual decision and have algorithms in place that tell you if it was a good move or not, and to be able to compare a move to other moves. And with a game like Civ that would be incredibly hard to do.

Like I said the far easier solution would be to hire (non-offtopic) Civ fanatics and get them to figure out the exploits and strategies. Then program your AI using what you've learned via your game playing minions.

That is what I said to do: "You've also got staff who spend their time figuring out ways to beat the AI, submitting detailed reports for their strategies"

The AI playing entire games generates an AI that will collapse immediately when confronted by the unpredictably human opponent. I suspect that's part of the problem. The SMAX AIs do fine against each other, because none of them use air power worth a snap. As soon as a human player gets an aircraft unit the game might as well just end. The AI masturbation process never developed any defenses against air units because the AIs never used air units well anyway.

Right, so you see that, and then you fix the AI not to fail in that case. I said to use AI v. AI play to measure balance, not as a primary development tool.
 
This whole idea isn't too bad at all. In fact, if someone manages to successfully develop a player AI independent of the game itself, I could see an entire new aspect of the gaming industry grow from that. It would definitely be the next big revolution in the gaming industry. The marketing for it could be that players can get all the fun aspects of the multiplayer experience without any of the downsides (rude players, cheaters, hackers, etc.)
 
Right, so you see that, and then you fix the AI not to fail in that case. I said to use AI v. AI play to measure balance, not as a primary development tool.

Unfortunately that doesn't seem to be the reality. I find it pretty much impossible to believe that no human player involved in developing any Civ AI ever said "hey, can we get it to not just endlessly send one unit at a time into a demonstrated meat grinder?" And there's no way that human players during development of SMAX sat around saying "yeah, I just can't think of any real use for these air units so I'll just do what the AI does and fly them from base to base in a big stack."
 
In software dev you usually have a long list of "must haves" that need to be finished so that the product is working and can in theory be shipped. I'm going through such a list right now. Items on the "we should probably have this eh" list get tackled next and in a lot of cases there's barely any time to tackle that list, since the first list leads to bugs and so on. So that's why we probably see such a bare(ly functioning) AI in Civ, once it's sort of working that's enough to check it off the "must have" list. Then there's all sorts of other items on the lists for devs to work on, so no time to improve AI, since hey it sort of works, so whatever. At that stage the studio is probably far more likely to put resources on other parts of the game, like graphics
 
There are definitely those who would consider 'an AI opponent capable of playing the game' to be a 'must have.' That's sort of my point here. That having these games on the shelf that do not have that particular 'must have' included in them may be creating a market for such a thing.
 
Back
Top Bottom