[UP]Miniman
- Lazarus
- Guru
- Posts: 555
- Joined: Sun Jan 22, 2012 12:02 pm
- Location: Someplace in the United States
Re: Miniman AI(UP)
One little improvment that I made: I changed the defconst pro to 1 instead of three. I'll update the version soon.(Soon meaning when I feel less lazy)
Time to learn all the new things is too much so probably not scripting
-
- Forumer
- Posts: 71
- Joined: Wed Mar 17, 2010 5:44 am
Re: Miniman AI(UP)
I'd like to highjack your thread for a minute.
You know what, this is a good opportunity to ask about a certain thing that has always bugged me. I've learned a great deal the last weeks and my AI is coming along nicely, yet there is one thing I dont understand when looking at other scripts. Let's take yours for example:
Most people start of by making the defconst list. Now the normal use of defconsts is clear to me, something like (defconst darkagevillagernumbertofeudalage 28).
I just dont understand what THIS is, where I get this from and how it works: (taken from your ai)
;--------------------------------------
; Define ProjectileType Constants
;--------------------------------------
(defconst projectile-town-center 0)
(defconst projectile-castle 1)
(defconst projectile-watch-tower 2)
(defconst projectile-bombard-tower 3)
(defconst projectile-ship 4)
(defconst projectile-siege 5)
(defconst projectile-fortification 6)
(defconst projectile-any 7)
;--------------------------------------
; Define EscrowState Constants
;--------------------------------------
(defconst escrow-included 0)
(defconst escrow-deducted 1)
;--------------------------------------
; Define PlacementType Constants
;--------------------------------------
(defconst place-normal 0)
(defconst place-forward 1)
;--------------------------------------
; Define TargetPriority Constants
;--------------------------------------
(defconst priority-offense 0)
(defconst priority-defense 1)
;--------------------------------------
; Define FindPlayerMethod Constants
;--------------------------------------
(defconst find-attacker 0)
(defconst find-random 1)
(defconst find-closest 2)
Where do people get these kind of defconsts from? I take it they are actual ingame functionalities, not made up substitutes for numbers. I mean I've read through a lot of stuff by now, but I never came across ingame constants like find-closest. It doesn't matter what they are defconsted as; do I understand that right? They just have to be defconsted as anything to be used in the script?
I just thought that defconsts were always words made up by the scripter, that serve as substitute for another thing. That's what puzzles me... Also does this stuff come from AoC or UP?
You know what, this is a good opportunity to ask about a certain thing that has always bugged me. I've learned a great deal the last weeks and my AI is coming along nicely, yet there is one thing I dont understand when looking at other scripts. Let's take yours for example:
Most people start of by making the defconst list. Now the normal use of defconsts is clear to me, something like (defconst darkagevillagernumbertofeudalage 28).
I just dont understand what THIS is, where I get this from and how it works: (taken from your ai)
;--------------------------------------
; Define ProjectileType Constants
;--------------------------------------
(defconst projectile-town-center 0)
(defconst projectile-castle 1)
(defconst projectile-watch-tower 2)
(defconst projectile-bombard-tower 3)
(defconst projectile-ship 4)
(defconst projectile-siege 5)
(defconst projectile-fortification 6)
(defconst projectile-any 7)
;--------------------------------------
; Define EscrowState Constants
;--------------------------------------
(defconst escrow-included 0)
(defconst escrow-deducted 1)
;--------------------------------------
; Define PlacementType Constants
;--------------------------------------
(defconst place-normal 0)
(defconst place-forward 1)
;--------------------------------------
; Define TargetPriority Constants
;--------------------------------------
(defconst priority-offense 0)
(defconst priority-defense 1)
;--------------------------------------
; Define FindPlayerMethod Constants
;--------------------------------------
(defconst find-attacker 0)
(defconst find-random 1)
(defconst find-closest 2)
Where do people get these kind of defconsts from? I take it they are actual ingame functionalities, not made up substitutes for numbers. I mean I've read through a lot of stuff by now, but I never came across ingame constants like find-closest. It doesn't matter what they are defconsted as; do I understand that right? They just have to be defconsted as anything to be used in the script?
I just thought that defconsts were always words made up by the scripter, that serve as substitute for another thing. That's what puzzles me... Also does this stuff come from AoC or UP?
- Finaldeath
- Guru
- Posts: 961
- Joined: Tue Mar 27, 2012 6:02 am
Re: Miniman AI(UP)
That is from User Patch: http://forums.aiscripters.com/viewtopic.php?f=3&t=2318
Download it and in the compressed file you'll find a UserPatchConst.per - this is it, copied into his file. Basically it is the numbers the game (Currently at least - I'd hope they get added eventually, some have!) doesn't recognise internally for the UP functions.
For instace place-normal and place-forward are just 0 and 1, and the input into (up-build inConstPlacementType inGoalEscrowState typeOp inOpBuildingId). There are more examples of the functions here: http://forums.aiscripters.com/viewtopic.php?f=3&t=2591
Download it and in the compressed file you'll find a UserPatchConst.per - this is it, copied into his file. Basically it is the numbers the game (Currently at least - I'd hope they get added eventually, some have!) doesn't recognise internally for the UP functions.
For instace place-normal and place-forward are just 0 and 1, and the input into (up-build inConstPlacementType inGoalEscrowState typeOp inOpBuildingId). There are more examples of the functions here: http://forums.aiscripters.com/viewtopic.php?f=3&t=2591
- Lazarus
- Guru
- Posts: 555
- Joined: Sun Jan 22, 2012 12:02 pm
- Location: Someplace in the United States
Re: Miniman AI(UP)
Which is how for (up-get-player-fact my-player-number unit-type-count villager g-some-goal) I used defconsts to turn it into
(up-get-player-fact bopbeepboop blahblahblah noobs gg)
bopbeepbop is defconst my player number,
blahblahblah is the same as the value of the defconst unit-type-count-villager(NOT DEFCONSTED AS THE COMMAND)
noobs is villager
gg is just the goal name.
(up-get-player-fact bopbeepboop blahblahblah noobs gg)
bopbeepbop is defconst my player number,
blahblahblah is the same as the value of the defconst unit-type-count-villager(NOT DEFCONSTED AS THE COMMAND)
noobs is villager
gg is just the goal name.
Time to learn all the new things is too much so probably not scripting
- Lazarus
- Guru
- Posts: 555
- Joined: Sun Jan 22, 2012 12:02 pm
- Location: Someplace in the United States
Re: Miniman AI(UP)
Ok, uploaded version with changed constant.
Time to learn all the new things is too much so probably not scripting
-
- Waheguru
- Posts: 5891
- Joined: Fri Jan 16, 2009 8:36 pm
Re: Miniman AI(UP)
lol that's quite an edit! You can probably shrink it even more by eliminating UP defconsts that you don't need
- Lazarus
- Guru
- Posts: 555
- Joined: Sun Jan 22, 2012 12:02 pm
- Location: Someplace in the United States
Re: Miniman AI(UP)
I could, but they make it more unreadable
Time to learn all the new things is too much so probably not scripting
- Finaldeath
- Guru
- Posts: 961
- Joined: Tue Mar 27, 2012 6:02 am
Re: Miniman AI(UP)
Still too readable
Perhaps also do a true minified version; remove all whitespace, rename all constants and so forth as single-letters.
Would be a nice variation?
Also the first version you did (or fixed version of it?) couldn't win against the default AI when I tried it - it managed to only rush when the petersen AI was in castle age, hehe. Was quite funny watching it though, it did destroy the TC then had it's TC destroyed by 3 swordsmen in return.
Perhaps also do a true minified version; remove all whitespace, rename all constants and so forth as single-letters.
Code: Select all
(defconst a 1)(defrule(true)=>(build-unit a))...etc
Also the first version you did (or fixed version of it?) couldn't win against the default AI when I tried it - it managed to only rush when the petersen AI was in castle age, hehe. Was quite funny watching it though, it did destroy the TC then had it's TC destroyed by 3 swordsmen in return.
- Campeador
- Waheguru
- Posts: 1340
- Joined: Mon Nov 01, 2010 8:11 am
- Location: Spain
Re: Miniman AI(UP)
I think that Lazarus only want to make a script with the least number of rules, not space.
The record for the smallest and shortest AI submitted in a tournament is the Chicken AI. Two rules one line:I made after to read it other PIDM Hun AI with a single rule and a single line which sometimes beated the Standard AI, but Chicken uses even less characters.
Chiiiicken!
The record for the smallest and shortest AI submitted in a tournament is the Chicken AI. Two rules one line:
Code: Select all
(defrule(true)=>(build stable)(set-strategic-number sn-number-explore-groups 1))(defrule(game-time > 7)=>(train knight-line)(train hussar)(attack-now))
Chiiiicken!