Frogboy Frogboy

Some of the AI updates coming in 1.1

Some of the AI updates coming in 1.1

Just checked this in:


----------
12.07.12
----------
+ Moved AIEvaluateAreaThreat to AIfaction
+ AI looks for enemy defenders sitting on top of targeted improvements in AIFindClosestEnemyImprovement
+ AI trait weighting reduced from 1000 to 100 for researching techs purposes
+ AI checks to make sure a given unit isn't a city guardian unit before doing AI on it
+ AI calculates the battle rank of its champions and sovereigns each turn afresh to accurately reflect how strong it is prior to operating on it
+ AI no longer uses post message to leave a city in order to ensure it has real time strength notice of a target city
+ AI caps how much it will count crystal, influence and metal when factoring what it should research
+ AI vastly better at choosing technologies to research
+ AI is more protective of its cities
+ Fixed bug where AI pioneers couldn't build outposts if they were in an army with a champion or a sovereign (hence, armies of pioneers late game)
+ Fixed AI bug where sovereigns and champions, late game, would tend to lone wolf attack cities
+ AI pioneers better about staying put if there is an area threat around them (i.e. will stay inside a city)
+ AI values armor more than before when designing units
+ AI champions now care more about whether the city is defended well enough before leaving a city
+ Fixed bug that prevented AI from casting strategic attack spells on enemy units
+ AI interacts more with players
+ Modified Average combat rating to be 100 instead of 200 in elementaldefs.xml
+ Fixed crash bug in elementalsectormapper where the ZOC would get updated in a thread
+ Fixed bug in mapgenerator.cpp in which terrain decals were being loaded and placed (we don't display them so we were just using CPU and memory for no reason)
+ Modified the prop code so that deserts display more props and other terrains show fewer (mapgenerator.cpp)
+ Fixed path finding bug that caused any AI units that intersected during movement to cancel their destinations. This prevented AI units from being able to effectively create armies or get around late game (basically crippled AI movement late game)
+ Modified the combat rating calcualtor to consider defense a bit more

 

We're going to tweak easy and below to be easier because of these changes.  My 1.05frog build (https://forums.elementalgame.com/437369/) has these improvements in it already for anyone who wants to try a private build.

 

One thing I learned from extensive testing is that the AI "quality" is heavily dependent on which factions you play against. Some factions are weaker than others (in terms of the AI's effective use).  Krax and Trogs are the ones the AI loves the most.

36,380 views 41 replies
Reply #26 Top

+1 on Nick-Danger post. The pathfinding from cities to cities is terrible, and I think everyone, Brad included, suffered from it at least once. Quite often, the unit will pop up in the wrong square and travel extra days to reach the 2nd city whereas a path existed which allowed a 1 turn move.

 

Anyway, thanks for the hard work on the AI.

Reply #27 Top

Another example of pathfinding problems.  Figure 1:

The pioneers (move=2) began their movement in the city Newton.  You can see the highlighted square that was their pathfinding destination.  Pathfinding had the pioneers move (starting in city center) southwest, southwest, northwest where it ended its turn (0 movement remaining).

Manually moving the pioneers results in the below Figure 2:

Again, the pioneer began its move in Newton.  I clicked the square the pioneer is currently on, and pathfinding had it move (again, from city center) west (on the road), southwest (into the woods), then northwest (to where it currently resides).  The pioneer still has 1.5/2 moves remaining (ie I move twice more along the road and movement then is 1/2) despite moving thru the woods.

The difference between the 2 scenarios is the first one targeted a square 1 further west, and yielded a huge difference in the pioneer's movement.

I'm assuming the AI can't manually move its units, so this has to be severely handicapping the AI vs those of us who manually move units.  Addressing this would do much to improving AI, which is important as there is no MP so AI is the only game in town.

===============

A second example Figure 3:

 

The Cav has movement=4, and started its turn in the city to its northwest.  I clicked on its current square as its destination and it moves southwest (into the woods, ignoring the road) then south (to its current position).  Note the unit now has 2/4 movement left.  Practically it should have only expended 0.25 movement twice (south on the road then southeast on the road to its current location), and have 3.5/4 movment remaining.  Again, pathfinding ignores the road when exiting the city.  Unlike the first example (the pioneer), this time moving thru the woods does cost against movement  -- whereas the pioneer in the above example paid no cost to move thru the wood. 

Figure 1 has the pioneer move into woods then plains then woods, ending its move=2 turn.

Figure 2 has the pioneer move along the road (in the city) then woods then road, using only 0.5  of its movement=2.

Figure 3 has the Cav move into the woods then road, using 2 of its move=4.

It's interesting how different this can be.

 

 

Reply #28 Top

Quoting PocusFr, reply 26
+1 on Nick-Danger post. The pathfinding from cities to cities is terrible, and I think everyone, Brad included, suffered from it at least once. Quite often, the unit will pop up in the wrong square and travel extra days to reach the 2nd city whereas a path existed which allowed a 1 turn move.

Anyway, thanks for the hard work on the AI.
End of PocusFr's quote

I've complained about this quite a bit myself.  At least your units weren't getting their destinations canceled outright like mine were (AI).

I think it has to do with the multi-tile city thing causing problems for the path finding.  There's practically a sub-game science on path finding in terms of maximizing performance vs. accuracy. I know as they optimize the algorithms they are able to do more with path finding. I would be surprised if path finding doesn't continue to get better in this game as we go forward.

 

Reply #29 Top

Quoting Frogboy, reply 28

Quoting PocusFr, reply 26+1 on Nick-Danger post. The pathfinding from cities to cities is terrible, and I think everyone, Brad included, suffered from it at least once. Quite often, the unit will pop up in the wrong square and travel extra days to reach the 2nd city whereas a path existed which allowed a 1 turn move.

Anyway, thanks for the hard work on the AI.

I've complained about this quite a bit myself.  At least your units weren't getting their destinations canceled outright like mine were (AI).

I think it has to do with the multi-tile city thing causing problems for the path finding.  There's practically a sub-game science on path finding in terms of maximizing performance vs. accuracy. I know as they optimize the algorithms they are able to do more with path finding. I would be surprised if path finding doesn't continue to get better in this game as we go forward.

 
End of Frogboy's quote
Not being a programming ace, my uninformed idea is to first test if there's a road exit from a city in the desired direction (if multiple road exits choose the one closest to the destination) then move the unit to said exit square, then calculate the remaining path.  It seems pathfinding is calculating the path from the city center and then exiting units in the square most in line with the destination square, ignoring roads (and thus ignoring a faster route).

Why movement costs are subtracted or not subtracted as shown in my above post, I have no idea.

And I agree that this stuff will be continually improved upon, else I'd not bother to bring it up.

Reply #30 Top

Yeah I've noticed that when there are a number of path choices the south-west corner always seems to get picked.  When I block off a route entirely by snaking a city, the AI units approach and try to pass in a north-east direction even though there is a longer way around that won't get them killed immediately.

Could be reading too much into it, I don't know.

Reply #31 Top

tracking

Reply #32 Top


One thing I learned from extensive testing is that the AI "quality" is heavily dependent on which factions you play against. Some factions are weaker than others (in terms of the AI's effective use).  Krax and Trogs are the ones the AI loves the most.

End of quote

I've noticed Yithril tends to dominate the AI factions in most of my games, vvith usually double the faction povver of other factions. They love vvar. I usually play Challenging or Hard difficulty. Krax does okay, I've seen them dominate, but Yithril is more consistent.

Last game I played Yithril. Once you get Juggernauts, it looks like it's game over for other factions.

I don't think this is an issue. Factions don't need to be balanced, and I think Yithril vvould be pretty vveak in a game vvithout iron mines. I think Juggernauts need the upcoming nerf though. Other races don't have anything that seems to compare vvithout huge amounts of research.

Reply #33 Top

I feel handicapped now that I have a game installed on my PC which isn't Steam. How do I know when this 1.1 patch is out and where do I get it?

Reply #34 Top

Quoting harmonic42, reply 7
Actually I have found that Gilden is by far the most effective AI faction. They always build wonders, and often end up with big, heavily-armored late game armies of barons that will whoop your butt unless you are faster/better at magic.

 

My first game ever: Gilden ended up on a spree of continuing to research refined defense and attack, apparently. I was forced to specialize in lots of magic use in order to kill those super barons and knights. 

 

But since then, no AI has managed to muster up a decent challenge. It is rather disappointing. The game has so much potential - hopefully the AI will eventually learn how to handle the game mechanics.
End of harmonic42's quote
No, not just Giden, any faction end up had ton of city and reseach city is powerful, I had a.i alther men do same, and thier leader had something like 150 attack and 150 denfence making all my best army useless?

I wonder how do he get high? answer is reseaching ton of refined defense and attack...How do He got that so fast? answer is had ton of citite, now I do like small kingdom and few city, but if you want to winning you had to had outnumber city than a.i do to keep up reseaching tech, if you had 3 city and a.i had 10 and alreadly max everything tech and keep reseaching thos refined defense and attack, while you lag in tech, even you do max, you lost a game...when they depend war on you...so if must winning game, you had to had building many city or stealing a.i city many as you can and reseaching like crazy to outpase those a.i or you lost a game...

Not even destory's gift can help you or save you because techonoly of reseaching refined defense and attack is much, much cheaper than those mana do...in long term...

I hate to said techonoly reseach rule this game, not magic or power, though they nice to had and help, but to be powerful, you had to resecahing techonoly to improved defense and attack...so reseaching techonoly rule this game...

Reply #35 Top


Often, I try best land, and I restart too many time...few time win game...if I unable to settle more city or I knew a.i had more city and more of techonoly then I alreadly lost a game...in normal level, even..

 

Edit: Personaly, I think refined defense and attack should crap or stop there so gave a chance weaker kingdom to fight back since weaker kingdom unable to outpast reseaching, I do not know how would they hold and fight army that far, far better than other do even it's same armor and weapon...

Don't get me wrong, I do like refined all those gold, food, tech, those are not overpower, but on other hand a combat like attack and defense at end of magic tech, those easier overpower and deadly and weaker kingdom had no chance to fight back even it's same armor and weapons...

I do like refined attack and defense but only when I'm leading, LOL, but to be fair and balance, I think a.i shouldn't used this refined attack and defense unless it's on highest level but what a point, if you leader had 70 attack and 70 densce while thier leader had 150 attack and 150 defense then you screwd, not even your amry could help you...even in city, I know I had as it's happaned to me...all because they had ton of city (they can settle on bad land while player can't?) Had more city and cause mass reseaching more than one had less city..

Personal though, is stardock wise to crap or removed those refined attack and defense in order make more fun so weaker kingdom had better chance to turn thing abround? but do keep those refined gold, tech, mana, I don't think it's overpower and it's make "reseach" city stay useful...while combat still be fair and balance without those refined attack and defense? Just a though...don't get me wrong, I do like those refined and make city useful, but it's not funny when you like to play small kingdom rather than large kingdom and a.i had reseached those crazy, faster rater than you do because you had small kingdom, same for a.i had a small kingdom as  well...

Reply #36 Top

Quoting Frogboy, reply 28

Quoting PocusFr, reply 26+1 on Nick-Danger post. The pathfinding from cities to cities is terrible, and I think everyone, Brad included, suffered from it at least once. Quite often, the unit will pop up in the wrong square and travel extra days to reach the 2nd city whereas a path existed which allowed a 1 turn move.

Anyway, thanks for the hard work on the AI.

I've complained about this quite a bit myself.  At least your units weren't getting their destinations canceled outright like mine were (AI).

I think it has to do with the multi-tile city thing causing problems for the path finding.  There's practically a sub-game science on path finding in terms of maximizing performance vs. accuracy. I know as they optimize the algorithms they are able to do more with path finding. I would be surprised if path finding doesn't continue to get better in this game as we go forward.

 
End of Frogboy's quote

Note that we can live with bad pathfinding if finding the path does not commit us to using it.

If we had an option (always an option for UI changes because nothing pleases everyone) to have the path laid in, and rendered instead of just used (when the path is longer than a single square) and a way of advancing along the path without removing it, that would help us tolerate bad path finding -- we could just see when the path does not match what we were wanting to do. (I mean, of course I enjoy sending my pioneers off to attack monsters to the north when I asked them to go east... *cough*)

For bonus points, some UI mechanism reporting movement resources along the path would be great (I am still not convinced I understand how city movement works).

Quoting Humility, reply 35
Not even destory's gift can help you or save you because techonoly of reseaching refined defense and attack is much, much cheaper than those mana do...in long term...
End of Humility's quote

Actually, in 1.02, destiny's gift is a part of the answer, it's just not the whole answer.  (I have not played 1.05 yet because of a mix of "I am using steam" and "I do not know how long it's going to be until the next release." and "I like long, long games.")

But, yes, when the AI becomes better we will have to stop giving it so many advantages. (Personally, I have no problems turning down the game difficulty -- I even played one beginner game, though I could not convince myself to finish it -- I am only playing on insane because the AI is hopeless in the kind of game I enjoy.)

Anyways, I hope that at some point some set of changes will get released and be "1.1" and some later set of changes will go into future versions.  There's just soo much iteration needed for both the AI and the UI, and there's game breaking stuff in 1.02 (like the blood sigil hang).

Reply #37 Top

Quoting dwilson, reply 33

Last game I played Yithril. Once you get Juggernauts, it looks like it's game over for other factions.
End of dwilson's quote

Horseback riding bowmen, you can not kill what you can not catch, and archers can move and fire on the same turn.

Reply #38 Top

Or, if you have a high magic kingdom, and plenty of mana, you might be able to solo them with a high level caster. The concept is similar to the cavalry archers except, of course, you get to use "firearms" (blizzard is great against most units, but does not work very well on juggernauts, powerful juggernauts probably need to be fractured and then flame darted).

Reply #39 Top

Quoting eobet, reply 34
I feel handicapped now that I have a game installed on my PC which isn't Steam. How do I know when this 1.1 patch is out and where do I get it?
End of eobet's quote

If you downloaded directly from the site and don't have Stardock Central installed, then just hang out here every day until the site pops up the dreaded 503 error, that's when the patch will be out.  Nah, just kidding, I expect the bandwidth usage will be quite light.  Anyway, just go to where you originally downloaded (it's on your account page) and there should be an update that you can download.

If you have Stardock Central then run that and it will show any updates if they're available.

Reply #40 Top

Quoting dwilson, reply 33

quoting post
One thing I learned from extensive testing is that the AI "quality" is heavily dependent on which factions you play against. Some factions are weaker than others (in terms of the AI's effective use).  Krax and Trogs are the ones the AI loves the most.



I've noticed Yithril tends to dominate the AI factions in most of my games, vvith usually double the faction povver of other factions. They love vvar. I usually play Challenging or Hard difficulty. Krax does okay, I've seen them dominate, but Yithril is more consistent.

Last game I played Yithril. Once you get Juggernauts, it looks like it's game over for other factions.

I don't think this is an issue. Factions don't need to be balanced, and I think Yithril vvould be pretty vveak in a game vvithout iron mines. I think Juggernauts need the upcoming nerf though. Other races don't have anything that seems to compare vvithout huge amounts of research.
End of dwilson's quote
Did your W break? or is this some kind of social test? How many people are anal enough to notice and post about this kind of thing? :)

Reply #41 Top

Quoting EvilMario, reply 41
Did your W break? or is this some kind of social test? How many people are anal enough to notice and post about this kind of thing?
End of EvilMario's quote

Nah, he is just  taking the name "Double V" very seriously.... ;)

To be honest, I never notice these kinds of things until I am made aware of them myself :D

Sincerely
~ Kongdej