Page 9 of 10

Re: myAi

Posted: Wed Jan 09, 2019 3:37 pm
by the1unknown
thanks scripter, i will take a look on how my ai will perform now

maybe a strategy would be to wall, lock gates, boom, make skirms/archers/mongonels and sit close to walls
got to imp -> open gates- >play

Re: myAi

Posted: Fri Jan 11, 2019 7:25 pm
by LightTree
How I miss that style of play (aka the human player that used to play like that) :( :(.

Re: myAi

Posted: Sat Jan 12, 2019 3:37 am
by scripter64
Would that person like 8+ layer walls and mini-towns across the map? :')

Re: myAi

Posted: Sat Jan 12, 2019 5:53 am
by the1unknown
I see if the ai loses most of his base and if ai will relocate his town center, it will keep walling his old base if part of the walls were broken.

going with scripter's idea, would be interesting to see ai making multiple town centers across the map and walling each base.

more even interesting would be walling with many layers of wall . Is this connected to town-size ?

I have done some experiments on your childrens and I saw pharaon walling with 2 layers, but with few tiles distance between them

https://ibb.co/R6bPhgY

PS: no one was hurt during this experiment!

Re: myAi

Posted: Sat Jan 12, 2019 6:06 am
by scripter64
The walls placed by the original "build-wall" commands are precalculated as the game starts, so they won't adapt to new town positions later on. The "up-build-line" command can be used to place custom walls (and other buildings) at specific positions on the map.

Re: myAi

Posted: Sat Jan 12, 2019 6:32 am
by the1unknown
I understand. So this is how ulysses managed to do that forward wall

I posted few months ago a pic with uly doing some forward random 1 tile wall in my base

Any ideas why pharaon made 2 lines of walls ?

one was set in dark age and second one was started in feudal. Is the only ai that made walls(palisade walls) in dark age, other ai wound't do palisade walls in dark age

Re: myAi

Posted: Sat Jan 12, 2019 9:56 am
by the1unknown
is there a command for enemy-found ?

For my DM Ai I first used the

Code: Select all

(defrule (true)
=> (attack-now) )
But it seems that military units start to freeze and move back and forth 2-4 tiles until my ai found enemy base/enemy units.

( I hope is not other script that causing the freeze problem)

If there's no code for enemy-found , then I will add

Code: Select all

(defrule (players-building-type-count any-enemy house> 0)
barrack , stable, archery, lumbercamp , tc and so on
=> (attack-now) )


(defrule	(players-unit-type-count any-enemy villager> 0)
	eagle, monk, UU, scoutline and so on
	=> (attack-now

Re: myAi

Posted: Sat Jan 12, 2019 10:35 am
by Promiskuitiv
You should be able to use players-building-count any-enemy >= 1 and for attack groups / attack now also players-unit-count any-enemy >= 1. Replace any-enemy by target-player in case you use sn-target-player-number for that purpose already. :)

Re: myAi

Posted: Sat Jan 12, 2019 11:33 am
by ER
And try not to use attack-now on every rules pass, it is very expensive on processor time. Consider using a timer or something to add a delay between each attack now.

This might be improved on UP, but before that in 1.0(c) you could literally beat other AIs by spamming attack-nows as it chowed all the processor time as it is an asynchronous operation, leaving not much processor time for the enemy. It also led to very jerky movement, etc.

Until you get more used to other methods of attack, I guess you could still use attack-now.

Re: myAi

Posted: Sat Jan 12, 2019 1:21 pm
by scripter64
Yes, in addition to what ER said, attack-now flood can cause your own units to rapid retask, which may lead to them becoming unable to actually hit even nearby targets properly in some cases.