How is the AI implemented?

ShimmerGloom

Chieftain
Joined
Jul 17, 2020
Messages
20
So, like any civ game - we have an AI.
Now, the year is 2025, so I have to wonder how is the AI implemented?

Is it still behaviour that is all set in code, with constant pre set weights? Or is it a more modern Neural network architecture?
 
There's a Minecraft mod called Voyager which uses GPT-4 to control an in-game agent which can explore the world, craft, and do other interesting things. It writes scripts in Python in real time to manage decisions. Smallville is more of a research project, but it simulates a town with 25 AI NPCs in it. AI dungeon is a text adventure which is entirely GPT generated.

Inworld AI, Convai, NEO NPC are all libraries for AI-powered NPCs.

Probably there are more but these come to mind off the top of my head.
 
do you have examples of such games ?
DOTA. They use high-end AI models that even beat human players at the highest level (pro, so to say). Although DOTA is a completely different game altogether, nothing Civ-like. But I think if invested in, Civ AI could also be made top-notch. Though it may be frustrating for some players to play against such AI. In DOTA, the AI is absolutely a monster. If you're new to the game, or even a "casual player", the AI just trashes you - no question.

Example:
 
Since the first version of chatGPT I've always been interested by the possibilities for RP, likes what's done in some mods (Skyrim for example), and, in the case of civ, diplomacy.

But I doubt we'll see anytime soon* an AI like that one for DOTA in a civ game.

First the reason you mentioned, some people would have fun playing against it, most would not want to lose all game or having to cheat to compensate. Second, the level of complexity; in a changing ruleset with each patch (lots of thread already on that subject in the forum). Third the cost (development and hardware)

*but I never thought I'd see something like chatGPT in my life time
 
Last edited:
Since the first version of chatGPT I've always been interested by the possibilities for RP, likes what's done in some mods (Skryrim for example), and, in the case of civ, diplomacy.

But I doubt we'll see anytime soon* an AI like that one for DOTA in a civ game.

First the reason you mentioned, some people would have fun playing against it, most would not want to lose all game or having to cheat to compensate. Second, the level of complexity; in a changing ruleset with each patch (lots of thread already on that subject in the forum). Third the cost (development and hardware)

*but I never thought I'd see something like chatGPT in my life time
Well yeah, DOTA is a highly competitive game with prizes and whatnot. Civ is chill game where you immerse yourself and enjoy the flow through the ages, very different vibes. In MOBAs (the genre of games such as DOTA), player base is obsessed with ranks, ELOs, wins/defeats and you get flamed a lot for small mistakes, the community is somewhat also toxic. In Civ, I'd say it's the complete opposite. It's a game where you can literally get a cup of coffee, chill and enjoy with your friends or even strangers you meet in multiplayer lobby. Only for this reason, I think the AI should not be made monster, driving Civ players to "optimize" every turn of theirs, and lose the game over a small mistake, trashing the whole progress over it. Monster AI such as that would make Civ a less enjoyable game. Perhaps the AI level could be adjusted accordingly, I mean, not every "Good AI" must be "monster", one could keep it "good" and also "tolerant" of mistakes. The current AI (civ7) is sort of meh because I rarely see it produce some units, for instance. It's not even a matter of being clever, it's just .. bad. I think this should be fixed.
 
Since the first version of chatGPT I've always been interested by the possibilities for RP, likes what's done in some mods (Skyrim for example), and, in the case of civ, diplomacy.

But I doubt we'll see anytime soon* an AI like that one for DOTA in a civ game.

First the reason you mentioned, some people would have fun playing against it, most would not want to lose all game or having to cheat to compensate. Second, the level of complexity; in a changing ruleset with each patch (lots of thread already on that subject in the forum). Third the cost (development and hardware)

*but I never thought I'd see something like chatGPT in my life time

Another big problem with any sort of trained AI for a game like civ is that in many cases, they might do weird things that people get annoyed about. You're a lot more likely to do the "mathematically best" option like aggressive forward settling, surprised DOW, etc... A "trained" AI probably would lose a level of personality.

Sure, in terms of competition, it would probably help. But it comes back a little to the old competition vs flavour/balance. I want Machiavelli to backstab me, even if maybe that's not the best actual choice he could make. I don't want Gandhi to surprise DOW me. To create a trained AI that also brings in AI personality is a level deeper than what would be available right now.
 
This is the problem with using AI to mean several different things lol
 
This is the problem with using AI to mean several different things lol
Fair enough:)
I was mainly curious with all the developments in Neural networks in recent years, I'll lay out my thoughts a bit:

I'll refer to AI as generally, the computer playing a civ.

"Traditionally", the AI is pretty bad - leading to absolutely massive bonuses for it in higher difficulty levels.

For many players on emperor difficulty and up, I think this does make the game less fun than it could be due to weird scaling throughout the game.
In the early game the AI is too strong, meaning you can't get any wonders and wars are a pain.
However, once you overtake the AI the game is essentially over.

So having at least the *option* for a better AI (say on the level of an emperor player or better) is something I'd like to see.

Now, with a proper API to the game like the firaxis Devs have, It seems like it really shouldn't be too hard to train a more modern model that could be better than the current AI, even if not as good as the DOTA AI you're describing.*

Anyway, I hope we'll see better AI in the game sooner or later:)



*Seems like reinforcement learning has had a lot of success with games - if there's a decent API available to the general public, I'll be happy to give it a shot :)
 
An LLM with “Genuine People Personalities” for the opponents, maybe even letting you chat with them and then having their in game behaviour reflect their personality and dialogue, would be super fun I think. You could give the LLM control over some weights using the current system, it wouldn’t necessarily need to be too complicated. And it can always be optional.
 
An LLM with “Genuine People Personalities” for the opponents, maybe even letting you chat with them and then having their in game behaviour reflect their personality and dialogue, would be super fun I think. You could give the LLM control over some weights using the current system, it wouldn’t necessarily need to be too complicated. And it can always be optional.
Chat is a good option some RPGs are already experimenting with it, but I don't see how LLMs could actually play the game of Civ at their current state. Simple script could do a better job with one millionth of computation power.

I was thinking how this chat could be used to enhance diplomacy, but I don't see any viable ways too. Working diplomacy requires some way to enforce agreements (relationship changes, war support, etc. in Civ7), so agreements outside of predefined ones won't work.
 
The LLM could be given control over some weights rather than being asked to play the game.
How do you see it? It could, for example, make relationship worse if the player is not polite, but I don't see how the game could benefit from it. Or which weights do you mean?

LLMs by itself just take text for input and output. There could be some things on top, like stuffing them with context through RAG, or categorizing their output, but all this as far from game AI as possible (well, other than RPG chats).
 
Back
Top Bottom