Crusade AI Project

Upload your latest creations here.
Please note that by posting comments to posts in this forum you forfeit your personal copyright on whatever you post. AI Scripters reserves the right to re-use objective comments in script reviews without requiring the posting author's permission. Credit, where appropriate will be given in such cases.
Post Reply
User avatar
THE RULER
Guru
Posts: 655
Joined: Sat Feb 20, 2010 10:55 am
Location: FRG
Contact:

Re: Crusade AI Project

Post by THE RULER »

your UP script spams mining camps, Camp.!
It's poison and it's blood and big fire, big burn - into the ashes and no return

User avatar
Campeador
Waheguru
Posts: 1340
Joined: Mon Nov 01, 2010 8:11 am
Location: Spain

Re: Crusade AI Project

Post by Campeador »

In which moment?

I remember that I had that problem in the past in the late game when gold/stone were finished for 1.c, and later for UP when I added the chance to build two or more camps at once. I imagine that I resolved it in a moment that I don't remember for my next version, but it should be nice to know the circumstance in which Crusade suffers it to pay attention in my tests.

User avatar
THE RULER
Guru
Posts: 655
Joined: Sat Feb 20, 2010 10:55 am
Location: FRG
Contact:

Re: Crusade AI Project

Post by THE RULER »

it's like you said. seems it hadn't been solved as you thought.
it keeps TSA quite busy lol and I also plan a building spamming strategy - all is allowed in war hihi
It's poison and it's blood and big fire, big burn - into the ashes and no return

User avatar
Campeador
Waheguru
Posts: 1340
Joined: Mon Nov 01, 2010 8:11 am
Location: Spain

Re: Crusade AI Project

Post by Campeador »

Argh! I still suffer it in very loooong games.

Here my rules to build mine camps. I have the (dropsite-min-distance gold/stone < 255) in all of them, so I don't understand the reason, but perhaps other scripter yes:

Code: Select all

; Quick gold camp for FC strategies before than extra lumber camps
(defrule
	(goal G-FEUDAL-STRATEGY GV-FC-ARCHERY)
	(building-type-count-total mill >= 1)
	(building-type-count-total lumber-camp >= 1)
	(resource-found gold)
	(cc-players-unit-type-count 0 GOLD-MINE > 0) 
	(dropsite-min-distance gold > 3)
	(dropsite-min-distance gold < 255)
	(can-build mining-camp)
 =>
	(build mining-camp)
	(chat-to-player my-player-number "43") ; Taunt TA-GOLD-MINING
)
More rules about other things. Later

Code: Select all

; Goals G-GOLD-MINING and G-STONE-MINING are useful to avoid mining camps until the selected strategy requires them.

(defrule
	;(strategic-number G-AGE-STATUS >= GV-ADVANCING-TO-FEUDAL)
	(taunt-detected my-player-number TA-STONE-MINING)
	(resource-found stone)
	;(or	(current-age >= castle-age)
	;	(building-type-count-total mining-camp < 4)
	;)
	(cc-players-unit-type-count 0 STONE-MINE > 0) 
	(dropsite-min-distance stone > BUILDING-DROP-DISTANCE)
	(dropsite-min-distance stone < 255) ; To avoid infinite stone camps with stone exhausted
	(can-build mining-camp)
=>
	(build mining-camp)
	;(set-goal G-BUILDING 0)
)

(defrule
	;(strategic-number G-AGE-STATUS >= GV-ADVANCING-TO-FEUDAL)
	(or	(taunt-detected my-player-number TA-GOLD-MINING)
		(and	(and	(goal G-FEUDAL-STRATEGY GV-FC-ARCHERY)
				(building-type-count-total mill >= 1)
			)
			(and	(building-type-count-total lumber-camp >= 2)
				(building-type-count-total mining-camp < 1)
			)
		)
	)
	;(or	(unit-type-count MALE-GOLD-MINER > 0);Male gold miner
		;(unit-type-count FEMALE-GOLD-MINER > 0))  ;Female gold miner 
	(resource-found gold)
	;(or	(current-age >= castle-age)
	;	(building-type-count-total mining-camp < 4)
	;)
	(cc-players-unit-type-count 0 GOLD-MINE > 0) 
	(dropsite-min-distance gold > BUILDING-DROP-DISTANCE)
	(dropsite-min-distance gold < 255) ; To avoid infinite gold camps with gold exhausted
	(can-build mining-camp)
=>
	(build mining-camp)
	;(set-goal G-BUILDING 0)
)


