Heroes of Might and Magic Community
visiting hero! Register | Today's Posts | Games | Search! | FAQ/Rules | AvatarList | MemberList | Profile


Age of Heroes Headlines:  
5 Oct 2016: Heroes VII development comes to an end.. - read more
6 Aug 2016: Troubled Heroes VII Expansion Release - read more
26 Apr 2016: Heroes VII XPack - Trial by Fire - Coming out in June! - read more
17 Apr 2016: Global Alternative Creatures MOD for H7 after 1.8 Patch! - read more
7 Mar 2016: Romero launches a Piano Sonata Album Kickstarter! - read more
19 Feb 2016: Heroes 5.5 RC6, Heroes VII patch 1.7 are out! - read more
13 Jan 2016: Horn of the Abyss 1.4 Available for Download! - read more
17 Dec 2015: Heroes 5.5 update, 1.6 out for H7 - read more
23 Nov 2015: H7 1.4 & 1.5 patches Released - read more
31 Oct 2015: First H7 patches are out, End of DoC development - read more
5 Oct 2016: Heroes VII development comes to an end.. - read more
[X] Remove Ads
LOGIN:     Username:     Password:         [ Register ]
HOMM1: info forum | HOMM2: info forum | HOMM3: info mods forum | HOMM4: info CTG forum | HOMM5: info mods forum | MMH6: wiki forum | MMH7: wiki forum
Heroes Community > Heroes 6 - The New Beginning > Thread: Which Heroes games have the smartest AI?
Thread: Which Heroes games have the smartest AI? This thread is 2 pages long: 1 2 · «PREV
OhforfSake
OhforfSake


Promising
Legendary Hero
Initiate
posted November 09, 2011 12:30 PM
Edited by OhforfSake at 12:38, 09 Nov 2011.

Quote:
Yeah sure, AI is bad. Now tell me when was your last game where you did not save constantly, reload battles if things not ok for you. Try one day to play a whole game without relying on a single save, as AI does, then post here again your result.


Do you mean me?

I did that to begin with, when I wanted a perfect game and I thought the AI would be super awesome. I haven't done that for years though, there's really little point, when I don't need to even go for potential risky battles to just end the game one week earlier against the AI. Beside, in my eyes it's extremely borin to reload, because that means you'll be overpowered by no doubt. Without reload, any setback means a possibly more interesting game, though it's still very rarely the case.

Quote:
it has been a long time, but I remember the H2 AI as quite dangerous. it didn't even hesitate to cast armaggeddon. ouch.

