Master of Magic

Master of Magic

View Stats:
rgp151 Dec 12, 2023 @ 11:44am
All the AI problems
Honestly, the biggest problem with this game right now is the AI. The AI is just way too bad and non-competitive.

Some of the issues I've seen:
1) Doesn't cast any World spells. I'm not entirely sure if the AI uses still doesn't cast stuff like Gia's Blessing, etc., but as far as I can see it doesn't. Doesn't cast Just Cause, etc. This of course means that the AI is playing with only a fraction of its available power.
2) Doesn't make good combat casting decisions. The AI hardly ever targets heroes with direct damage. In Classic (at least 1.5, I forget how 1.3 played) the AI would aggressively target heroes an eliminate them with stuff like Lightning Strike, Psionic Blast, etc. The AI works way too hard at removing buffs, most of which don't even matter, like going crazy to dispell Water Walking, as if that has any bearing on the fight at all.
3) Doesn't defend cities. Can't count the number of times I've taken a capital with a spearman in it, while a 9 stack of Paladins sits right outside.
4) The trading system is too easy to exploit. In Classic 1.5 the AI did a much better job of recognizing the value of certain spells.
5) Hopelessly suicides ships. I'll make like a 4 stack of Warships and sit it off my coast and the AI will send countless Triremes filled with helpless units to attack my Warships and die hopeless deaths.
6) Can't handle Invisibility. Doesn't know how to use it itself, and doesn't know what to do when you cast it. Casting Mass Invis basically just shuts the opponent down.
7) Doesn't build roads.

I'm sure there are many more I'm missing.
Last edited by rgp151; Dec 13, 2023 @ 4:43am
< >
Showing 1-15 of 49 comments
Ichthyic Dec 12, 2023 @ 7:08pm 
speaking of casting spells... It used to be that the OG "detect magic" spell would cause any spell your opposing wizards were casting to appear above their portrait as text.

I have no idea where one is supposed to find what spells enemies are casting with this new version of detect magic. I have it running... but I'll be damned if I can figure out what anybody is casting. I know for a fact I should be detecting at least one wizard casting "summon bears". Anybody know where the information is supposed to be presented?
Narf the Mouse Dec 12, 2023 @ 9:04pm 
  1. They do cast world spells, but they are much less likely to cast them on lower difficulty levels, and some spells that probably should show up as "On World" only show up as "On You".
  2. Yeah, the combat AI is somewhat obsessed with dispelling buffs.
  3. Haven't had this problem, but I also like playing long games, and the AI should still have more than a single stack defending their capital.
  4. To some extent. However, this is counter-balanced by being able to loot all of the spells of a realm, even if you only have a single spellbook in that realm. Another problem is that the AI probably has no real idea of what to do with the thousands of gold I paid to get Transmute or Gaia's Blessing.
    1. To add to this list, being able to loot all of the spells of a realm, even if you only have a single spellbook in that realm.
  5. Well, it's not spamming ships anymore, but I think they fixed that bug a little too much.
  6. Also if all units on both sides of a combat are invisible, I get a CTD. I tend to play heavily modded, though.
  7. Yep.
rgp151 Dec 13, 2023 @ 4:54am 
I recall in 1.5 stuff like Detect Magic & Spell Blast, Suppress Magic and Spell Binding all being very valuable because they were needed. Now they are essentially useless because there is no need for them. I recall many games in 1.5 where I was only able to keep myself alive due to stuff l like Spell Blasting some critical spells or needed to get Suppress Magic to prevent stuff like Meteor Storm. I recall one game on 1.5 Impossible where a wizard got Meteor Storm really early somehow, must have popped it from a Chaos Node or something.

I was luckily pure Sorcery that game and after I got it dispelled the first time and had to keep randomly casting Spell Blast from time to time to stop it until I got Detect Magic. It was a pretty crazy game and I'm not even sure I won that one.

I also recall seeing wizards use Gia's Blessing and Change Terrain a lot and things like Ariel with a ton of Dwarven cities running Prosperity, etc.