; More camps if dead miner. Based in Echidna's rule for extra lumber camps
(defrule
	(or	(wood-amount > 375)
		(or	(unit-type-count MALE-DEAD-MINER > 0)
			(unit-type-count MALE-DEAD-MINER > 0)
		)
	)
	(or	(taunt-detected my-player-number TA-GOLD-MINING)
		(taunt-detected my-player-number TA-STONE-MINING)
	)
	(building-type-count-total mining-camp < 4)
	(dropsite-min-distance gold < 255) ; To avoid infinite gold camps with gold exhausted
	(up-pending-objects c: mining-camp < 1)
	(can-build mining-camp)
=>
	(build mining-camp)
	;(set-goal G-BUILDING 0)
)

User avatar
Finaldeath
Guru
Posts: 961
Joined: Tue Mar 27, 2012 6:02 am

Re: Crusade AI Project

Post by Finaldeath »

Might be there are still pockets of gold or stone on the map, but unreachable by placing camps - such as behind an enemy base. Adding a increasing delay between camp placements, especially if the camp does not return a lower dropsite-min-distance for either resource, would be the best solution; possible in 1.0c I think to do this.
Finaldeath

Writing a set of tutorials - My own AI is super secret development!

User avatar
Campeador
Waheguru
Posts: 1340
Joined: Mon Nov 01, 2010 8:11 am
Location: Spain

Re: Crusade AI Project

Post by Campeador »

I've added a timer for late game mining camps (only for UP, I have 10 busy timers for 1.c :head ). After a test with a very long game (two hours) it seems that it resolves the problem partially. Still useless new mining camps but only every 30'', so they sometimes are even built in correct places.

I've also reduced drastically my TLS problems, which can be quite annoying in 2v2 since I use attack-groups+TSA. Again only for UP. <_< So it seems that I'll be more foused in UP in my next versions.

User avatar
THE RULER
Guru
Posts: 655
Joined: Sat Feb 20, 2010 10:55 am
Location: FRG
Contact:

Re: Crusade AI Project

Post by THE RULER »

Promi 1.3 has same problem - under pressure ( no gold mine ) it spams camps all across the map, but not next to a pile, so min dist is always true.
I don't know why the camps aren't placed correctly next to a pile.
It's poison and it's blood and big fire, big burn - into the ashes and no return

User avatar
Promiskuitiv
Waheguru
Posts: 1364
Joined: Thu Nov 10, 2011 1:07 pm

Re: Crusade AI Project

Post by Promiskuitiv »

THE RULER wrote:Promi 1.3 has same problem - under pressure ( no gold mine ) it spams camps all across the map, but not next to a pile, so min dist is always true.
I don't know why the camps aren't placed correctly next to a pile.
Yeah, i'm also trying to fix that problem. :/

User avatar
Finaldeath
Guru
Posts: 961
Joined: Tue Mar 27, 2012 6:02 am

Re: Crusade AI Project

Post by Finaldeath »

Campeador: what is TLS?

Also, camp placing is...not great. You can find more from Bani's tutorials but even that doesn't reflect all cases - ie; when both resources are in range of your maximum dropsite distance, or one has run out and the other is still within the dropsite distance...

http://aocai.ninja-web.net/tutorial/expert02.html

Possibly, and this might help, but it is part of my everlong "to test sometime" list is to run the build command but set the dropsite max distance to 0 or 1 to see how it changes it. To be honest I think it is just buggy in-game logic that is causing it, and something like "sn-must-place-dropsite-within" which forces build to fail if the dropsite area cannot be reached would be better.
Finaldeath

Writing a set of tutorials - My own AI is super secret development!

User avatar
Promiskuitiv
Waheguru
Posts: 1364
Joined: Thu Nov 10, 2011 1:07 pm

Re: Crusade AI Project

Post by Promiskuitiv »

Finaldeath wrote:Campeador: what is TLS?
Tower-love-syndrome or something like that. ^^ When villagers attack enemy towers.

You mean Bari the creator of 'Kosmos'? Didn't know he wrote tutorials, nice. (:

Post Reply