History of hex-based AIs?

Jtownsend

Chieftain
Joined
Dec 31, 2007
Messages
83
Non-rhetorical question: Has a decent random map hex based wargame AI been done in the past?

In the 90s-2000s I played Norm Koger's The Operational Art of War series (TOAW) and a major component of what was widely considered "the" customizable wargame of the era was the PO (programmed opponent.) It was called that because it made little pretence of being an AI. The scenario designer was supposed to give the AI very specific instructions on the map of what to do, by setting as ramified a set of mini-objectives and contingency-instructions as possible, basically providing it with pathing and "operational" instructions. Then hopefully this was tested to see how the (gormless) AI would handle its instructions, and tweaking accordingly.

It was the contention of the designer - and a lot of other credible people who discussed it on the newsgroups - that a meticulously planned list of instructions was the -only- way to make an AI perform adequately at TOAW. That might not carry over to all hex based wargaming, and it might be obsolete, but I wasn't -aware- of it being done yet.

Anyone know of "sandbox" hex-wargaming AI successes, AIs that weren't basically given a roadmap and instructions on what to do? Please keep any Civ5 cheer/jeerleading out of this.
 
Never heard of Wesnoth. TOAW is the best one that I have ever encountered, and it is as you described above. Soren Johnson when asked about hexes said something along the lines of that he would love to do it, but current AI tech (this was back as Civ4 vanilla was developed) just couldn't handle it. The impression I had was that he made a real rough hex based combat sim and the AI just failed.
 
R.E. Lee - Civil War General (1996) was the first hex-based game I've ever played. It was alot of fun. It wasn't random, though. The maps were pre-made.

♥
 
Dashie: Was it random hex maps? Hexes (and by implication things like adjacency stacking rules) offer an additional thing for an AI to get wrong, and premade maps permit detailed AI scripting and pathing.

EDIT: Wow, I read that badly. Hexes, premade maps, gotcha.

I just noticed another thread where Cilpot brought up this question: posters mentioned Wesnoth and (I don't know if it's hex based) RoN, along with Galciv2 which AFAIK is not only not hex-based but more or less terrain-less.

Just to reiterate, I'm not asking with any "freeform hex wargame AI is impossible, ergo Civ5 AI will never be decent at war" I'm getting at - I'm just wondering where thinking has gone on the "freeform hex AI is very hard" front since the old days.

EDIT: Removed needless repetition of Godking's post when I realized it was in -this- thread and not another one.
 
Hex tiles are not inherently harder for an AI than square tiles. Both types of maps are really just a visualisation of a graph, you can think of the tiles as the nodes, and the possible moves from one node to another are the edges. All your algorithms work on graphs. Even if you insist on using a flat array to store your graph you can do that with hex tiles, all you need to do is pretend that every other line is indented by half a tile and disallow straight vertical movement and there you have your hex tiles.

Now, freeform, that is hard regardless of what shape your tiles are. But Wesnoth is pretty good at it.
 
Wesnoth

Comes to mind.

I love Wesnoth, made many of the official maps for it, and for a while was one of the best players.

The AI was frankly Atrocious. It was very good at killing units when it could, little else. I played that game MP for 3 years, but spent about 2 weeks playing SP.

Wesnoth AI was based on production bonuses and always aiming to kill as many units as possible. Tactically and strategically it was ******ed and it couldn't siege at all.

That said it is one of the better hex based AIs out there. AI is really hard. I have seen people mention Gal Civ AI. It is not very good either honestly.
 
Hex tiles are not inherently harder for an AI than square tiles. Both types of maps are really just a visualisation of a graph, you can think of the tiles as the nodes, and the possible moves from one node to another are the edges. All your algorithms work on graphs. Even if you insist on using a flat array to store your graph you can do that with hex tiles, all you need to do is pretend that every other line is indented by half a tile and disallow straight vertical movement and there you have your hex tiles.

Perhaps in theory - I say perhaps out of ignorance rather than doubt - but in practice games with tactical unit orientation, adjacency bonuses and so on are also hex based games, from the very crude (Road to Moscow, Panzer General) to the complex. I'm sure there are exceptions, but I was under the impression it had to do with the distance representation problem. I know this gets into old rehashed arguments that are a bit tangential to the topic, so...

hex based games or [non-hex-based games that incorporates the sort of flanking rules and other "unit deployment geometry" common in hex games]. Clear as mud.

Now, freeform, that is hard regardless of what shape your tiles are. But Wesnoth is pretty good at it.

This I've been encouraged to learn, although I've never played it.

And incidentally by "good" what I actually mean is "satisfactory most of the time." Even a well-scripted PO in a good wargame sometimes gets a screw loose.
 
The bottom line for me, as a programmer and life-long game, is that I think the AI could and should be better, and that some of the blatant AI failings are inexcusable.

I also really detest the concept of the only way of making the AI have a chance is to give it tons more resources so that it can make tons more units, instead of using the units worth a crap.

I love Wesnoth, made many of the official maps for it, and for a while was one of the best players.

The AI was frankly Atrocious. It was very good at killing units when it could, little else. I played that game MP for 3 years, but spent about 2 weeks playing SP.

Wesnoth AI was based on production bonuses and always aiming to kill as many units as possible. Tactically and strategically it was ******ed and it couldn't siege at all.

That said it is one of the better hex based AIs out there. AI is really hard. I have seen people mention Gal Civ AI. It is not very good either honestly.

I would agree that the GalCiv2 AI is overrated and if you tried Elemental the AI in that at release was so bad it's hard to put into words (same AI guy, Brad).

I would be a lot happier with Civ 5 AI if it performed as well as Wesnoth's AI, which I think has a lot of good things it does.

