Jump to content

AI Wishlist


Recommended Posts

  • Replies 54
  • Created
  • Last Reply

Top Posters In This Topic

I'll start us off. :S

I'd like an AI editor, with built-in debug tools, meaning you don't have to rely on notepad.

I'd also like ways of declaring and using variables.

It'd also be good to allow logical comparisons on game commodities, e.g:

food-amount 1 greater-than player-population 1 (where the 1 refers to the player whose food and population are being checked.

Also, error logging would be good, maybe saving to a error data file.

Another nice addition would be that of saving the AI at the same time as saving the game. This would mean that if you had variables defined etc. then their contents would be saved too, rather than having to check for a reload, then reassign the variable contents.

That's it for now, I'll keep thinking. B):P


Link to comment
Share on other sites

i want the AI to do all the things a Human player can do (garrison Buildings, repair Buildings, perform all the commands a Human player can asign to a unit, oput hem in Groups and give them a Formation and/or behave)

(and maybe more B) say a Human can define per strg+1(1-9) Groups - the CP can define a greater Amount of Groups. - and of course add Units to a group, remove them from a group - and so on)

I also want the computer be able to move Units around the Map to a certain Location (ok - thats already covered by "i want to CP can do all the Things a Human can do"),

and that the AI has the Tools to make this in a senseful way, so that the scripter (the scrpter script an AI for a RM-Map without knowing WHERE the AI start, WHERE the enemies are, where "the Hill" is and so on -

the scripter need to be able to determine all this -

ye more comfortable ye better of course -

getting the cooordinates is one thing, (and already helps a lot, also needed: counting objetcs in a certain Area (defined by a Point and a Radius))

of course this is very general -

i weould like to have an IDea how the AI-LAnguage will/could look like - what are the Basic Parts of it ?

Will it be "Rules" that go through each Pass, or whatever ?

Link to comment
Share on other sites

so i want a lot of individual control, but ONLY if i want to do it.

On the other HAnd it shoul dbe able to set a few Parameters to determine which Buildings should be repaired when damaged, by what Villagers, -

if towers should be garrisoned, by which UNits, in which Cases

and so on.

EDIT: I am surely willing to help on Design (and Test B) ), but not programming :S

Link to comment
Share on other sites

The AI editor is probably a no. There are many text editors you could use and some allow you to define syntax highlighting with a configuration file. As for debugging, this would be implemented into the game engine itself. I wanted to put less emphasize on a script debugger and more emphasize on an informative error handler though. If the script can send you notices/warnings without failing unless it was a critical bug, you have a better chance of figuring out what's wrong. It would even help find logical bugs that aren't obvious, but you'd like to know about them. :S Logical operators would come in the form of >, <, >=, <=. There is no reason to create keywords for something like that as AOK did.

Could you try to explain what you mean by storing variables? What variables would you store?

I was thinking that the AI can maneuver by choosing a point based object placement. If your patrolling unit saw these miners, you could have the AI move somewhere within the range of that area. Counting objects is also an important way to consider your plan of action. I think your idea is implemented best just as you described it. Do you think choosing a point based on where friendly/enemy objects are would be effective enough?

I can't exactly show you how the AI will look because it's too early. I also don't want to move the conversation towards the actual language yet and just keep it as an ideas thread :P.

"so i want a lot of individual control, but ONLY if i want to do it." Don't we all? B). The plan is to use a constraint-based system which I won't explain in detail at this time which allows you to choose units depending on information about them such as "garrison 6 of the closest idle civilians to tower" or "garrison the 6 civilians to the closest tower". Things like building a tower near a resource by the gatherers themselves becomes possible with little effort. You know who you want to do your tasks, all we have to do is make sure you can pick them without keeping track of specific units.

About what he means when it comes to storing errors. There are more than 1 type of error. There is the error that prevents the script from running, an error that doesn't do what you thought it would, and errors that occured externally such as not enough system resources or couldn't load a needed file. So, you need to keep track of them all the most important being the errors that don't do what you thought it would. These logic errors are very hard to find when it comes to AI.

Link to comment
Share on other sites

Logical operators would come in the form of >, <, >=, <=. There is no reason to create keywords for something like that as AOK did.