As for #3, I was just in a game where I took a capital that literally had three 9 stacks sitting outside it while it had I think just three units, 2 of them engineers, sitting inside.
GeorgeJJR Dec 13, 2023 @ 6:48am 
1) I've seen the AI cast earthquake regularly, but I can't recall it casting many other world spells.
2) Agree. As was said, the AI is obsessed with casting dispel magic. It does like to cast flamestrike and counter magic first, but after that its all about removing buffs, which means a simple way to keep it occupied is to continue to cast something like elemental resistance. This is especially effective if your army has the buffs before battle starts.
3) I haven't seen this, but I play tall and by the time I make it to their cities they're usually full of units. Though often low level units even in late game.
4) I've never used the trading system -- playing against the AI on hardest level means automatic war. I'm not sure that's a good thing.
5) Haven't noticed this, but I haven't built a lot of warships .
6) Agree
7) Agree
Ichthyic Dec 13, 2023 @ 8:39pm 
Originally posted by GeorgeJJR:
1) I've seen the AI cast earthquake regularly, but I can't recall it casting many other world spells.
2) Agree. As was said, the AI is obsessed with casting dispel magic. It does like to cast flamestrike and counter magic first, but after that its all about removing buffs, which means a simple way to keep it occupied is to continue to cast something like elemental resistance. This is especially effective if your army has the buffs before battle starts.
3) I haven't seen this, but I play tall and by the time I make it to their cities they're usually full of units. Though often low level units even in late game.
4) I've never used the trading system -- playing against the AI on hardest level means automatic war. I'm not sure that's a good thing.
5) Haven't noticed this, but I haven't built a lot of warships .
6) Agree
7) Agree

"the AI is obsessed with casting dispel magic"

It feeds into my love of the game that I can put spell lock on a unit and watch the AI waste turn after turn in combat. It's a guilty pleasure.

Also, I think there is something wrong with the counter magic spell. It actually seems more effective if you spend no mana on it at all, instead of trying to buff it.
rgp151 Dec 14, 2023 @ 3:25am 
Yeah Counter Magic is quite strange. I haven't figured out how it works. In the Classic game, I would say that Counter Magic was one of the most important spells in the game, and often the main spell Blue spell I would choose to start with. In this game I never even us it anymore. For one thing it doesn't seem very effective. For another the AIs aren't effective enough at casting right now for it to matter. In 1.5 Classic the enemy wizards were definitely to be feared. I'd ALWAYS hit the capital first and then only attack their towns after having taken out the capital, and rarely allowed by heroes to go into battle against enemy wizards unless they were fully stacked with Magic Immunity/Invisibility, Flight, etc.

But yeah, in this game the AI is so bad and weak that banishing the wizard doesn't really matter much.
GeorgeJJR Dec 14, 2023 @ 11:29am 
Agree that the AI is weak in this game (and 99% of all computer games, except for chess, checkers and Go etc). On the other hand, the lair battles (and now soul trapped event) and general building are a lot of fun, which is why its a game I've come back to for decades.

I wonder how long it'll be before machine learning becomes an standard implementation in 4x games -- that's likely what it'll take to get good AI in them.
Last edited by GeorgeJJR; Dec 14, 2023 @ 11:30am
Narf the Mouse Dec 14, 2023 @ 2:05pm 
Originally posted by GeorgeJJR:
I wonder how long it'll be before machine learning becomes an standard implementation in 4x games -- that's likely what it'll take to get good AI in them.
Note: This entire post is pre-food.

As I understand it, AMD, and Intel, have announced AI integration for new/upcoming CPUs. From there, libraries need to be created that can be plugged into your video game, and APIs to use those libraries need to be standardised. Being able to run a dedicated AI on a CPU without needing to hijack the GPU away from its rendering tasks, is almost certain to accelerate AI development.

AI is widely used in video games, from advertising to players, to determining if a player cheated in a multiplayer game, but as you noted, those are artisan AI; purpose-built using software and methods specific to that AI and game.

I would be surprised if no-one is working on a standardised API for AI in 4X strategy games; that being said, it would be a very complex topic, that would be hard to generalise.

At a guess, four years, maybe for a version 1.0? That being said, LLMs might be used to speed up the development of such a library, so it might come sooner than I guessed.
Last edited by Narf the Mouse; Dec 14, 2023 @ 2:06pm
Narf the Mouse Dec 14, 2023 @ 2:29pm 
Note: Also pre-food.