I would be a lot happer with Civ 5 AI if these very basic concepts happened:

- do not move ranged units into obvious suicide locations (right next to enemy melee/horse for ex)

- exhibit some patience, when declared on or attacked, hold a line on favorable terrain instead of always 100% lemming suiciding into the nearest enemy units

- ties in with the previous point, the AI is very poor at assessing threat. Lemming suicides charge/flood any attacker just isn't always the best option (beyond the fact that it's not forming lines, supporting with range, or using terrain/promos at all)

- when you're getting slaughtered, retreat sooner rather than later, before the bulk of your army is gone and you're giving away your entire empire to settle for peace or making yourself ripe for "giving" away your empire without peace.

- there is pure beauty in Civ 5's combat system, with terrain, ranged support, flanking, zone of control, great general support - the AI has little to any grasp of the basic game rules. Usually when the AI does anything smart I think it's an accident of how the flood/swarm of units end up.

I've been gaming for 20+ years and I've seen plenty of AI that was decent, if not well done. It IS possible. The shift to hexes and 1UPT elminated the nebulous wide open stacks of doom scenario and introduced much more clear rules. ZoC, terrain, promos leveraging terrain, range, flanking bonuses, generals (which the AI sometimes uses well), etc. Clear rules are easier to code around. The AI could and should be better.

The AI in general does do some slick things in Civ 5. I think there's potential. What's upsetting is that they didn't get closer to that potential before release. They should've hired an army of coders if needed to get it done instead of just being satisfied with, "the AI is sort of pathetic but oh well"

In another thread I saw someone complaining that the Civ 5 team doesn't communicate with the fans/core audience worth a crap, and I completely agree. I want explanations for some of this. This is an A1 title by a successful company that shouldn't need to rush things or accept mediocrity.

I also wanna know why the members of this community who were testers aren't discussing the test process or adding enlightenment - I can only surmise that they're forbidden from discussing it, which is weak. I'm finding it hard to believe that the laundry lists of issues, some legit, some opinion, that are flooding this and the official forums were not brought up during testing.
 
The 1 unit per hex makes pathfinding very complex for both players and AI; in fact, I am pretty sure that this is the reason the game is so painfully slow. I suspect that even raising it to 2 would make the AI much, much better and the game much, much faster.
 
Steel Panther games are hex based strategy war games - played them quite a lot years ago and what I can recall, those games had pretty tough AI. Here's screenshot about the game's interface. The game simulates pretty much all WW1-2 unit types & weapons, troop morale, multiple armor values (sides, front, back etc), different ammo types and so on. Today's it's a free game...
 
Wesnoth AI was based on production bonuses and always aiming to kill as many units as possible. Tactically and strategically it was ******ed and it couldn't siege at all.
For an AI that gets a lot of production bonuses, focusing on killing units can be a very effective and simple strategy. If you have twice the amount of units as the player and can trade 3 of your units for 2 of theirs, you're going to be doing pretty good, even though it would be a terrible idea in a fair fight.

The CiV AI could definitely use a lesson in the value of killing a player's units. Just because the AI isn't necessarily smarter on an absolute scale, doesn't mean that it can't be more effective when considering it's bonus advantages.
 
Steel Panther games are hex based strategy war games - played them quite a lot years ago and what I can recall, those games had pretty tough AI. Here's screenshot about the game's interface. The game simulates pretty much all WW1-2 unit types & weapons, troop morale, multiple armor values (sides, front, back etc), different ammo types and so on. Today's it's a free game...

In my experience (which is quite a lot) these types of war games AI is just as bad. The scenarios are hard due to time limits, and the setup generally being against you, but the AI isn't generally a whole lot smarter. It has a lot less to do because the situation isn't as dynamic.
 
For an AI that gets a lot of production bonuses, focusing on killing units can be a very effective and simple strategy. If you have twice the amount of units as the player and can trade 3 of your units for 2 of theirs, you're going to be doing pretty good, even though it would be a terrible idea in a fair fight.

The CiV AI could definitely use a lesson in the value of killing a player's units. Just because the AI isn't necessarily smarter on an absolute scale, doesn't mean that it can't be more effective when considering it's bonus advantages.


I have often seen the AI leave a weakened unit(3-1 HP) alone in favor of attacking a more powerful unit that is at or near full health. This is one of the worst things they can do, especially because if the weakened unit is an archer or siege, after they attack enough they can take the instant heal promotion. I'm sure this is one of the reasons the AI in Civ V is so poor.

Another reason the AI is poor is because they will often place a valuable unit, such as a Longswordsman, into a position were it can get attacked by multiple archers on the next turn for the sake of killing a wounded scout.

If the AI algorithim is modified to make it understand the value of units better and that it shouldn't sacrifice a valuable unit to kill a cheap one(but sacrificing a cheap unit to kill a valuable one is acceptabile), the AI will be vastly better, even if it still doesn't understand how to use tactics and formations on a hex map.
 
Most of the hex-based games I played (Steel Panthers I think, some Whatever general games, Wesnoth, Space Empires V) had pre-built maps and/or little terrain to consider and/or nevertheless AI problems. I think Wesnoth is pretty decent though, but I didn't spend much time with it.

Hex maps aren't particularly hard for an AI to grasp. As dannythefool already pointed out, they can easily be represented as square maps with a movement restriction across one diagonal. And in a game like Civ, where different tiles have different movement costs, pathfinding has to check non-direct routes anyway (since they may be faster as the direct one), so there's actually no advantage that a square map would have over a hex-based one.

The stumbling block for Civ5's tactical AI is 1upt, not the hex map.
 
Top Bottom