Exercises in Formula and Lua AI and AI-demos add-on feedback

Discussion of all aspects of the game engine, including development of new and existing features.

Moderators: Forum Moderators, Developers

Post Reply
tuggyne
Posts: 76
Joined: May 22nd, 2011, 5:52 am

Re: Exercises in Formula and Lua AI

Post by tuggyne » September 2nd, 2012, 9:13 am

mattsc wrote:a new check at the beginning of the game that the right faction, side and map were chosen.
Ow, I had a problem with this too. I tried to run Fred on another map (Silverhead Crossing) without thinking, and after displaying the message that Fred didn't know how to play on this map, Wesnoth hung at full CPU. I'm fairly sure that's because of the code to quit the map, but I don't know why that would be.

mattsc
Posts: 1062
Joined: October 13th, 2010, 6:14 pm
Location: Wandering, mostly aimlessly

Re: Exercises in Formula and Lua AI

Post by mattsc » September 2nd, 2012, 5:37 pm

Rigor wrote:gj! about recruiting: is there any code already except to move the already standing units on the keep? im asking because some maps, such as arcanclave and 1000 scorpions require the ai to understand that connected keeps enable it to recruit at very remote places, which is crucial to winning the game.
There is, but nothing sophisticated. Both Fred and Ron recruit on whatever available hex is closest to a "goal". For Fred this means the village at 27,16. For Ron it's the distance to all the enemy leaders (in a sum(1/x^2) sense).
Rigor wrote:theres somethign more: if there is just one keep everything is alright, but on many maps you have multiple keeps to recruit in - this means, usually the ai never moves his leader to those keeps and they r good for nothing. ideas?
No, none of the rush AIs would do that at the moment. Ideas? Not really... How would you make the decision when and how to move the leader (in a way that a computer can understand, I mean)? This is, however, one of those "orthogonal" things I was talking about. Since there's no need to do this for the Fred Freelands development, adding this to Ron would not be a duplication of work. So I am open to suggestions.
Rigor wrote:and something else: i would so love to see this new smarter ai integrated into world conquest, just to see if its owning all those nonstop wcplayers - i was one of them btw and it is so much fun! is it possible to just do a quick and dirty solution for the first scenario?
I just poked around in the WC code a little. In principle, it's easy to add the generic rush to any campaign. However, WC presents a specific problem here with its mixed recruit lists. Ron relies on there being one kind of "cheap fighter recruit" that it hires a lot of and throws against the enemy. It seems that the recruit lists in WC often (sometimes? usually? always?) contain several of them and Ron wouldn't know how to deal with that. Also, possibly an even more serious problem, Ron's currently not at all balanced between the different factions. I'm pretty sure that he plays best with Northerners, and worst with factions that have no poisoners and more expensive fighter units.
tuggyne wrote:Ow, I had a problem with this too. I tried to run Fred on another map (Silverhead Crossing) without thinking, and after displaying the message that Fred didn't know how to play on this map, Wesnoth hung at full CPU. I'm fairly sure that's because of the code to quit the map, but I don't know why that would be.
Hmm, I just tried and had no problem. I chose Silverhead with Northerners for Side 1 and the AI bows out after that message. Could you tell me what exactly I need to do to reproduce this?
SP campaigns: Galuldur's First Journey (1.12 & 1.14) & Grnk the Mighty (1.10 & 1.12)
AI experiments: Micro AIs (wiki, forum thread, known/fixed bugs), Fred, AI-demos add-on

#wesnoth-dev.2018-??-??.log:< c?????> mattsc, I think you broke Vultraz.

User avatar
Alarantalara
Art Contributor
Posts: 782
Joined: April 23rd, 2010, 8:17 pm
Location: Canada

Re: Exercises in Formula and Lua AI

Post by Alarantalara » September 2nd, 2012, 5:50 pm

