EggPlant AI ramblings

For AI and campaign script related discussions and questions
User avatar
Emdek
Regular
Regular
Posts: 1329
Joined: 24 Jan 2010, 13:14
Location: Poland
Contact:

Re: EggPlant AI ramblings

Post by Emdek »

aubergine, this is a way to go, just needs test for performance (like animating that way 100 units at once). ;-)
You can get some inspiration for API here (lots of material to analyze):
http://qt-project.org/doc/qt-4.8/animat ... rview.html
Nadszedł już czas, najwyższy czas, nienawiść zniszczyć w sobie.
The time has come, the high time, to destroy hatred in oneself.


Beware! Mad Qt Evangelist.
User avatar
Giani
Regular
Regular
Posts: 804
Joined: 23 Aug 2011, 22:42
Location: Argentina

Re: EggPlant AI ramblings

Post by Giani »

How is the AI going?
My maps: http://forums.wz2100.net/viewtopic.php?f=10&t=9501
User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Re: EggPlant AI ramblings

Post by aubergine »

The AI is going slow at the moment. I've hit a bit of a brick wall in terms of dynamic research - I can easily make it research random stuff, but I want it to research stuff in a more intelligent manner than that. I'm currently taking a brain distraction and doing some videos http://www.youtube.com/playlist?list=PL ... ature=plcp
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: EggPlant AI ramblings

Post by NoQ »

May i have a word? Just some trivial thoughts.

Even though this nullbot thing of mine may be relatively strong, you shouldn't really bother with beating it in play strength. On the other hand, your focus on a transparent and well-designed code base is something i can't dream of (because of being a poor coder), but once the fundamental code is done, i could easily feed the existing well-tested data (strategy definitions) into it and thus make it as strong as i currently can. In this case, nullbot will die, having fulfilled its primary purpose of being a quick and dirty experimental proof-of-concept piece of code (hence the name), and i'll be really happy about that.

Am i right to understand the process going on here this way? (:
_________

About dynamic research ... when i added 5-way research adaptation to nullbot, the heart of the algorithm used is called the adaptation matrix. It could have been a matrix in your common mathematical sense (a linear operator transforms a vector of game situation describing numbers into a vector of decision priorities), but it turned out to be a non-linear operator at the end (but the word "matrix" still sounds cool, so i think i'd keep it).

For example, suppose we have two-dimensional adaptation: we take the number of enemy tanks and cyborgs on the board and want to find out how many AT and AP weapons we need. Let x be a vector (x1,x2), where x1 is the number of tanks and x2 is the number of cyborgs. Let y be a vector (y1,y2), representing our decision: we need to pick AP research in y1 cases and AT research in y2 cases out of y1+y2. Then if we pick a simple adaptation matrix

Code: Select all

    / 0   1 \
A = |       |
    \ 1   0 /
and let y=Ax, we will have an adaptation method: AP:AT research ratio will be equal to borg:tanks ratio. This might be suitable for MG/Rockets AI, but MG/Cannons AI (that uses cannons as AT weapons) might prefer another matrix:

Code: Select all

     / 0   2 \
A' = |       |
     \ 1   1 /
considering the fact that cannons work better against cyborgs than rockets do. That second adaptation matrix will make AI not stop researching cannons even when no tanks are present on the board. That's not really good. So there is certain freedom in picking the adaptation matrix, and it's not obvious which one is the best.

The same idea can be applied to adapting production ratios.

Well, i'm not saying anything non-trivial, that's just some sort of clarity that i'm relying on since recently.
User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: EggPlant AI ramblings

Post by NoQ »

The other idea is to make a priority queue of "research exceptions", which is a series of statements similar to the following:
- If we have seen an enemy cyborg for the first time, research TMG with prioirty 3;
- If we were just attacked by enemy nexus link turret, research nexus resistance with priority 2; /*we will still research tmg first*/
- If we were just attacked by an enemy VTOL or seen an enemy VTOL factory, research hurricane with priority OVER9000;
- If nothing in particular, research laser satellite with priority 1;
etc.

Maybe the whole AI could be made of exceptions?
User avatar
Giani
Regular
Regular
Posts: 804
Joined: 23 Aug 2011, 22:42
Location: Argentina

Re: EggPlant AI ramblings

Post by Giani »

NoQ wrote: Maybe the whole AI could be made of exceptions?
That would make him better than many human players and nullbot :)
My maps: http://forums.wz2100.net/viewtopic.php?f=10&t=9501
User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: EggPlant AI ramblings

Post by NoQ »

Giani wrote:
NoQ wrote: Maybe the whole AI could be made of exceptions?
That would make him better than many human players and nullbot :)
So certain are you =/ The real question is how much readable the code will be.
User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Re: EggPlant AI ramblings