AOK has also the ">, <, >=, <=" beside the Key-Words - and believe me, no (expierienced) Scripter use the Keywords B)

btw, these operators were not the point of his statement - he would like to be able to compare things with each other

Instead of making 100`s of Rules comparing the Values like this

players-population < 15

food-amount >= 15


players-population < 16

food-amount >= 16


players-population < 17

food-amount >= 17


food-amount > players-population

(this is not cvorrect AOK-"Slang" but i guess you know what i mean

an error that doesn't do what you thought it would

the most important being the errors that don't do what you thought it would.

These logic errors are very hard to find when it comes to AI.

No need to chec these, the scripter has to search his script for logical errors -

how to determine what the Player want to do anyway -

if i ask

"enemy-unit < 13"

and i wanted

"enemy-unit > 13"

how to determine what i wanted to do ? Thats impossible - and anyway not needed

Link to comment
Share on other sites

btw, mabuse... thx for specifying that... yes you could compare functions with eachother directly.

"how to determine what i wanted to do ? Thats impossible - and anyway not needed"

To determine that, we could log the decisions and actions the AI made sorta like a movie script of what happened during a game. You could then use it to find things that you find wrong... like why did it go for so much wood if it needed to make cavalry type things B).

Link to comment
Share on other sites

  • 3 weeks later...

ah, another Thing came to my Mind.

of course it is difficult to talk about something we not know how the scriptlanguage wil owrk finally or look like.

so i can only show what i mean in AOK-scripting (or something that is similar)


In AOK every Unit has a certain ID-Number.

You can ask

(unit-type-count archer < 4)


(unit-type-count 4 < 4);4 is ID of archer

then there are "-lines" that include all the Units that can be trained in this "-line" like Archer, Crossbow, Arbalest

and finally GROUP-Numbers that include ALL UNits that are "ranged foot soldiers" for example.

Now what i wanted to ask:

Is it perhaps possible to "store" several Values within one Variable for example with

(defgroup TROOPS 100, 22, 456, 238 ...)

And then i can ask

(unit-type-count TROOPS >= 30)

and create my own Group-ID (and decide which ID they should include) ? :(


hehe, but then again, i could also count all these manually and add them :)

Provided the language allow me to do this

Link to comment
Share on other sites

Speaking also from AOK perspective...

It seems apparent that AI's are more powerful when the basic framework is provided and the scripting community is able to develop itself. In AOK many commands/facts are used (effectively) in ways that the programmers may not have anticipated. Much control can be given and yet the scripting still be accessible to newcomers if levels of complexity are structured : a simple example - newcomers tell their army to attack - experienced scripters specify only land unit to attack...others specify archers only to attack etc..

Along these lines aok enables us to count how many archers are in your amy but does not enable to give specific commands to these. Instead the entire army must be addressed as a whole.

Directional commands would be great - eg. Attack closest enemy or attack the enemy my ally tells me to

- Build a tower at the front(north) limit of my town or at the west side etc.

Anyway.. an interesting project... well done !

Edited by Koalaface
Link to comment
Share on other sites

  • 1 month later...

Threat Assessment == Situation Assessment

from aiscripters forum


QUOTE (Mabuse @ Oct 19 2005, 01:09 PM)

to assess a threat the scripter does not need more to know than to count units of certain types within a certain area - nothing more.


Btw, thats of course not all :)

we also would like to know which equipment (upgrades) the enemy units have, which time the enemy is in and so on.

in AOK we have thee things to determinate things about the nemy -

















the ability to detect certain reerches of the enemy (the ones you could detect in some ways) could be also useful

in dimensions of 0ad - man more things would come up -

the next Step:


let us not call it "threat"-Assessment -

better descibe it as:


then we need much more Informations:

(from AOK)




























































































And of course many, many more related to all the new Commands we will get with 0ad.

I could now list up a bunch of things related to the things i suggested in several Threads (at aiscripters), but this would not make much sense, snce i don`t know if these commands are used, or whatever

Only my Comment so far, in AOK are a lot things missing

And we scripters can tell you something about.

I would like to see the first Suggestions how the Scripting Language will look like, which Commands it has and so on. If there are some so far.

Link to comment
Share on other sites

