Artificial Intelligence.

Is there any way to implement Artificial Intelligence in this game, for example, when generating new campaigns? Or is it still too early to think about that? I suppose it takes the game developers quite a lot of time to create new content. However, Artificial Intelligence would help generate that content much faster.

Best regards! :blush:

Hard to know exactly what and how the devs are doing. I think one of the most interesting possible applications directly visible for us players is to improve the AI, and perhaps make it more “human-like”?

1 Like

What are you talking? About are asking why they the devs are not using language learning models to build maps, script scenarios, balance encounter, and write scenarios. I’m sure there are some task that could be automated like create topographic maps. but if you want ai generatated campaign your going first need thousands0 of campaign just to train the ai.

2 Likes

yeah.
Too early as in probably decades to early. Well it depends.

LLM (Large Language Models) like ChatGTP are trained on the entirety of the internet and gigantic numbers of scanned books as wells as automatically generated video subtitles. OpenAI downloaded pretty much the entirety of youtube, then generated subtitles and then used them for training.
This is a absolutely gigantic amount of training data. This is also why AI hasn’t really been getting all that much better in recent years. You can’t just add more training data because it doesn’t exist. You can only improve training data but to improve it you need humans to either generate data (write texts) or filter existing data by quality.

AoE2 has a a few hundred official scenarios plus a lot more fan made ones but the fan made ones are not all of equal quality.

Generating text (like ChatGTP) is a linear thing, you just need to predict the next letter.
Generating images is a 2D thing. Since it’s just 3 numbers per pixel (Red, Green, Blue) it’s not too complex.

AoE2 has multiple systems on top of each other that need to interact correctly.
The basis is a 2D map. This part would be relatively easy to generate. We already have random maps after all.
The 2nd aspect is object. Units, buildings, resources. Those follow a lot of rules. Rules are easy to code but hard to teach to a generative AI. Generative AI doesn’t work like normal software.

Is the AI going to understand that certain units belong together or not? Like does it generate Lions on a snow map or give a player units they can’t train. Light Cavalry for Aztecs and so on.

And then there is the whole trigger thing. Does the AI understand what triggers are possible, how they work and how to make them function.
Let’s say the mission is to move a relic cart from point A to point B.
Does the AI understand how to make it possible to move from point A to point B. Maybe there is a cliff or water blocking the path.
Does the AI understand how to communicate to the player where point B is. Like does it make a marker on the map.
Does the AI know how to make the mission challenging. Are there the right number of enemies? Are point A and point B even far enough apart from each other?

The getting the right challenge part is the hardest. How to test if the scenario is doable. Technically and practically.
Like how to test if the winning condition even works. Prevent softlocks and so on.
And then how to test if the mission is not to easy and not too hard.

You would have to develop and AI that plays like a player to effectively test those scenarios. Because testing with humans would completely ruin the point of making them AI generated.

Well and in the end there is also the question if it’s even going to be fun and interesting.
AI usually generates very average and boring things because it’s not really creative. It’s trained on a lot of data so it will be very likely to spit something out that is very common in the training data.
It can’t come up with new kinds of missions, it will just remix existing ones.

Current machine learning based AI that plays video games (like DeepMind) requires very powerful hardware and only works on some kind of games.
I don’t think most people have a server farm full of GPUs at home.

And even then it’s not human like at all because it can’t adapt. It is only based on it’s training data.
For example the Go AI (AlphaGo) that beat the Go champion can be beaten by anyone by just knowing one simple strategy.
Also that AI needs over 100 GPUs to run.
The AI can’t adapt to new strategies and it doesn’t even understand the rules of the game.

Go is a lot simpler then AoE2 and it’s a turn based game instead of a real time one.

I don’t think we will have machine learning based AI play AoE2 any time soon.

2 Likes

Considering how weird AI results can get (look at how it’s unable of generating texts & symbols correctly in images, which a human artist would get right), results would be very disappointing if the campaign was made by an AI. And results would tend to look very similar and likely quite broken.

2 Likes

Hmm but that’s missing the point (or perhaps I misunderstood?): you can just compile an AI which is playing as well as The Viper, assuming you managed to train it there, and then release a new AI “The Viper level”. Assuming it can be compiled efficiently (which I have no idea of
), people would not need to individually train the AI.

No you need a server farm to run an AI like DeepMind not just to train it.

I struggle to understand why: could you elaborate? Maybe we don’t speak of the same thing?

You have any idea how machine learning works?

The AI in AoE2 is a hand written script.
All the AI that is being hyped right now is based on machine learning. You need AI accelerators (which can just be GPUs) to run the AI model on a computer. You need hardware to generate those funny images and texts. That’s why you can only get the new AI features on new smartphones.
But those AI features they are doing are way less complex then understanding a video game.

You can’t use machine learning to make a classic AI script.
Maybe you can make an AI script that copies one build order from the Viper but then it won’t be able to react to anything the player does like a real the Viper could.

1 Like

Alright, I answer politely, but the way you talk to me is really the main problem on this forum: why do you need to answer in such an entitled and aggressive way when I was just looking for and trying to deliver constructive criticism?

Now, I know all of that, and I admit that I don’t know how doable it is from a computing power perspective, but in theory, if you let the AI “watch” thousands or millions of games, and allow it to identify key behaviours, identified to actions linked to the many scripts (“drush”, “produce fleet”, whatever they’re called), then you can train it to play in a specific fashion.