Post by aubergine »

Priority based research / building / etc., is certainly a key design factor in EggPlant - almost everything uses prioritised lists.

The big problem I have with research is that currently it's not possible to write code that works out what to research based on game state without ending up with very crufty code.

It's why I started the project to try and find a way of representing the tech tree in a big spreadsheet which would define more detailed info and categorisation for each research item. If I ever manage to finish that task and then convert the data in to JSON format, so it can easily be included in to an AI, then the code that interfaces with it will be very clean and readable, although perhaps non-transparent because it won't be clear from reading the code what it will research (because that is actually defined in-game by the actions of your opponents).
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
User avatar
dak180
Trained
Trained
Posts: 288
Joined: 01 Nov 2009, 23:58
Location: Keeper of the Mac Builds

Re: EggPlant AI ramblings

Post by dak180 »

aubergine wrote:It's why I started the project to try and find a way of representing the tech tree in a big spreadsheet which would define more detailed info and categorisation for each research item. If I ever manage to finish that task and then convert the data in to JSON format, so it can easily be included in to an AI, then the code that interfaces with it will be very clean and readable, although perhaps non-transparent because it won't be clear from reading the code what it will research (because that is actually defined in-game by the actions of your opponents).
I am not sure if this will help you any but my understanding is that the stats for wz were (when being originally developed by pumpkin) represented as a full on database for the purpose of editing and were subsequently exported to text files in order to allow for easier modding and reading at run time.
User:dak180
Keeper of the Mac Builds
User avatar
Rman Virgil
Professional
Professional
Posts: 3812
Joined: 25 Sep 2006, 01:06
Location: USA

Re: EggPlant AI ramblings

Post by Rman Virgil »

aubergine wrote:It's why I started the project to try and find a way of representing the tech tree in a big spreadsheet which would define more detailed info and categorisation for each research item. If I ever manage to finish that task and then convert the data in to JSON format, so it can easily be included in to an AI, then the code that interfaces with it will be very clean and readable, although perhaps non-transparent because it won't be clear from reading the code what it will research (because that is actually defined in-game by the actions of your opponents).
dak180 wrote:I am not sure if this will help you any but my understanding is that the stats for wz were (when being originally developed by pumpkin) represented as a full on database for the purpose of editing and were subsequently exported to text files in order to allow for easier modding and reading at run time.
That is correct. It was built in MS Access db. The lead software engineer / designer burned a copy on CD and mailed it to us from their game dev studio in Bathe, England, in October 1999..

The running joke back then was that they got it to us (with a bunch of other useful stuff) just in time for us to carve up pumpkins for Halloween. ;)
.
.

Impact = C x (R + E + A + T + E)

Contrast
Reach
Exposure
Articulation
Trust
Echo
.
cue
Trained
Trained
Posts: 59
Joined: 06 Nov 2011, 00:12

Re: EggPlant AI ramblings

Post by cue »

Good work!

Looking forward to bashing the life out of your EggPlant AI with my friends :twisted:
cue
Trained
Trained
Posts: 59
Joined: 06 Nov 2011, 00:12

Re: EggPlant AI ramblings

Post by cue »

@aubergine are you stopping this one?
I see you are busy with NullBot.
User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Re: EggPlant AI ramblings

Post by aubergine »

I'm learning a lot looking at the NullBot code and it's making me think a lot about the best approach for EggPlant.

I think the first part of EggPlant that I'm going to try and get finished in the VAULT module that keeps track of game objects. If that works OK then the rest should be relatively straightforward to implement. Main blocker on VAULT is my complete lack of RegEx knowledge so if there are any RegEx gurus around please let me know :)
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
User avatar
Emdek
Regular
Regular
Posts: 1329
Joined: 24 Jan 2010, 13:14
Location: Poland
Contact:

Re: EggPlant AI ramblings

Post by Emdek »

Regular expressions?
Maybe this documentation will help you (pattern rules in JS should be at least very similar):
http://qt-project.org/doc/qt-4.8/QRegEx ... troduction

Though I see that they are very limited there...
http://www.regular-expressions.info/javascript.html
Nadszedł już czas, najwyższy czas, nienawiść zniszczyć w sobie.
The time has come, the high time, to destroy hatred in oneself.


Beware! Mad Qt Evangelist.
User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Re: EggPlant AI ramblings

Post by aubergine »

I'm completely befuddled when it comes to regex. :(
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
Post Reply