I took a look at the Counter-Magic and Dispel Magic scripts. Both of them are using:
Dispel Strength / (Dispel Strength + Target Strength)
to calculate the dispel chance; however, at least in battle, Counter Magic bases the Target Strength off of the amount of mana put into the spell, multiplied by the distance multiplier. In short, you can more easily Counter Magic the enemy's spells if you are right next to their capital. This is likely a bug.

Also the strength of Counter Magic might not take into account the amount of mana put into Counter Magic, only the base mana.

I didn't notice any other potential bugs, but as noted, I haven't eaten yet.
Last edited by Narf the Mouse; Dec 14, 2023 @ 2:29pm
Dorian Gray Dec 26, 2023 @ 1:36am 
Originally posted by rgp151:
Honestly, the biggest problem with this game right now is the AI. The AI is just way too bad and non-competitive.

Some of the issues I've seen:

3) Doesn't defend cities. Can't count the number of times I've taken a capital with a spearman in it, while a 9 stack of Paladins sits right outside.

This still seems to be a major issue.

I can park a stack next to their capital city and they all run away but a couple of stragglers, leaving only 1-2 to defend on against my followup attack.

Crazy AI stuff....
Narf the Mouse Dec 26, 2023 @ 6:17pm 
I took a look at the AI's capital; too many units. Built a stack of Mithril High Men Pikemen and Bowmen, came back on a Floating Island. One singular unit.
Ichthyic Dec 27, 2023 @ 1:47am 
The first person who figures out how to program a good AI for your average 4x is going to be a very, very rich person. I can count on one hand the number of turn based, strategic games that I have seen decent AI in, let alone good (none). And I have been playing these games since 1989.
Narf the Mouse Dec 27, 2023 @ 2:04am 
There are resources for video game AI dev, but they tend to be scattered, retreads, poorly-explained, or simplistic. For AI, you tend to go from "This is a state machine, this is a behaviour tree, this is goal-oriented programming, etc; now go build something" to "how to make a massively-parallel learning algorithm" with little exploration of the former topic, and very little in-between.
GeorgeJJR Dec 27, 2023 @ 5:22am 
Originally posted by Narf the Mouse:
There are resources for video game AI dev, but they tend to be scattered, retreads, poorly-explained, or simplistic. For AI, you tend to go from "This is a state machine, this is a behaviour tree, this is goal-oriented programming, etc; now go build something" to "how to make a massively-parallel learning algorithm" with little exploration of the former topic, and very little in-between.

Do you know if there's much work done on machine learning for 4x games? I've read that games like chess, backgammon and Go now have machine learning (from scratch) AI that are far better than the best human players, but most of that research was done at universities or companies as part of their AI research (ie the games didn't have to be profitable, or even sold to the public).
Narf the Mouse Dec 27, 2023 @ 1:28pm 
Originally posted by GeorgeJJR:
Originally posted by Narf the Mouse:
There are resources for video game AI dev, but they tend to be scattered, retreads, poorly-explained, or simplistic. For AI, you tend to go from "This is a state machine, this is a behaviour tree, this is goal-oriented programming, etc; now go build something" to "how to make a massively-parallel learning algorithm" with little exploration of the former topic, and very little in-between.

Do you know if there's much work done on machine learning for 4x games? I've read that games like chess, backgammon and Go now have machine learning (from scratch) AI that are far better than the best human players, but most of that research was done at universities or companies as part of their AI research (ie the games didn't have to be profitable, or even sold to the public).
Very popular games like DOTA have also had AI researchers make models that can play them. But there's nothing standardised that I know of. I do have a thought that if you had an LLM that you fed data about your game, you could use two agent models, one to propose actions and one to critique them. You want two agents because they're less likely to get caught in a loop. Orders could be given to the game in a formal like JSON, where the game could return formatting or other errors if needed so the LLMs could correct them. The game should probably only take orders from one of the LLMs.

Also I think we may have talked about this before?
< >
Showing 1-15 of 49 comments
Per page: 1530 50