mattsc wrote:
Rigor wrote:theres somethign more: if there is just one keep everything is alright, but on many maps you have multiple keeps to recruit in - this means, usually the ai never moves his leader to those keeps and they r good for nothing. ideas?
No, none of the rush AIs would do that at the moment. Ideas? Not really... How would you make the decision when and how to move the leader (in a way that a computer can understand, I mean)? This is, however, one of those "orthogonal" things I was talking about. Since there's no need to do this for the Fred Freelands development, adding this to Ron would not be a duplication of work. So I am open to suggestions.
If on keep, find all keeps within two turns' movement of leader.
If not on keep, find all keeps within one turn's movement of leader.
Select keep closest to enemy leaders.
Try to move there after recruiting.

Edit: For extra performance, include a village capture on the path to the next keep when possible.

tuggyne
Posts: 76
Joined: May 22nd, 2011, 5:52 am

Re: Exercises in Formula and Lua AI

Post by tuggyne » September 3rd, 2012, 12:31 am

mattsc wrote:
tuggyne wrote:Ow, I had a problem with this too. I tried to run Fred on another map (Silverhead Crossing) without thinking, and after displaying the message that Fred didn't know how to play on this map, Wesnoth hung at full CPU. I'm fairly sure that's because of the code to quit the map, but I don't know why that would be.
Hmm, I just tried and had no problem. I chose Silverhead with Northerners for Side 1 and the AI bows out after that message. Could you tell me what exactly I need to do to reproduce this?
Ah, I see. With Northerners, it still works, but I must have also used a different faction, which does hang it (e.g. Loyalists).

mattsc
Posts: 1062
Joined: October 13th, 2010, 6:14 pm
Location: Wandering, mostly aimlessly

Re: Exercises in Formula and Lua AI

Post by mattsc » September 3rd, 2012, 1:03 am

tuggyne wrote:Ah, I see. With Northerners, it still works, but I must have also used a different faction, which does hang it (e.g. Loyalists).
Hmm, you're right. Well, it's fixed - the way it was done previously was not very good anyway and I had already changed that. The new code seems to work as desired. If you remember, could you test this again once the next version comes out? I don't want to release it right now because I am in the middle of changing some other things. Thanks for reporting!
SP campaigns: Galuldur's First Journey (1.12 & 1.14) & Grnk the Mighty (1.10 & 1.12)
AI experiments: Micro AIs (wiki, forum thread, known/fixed bugs), Fred, AI-demos add-on

#wesnoth-dev.2018-??-??.log:< c?????> mattsc, I think you broke Vultraz.

User avatar
Rigor
Posts: 941
Joined: September 27th, 2007, 1:40 am

Re: Exercises in Formula and Lua AI

Post by Rigor » September 3rd, 2012, 5:17 am

the specific solution to this specific problem is to do a quick and dirty hack then, involving the following steps:

take world conquest and give the AI a recruit list that fits well into our ai manipul... eh improvement scheme, removing randomness as an element in the first place. look how it performs on a generic map.

i envision the following recruitment list:

grunts
drake burners
elvish fighters
assassins
adepts
poachers
horsemen
skeleton fighters

considering wc players love a challenge, id give them just that.

nelson
Posts: 91
Joined: March 19th, 2008, 11:15 pm
Contact:

Re: Exercises in Formula and Lua AI

Post by nelson » September 3rd, 2012, 8:01 pm

Here's a game where my Loys defeat Fred 0.10.5 as he recruits a buttload of archers, maybe too many:
2p_—_The_Freelands_replay_archer-heavy_Fred_loses_to_Loys.gz
Archer-heavy Fred loses to nelson's Loys
(27.45 KiB) Downloaded 151 times
4. I want orcs to advance aggressively at dusk, but not so aggressively that they stand next to an empty village allowing me to get damage in cheaply while holding my village. The archer standing next to the village on 27,16 by himself is suicidal.

5. Fred gets crazy luck this turn, slaying both of my village-holding spearmen, so his archer mistakes don't hurt him as much. I would probably have put the grunt on the outside at 29,15, not an archer, but it's definitely better to lose an archer than an assassin so this isn't disastrously stupid. Nevertheless I kill both of the archers in his initial assault. I would not have two archers in an initial rush, even against Loyalists, you just need more tanks, and it's good to trade grunts for e.g. spearmen while trading archers for spearmen doesn't help at all.

