Subotai 0.9

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.
User avatar
Mandulis
Forumer
Posts: 28
Joined: Sat Mar 31, 2012 9:41 am
Location: at home

Subotai 0.9

Post by Mandulis »

Here comes the Subotai AI. Named after the famous mongolian general I will try to make it earn its name. It only plays mongols and 1vs1 matches at the moment.
Attachments
Subotai-0.9.rar
(39.89 KiB) Downloaded 81 times
Last edited by Mandulis on Wed Oct 11, 2017 1:08 pm, edited 13 times in total.

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

Re: Subotai 0.1

Post by Campeador »

You've got only two errors:
- one of your timers lacks its constant
- your TSA file should be placed in a folder called Subotai, no in the AI folder

Apart from that, it's only a thing to complete and optimize your AI. I see that you are doing the same that I did when I started, to copy the Training AI and customize it to add your own strategy. In the future you'll change the structure to make it more "yours" and stronger. Your are going in the correct path.

Welcome to the world of :head .

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

Re: Subotai 0.1

Post by Promiskuitiv »

Hey Mandulis,

welcome to our lovely community! :)


I'll happily download and criticize the next version of your AI (with the bugs fixed). :)
Creator of Promi.
Feedback is greatly appreciated.

User avatar
Mandulis
Forumer
Posts: 28
Joined: Sat Mar 31, 2012 9:41 am
Location: at home

Re: Subotai 0.1

Post by Mandulis »

I had the problem of getting endless monasteries built. I asked the guys in the chat and uploaded the script here to let them have a look. The script is horribly ripped apart as I deleted parts to find the error. The actual script looks a bit better. :)

I'll post the script, when im done with the first version. Maybe I find something smart to include.

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

Re: Subotai 0.1

Post by Campeador »

Well, in the version that you have uploaded here, it builds monasteries with a single rule:

Code: Select all

(defrule
	(building-type-count-total town-center > 1)
	(building-type-count monastery < 1)
	(can-build monastery)
=>
	(build monastery)
	(chat-local-to-self "building monastery")	
)
It haven't to be a problem if you play without the UP, because without it AIs can't buildmore more than a building of the same type at once. But with UP, using building-type-count (which only counts finished buildings) instead of building-type-count-total (which also considers buildings under construction) can cause more than a monastery at one. Until one fo them becomes finished. If in the version in your computer you have added something more then it's a different story.

User avatar
Mandulis
Forumer
Posts: 28
Joined: Sat Mar 31, 2012 9:41 am
Location: at home

Re: Subotai 0.1

Post by Mandulis »

The error was actually a different one. One of my deconst variables had a reserved name ("castle") which caused the AI to always build a monastery when it tried to build a castle. I already fixed that. The next task will be completing the castle age. There is quite some stuff to do. Although there a probably already well known ways which research to do in which order and so on, I want to find that out by myself to increase the learning effect. Let's see, how it turns out. :)

User avatar
jdstankosky
Guru
Posts: 908
Joined: Thu Nov 25, 2010 12:30 pm
Location: Florida, USA
Contact:

Re: Subotai 0.1

Post by jdstankosky »

22:11 scripter16 found the problem
22:12 scripter16 (defconst g-ranged-unit 24) ;which ranged unit to train primarily
22:12 scripter16 (defconst infantry-threat 24)
22:12 scripter16 you have 2 goals
22:12 scripter16 with the same internal id
22:12 scripter16 they are overwriting each other
Do not try to script a counter for everything. That is reactionary, and always slower than taking the initiative in battle. Decide from the start what you are going to do, and do not waiver from it. Own it.

User avatar
marathon
Waheguru
Posts: 1976
Joined: Fri May 14, 2010 2:30 pm

Re: Subotai 0.1

Post by marathon »

(defconst primary-unit archer-line) Bad
(defconst primary-unit archer) Good

User avatar
jdstankosky
Guru
Posts: 908
Joined: Thu Nov 25, 2010 12:30 pm
Location: Florida, USA
Contact:

Re: Subotai 0.1

Post by jdstankosky »

marathon wrote:(defconst primary-unit archer-line) Bad
(defconst primary-unit archer) Good
This is also my opinion, but scripter told him it'd be fine this way.
Do not try to script a counter for everything. That is reactionary, and always slower than taking the initiative in battle. Decide from the start what you are going to do, and do not waiver from it. Own it.

User avatar
Mandulis
Forumer
Posts: 28
Joined: Sat Mar 31, 2012 9:41 am
Location: at home

Re: Subotai 0.1

Post by Mandulis »

marathon wrote:(defconst primary-unit archer-line) Bad
(defconst primary-unit archer) Good
Why's that so? I tried both and both worked fine syntax wise. But I am always ready to follow advice from the scripting veterans. B)

I'll upload the script again soon. Currently I am working on the basic structure. I want the script to have the right layers of decision making and to pursue it's own strategy for now. Adapting to the enemy and optimizin things (like spreading units and stuff) will come in step by step.

Maybe one of you could give me a hint if my plan is total rubbish or actually doable. My idea was to have a main script which handles everything that is not related to a specific strategy. It does the defconst stuff, the resign rules, taunting and trading. It also contains the decision making which is done in several layers. Layer one is scouting. Layer two is the analysis of the enemies possible strategy out of the scouting and the current circumstances (which age is everybody in and so on). The third layer defines my own strategy out of the enemy's strategy and the current situation. Here I will load the corresponding strategy script. Each strategy script will do the fourth layer. It decides on the primary melee and ranged unit I will build. The strategy script also contains the research and building rules as well as attack conditions.

Threat evaluation and training of units is put into the main script. Each unit will be trained out of three reasons only:
- it is my current primary unit
- it is the right unit for a certain threat which is currently active
- it is a subsitute unit (light cav when we want knights but are low on gold or so)

What I am trying to do here is to keep the training rules simple and short. Building and research rules should also be quite short. Of course the decision making has to be more complex to achieve this. I hope that the script will be quite modular in this way. Adding a new strategy would only involve the right detection and a separate script for building and research.


Probably I did only come to conclusions many already had before me, but you never know. :ph34r: So can this be viable or is it rather stupid?

Post Reply