This needs not to be a classic AI script of course, and my whole point is that players don’t need to train locally the AI, but World’s Edge or whomever with the computing power could in theory do it, compile such a model, and distribute it for players to train against.

Now, I was not thinking about that, but I guess it is also technically possible to train the AI in 1 vs 1 iteratively by participating in sending to whomever trains it. Again, not talking about how many games that would require.

I’m not trying to be aggressive, I’m just trying to explain how AI works and what it does.

You haven’t gotten my main point yet. You don’t just need a super computer to train the AI, you also need a super computer to run it.
It takes a few seconds to generate an image with an AI on a home computer. Making a decision in an RTS is a more complex task than that. So the AI would take a minute for each decision on a highend (like RTX 5090) computer to decide what action to do next. But you want the AI to be able to do that multiple times a second.

With some more optimisation, generally more experience with AI and better AI hardware it will likely be possible in the future.
But then the game would require powerful AI hardware to run which would limit it to relatively new and expensive computers.

tldr:
It’s not possible yet. It will likely take a few more years before the first game will have machine learning based AI that actually works better than scripted AI.

I think it is not too far away for AI campaign building, AI difficulty settings, and so on, if it is pursued. I don’t agree with the notion of this stuff being decades away. And I’m pretty sure some of the data crunches for these things can and will be easily handled by local PC. Maybe not right away? But at least after some training occurs on Microsoft’s end and streamlined AI authoring tools based on that are given to players.

We’re talking about AoE campaigns and difficulty settings here; not compiling and analyzing the combined knowledge of humankind or scraping the entire Internet. I think it could be a year or two away if it was decently pursued.

Microsoft intends to spend like $80 billion on AI-enabled data centers in fiscal year 2025, too. Sure, big investment for big ideas. Probably some of that and related work they do would benefit AoE AI endeavors, if the desire is to displace artists and developers or the causal effect is as such.

AI difficulty settings for AoE were brought up by MS during AoE4’s development as a possible vision of the future. They might be working on it for AoE4? If not, then I bet they would more seriously consider it for AoE5. It could be a good way to finally have the AI feel like they have a unique personality and gameplay approach with every “vs. AI” game you play, as we know and as I think they alluded to or mentioned

The team artificial intelligence is confusing so many people don’t understand what it means because it can mean a lot of thing.
Probably no one would call a fridge that turns of the light when you close it artificial intelligence, right? But at what point does it stop being a simple function and start becoming “intelligent”?

When we talk about AI in the context of controlling a player in AoE2 there are 2 entirely different things we are talking about:

  • Scripted
  • Machine learning

Currently the AI is completely hand written and scripted to do the things it does.
The AI has build order coded in and then has a lot of “if x then y” things added.
Like “if enemy makes cavalry make build pikeman” and so on.

Machine learning works very different. You let the AI play the game many times (or let it watch many replays) and then the AI “learns” how to play the game. But machine learning is super complex and it doesn’t generate a human readable result.
The “trained” AI then needs AI hardware to run. It does not generate a classic AI script.

But to train the AI on the game you need to make a training interface first. What information does the AI get? Do you just send all the raw data like unit positions, resources and so on or do you give the AI the actual image that is shown on the display.
Maybe something inbetween. Maybe give the AI a simplified image where the game basically runs with the box mod.
All things that need to be decided and to be tested.

But that would also mean that the AI has to get that information while it is running. Like if it has to analyse the screen it has to do that in real time while you are playing.
They tired that with the game Quake but they had to run it on very low resolution and they did run it with a super computer.

And then you have to retrain the AI every single time you change something with the game.

Generating game content is a whole different challenge. Generating scenarios is extremely complex. It might work for other types of games where there is more flexibility. But in the case of AoE2 it’s really hard to grantee that a mission is technically winable without being trivially winable.

There is no game out there that does those kind of things yet. And most games are way less complex then AoE2.

1 Like

So to be clear I am familiar with all concepts you exposed, and I do work with machine learning myself, though not at all in games/videogames.

If you have the technical knowledge and experience to say that machine-trained AI would yield an extremely complex model, which could not be easily compiled or simplified, then fine, I believe you.

Yet, technically, I struggle to understand why (that was my initial question
). Of course, AI models generated with e.g. deep learning or not understandable for humans, etc. and perhaps the amount of data necessary to create a responsive, fun AI would just be too big. However, in a number of other fields, training is complex and requires a supercomputer, but the final model can easily be used at home.

Moreover, I can imagine ways to use supervise learning to associate to some existing script blocks some patterns observed in games, and it seems to me that’s already how the scripted AI proceeds (recognising the strategy of the opponent to react). That’s what I meant here:

It’s okay, I’m not confused by the conversation, but thank you for clarifying if it helps others.

Relic had this old Twitch video (“Age of Empires IV: Gamescom Recap”) I thought the current thread might appreciate seeing. See 25m 00s for start of short discussion (World’s Edge and Relic) about AI deep learning
 maybe 5 or 6 mins.

  • I wouldn’t, personally, want a so-called “Merciless” AI or an AI that “gets better every time someone beats it”, which is also talked about. I’d mainly just want different personalities and playstyles.


I envision something more like @Horapallas said, where big fast computers crunch all the data on Microsoft’s end and then a final models are created to run on local PCs.

There were some past discussions on the topic of deep learning here, too:


And, of course, the original cinematic was made HD with AI:

1 Like