Also, notice how my lone cavalry on the left is able to keep both a grunt and a wolf passively sitting in their villages for most of the game. Eventually Fred adds a goblin to that front, and all 3 units *still* sit passively and fail attack the cavalry or threaten to steal my villages for several turns! This gives me an effective unit advantage, even though Fred outnumbers me on that front. Finally on turn 13 the goblin threatens to village steal, and I have to actually defend the western front at long last.

6. Fred should not have attacked the village here. Even if he has a ctk with 3 units he can't put another unit in the village to take it, and he opens himself up to counterattacks from the leader and mage. Fred should either retreat now (since he is outnumbered on this front) or attack the enemy units further away from the keep that won't heal off the damage. Here if I were determined to attack, I would use the two grunts on a unit and then use the assassin either to finish that unit or poison a different unit. (Generally I prefer to not put damage into a poisoned unit, since that unit will continue to take damage unless it heals anyway.)

7. WTF is the grunt doing moving to 19,18??? Don't advance close to the enemy keep at dawn unless you have a ctk on the leader or something else crucial!

8. Fred should retreat further back rather than holding the line at the castle where he can take damage at day. He can come back at a better TOD. Taking damage at this point means he will lose units before they can contribute to his nighttime attack.

9. Fred does *not* want to be in range of the mage at daytime. Now that he has taken damage, Fred kind of has to attack, but it would have been better if he had retreated last turn and could now show up with full-health units, placing them outside of the range of the mage.

The injured grunt attacking cavalry at day from 27,11 is suicidal.

Also, I think 4 archers is too many even against horse-heavy Loys. They're just too squishy by themselves. Fred is going archer-crazy! On the other hand, he slaughters 3 mounted units and a spearman in 2 turns (10 and 11) using those archers, so maybe it's a reasonable play.

12. Although it is still night, Fred is now outnumbered and has no shields to protect his squishy (and injured) archers against all of the melee I have assembled. Fred must retreat.

14. Although attacking the spearman on 27,10 was risky/silly, once Fred has done it, he needs to finish that almost-dead spearman with something (perhaps the assassin?) and then shield that attacking unit if possible. Don't make half-ass attacks, it's all or nothing for orcs! Not attacking would have been the better move in this situation, though.

17. At this point I have a 17-7 kill advantage, Fred has lost all of my villages that he has captured, and it is first watch but Fred has no targets in range to attack. I'd say the game is over at this point.

nelson
Posts: 91
Joined: March 19th, 2008, 11:15 pm
Contact:

Re: Exercises in Formula and Lua AI

Post by nelson » September 3rd, 2012, 9:28 pm

Here's a quick game where my Loys trounce the latest Github version of Fred as of an hour ago:
2p_—_The_Freelands_replay_latest_Github_Fred_dies.gz
Latest Github version of Fred dies to my Loys
(21.77 KiB) Downloaded 146 times
4. Because my fencer in the center draws off a grunt from the grunt rush, Fred is outnumbered on the right. The leader should have covered the center to allow the grunt to continue on to attack. If a unit is drawn off for some reason, Fred should notice that he is outnumbered, and should consider delaying his grunt rush attack and not hitting this turn.

On the left the grunt and wolf should have moved to 12,12 and 9,13 to use ZOC to prevent the cavalry from stealing Fred's village, and threaten to steal my villages in turn.

6. On the left: Without other units joining the attack it is unlikely if not impossible that the wolf could kill this fencer. Instead of attacking the fencer, the wolf should move so that it threatens to steal as many villages as possible, ideally different villages from the ones that the grunt threatens to steal. The wolf can't reach 16, 22 or 20,15 from its position on 13,18, and neither can the grunt from its chosen position. The grunt should also move to threaten as many villages as possible, meaning it should get between 14,17 and 10,19 in all likelihood.

On the right: attacking with the injured grunt from 28, 14 is risky. If you have to attack with that grunt, I would do it from 29,14 so that spearmen would have to step out on to flat in order to fight. There are no Loy units left besides spearmen if you discount the injured cavalry that will probably retreat this turn.

7. Fred correctly retreats here but fails to shield the injured archer (or the injured grunt, but that's less important). It is more important to shield injured units than to get on good terrain.

8. Fred foolishly hangs around at day, in range of a mage. His good terrain can't help him now. A massacre of Fred's units is the predictable result.

10. I now have a lvl2 unit and a 7-2 kill advantage. This game is probably over.

nelson
Posts: 91
Joined: March 19th, 2008, 11:15 pm
Contact:

Re: Exercises in Formula and Lua AI

Post by nelson » September 3rd, 2012, 11:05 pm

Here's a replay of Ron murdering Fred in an orc mirror.
2p_—_The_Freelands_replay_Ron_kills_Fred.gz
Ron kills Fred.
(20.76 KiB) Downloaded 155 times
4. Dear god, why isn't Fred ganging up on that trapped grunt? Why did the lone grunt continue on to assault the enemy village by himself? Why didn't the assassin poison the trapped grunt? Both the assassin and the grunt that are running off to assault the enemy village should be ganging up on the enemy trapped right in front of them. FOCUS FIRE!

10. Fred completely fails to reclaim villages with his two injured units on the left. HUGE MISTAKE.

11. Fred fails to reclaim villages on the left again, instead bringing units to sit without doing anything in the center.

12. Fred's wolf suicides instead of going to the rear to heal and RECLAIM VILLAGES. The injured grunt on the left moves south instead of RECLAIMING A VILLAGE.

13. Ron (blue) levels a unit and has a huge village advantage, while Fred has failed to build up a group of killers to reclaim territory. (His lvl2 orc archer would be a good killing team member if he were properly supported and not sitting injured by himself trying futilely to kill things at daytime instead of healing / holding down a village.) This game is over.

Generally, Fred should heal / reclaim villages at day and deal damage at night when possible. When dealing damage is not possible that turn, or dealing damage is suicidal, units should always reclaim villages, even at night. Even if the leader is threatened! You'd better hope the leader can take care of himself long enough for you to get your villages back so you can buy shields for your leader.

nelson
Posts: 91
Joined: March 19th, 2008, 11:15 pm
Contact:

What to work on next

Post by nelson » September 4th, 2012, 2:01 am

mattsc was telling me that he felt overwhelmed by all of Fred's problems. What should we work on next? What is the highest priority / lowest-hanging fruit?

One thing I've realized is that we can divide Fred's opponents into 3 classes:

1. Other (naive) AIs. Most (all?) other AIs are naive and Fred should be able to outsmart them, but Fred has some weaknesses. The two opponents I pit Fred against in this class are Ron (our generic rushing AI) and the default RCA AI. Since Fred regularly trounces the RCA AI, it must be over-resourced to be a challenge for Fred. Fred should be able to win consistently by using concepts, strategies and tactics that naive AIs completely ignore.

2. Noobs, aka inexperienced humans. Noobs will generally be naive like AIs, but they will be much less predictable, and human noobs can learn Fred's behavior and adapt to it over the course of a game or two, so they will be able to exploit major flaws in Fred's gameplay. They may also stumble across flaws that AIs do not reveal.

3. Pros, aka expert humans. Expert humans will almost always do the "right" thing, are creative and able to come up with clever plans that Fred cannot anticipate/understand, and can milk minor leaks in Fred's gameplay for all that they are worth. Fred's best bet is to play as unexploitable a game as possible, and hope that he gets lucky or wait for the human to make a mistake, since he will have trouble outsmarting a pro. The one disadvantage pros have is that if they have a "correct" way of playing and are too inflexible about modifying it, they become predictable and we can teach Fred "smart" responses to known tactics/strategy, allowing Fred to have a good chance of beating them if they play conventionally. We want to force pros to play in ways that they would not play against other pros (or against naive AIs or noobs), to push them out of their comfort zone and increase the chance they will make a mistake.

One disadvantage of the way I've been testing Fred is that I am a "pro" (for the purpose of this discussion) and so the problems that my games reveal with Fred are different from the weaknesses that AIs and noobs will uncover. It is also more difficult to test Fred's "pro" weaknesses and discover when they have been fixed, since it requires a pro like me to spend time and energy testing them. I think we should focus our initial energies on weaknesses that naive AIs uncover in Fred, which developers like mattsc and Alarantalara can test themselves without much effort. Then once Fred is trouncing AIs reliably, turn our attention to noob and pro humans.

Looking over the replays I've posted here, I see that some of Fred's weaknesses have been exploited by both AIs and noobs:

(A) Defending and retaking/reclaiming the NW villages. Fred frequently allows the enemy to steal/take his NW villages, and then has lots of trouble making a concerted effort to clear them. Even once he has killed the units holding his NW villages, he often fails to reclaim them, allowing the enemy to keep their income.

(B) Poisoning. Fred often misses key opportunities to poison units. This may be an overcorrection of an earlier problem Fred once had where he was far too aggressive with poisoning, putting assassins on bad terrain attackable from many hexes and in harm's way at a bad TOD. Now he will do bizarre things like abandoning a village rather than poisoning the melee unit standing right next to the village. Most importantly he won't take opportunities to poison the enemy leader. (Trapping the enemy leader would be nice too, but that's a separate issue.)

UPDATE:
(C) Putting a unit next to an empty village when an enemy can reach that village. This allows an enemy to both claim/hold the village and attack Fred's unit while benefiting from good terrain/defense and healing. Fred should force enemy units to choose between claiming/holding the village and attacking Fred's units. This can be accomplished by moving a hex or two away from the village, rather than right next to the village, even if that hex next to the village would otherwise be preferable.

However, two other recurring problems turn up more often in games against me (pro) than against noobs/AIs:

(D) Poor tactics when village stealing. Fred often (1) grabs villages that are closer to the enemy keep rather than further from the enemy keep, allowing the enemy to clean him out easier, and (2) positions village stealers incorrectly so they don't threaten to steal as many different villages as they conceivably could.

(E) Failing to fully retreat during an unfavorable TOD. This is even more important if the enemy has magic in range. Fred currently retreats until his units are on good terrain and then tries to form a line. This is bad but not completely suicidal against ordinary units, but against magic (or marksman) units that can ignore his increased defense on good terrain, this is a disaster. Generally Fred should retreat out of range of enemy units during their powerphase (for lawful factions, that's daytime), he does not want to take damage from enemy units at all at a time when battles will favor his opponent. Fred should be especially cowardly when e.g. a mage is in the field, Fred should not accept attacks from mages during daytime if it can be avoided.

I would tackle ABCDE roughly in alphabetical order, the order I listed them in. However, I would look hard at weaknesses revealed in games against AIs first and fix all of those, then weaknesses noobs reveal, and only then turn to issues mostly seen in pro games. I'd put (E) in that final category.

User avatar
Alarantalara
Art Contributor
Posts: 782
Joined: April 23rd, 2010, 8:17 pm
Location: Canada

Re: Exercises in Formula and Lua AI

Post by Alarantalara » September 5th, 2012, 11:00 pm

Here's an example game to show how an attempt to pin the enemy quickly turns into a pillaging raid, even though the opponent can do it first and more effectively. Note the actions of turn 4 and 5 on the left hand side to see what is happening.

Also, it felt much as though the attack on the right was light. I had more units defending than attacking despite sending several units left. Also, the push down on the left side of the right flank let me move my leader in directly for added power. nelson, would there be a good way to avoid that or at least force me to stop recruiting for a turn?
Attachments
2p_—_The_Freelands_replay.gz
(18.54 KiB) Downloaded 151 times

User avatar
Rigor
Posts: 941
Joined: September 27th, 2007, 1:40 am

Re: Exercises in Formula and Lua AI

Post by Rigor » September 6th, 2012, 6:35 am

i think we agreed upon an abort command "go for trapped units instead of grunt rush on the right", Fred appears like a greedy little noob who thinks he can own both sides which he cant. so how to determine for the machine its being acting "like a noob"? before i answer that question let me have a few words on that action you described. and before i ask those questions, let me tell you this is a longer strategy walkthrough where i tried to give the AI parameters which it can use to control its behaviour and actions - and you should not read it when in a hurry.

Image
Spoiler:

mattsc
Posts: 1062
Joined: October 13th, 2010, 6:14 pm
Location: Wandering, mostly aimlessly

Re: Exercises in Formula and Lua AI

Post by mattsc » September 6th, 2012, 1:40 pm

Hi Rigor, your post about abandoning the rush on the right under certain circumstances (and yes, I remember that we've said we'd do this) is very interesting timing... I've been quiet for a few days (on the forums, at least) because I've desperately been trying to get the balance of left vs. center vs. right vs. poisoning vs. ... right and it's just not been working. Yesterday, I finally decided that I need to do a pretty serious restructuring of those CAs or we simply won't be able to do the kind of thing you describe. One of the features I am building in is an easy way of changing which part of the map has higher priority given the current situation. I'm also splitting it up into rush & attack vs. retreat vs. other options, so that'll be easy to do one or the other, depending on what the best tactic is at a given time. I am in the middle of all that. Once I am done, things like abandaning the rush on the right when X happens should be (relatively) easy to implement. I hope. At that point I'll come back to what you wrote and see how to code that.
Rigor wrote:how to determine which villages are yours? for a generic approach, count X/Y coordinates from player starting position defined by the map.
A couple days ago I wrote a function that does exactly that. :) Well, I am using the closest keep to the side leader, but on a map like Freelands that's generally the same thing.

I also still owe you a reply on your WC suggestion. I looked into it a little more and while it's not super hard to do, it still requires quite a bit of changes, mostly to Ron. It's not been forgotten, but fixing Fred is more important right now, IMHO.
SP campaigns: Galuldur's First Journey (1.12 & 1.14) & Grnk the Mighty (1.10 & 1.12)
AI experiments: Micro AIs (wiki, forum thread, known/fixed bugs), Fred, AI-demos add-on

#wesnoth-dev.2018-??-??.log:< c?????> mattsc, I think you broke Vultraz.

nelson
Posts: 91
Joined: March 19th, 2008, 11:15 pm
Contact:

Re: Exercises in Formula and Lua AI

Post by nelson » September 6th, 2012, 6:54 pm

Here's a game where my Loys beat the latest bleeding-edge version of Fred. This is unreleased and we are in the middle of refactoring our code, so some things may seem a little of a step backwards.
2p_—_The_Freelands_replay_nelson's_Loys_crush_Github_Fred.gz
I kill the latest development version of Fred with Loys.
(18.93 KiB) Downloaded 151 times
I'm having trouble figuring out exactly what is wrong with Fred's rush on the right. It fails against me pretty consistently, but I'm not sure what it can do better. I think maybe we need to bias it towards attacking the outer enemies, i.e. the ones furthest from my castle, even if that means it is less likely to get a village. I think I am defending the village too heavily to be taken without killing/injuring/poisoning some units first. Grunt rushes are for getting kills too, not only for getting villages! If he can get a kill advantage and then retreat without enough units to negate his kill advantage, then that's a successful attack.

4. On the left, if the grunt and wolf attack the cavalry, they need to do so in a way that ZoCs the cavalry so it cannot run behind them and steal a village this turn. 10,12 and 12,12 might do it. If such an attack is not possible, Fred has to focus on ZoCing while advancing, not dealing damage.

Center: Bar is needed in the grunt rush on the right, don't put a unit in the center village, send him right but be prepared to pull all of your units back to "trap" and kill the fencer if it goes for the center village. We need to teach Fred to restrict the movement of skirmishers even if true trapping is not possible.

5. Fred doesn't trap on the left. Wolf should have gone on mushrooms, to prevent the fencer from benefiting from that terrain. Sadly Fred can't prevent the fencer from getting into the village, but he can prevent the cavalry from moving on to grab another village.

Center: Why is Bar going on a mountain? He shouldn't even worry about terrain, no enemies are in range and it's nighttime anyway.

Right: Fred needs to make sure his units can't be trapped, he needs a solid battle line. If he can't form a solid battle line to prevent encirclement, he needs to call off the attack and retreat, waiting for reinforcements.

6. On the right, the grunt willingly moves to 28,14 and traps himself. He should probably just flee, that archer is dead, and there can't be a good ctk on that cavalry. (is there one at all? If there was, he shouldn't have retreated that injured grunt, he should have seen whether it is needed for a kill before retreating it.)

Left: The leader should help kill the fencer, with marksman and blade damage it is one of the few units that can reliably kill fencers. You want to deal damage at night! That goes for the leader too. With the leader and two other units the already injured fencer should die.

7. Right: Moving the archer and grunt forward is a mistake. They should pull back and hold the line at Fred's villages, and try to stay out of range of my dawn damage.

8. Right: Continuing to fight at day with a mage in range is definitely a mistake. Retreat to the villages and if there is still too much damage in range, abandon the villages and keep running towards the rear / the friendly castle.

9. Right: Still attacking into a superior force at day. Although it is afternoon, Fred is badly outnumbered on this front, and I would be wary of attacking here even at night, unless reinforcements are on the way that would even the numbers out.

10. I have a 10-2 kill advantage, a lvl2 cav, and an income advantage due to mistakes on the left. This game is over.
Last edited by nelson on September 6th, 2012, 7:28 pm, edited 1 time in total.

nelson
Posts: 91
Joined: March 19th, 2008, 11:15 pm
Contact:

Re: Exercises in Formula and Lua AI

Post by nelson » September 6th, 2012, 7:15 pm

Here's Ron demolishing Github Fred:
2p_—_The_Freelands_replay_Ron_kills_Github_Fred.gz
Ron kills Github Fred.
(21.57 KiB) Downloaded 146 times
4. Fred continues with a half-ass rush on the left even though Ron is clearly setting up for an attack on the center and many units have been drawn off to defend. This is a good time to cancel your assault! If you can get the other guy to attack you, especially during your powerphase (even if it is also his powerphase), that's often better, since you'll be fighting on your home turf.

5. Ron has now committed to an attack. If there was any doubt before, now there is none, Fred must retreat and deal with the enemy in his home turf. Instead he pointlessly throws away a single lonely, outnumbered grunt in a misconceived continuation of his rush. CLEAN UP YOUR HOME BEFORE ATTACKING. Kill the closest enemies first!

6. Left: The injured wolf should not have committed suicide against an almost full-health wolf that is sitting in a village. He should have healed.

9. Left: Either attack with the injured grunt or heal it. Don't leave it sitting on flat next to a village, occupied by a unit that is about to level!

10. Center: Sending Vigor the grunt on a village-stealing expedition is a little silly while Ron is all over Fred's home turf. When dealing with an invasion, Fred needs to focus fire and get kills, which means bringing his units as close to home as possible. Vigor will only get trapped and killed, especially since Ron has assassins to wear down his HP no matter how dodgy he is. If Vigor had attacked Vriralg, the enemy grunt that is about to level, maybe it wouldn't have made it to lvl2 the next turn.

11. Fred should have taken the risk and attacked with his leader. He has resistance to blade damage, is on OK terrain, and will heal off some damage anyway, unlike other leaders that have to retreat to villages after taking damage.

12. Fred absolutely has to use his leader on the mountain at 14, 4 to kill the lvl2 wolf. It has to die before it reaches lvl3.

This game is lost.

Post Reply