and he will probably not as happy as ypu to see this, as it is just copied from AOK-AI. :D:)

however, these are the most basic things we need in every Case. all the other things will be important also.

because of the fact, that an [advanced] AI scripter invest much time to try to assess situations of many kinds - for example how to determinate that the enemy plays a certain strategy, or you look at a Test-Game and thnk if NOW the AI would do this and that it would be "so cool".

then you first have to assess the situation and try to describe it with the commands that were given to you.

so somthing like "threat-asessment" is somethng we do all the day.

So a good start would be the commnds we already have in AOK, but there will be a bunch more of them, that also dependsa lot on the "actions" an ai can execute.

so if i can move units to a certain pont, i must be able to determinate ist currnt position, determinate units withina certain are, determinate the current task a Unit has, determinte the stance a certain unit has, determinate which units (of which area) should join a certain group - all that position stuff for groups .

... etc etc etc ...

and much more - i could make a list with "fictional commands" - but i doubt that make much sense.

Link to comment
Share on other sites

  • 3 weeks later...
  • 3 weeks later...

can you specify what you mean by unit emotion and how it would apply to a game like 0AD? If it's a consistent reaction, it would work in an RTS game, if it's a random reaction, it would ruin the balance.

The way it`s used in LOTR BFME, as fas as I know (I`ve ony seen trailers, and never played the game) It`s mainly animations and sound. For example ik 2 armies face eachother on the battlefield, the units (who stay in their formation an on their place) start shouting an making sound with their weapons and shields. Or if a big troll (ok, in 0 a.d. ehr.. well, some other terifying unt) get`s near them, the units start hiding behind their shields and maybe even slowly start walking backwards. Or if one`s army is beeing slaughtered and only few untis are left, they run away (while sh*ting their pants :D )

P.S. sorry for the late reply :P

Edited by Vingauld
Link to comment
Share on other sites

  • 1 month later...

Hi !!!!

realizing the Danger of getting on your Nerves (ope that makes some sense in english) i just ask about some Progress or just a kind word like "everything is alright" :P

i think it is not too easy what you are aiming on and though i am sure that "too many cooks will ruin the soup" (or something like this :P) - i am of course willing to give suggestions or judge about some things (to judge is fun :) - )

also of course of interest is how the scripting-language (if there is one) wil look like -

something like

- "it will look like Javascript" makes no sense for me as i don`t know "Javascript"

so if somebody could slowly introduce the syntax of the language and maybe present some Ideas -

well, i would find that entertaining -

of course nothing need to be complete or something, just few notes etc etc

and we ask then stupid things - that would be nice :o

Link to comment
Share on other sites

Javascript is just a simple general-purpose programming language (it's a full programming language, unlike AOK's rule system, although we will have some way to create "rules"). I'm not sure exactly what AI code will end up looking like, but if you want to have an "edge" when you start you can try learning programming using Python or web programming with PHP or JavaScript (all three of these should be fairly easy to pick up and have lots of examples available on the web; for PHP you need web hosting though). Basically if you understand programming concepts like variables and functions, many of which already sort of exist in AOK, you'll be fine. It will certainly be possible to do the things you can already do in AOK (which are basically if something -> do something), and you will be able to do some other things as well, like remember stuff in variables, do more interesting mathematical calculations, etc.

Link to comment
Share on other sites

Well everyone here seems to be talking bout coding AIs, how about some sort of flowchart for non programmers? I mean stuff like dragging out if food lower than X then do X etc, it would make for simpler programming of the AI.

And what about a learning AI?

This would mean that you never have to program a specific AI with tactics etc, just play against it.

However the real benefiot of a learning AI would be tactics adaption. Whenever I play an AI I can use the same tactic time and again - when I play my brother (a human ;)) I have to keep coming up with new tactics to evade the defences he has built against my old tactics.

Edited by martin
Link to comment
Share on other sites

I haven't really been working on this stuff for a good 2-3 months, but I do plan to incorporate some learning into the AI if I'm smart enough to figure out how it should be done :D. I need to finish up some personal projects before I dive back in though.

And as Matei said, we don't really know how it'll look like until it's almost done because things change over time. If I have anything to do with it, it'll be easy to work with though ;).

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...