Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: Artificial Intelligence

  1. #1

    Artificial Intelligence

    Alright, one of the things people have asked about a few times is the AI. How is it going to work in WoM? Are we ready to handle something of such grand complexity? Well, this post is to give you a little more information (albeit in the loosest philosophically terms).

    I want to start by addressing what Artificial Intelligence is. I know that most of you know and that it's fairly obvious, but I have to start somewhere and the beginning seems like a logical place. Artificial Intelligence is Intelligence that is (wait for it) Artificial. It's job (in WoM anyway) is to do what a player would do without a player being there. When you play against the computer in WoM you will be playing against a number of AI opponents. Each of them should have a unique play style. As you play against them you should be able to recognize their patterns of behavior and get to know them just as you would a player. It should leave you with the feeling “That's just how George plays.” not “The computer gets confused if you BLANK.”

    So far, that's pretty straight forward. How does it work? On the most basic level the coder who wrote the AI looks at the current information and makes decisions on what the AI forces should do. A lot of people don't seem to get that when you play against an AI you are actually playing against another person (or team of people). The computer doesn't have a goal, it doesn't want to win, it doesn't want you to enjoy the game, it just computes. This may not seem to matter, but it explains why a lot of AIs fail. The coder who is writing the AI doesn't know how to play the game. That's a problem. It leads to things like just dumping loads of resources into the AI's lap in order to give them a chance to beat a player that can actually PLAY.

    Now, that's one of the advantages our team has. We can play. Not only that, a lot of you can play. So, when we start banging out AI code we're going to be putting together computer opponents that have strategy arcs that span the entire game. As we get feedback from play testers explaining some weakness in a certain opponent's strategy we'll be able to work on that point and strengthen it. Plus, of course, the computer never forgets to check anything. It doesn't make a rough guess at the odds, it knows exactly what they are. It doesn't get tired of checking every city every turn. It doesn't feel any sense of loss when it sacrifices a hero to win the game. All this added together means that we can make opponents that are truly almost impossible to defeat.

    We plan to go beyond the basic “Make the AI play like we would” and attempt to quantify certain strategic concepts like “Expansionist”. The idea is to boil down certain elements of strategy and use them like legos to build a completely new and unique AI that has a solid play style pieced together out of a number of viable play strategies. Now, that is going to be the real trick. It's relatively easy to hand craft a sorcerer with a certain set of skills to play a certain way. It's another thing entirely to be given a set of skills and strategic “methods” and try to dynamically make something that can actually offer a challenge. However, it's something we're aiming for.

    We want the AI in WoM to feel like artificial intelligence not artificial intelligence. It's going to take a lot of work to make it happen, but it's work we're going to love. As with all things WoM related, play testing is going to be a big element. In fact, it's going to matter more with the AI than with any other single element.

    I could go into more detail here, but this post is almost a page long. As you guys know I try to cut it there. (Also it's my sixteenth anniversary, so I have to take the wife out for a bite to eat here in a minute, lol). Anyways, feedback and suggestions. You know the drill.
    Last edited by Aaron; 03-09-2013 at 02:31 PM. Reason: Typo

  2. #2
    Moderator Asmodai's Avatar
    Join Date
    Feb 2013
    Fredericksburg, VA (USA)
    Happy Anniversary!!!
    Now get out and spend time with your wife! There is nothing here, especially the posts I've made, that can't wait till tomorrow (or Monday, or Tuesday, or Wednesday...)

  3. #3
    Join Date
    Feb 2013
    Portland, OR
    Indeed, happy anniversary! Go have fun.

  4. #4
    Arcane Candidate
    Join Date
    Mar 2013


    All in all, good text on the topic of AI. I'm really curious how you guys will approach the subject in the game.

    A computer program doesn't feel emotions, it's not creative - it will only act in the ways that it's programmer had implemented, and will react only in ways that the programmer has foreseen. This makes creating an AI a real challenge, if you want to make it seem as a human player.

    What you said about the computer not feeling bad about loosing its hero - yes, it's true. And personally, I think it's part of the problem with AI that act -- well, artificial. I've been playing computer games since, well, since they started to appear, more or less But I never saw a computer controlled player, say, give up on the fight, get pissed of, panic, etc. But we humans do that, we feel and act in accordance to our feelings. Even the best players sometimes make mistakes because they let their emotions get in the way - it's natural for us. Still, we don't program AIs in this way, we basically just give them a set of actions mapped against an array of predefined situations. If the program doesn't recognise the current situation, it just chooses an action from its list, either randomly or based on a given order / set of priorities. But what if the computer player could actually be taunted, offended, intimidated, and not by a dialog option on the diplomacy screen, but by player's actions? I think it's a road to be explored, if we want our AIs to be able to simulate the behaviour of a human player. An "emotional" AI would present a completely different experience for players - if it would simulate those emotions in a believable way.

    Another thing that you wrote - the computer never makes mistakes. So, in order to create an easier, less challenging AI, we force it to make unnatural, artificial mistakes, usually by implementing random behaviour options. But this actually gives the impression that sometimes the computer player doesn't even know what it's doing in the game. Sometimes those random moves are so obviously random, that instead of an "easy AI" (created to simulate the behaviour of an inexperienced human player) we simply get a stupid AI. Just to clarify - it's not an issue of an AI making a wrong choice, it's a problem of it making a senseless choice. So this is another lane of exploration - how to make computers "make mistakes" in the way that would be viewed as natural (as opposed to random or forced) by us humans. How I see it, it can only be done by analysing the behaviour patterns of rookie players and comparing them with what the seasoned players do. Not a small task.

    The third issue on my list is - well, relationships is the best word I guess. How many times did we see a true friendship bloom between a human and an AI? How many times did we witness acts of AI loyalty to a long lasting alliance? Sure, we always have a basic action-reaction system - you attack an AI's city/army, it likes you somewhat less. You do someting to help it, it likes you a bit more. And most of the time, that's it. I've seen quite a few attempts to tackle this - usually by implementing a sort of "action register", meaning that if you were consistently helpful and friendly to an AI, it would be less likely to attack you or choose an action that would be harmful to you. But even then the computer could flip a complete one eighty and attack you for absolutely no reason (other than "you must win" of course But try to picture this: the AI asks you for your support in an oncoming war with another AI. You have your usual array of replies. You choose to help and do whatever is necessary. Normally, this would only constitute another "friendly" action in the AI predefined pool, worth a given amount of points towards "better relations". But what if this particular battle would be really important to the AI? What if it felt about it as a "life or death situation"? What if it could "remember" your deed as a human would - that you helped it when the need was most dire? Here I jump back to the AI lack of emotions issue, but what I try to say is this - the computer player should be able not only to count the good and bad deeds against it, but also to weigh the individual gravity and importance of each of those actions, and it should be able to factor all that when choosing an action against a human player. In simpler words, the AI should be able to "think" something like: I should attack this bugger now, but damn, I like him too much after what he's done for me And of course, it should go both ways - when harassed for no good reason, "artificial hate" should build up, to the point that even when facing imminent destruction from the player, the AI would not be willing to negotiate or seek peace with the human player. The resentment should be able to contradict the common sense

    Tactics vs strategy - here we have another difference betweend humans and AIs. We, imperfect human beings, often lose focus of the ultimate goal, which is to win the game. Instead we get fixated on smaller things, like "I need to crush this army", "this city has to be mine" or "my part of the map looks weird, I need to move my borders" So, if an AI is to be more like humans, it should sometimes stop calculating the best way to win the game and start "obsessing" with smaller things, that are not necessarily the fastest way to achieve the ultimate goal. Strategy is about finding the best way to achieve victory (however you define it). Tactics means an ability to make the most of the current situation, with the available means. In a strategy game, the first part should theoretically always take precedence. Sometimes losing a battle will help win the war, and so on. But then the human factor kicks in and all of a sudden we need to do everything we can to win this particular battle, even if it's of no real consequence. I've never seen an example of this kind of "thinking" from an AI.

    As for the various AI "personality types" - it's just a matter of a predefined preference. We all know what an expansionist does, or the scientist type, or a sociopath This is based mostly on set priorities and doesn't really influence the points that I laid in this post; meaning that it's not enough just to give the AI some rules of behaviour based on a given preset. The varied personalities should obviously be pursued, but without addressing the other matters, they will not make much of a difference. We've seen that many times already.

    One last thing - you said that the programmer that implements the code for AI doesn't know how to play the game. Really? That is very far from OK if it is actually happening. I'm sure that it happened number of times over the years - but if a development studio wants to make a game, it's rather unthinkable that someone should be assigned such an important task without a good knowledge of the game mechanics and strategies. Glad to hear it will not be an issue with WoM

    So don't feel bad when I say this - I've heard so many claims about making a new, better, revolutionary AI, that I no longer believe them And while I really support making of the game and wish that the final product will be even better than MoM (which, let's face it, had some pretty crappy AI), I will wait and see, before I'll sing any praises. Remember, it's not just a question of making the AI challenging - as you stated, the computer "knows" everything, so it's quite easy to make it really hard to beat. It's about making it seemingly alive, giving the impression that we're not playing against just a set of predefined actions, but against an entity that reacts, to us and to the environment, based on its personal evaluation of what's going on, on its feelings towards us, on its previous experiences when dealing with us. There is no easy way to simulate all this, I realise that - but it's a worthy goal and it should be pursued by anyone who claims that they want to create "a better AI".

    You guys have commited to a pretty big thing - you want to surpass a legend among turn-based strategy games. I only hope that you'll not go about it by thinking "let's make what they made but more of it". Remember, MoM was far from perfect, patches or no patches. The game was heavily unbalanced, the AI was pretty bad, the user interface could be better - but still it had this marvellous replayability factor. Even now, after all the years, I sometimes start dosbox and give the MoM yet another go. And guess what - I still get suprised sometimes by what happens, each game is like a new story to be told. It's quite difficult to explain why that is - surely the strong random factor and all the different traits that you can use to create your mage are helping, but it's not just a question of a large combination pool that makes me come back to the game after so much time. It's rather the climate of it, the possibility of something new happening - even though after so many games everything should be well known and not suprising.

    In the end, just to point out some misspelled words / grammar errors - forgive me, it's my little obsession: the loosest PHILOSOPHICAL terms... can go straight forward, but what you write/say is STRAIGHTFORWARD.

    Happy anniversary
    Last edited by zvoloo; 03-10-2013 at 01:55 AM. Reason: too many newline characters ;)

  5. #5
    Mage’s Assistant
    Join Date
    Mar 2007
    Show me a complex wargame with good AI. All that can be done is hiding its stupidity. The best way to do this is giving bonuses and programming to play defensive at the beginning of a game. If AI must attack (big strategic attack), it have to do this only after collecting a certain amount of troops. In FE the AI can attack even well-defended city with its lone sovereign XD.
    Sorry, signature is under construction.

  6. #6
    Thanks for the kind words guys!

    John, I hope we can do better than just hiding the AI's stupidity, lol. We intend to try to give it an actual play style that feels (at least somewhat) like another player.

    zvoloo.... well, zvoloo.... OK, give me a minute.

    To open I want to say (and I'm sure you know this) what you're talking about is making something like the Master Control Program from Tron. I agree that the MCP would make an excellent opponent, but it's something that is probably going to be beyond the scope of WoM. However, we're going to do our best to offer challenging and interesting AI opponents.

    Let me try to respond to your points one by one:

    You make a good point about not being able to provoke or taunt an AI opponent with normal in-game actions (as you say, not through some diplomacy menu.) The problem with a system that considers in-game actions and implements an emotional reaction for an AI opponent is the extreme complexity involved. Say a unit is just passing through the countryside and crosses an enemy border. A human is going to consider the situation and try to determine if they're up to something or just passing through. They may not even notice that it happened. Say that the enemy army is up the something and the player is provoked. What will the reaction be? Do they go kill that army or attack the nearest city owned by that player? There is a universe of possibilities. Not only are there a number of emotions that may be stimulated, but the actions those emotions might provoke vary greatly. Obviously if you want the AI to play like a player all this needs to be considered, but it's a lot to try to take on. That's not to say that we shouldn't try to implement some such mechanic, it's just that it's going to be a big task to do it at all well.

    As far as mistakes are concerned you make a good point. I think simply randomizing actions creates random (and therefor unrealistic) results. If you want the AI to make natural and unforced mistakes you have to copy natural and unforced mistakes players make. This means quantifying and replicating strategies and tactics that players use and including the mistakes players make in the AI. It's not an easy achievement. However, we intend to base easier AI opponents on things inexperienced players do, not cripple the AI with a random “stupidity” factor, lol.

    On to relationships: This is such an in-depth and complex topic that it would need it's own post (and possibly forums) to thoroughly discuss. In my mind in ties a complex emotional system to an in-depth memory system. If you want to make it real then the AI will occasional forget you helped them out that one time or decide to forgive you for stabbing them in the back early in the game. I'm not saying it's not a great idea, I'm just saying it's currently beyond the scope of any project not in the basement of MIT, lol. Again, we could try to implement some simplified mechanic (and perhaps should) that could really add to the “relationship” feel of the AI. However, fulling achieving what you're talking about is something that no game (at least that I ever heard of) has ever accomplished.

    I do think that developing certain AI obsessions would be a good idea. The trick is going to be quantifying those obsessions. I think you example of "my part of the map looks weird, I need to move my borders" is a perfect example. Things like that drive people crazy and the AI never notices. The result being that the AI feels artificial. The trick is how to tell the AI that it's map does look funny and what it needs to do about it

    I also agree that the idea of making the AI pursue non-victory goals makes them more real. I would like to explore it. However, we have to make sure that it doesn't end up doing crazy things. Imagine an AI with some even number hangup. It would pursue even numbers of units in armies, even numbers of cities, etc. It would be funny to have an AI with a mental illness, but it might be difficult to make them challenging, Lol.

    I see your point about “personality types” and agree that alone they seem as artificial as any other simple series of “if statements”.

    I've played a number of games where I felt the AI coder didn't know how to play the game. I think most of us could say that. I didn't mean it as an insult, just as a statement in fact. To a certain extent the players will always get better than the creators. I've probably played more MoM than the guys that wrote the AIs for it did. (To be fair MoM had to overcome a number of technological limitations at the time. The coders could have been legendary players and the AI still wouldn't have been able to play like them.) I believe that it's probably a rare occurrence where the coder working on a game's AI ends up being one of the best players in the world. That's one of the reasons we're going to use play feedback to tweak the AIs. Also, we'll be able to keep updating WoM's AIs as new strategies are developed and great players arise

    I don't take any amount of reserve as an insult The proof is in the play testing. A lot of people have set out to do this. I think we talk a good talk and we are sincerely trying to walk the walk, but it's like bigfoot, you won't believe it until you see it, lol. I think that's fair.

    We have taken on a momentous task. MoM is a true classic. Just making a game up to it's standard is going to be difficult and going beyond it obviously more so. However, I think it's something we're truly going to be able to accomplish, especially with the community feedback that we're going to be able to draw from. Feedback just like this. So, thanks! We truly appreciate all the feedback we're already getting and look forward to getting more during our alpha and beta play testing phases.

  7. #7
    Moderator Asmodai's Avatar
    Join Date
    Feb 2013
    Fredericksburg, VA (USA)
    First I'd like an AI that doesn't cheat. By cheat I mean things like automatically see the entire map, get a production bonus, pay less upkeep, etc.

    With that in mind an AI CAN make a mistake in that it doesn't have all the information required to make the correct decision. Maybe you're amassing units nearby but it doesn't have a city or unit close enough to see so it makes the "mistake" of leaving the closest city under defended. Now if the AI see's everything this won't happen because it will see you amassing troops and will react but if it's not cheating it can't make a decision based off of information it doesn't have.

    I'd like to see an AI that's reacts to what the other players (both AI and human) do and is not boxed in by pre-defined things like "expansionist". If the AI takes over cities (or starts with them) that have a high population growth then maybe that makes it expansionist but if all it's cities are of low population growth maybe it isn't. If all the nearby cities are weaker than it then it's "aggressive" but if the nearby cities are not then it plays more "defensive". Even down to little things like if you are pumping out cavalry units and are on unfriendly terms with the AI then it adapts by producing more units with the "set vs charge" ability. If you instead switch to making flying units and they require ranged attacks to hit then the AI will adapt to that. So how they expand would depend on what is around them (open space or weak units causes rapid expansion), what military units they produce would depend on what their enemies are doing (perhaps weighted by how hostile those enemies are... so even "allies" would factor in just much less so than enemies...)

    This also means you can try to trick the computer, by putting a bunch of cavalry near your border so they can see them you may cause the AI to start pumping out units that set vs. charge. This could all be a feint though and your actual attack could come from other units positioned farther into your territory so they couldn't see them that are particularly strong against their anti-cavalry unit. Likewise I'd like an AI that was capable of doing such things to the player.

  8. #8
    As I mentioned in an earlier post there are no plans to make a cheating AI. Your computer opponents will collect information and resources in the same way the player does.

    Now, that will mean that the AI can make a “mistake” due to having inadequate information. However, I think the mistakes zvoloo was refering to were decisions that were in and of themselves bad. The AI has all the information it needs but makes the wrong decision just as a player might. As he pointed out this is a complex situation to deal with. If you simply implement a “random mistake” engine then the AI will end up doing crazy things that are certainly mistakes, but not ones that real players make. I think a good example of a “mistake” that an AI might make is building cities inefficiently (this could spin off into an entirely different subject here, but for the moment let's just leave it at “inefficiently”) or favoring a certain unit unreasonably. (I myself have lost some games over the years due to this obsession, lol.) Those are mistakes real players make and so, in order to make an AI seem more real, they need to make them as well.

    I feel that the AI certainly should adapt it's strategy according to how it's empire naturally takes shape, just as a player would. However, that still leaves plenty of room for the idea of “personality”. A player who's preferred strategy is expansion may find himself in a situation where that isn't a viable option. He'll need to alter his strategy until he can begin to expand again or has used another method to win the game. The AI opponents should show the same kind of flexibility. Now, I do want to point out that this is something that is very easy to write down as a concept, it's another thing entirely to develop that concept into a working AI. If there was a “briliant AI switch” everyone would flip it and we would all be very happy with all the AIs in the universe. We all know that's not how it works.

    We've got some good ideas and we're going to do our best to bring them to life in the form of challenging (and interesting) AI opponents. However, we always have to keep in the forefront of our minds that this is something that's a real challenge to do well.

  9. #9
    Quote Originally Posted by Aaron View Post
    However, we always have to keep in the forefront of our minds that this is something that's a real challenge to do well.
    Absolutely. My greatest sympathies to the AI developers! It's a real challenge, and complex enough that I don't feel I have anything to add to this particular conversation. Let's just say that I really like the direction you're heading in and wish you the best of luck!

    Also, happy belated anniversary!

  10. #10
    Arcane Candidate
    Join Date
    Mar 2013
    A few points I'd like clarified, although Aaron's second post offers much information.
    How much "scripted" will your ai be? Otherwise said: If the game is moddable, then will the ai be able to cope with new spells/units/whatnots, or will it not?
    Consider a game like civilization III/IV/V: new units can be designed. How do you use them? Do they fall into categories and how do you compare them to each other? If you change the stats of some unit due to playtesting, do you have to rewrite the ai so the strategies change accordingly, or will the code check the unit value based on its stats and adapt accordingly?

    Regarding diplomacy. how do you plan to tackle the dishonesty of human players? Stuff like making a deal just to break it immediately after because the short-term benefit is so good. For instance, can you exchange gold for gold per turn? If so, what prevents the player from abusing this (like killing the ai the turn right after getting all his gold in the deal, nad before paying anything back). I think many game-design decisions, in particular regarding trades between players, must take account the ai. If it's possible to abuse diplomacy, the player will always be better than the ai. If the ai miraculously managed to be better than the player at abusing other parties, then the player would likely feel the ai gang up on him artificially, or are mean, and would resent it.

    Finally, quoted from another forum:
    Now, I completely disagree that the AI will always react the same way to the same stimulus. That's up to the coder to decide. A player certainly won't react the same way to the same stimulus every time.
    I stand to my point. Even if you out a random in it, unless the program changes itself and adapts (which it can do if you patch it often for instance), then the algorithm will remain the same and the ai will not suddenly use a new tactic that some player may have discovered 2 years after the game got out. It's not that important however, as the point of the ai is to provide a challenge, and even if it caters to 2 strategies, then it's probably good enough. Just avoid having it do always exactly the same thing (except maybe on the simplest level).

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts