Page 5 of 8

Re: Cruzada

Posted: Sat Dec 13, 2014 2:31 am
by Campeador
Thanks. Another question.

I've watched in tests that Barbarian uses TSA for the "main" attacks, leaving DUC just for small raids. The Horde uses DUC dodging tower fire by retreat and a new route. What more AIs do you recommend me to study DUC? Kunyi has one that uses it well, but it's designed for PIDM, so it could be interesting in RM for late game, but I don't know if also for flushes.

Re: Cruzada

Posted: Sat Dec 13, 2014 11:44 am
by Campeador
Eternal DUC problem resolved. I've made a GRAFCET with conditions to change from TSA into "different" states of DUC. I say "different" because both DUCs behave the same, but the conditions to change from/into TSA are different.

It seems that my AI changes TSA/DUC viceversa ok. The only (and new) problem is that the retreat-now command executed when an attack finishes doesn't work now. So survivors from a battle can be hunted by enemy army easier. I think that the reason is here:

Code: Select all

(defrule
	(up-compare-goal g-attack c:!= gv-no-attack)
	(population < 190)
	(up-compare-goal g-military-superiority c:<= gv-military-weaker)
=>
	(set-goal g-attack gv-no-attack)
	(up-reset-search 1 1 1 1)
	(up-reset-filters)
	(set-goal g-tsa 0)
	(up-reset-unit c: -1)
	(up-retreat-now)
	(set-strategic-number sn-number-explore-groups 1)
	(set-strategic-number sn-total-number-explorers 1)
)
Could it be that up-reset-unit which avoids retreat? Exploration is also finished, which is an additional problem.



Apart from that I've added a code from Promi and The Horde, I don't remember which of them :P. It's to get lost gaian sheep if detected.

Other improvements like an earlier castle market and better eco balacement in castle age. By better I mean that it's still horrible, but less than before. :lol:

Re: Cruzada

Posted: Sat Dec 13, 2014 5:20 pm
by Promiskuitiv
Campeador wrote:Apart from that I've added a code from Promi and The Horde, I don't remember which of them :P. It's to get lost gaian sheep if detected.
My two rules for that are based on Archon's code (credits given) anyway, so it doesn't really matter from which AI you got it there. 11

Nice to see you making good progress so far! :)

Re: Cruzada

Posted: Sun Dec 14, 2014 11:18 am
by scripter64
For retreating, try (up-update-targets) after reducing TSA town size to ensure that a subsequent retreat command isn't ignored before the next turn.

Re: Cruzada

Posted: Sun Dec 14, 2014 11:20 am
by Campeador
After a few tests, I've watched that my attack system selects DUC and TSA as desired, but it has two problems:

- If enemy tower fire detected it retreats with not stop. Although I know the reason. It's because in the condition I've typed that the timer has to be running instead of not running. I'll just change a character in a line next weekend to resolve it. :rolleyes:

- My DUC turns with no stop from send my soldiers to attack and freeze them. The reason is that I send them to their targeted camp with no stop, every scan cicle. I made DUC rules so because otherwise I sent the units that I had already created but not the new trained ones. Any idea about how to do it?

Re: Cruzada

Posted: Thu Dec 18, 2014 9:09 am
by Campeador
I've thought a possible solution to avoid my DUC up-sending soldiers every scan cicle. But I don't know if it can be implemented. It should be to select just the new created units which haven't yet been affected by up-sendxx command. Perhaps using a filter to include just the new ones or to excluded the old ones.

Is it possible? If yes, how could I do it?


An alternative should be using a timer to use up-send every X seconds instead of every scan cicle, or when new military units detected. But it had had the problem that it should still reduce the performance of the already soldiers. And with the X seconds per cicle it also should introduce a small delay for the new units.

Any third solution?

Re: Cruzada

Posted: Thu Dec 18, 2014 4:40 pm
by scripter64
I think it might be possible if you exclude units with actionid-move and orderid-attack. It may require looping through each unit independently if you also need to avoid explorers, etc. II2N may know of a reliable way to do this while avoiding excessive complexity.

Re: Cruzada

Posted: Sat Dec 20, 2014 4:11 am
by Campeador
Nice! Both problems are resolved now, improving my battle behavior.

Next question. How can I set my soldiers into defensive stance? I think that it's really easy with up-set-attack-stance when I use TSA. The problem is that when I do it with DUC my archers go into enemy's base... until they fire something in their path. Then they don't march any more, staying in their position unless they find new target near to them. So I have my first archers in the middle of the map, unless they didn't find wolves or enemy soldiers in their path, and reinforcements stay at base because their previous mates have fired something.

It's easy to resolve with agressive-stance. But then archers don't use hit&run tactics so they fight better.

Re: Cruzada

Posted: Tue Dec 23, 2014 3:05 pm
by Campeador
Cruzada updated again.

It's more completed but it has a problem with my DUC commands. I don't know the reason, but when it destroys enemy army and starts DUC, my soldiers just attack enemy buildings and units which are near to them. If they have to walk too much to destroy something they don't do it.

I would like to resolve this by two reasons:

a) Improve battle performance, sending complete enemy's to battle even with DUC. And finish at once "defeated" enemies. Otherwise they could reborn or get time limit in AI tournaments.

b) Walking is a healthy exercise. I don't want unfit people in my kingdom. B)

Re: Cruzada

Posted: Wed Dec 24, 2014 1:55 am
by scripter64
Targeted (target-player set) 255 town size TSA works well to finish in most cases. If the enemy has no buildings visible, then adding more explorers can help to find them. DUC will not find enemy units (non-buildings) after they've gone back into the fog for more than 2 seconds.