Page 9 of 13

Re: BruteForce AI

Posted: Sat Jan 30, 2016 9:14 am
by TheLightEmpire1
Toast, here is a bug or some bugs, when the boar is outside of arena walls, it doesn't delete one wall, so the boar dies outside, will delay brute quite a lot with the walking vills. And adds tc's way too late which will delay boom and imp time. Other than that, everything else seems okayish :P

Re: BruteForce AI

Posted: Thu Feb 04, 2016 2:20 am
by CheeseOnToast
Not sure how to really do the wall delete thing for boars, (still a UserPatch script kiddie) but I'm sure if I s̶t̶e̶a̶l̶ browse about I will find something to work with. :devil
Will look into improving Arena some more.

Re: BruteForce AI

Posted: Sat Feb 06, 2016 12:13 pm
by Esty
Hello, I am new scriptor, working hard to try to understand all those scaring codes.
But i am improving step by step thanx to this great website.

I read in your update 2-10-3c that u made your AI (bruteforce) able to place his mining-camp where you want him to build :

Fixed a bug where BruteForce sometimes places its first mining camp for gold on stone.

Actually i have the same problem ; i want it to be placed on gold, it makes it the most of the time on gold but sometimes its placed on stone <_< .how did u solve this bug ?

One more question relative to the same problem :
When in castle-age i want to make a town-center in that way :

Code: Select all

(defrule
	(current-age == castle-age)
	(resource-found stone)
	(and	(building-type-count town-center > 2)
		(building-type-count town-center < 4))
	(can-build town-center)
	(up-pending-objects c: town-center < 1)
=>
	(build town-center)
	(set-strategic-number sn-allow-adjacent-dropsites 1)
	(set-strategic-number sn-town-center-placement mining-camp)
	)
I want my TC to be built on stone. But he will be placed randomly on stone or gold...
Is it fixable ?

Sorry for my not great english ; I hope i am understandable.

Re: BruteForce AI

Posted: Sat Feb 06, 2016 2:00 pm
by _II2N_
The TC has to be forced on stone:

Code: Select all

(defconst gl-point-x 101)
(defconst gl-point-y 102)

(defrule
   (current-age == castle-age)
   (resource-found stone)
   (building-type-count town-center == 3)
   (can-build town-center)
   (up-pending-objects c: town-center < 1)
=>
   (up-get-point position-self gl-point-x); Get point of home TC
   (set-strategic-number sn-focus-player-number 0)
   (up-set-target-point gl-point-x); Set focus around home TC
   (up-reset-search 1 1 1 1)
   (up-reset-filters)
   (up-filter-distance c: -1 c: 30); No minimum distance to home TC, maximum distance 30 tiles
   (up-find-remote c: stone-mine c: 1)
)

(defrule
   (up-set-target-object search-remote c: 0); Found stone -> set it as target-object
   (current-age == castle-age)
   (resource-found stone)
   (building-type-count town-center == 3)
   (can-build town-center)
   (up-pending-objects c: town-center < 1)
=>
   (set-strategic-number sn-allow-adjacent-dropsites 1)
   (set-strategic-number sn-town-center-placement mining-camp)
   (set-strategic-number sn-placement-zone-size 5)
   (up-get-point position-object gl-point-x)
   (up-set-target-point gl-point-x)
   (up-build place-point 0 c: town-center)
)
At the end of each rule pass you must ensure that target-point is correct until the TC is placed (so that target-point still focuses the TC around stone and not elsewhere).

Re: BruteForce AI

Posted: Sat Feb 06, 2016 2:06 pm
by Esty
Thank you so much for the fast of your answer. This is really smart. I'l right now test it. :)

Re: BruteForce AI

Posted: Sat Mar 12, 2016 1:31 am
by scripter64
Oh hi, CheeseOnToast :) :)
Thanks, ER!

Re: BruteForce AI

Posted: Sat Mar 12, 2016 5:26 am
by CheeseOnToast
scripter64 wrote:Oh hi, CheeseOnToast :) :)
Thanks, ER!
ER is amazing :D :D :D :D :D

Re: BruteForce AI

Posted: Sat Mar 12, 2016 9:50 am
by Promiskuitiv
What happened? :D

Re: BruteForce AI

Posted: Sat Mar 12, 2016 12:06 pm
by CheeseOnToast
Promiskuitiv wrote:What happened? :D
ER changed my old name from "SausageBread" to "CheeseOnToast" for me lol

Re: BruteForce AI

Posted: Sat Mar 12, 2016 1:22 pm
by Promiskuitiv
7 i didn't even notice, nice! :D