I played Heroes 2 recently, and I had no idea what to expect, but to be honest, when I came to the end game, I was somewhat dissapointed (I played the XL map with 6 towns, where you can't choose Wizard or Warlock, I think). Though early in the game, there was times when I thought I might loose this one, I kept on loosing towns, most of all because I overrated the arrow towers and the moat I had bought.


About AI vs. script. I must admit I don't understand how AI is not a script, but I understand how it's not linear in the sense that it needs the ability to adapt and correspond to situations which it were not directly instructed for, otherwise there'd not be much "I" in the "AI".

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Salamandre
Salamandre


Admirable
Omnipresent Hero
Wog refugee
posted November 09, 2011 12:48 PM

@Warmonger

I was not talking about AI today definition, just the AI of 10-12 years old games, as H2-H3. With recent computers capabilities, I would expect much better. For instance, those 2 games are scripted and have no flexible AI. However, given the design, they can act well. Once you change the layout of what was intended (ie: templates), AI lose its advantage. 3DO gave him a limited radius in which he can take different decisions. And that's why the regular rmg had a lot of teleporters, to keep AI active in all areas. H2 campaigns are quite hard, H3 are decent too. Now, for a flexible AI, maybe VCMI will come with proposals.

I saw AI taking smart decisions, if the design was appropriate. Once you know how "he" thinks, give him the bonuses and he will use them rather well.

@Ohfor: not you, but we. I also use intensively the reload. Guilty.
____________
Era II mods and utilities

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Warmonger
Warmonger


Promising
Legendary Hero
fallen artist
posted November 09, 2011 01:03 PM
Edited by Warmonger at 13:10, 09 Nov 2011.

Quote:
I must admit I don't understand how AI is not a script


So, in a script, the programmer must predict and determine all the conditions that trigger certain actions.

For example:
if enemy casts slow
then if
you can cast haste then
cast haste
else
if you can cast dispel
cast dispel


Still, such very simple script can be uneffective if, for example, enemy cast slow while we defend the city with shooters and he can't really get inside easily. Casting dispel may be a waste of mana , when instead we could implode his shooters or flyers. Or catapult.

Some situations are very rare and hard to predict, such as:

if enemy has shooter and enemy has ammo cart and force field protects shooter and enemy does not have any other craeture and you don't have shooter and all your creatures are double-wide and you can cast dispel
then cast dispel
else

you can finally get to opponent and do him some harm. If any of the above condition is not met, the battle can be won.

Of course no one is going to write such script, that's why they are not effective in such complex games as HoMM 3.

Instead, we need more general knowledge and rule representation, giving AI some idea about what every spell, ability and effect does, what are the goals (killing enemy with melee stack) and what are the possible actions.
Some basic strategies can also be put down, but in general it's only a set of rules which are adapted and used differently at run time.

However, for adventure AI totally different mechanisms must be used, not only for pathfinding, but also developing some strategy and managing armies, heroes, artifacts as well as finding some short-term goals, such as captuing the mine.

In general, it's hard as hell to program and takes many more times if we want to cover every possibility game offers. Firts of all, a general framework needs to be designed. Then, rules and AI bindings must be added. But once it's done, we can't really know what the algorithm will produce. Stacking a number of different, little rules in unusual situations is someting that the programmer does not predict.

However, in VCMI we don't need to provide working AI in, let's say, three months - its different parts can be added at different moments and at many levels of abstraction, using different AI techniques.
Also, it's likely that flexible rules can cover a part of features added by mods, and new rules can be added as well.
____________
The future of Heroes 3 is here!

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
B0rsuk
B0rsuk


Promising
Famous Hero
DooM prophet
posted November 09, 2011 01:54 PM
Edited by B0rsuk at 14:02, 09 Nov 2011.

Sure, such special cases can be handled with extra effort. But programmers call it spaghetti code for a reason. Lots of special cases and exceptions result in very convoluted code. Code that is hard to understand, hard to debug, hard to maintain, improve etc. It gets increasingly harder to add stuff this way. And when you finally make it work decently, you're terrified of any design changes, because your inflexible code will struggle to handle it.

That's why most programmers prefer elegant, general solutions.

Salamandre:

Complexity of programming problems grows much faster than computational power. That's why.
____________
http://www.youtube.com/watch?v=u5um8QWWRvo RSA Animate - Smile or die

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
OhforfSake
OhforfSake


Promising
Legendary Hero
Initiate
posted November 09, 2011 01:59 PM

Useless nitpick from my site, but I don't think you can implode a catapult

Anyway, if I get what you're saying, the problem is not that the computer won't have enough processing power to run a linear script, but rather there are so many possibilities that making such a script would take more work than what is wortwhile?

I mean, take your two examples, both of them have, as I see it, a feature in common regarding how accesable units are (behind walls and forcefields). If one had made a script where the computer evaluates the accesability of units of each side and then runs a list of possibilities (e.g. dispel removes forcefield, rerun accesability without forcefield if dispel is in spell book) would not both problems be solveable with relative few commands?

I mean, I think I get what you're saying, and in that case I agree, the AI would probably need, like a human, to have some kind of general "understanding" of its environment and its possibilities to take account for "unexpected" situations and adapt like it was something intelligent. But is it still not a script?

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
B0rsuk
B0rsuk


Promising
Famous Hero
DooM prophet
posted November 09, 2011 02:14 PM
Edited by B0rsuk at 14:16, 09 Nov 2011.

Programming in general is hard. To this day multiple cores are at best partially utilized in games. This is because not all tasks can be easily divided into chunks. Car analogy:

A good driver can take a package and transport it quickly from A to B with a car. Now you are "given" an extra employee and are supposed to make the transportation process faster. To complicate things, let's say the path is not a straight line, but is contained entirely in a fairly chaotic city. What should the extra employee do ? Putting a second driver in the car won't help. In car races, drivers often have helpers called pilots, who focus on the big picture. Fine, so you got some increase by hiring a pilot, but not 200% increase. Then you get a third employee. What now ?

Not all tasks are like that. Painting a room can be easily sped up by using more workers. But hard programming problems are not like that.

One creative use for extra CPU cores - additional cores can be used to calculate AI turn during human player's turn. That would allow to plan ahead a few more moves. (I heard Galactic Civilizations II does this). But it may still be insufficient. Humans easily grasp high-level concepts and often don't think in terms of "5 moves ahead". Advice such as "Get Alchemist's Lab as soon as possible, this will allow you to get level7 creatures quickly and dominate most opposition." is simple for a human... but computers only understand much, much lower-level speak.
____________
http://www.youtube.com/watch?v=u5um8QWWRvo RSA Animate - Smile or die

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
OhforfSake
OhforfSake


Promising
Legendary Hero
Initiate
posted November 09, 2011 03:47 PM

That reminds me, about the link Alci posted, it does make good sense, in my opinion, for the computer player to go for the cart of lumber first, especially if the terrain type does not match the boots terrain. After all, it means +1 wood. For the rest of the items (again given the terrain does not match the boots, which I believe is swamp terrain), I'd actually also go for shackles, relic and finally boots, after all shackles is a surprise item that may win you the game, whereas the relic is "just" a stat booster, if I recall correct. The boots may be useful, but certainly not "right now".

It doesn't mean the Heroes 4 computer player is any good though, I actually get upset with myself if I don't get to his area fast enough, so I can take all "his" stuff. Stuff which the computer should have taken during the first two days, often unguareded treasure chests and artifacts.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
DoubleDeck
DoubleDeck


Promising
Legendary Hero
Look into my eyes...
posted November 10, 2011 07:21 AM

Quote:
It doesn't mean the Heroes 4 computer player is any good though, I actually get upset with myself if I don't get to his area fast enough, so I can take all "his" stuff. Stuff which the computer should have taken during the first two days, often unguareded treasure chests and artifacts.

I think the computer player's main priority is to maximise daily growth in gold and resources in the minimum path maybe...so they leave plain resouces which is a little dumb and go for mines, etc.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
alcibiades
alcibiades


Honorable
Undefeatable Hero
of Gold Dragons
posted November 10, 2011 07:34 AM

Quote:
Quote:
It doesn't mean the Heroes 4 computer player is any good though, I actually get upset with myself if I don't get to his area fast enough, so I can take all "his" stuff. Stuff which the computer should have taken during the first two days, often unguareded treasure chests and artifacts.

I think the computer player's main priority is to maximise daily growth in gold and resources in the minimum path maybe...so they leave plain resouces which is a little dumb and go for mines, etc.

Except the Heroes 4 AI doesn't even flag ungarded mines that are right in front of him (see my link in second post).
____________
What will happen now?

 Send Instant Message | Send E-Mail | View Profile | PP | Quote Reply | Link
DoubleDeck
DoubleDeck


Promising
Legendary Hero
Look into my eyes...
posted November 10, 2011 08:29 AM

Maybe then the AI just wanted to maximise level ups, or they didn't need that particular resource for their build.....lol, still that was Heroes 4.....though I do remember some AI in Heroes 5 doing that too

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
G0b1in
G0b1in


Adventuring Hero
posted November 10, 2011 11:57 AM

well my biggest problem with Heroes' AI is that it's not enough "human-like" - example: he dosen't pick resources and flag mines coz he realy don't need to - he's cheating anyways

however most anyoing thing to me is that AI somehow seem to "know" what is behind that black uncovered area - i noticed this in all heroes games i played - including H6 - when you buy units in your castle AI will cease to move towards it, even thou none of his heroes have ever been close enough to explore area - or is there a way to see garrison of unexplored town ?

in H6 i noticed tho that AI refuses to defend it's own towns (in Normal difficulty campain and Normal difficulty skirmish), but instead run away with his hero and leaves castle undefended- AI realy disslikes battle i guess    
____________

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
DoubleDeck
DoubleDeck


Promising
Legendary Hero
Look into my eyes...
posted November 10, 2011 12:07 PM

@Goblin, good point, which means that the AI cheat.....look the computer knows what's under the black covered area, so the AI know cos the AI is the computer

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
OhforfSake
OhforfSake


Promising
Legendary Hero
Initiate
posted November 10, 2011 12:21 PM

In principle I'd say the computer doesn't know anything, it can't. It has some information it deals with in a preprogrammed way. It's expected the computer player only acts upon information, which is accesible through the rules of the games.

I have however also seen these kind of cases before. If you in Heroes 3 take the computer players last town, it'll very often go straigth for another town, despite not having bothered with that area before. Earlier I thought it was due to view air with expert air magic, but I've since discovered that's not the case. Not only that, but even in labyrints, the AI will take the right way, despite not having view earth at expert earth magic and I'm talking about labyrints which goes over most of the map, where only if the computer player takes the exact right path it can just reach the other town, before time is up.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Salamandre
Salamandre


Admirable
Omnipresent Hero
Wog refugee
posted November 10, 2011 12:33 PM

It is even extended:

Consider you took AI's last town . He has 2 heros (one strong, one weak) in a closed area near a one way teleporter entrance. There are two exits, one dead end, one near a town. The exits of a one way teleporter are initialized at each turn start. if the exit was initialized to go into the dead end, the AI will send the weakest hero first and block the dead exit. Then with strong will reach the town.
Always.
____________
Era II mods and utilities

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
DoubleDeck
DoubleDeck


Promising
Legendary Hero
Look into my eyes...
posted November 10, 2011 01:05 PM

Also, the AI knows what area YOU haev uncovered, eg. if he has his last hero on the map, he will hide in the very area that you might not have uncovered yet

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Warmonger
Warmonger


Promising
Legendary Hero
fallen artist
posted November 10, 2011 01:12 PM

This is just because of simplified design. It's quite easy to simulate fog of war for AI, giving it only limited information avaliable.

But the issue has also other side - players may learn the map and not run blindly for the second time, but know positions of static objects. It's also a kind of cheating for human player, if AI still is limited by fog of war.
____________
The future of Heroes 3 is here!

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Magissia
Magissia


Adventuring Hero
posted November 11, 2011 08:37 PM

Quote:
This is just because of simplified design. It's quite easy to simulate fog of war for AI, giving it only limited information avaliable.

But the issue has also other side - players may learn the map and not run blindly for the second time, but know positions of static objects. It's also a kind of cheating for human player, if AI still is limited by fog of war.


I agree with that, people can even know by heart a map and it's monster, leaving the IA beaten all the time if it do need to "explore"
____________

My works

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
OhforfSake
OhforfSake


Promising
Legendary Hero
Initiate
posted November 11, 2011 09:43 PM

Well I think a random generated map with certain standardizations (so you e.g. don't end up with a horde of Titans waiting for you outside of town), which can be randomized to certain degree as well, is more preferable and does to a large degree avoid the problem.

I imagine what would also help a lot would be an AI which learns, so when you buy the game, the AI doesn't have any experience, it doesn't "know" stuff you'll learn by playing yet, but as the player improve so does the AI as both learns and this way both will match eachother for much longer. I mean, I recall when I for the first time ever tried a difficulty beyond normal, and I got beaten severely, but now any difficulty will often be way to easy, mostly because the computer opponents develops way too slow and make some very bad decisions. If the AI would learn and do so effectively, but only by those it plays against, I imagine the game could be a challenge for everyone, but impossible for no one.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
DoubleDeck
DoubleDeck


Promising
Legendary Hero
Look into my eyes...
posted November 14, 2011 09:08 AM

I am not sure if that's such a good idea....I guess a perfect AI would be one that is similar to a human opponent..ie. they can't see the whole map and know where you are unless they uncovered that area of the map, and that they defend castles and not flee, etc.

Sometimes I must say AI are sneaky, like I was necro and lost a stack of troops and wanted to raise them, but the last AI stack stood over my dead stack so I couldn't raise! Sneaky bugger!

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Jump To: « Prev Thread . . . Next Thread » This thread is 2 pages long: 1 2 · «PREV
Post New Poll    Post New Topic    Post New Reply

Page compiled in 0.0715 seconds