You must be logged in to post messages.
Please login or register

General Discussions
Moderated by Maffia, LordKivlov, JimXIX

Hop to:    
Welcome! You are not logged in. Please Login or Register.38 replies
Age of Empires III Heaven » Forums » General Discussions » AI wars
Bottom
Topic Subject:AI wars
« Previous Page  1 2  Next Page »
B_V war lord
Skirmisher
posted 03-15-06 02:31 PM EDT (US)         
creit to plexiq.look in tread new and impoved ai.....

A great idea AI vs AI games to see who can make the best AI a great chance for AI moders to show how good they are and to get new people to make AIs for the game( just 2-3 AI at the moment).

AuthorReplies:
Tigger_Bounce
Skirmisher
posted 03-15-06 03:47 PM EDT (US)     1 / 38       
umm dude this has been posted like 30000000000 times and it happened in AOK so it is prob going to happen unless an AOE:4/Aoe:3 Xpack

Eso Name For AoeIII: GL_Chewy 2nd Lt. for now...PR 21
I play TWC
plexiq_
Skirmisher
posted 03-15-06 04:59 PM EDT (US)     2 / 38       
Id still love to participate in an AI wars tourney. But there would need to be at least a hand full of ai-modding-teams to make this fun.

Not sure if there are enough people interested in smthg like that.

jabelar
Skirmisher
posted 03-15-06 06:58 PM EDT (US)     3 / 38       
Well, it is definitely a good way to evolve the AI (by pitting them against one another). It's hard to tell how many people would be interested/good enough to participate though. Felix is the only one who has contributed a significant AI so far.
tster123
Skirmisher
posted 03-15-06 07:31 PM EDT (US)     4 / 38       
if their was an official contest I would most certainly enter.
ultimitsu
Skirmisher
posted 03-15-06 08:27 PM EDT (US)     5 / 38       
I dont know if i am missing something, how do you get the source code of aoe to program AI?
tster123
Skirmisher
posted 03-15-06 10:27 PM EDT (US)     6 / 38       
you surely do not get the source code for the engine that runs the game. however, the AI is simply a script and you surely do get the script because scripts aren't compiled they are simply run by the engine.
Felix Hermansson
Skirmisher
posted 03-16-06 03:47 PM EDT (US)     7 / 38       

Quote:

Well, it is definitely a good way to evolve the AI (by pitting them against one another).

I doubt that, actually. I think it would help the AI scripters get better, but not the scripts themselves. The best way to win this kind of tournament would probably be to write an AI which concentrates on taking advantage of inherent AI weaknesses, but something like that would fail horribly against a human player.

Tigger_Bounce
Skirmisher
posted 03-16-06 03:52 PM EDT (US)     8 / 38       
umm the normal AIs unedited just go al defencive and i seriously think that a modded AI is better than a normal AI you prob can do it by sitting in his tc

Eso Name For AoeIII: GL_Chewy 2nd Lt. for now...PR 21
I play TWC
plexiq_
Skirmisher
posted 03-16-06 04:04 PM EDT (US)     9 / 38       

Quote:

I doubt that, actually. I think it would help the AI scripters get better, but not the scripts themselves. The best way to win this kind of tournament would probably be to write an AI which concentrates on taking advantage of inherent AI weaknesses, but something like that would fail horribly against a human player.

Of course, its easier to exploit inherent weaknesses atm. But if those events are run on a regular basis, the worst weaknesses should be fixed soon - and scripts would actually start to improve vs humans too.

Btw, we already did a "full" rewrite of the aoe3 ai (only ~5% of the code left from ES). Of course, our project has several huge flaws too, but i think most are quite different from the standard AI's flaws.

What im trying to say:
If you only exploit the standard AI's flaws, that wont work very well vs user-written AI's. And if you abuse specific flaws from other authors, they will work hard to fix them until the next tourney, etc...

I think this kind of competition could really help a lot to improve the ai's, in the long run.

Felix Hermansson
Skirmisher
posted 03-16-06 04:30 PM EDT (US)     10 / 38       

Quote:

If you only exploit the standard AI's flaws, that wont work very well vs user-written AI's.

I'm not talking about flaws in the scripts, but in the game code itself. Example: Shooting at a single villager will usually cause all villagers to run for cover, even if the attacker presents no real danger. This behaviour is defined in the game code somewhere, there is no way to change that in the AI script.


Quote:

I think this kind of competition could really help a lot to improve the ai's, in the long run.

No doubt it would. But as I said, it would do so by improving the scripters, not by producing usefull AIs for human vs. AI games.


Btw, I'd like to be proved wrong for both points I just made...

tster123
Skirmisher
posted 03-16-06 04:40 PM EDT (US)     11 / 38       

Quote:

I'm not talking about flaws in the scripts, but in the game code itself. Example: Shooting at a single villager will usually cause all villagers to run for cover, even if the attacker presents no real danger. This behaviour is defined in the game code somewhere, there is no way to change that in the AI script.

that statement is definitially wrong. the AI script tells those villagers to run away. if it was inherent game code then when you got raided your own villagers would run away... but as is they don't.

Quote:

No doubt it would. But as I said, it would do so by improving the scripters, not by producing usefull AIs for human vs. AI games.

a usefull AI vs. humans would have fewer of those holes that you can currently take advantage of. to make an AI that was better than most other AIs you would most certainly want to attack those holes and yet also fix those holes in your own script. then after a couple rounds you'll stop attacking those holes and look for new ones. eventually there will be less holes left and therefor a better AI.


Quote:

Btw, we already did a "full" rewrite of the aoe3 ai (only ~5% of the code left from ES). Of course, our project has several huge flaws too, but i think most are quite different from the standard AI's flaws.

who is we? I have a hard time believing that you have done that. the two main AI files are over 10,000 lines each. however, if you did do it then good job... is there any chance that you are going to make it an open source project?

plexiq_
Skirmisher
posted 03-16-06 05:01 PM EDT (US)     12 / 38       

Quote:

who is we? I have a hard time believing that you have done that. the two main AI files are over 10,000 lines each. however, if you did do it then good job... is there any chance that you are going to make it an open source project?

We = Christoph Hermann (he s not gaming online) and myself. We did that for an uni course in AI. Was over 200 work hours per person -_-

At the moment, i do not have the permission to publish the whole code. (Also, it has to be ported to retail version, we were using the AoE3 beta and there were several changes from beta->retail) If i get started w/ AoE3 ai programming again, i ll definitely try to open some of the source.

We wrote a bunch of data structures (avl-tree based sets/maps) and math functions (log/exp/sin/cos/etc), i gues those could be of good use for others.

[This message has been edited by plexiq_ (edited 03-16-2006 @ 05:02 PM).]

Elpea
Hal
(id: lp_usa)
posted 03-16-06 05:03 PM EDT (US)     13 / 38       

Quote:

i gues those could be of good use for others.


Oh, most definetely.

tster123
Skirmisher
posted 03-16-06 05:47 PM EDT (US)     14 / 38       
damn that's a lot of work for 1 course! was it 3 credit hours?


I wonder if there is a way to make a script play for you on ESO. that would be most intense to write a script that was good enough to compete at least at the noob level and just have it quicksearch all day to level your cities.

[This message has been edited by tster123 (edited 03-16-2006 @ 05:49 PM).]

plexiq_
Skirmisher
posted 03-16-06 06:42 PM EDT (US)     15 / 38       

Quote:

damn that's a lot of work for 1 course! was it 3 credit hours?

Course was worth 19.5 ECTS. (Dont know how that translates to non-european systems -_-)

About lettings scripts play on ESO: Would be very cool for testing, of course. But there s no way we could do that without ES' help. (And i gues its hard to control cheating once you allow ai scripts online.) I dont think we ll be able to do that

tster123
Skirmisher
posted 03-16-06 07:02 PM EDT (US)     16 / 38       
OK, that's like a 10-12 hour course. sounds likes a good project.
Felix Hermansson
Skirmisher
posted 03-17-06 02:51 AM EDT (US)     17 / 38       

Quote:

that statement is definitially wrong. the AI script tells those villagers to run away.

If you kow that, you must have reviewed the complete AI script code just as I did, right? I must have overlooked this function then. Can you tell me where it's located?


Quote:

if it was inherent game code then when you got raided your own villagers would run away... but as is they don't.

Of course they don't - since this code parts are only active when an AI player is in control. Military upgrades e.g. are the same: There is no rule or function for those in the AI script, but the AI gets them anyway. This doesn't mean that a human-controlled player automatically researches them as well. The way the AI plays is only partly controlled in the AI script, there are at least two more "control" levels: The one I just mentioned and which doesn't affect a human player, and then the one which makes e.g. settlers automatically gather from nearby crates, or military units choose their targets, which is active for the human player as well.

plexiq_
Skirmisher
posted 03-17-06 03:33 AM EDT (US)     18 / 38       

Quote:

If you kow that, you must have reviewed the complete AI script code just as I did, right? I must have overlooked this function then. Can you tell me where it's located?

I pretty sure you can work around this automatic garrison "feature". I can remember changing something related to the town-bell behaviour...cant remember exactly tho.

Quote:

Of course they don't - since this code parts are only active when an AI player is in control. Military upgrades e.g. are the same: There is no rule or function for those in the AI script, but the AI gets them anyway.

The UnitPicker handles the military upgrades for the standard ai. You can research them "manually" too.

Actually - you can do almost anything by AI script, that you can do manually as a player. However, some things are a bit tricky to achieve.

Anyway, could the people who are interested in participating please state that here?

So we can all get an impression of how many ppl we are talking about. I gues 5-10 "teams" would be like the minimum, wont be fun w/ less.

PS: Dont get too scared when looking at the standard AI scripts. Most of the script is taken up by civ/map preferences, chat handling and teamplay stuff. In a competition you would most likely only program for 1v1, given map, chosen civ - so, loads of the standard AI code will be irrelevent for AI wars.

[This message has been edited by plexiq_ (edited 03-17-2006 @ 03:34 AM).]

Felix Hermansson
Skirmisher
posted 03-17-06 05:00 AM EDT (US)     19 / 38       

Quote:

I pretty sure you can work around this automatic garrison "feature". I can remember changing something related to the town-bell behaviour...cant remember exactly tho.

I'm always willing to learn. Can you try to remember, or look it up somewhere?


Quote:

The UnitPicker handles the military upgrades for the standard ai.

You're sure? It handles the units the AI trains, but I didn't find anything about upgrading them in there, say, like the econUpgrades rule.


Quote:

Actually - you can do almost anything by AI script, that you can do manually as a player. However, some things are a bit tricky to achieve

If that's true, that would be great. Did you manage to get things like building repair, explorer ransoming, unit healing, factory production or even levy to work? If so, how? (Maybe we should take this part of the discussion over to the design section?)


Quote:

In a competition you would most likely only program for 1v1, given map, chosen civ - so, loads of the standard AI code will be irrelevent for AI wars.

I thought the long term goal was to improve the AI's overall performance, to make it a feasible opponent for a human player? Then what good would an AI be which only knows how to manor boom on a Texas map with the British?

Don't get me wrong, it would still be fun for the people participating, but I doubt it would lead to an overall improved AI. (Though someone might be able to patch something together from the participant's scripts afterwards.)

Anyway, it'll be interesting to see the results.

Strong Man
Skirmisher
posted 03-17-06 05:04 AM EDT (US)     20 / 38       
1. How many player each AI controls? 1v1, or 2v2? Paying tributes allowed?

2. Map type specific?

3. How many rounds in each match? 1? 3? or 5?

4. Prize?

5. Any rehearsal? Eg. two of us send our files to a moderator for running, and we watch the recorded games, see the level of people's work and think about how our AI scripts should be written.

PS.
6. Card decks?


In case I don't see ya, good afternoon, good evening and good night!

[This message has been edited by Strong Man (edited 03-17-2006 @ 05:09 AM).]

plexiq_
Skirmisher
posted 03-17-06 05:25 AM EDT (US)     21 / 38       
@Strong Man:
I think this stuff should be discussed when we find enough people to participate. But to keep things as simple as possible in the beginning, id suggest 1v1 with a fixed map(?) (and AI is allowed to pick a given civ).

About the administrative stuff, its too early to discuss now, i gues. With the low number of participants, im pretty sure we ll be able to agree on some modus. As for prices...maybe ES gives us some gimmicks like t-shirts? Im sure i can get some small prices, but dont expect anything big, heh.

@Felix
About UnitPicker: Yes, im sure. I think we disabled that function and chose the military upgrades "manually".

I can remember getting ransoming+levy to work. But there was still much work left - building TCs w/ the explorer was one problem that i remember. But we were working on the beta version of aoe3 - im sure some of those problems are quite easy to fix now.

Anyway, i gues we should keep this thread related to the competition.

About improving the ai vs players:
If people plan to do advanced changes to the standard ai, its just too much work to test all maps/civs/teamplay combinations. Id rather suggest every competition gets fixed settings, so testing is less painfull. (After running a few 1on1 competitions on different maps, one could finally switch to 2on2 mode...thats not a big problem)

So, this should still result in an improved ai vs humans. For the first few runs, fixing the main AI loopholes would be the #1 priority anyway. Those are pretty much the same for all maps/civs - so, this work would certainly contribute a lot towards making a better overall ai.

Anyway, we should discuss the mode once we know who s interested.

PS: Here s the ransom-related code
Note that this snipplet used loads of user-written functions, so - u d need to change the resource reservation thingie. Should still give you a decent idea how it works (or at least: worked in beta) (btw: I ve no idea where that 42 in the ransomExplorer-Call came from -_- didnt comment anywhere, heh. And it seems ransoming had a cost of 200.0 back then ^^)


static int explorerReservationID=-1;
if(kbGetAge()>cAge2 && aiGetFallenExplorerID()>=0)
{
if(kbResourceGet(cResourceGold)<200.0 && explorerReservationID<0 && kbUnitGetHealth(aiGetFallenExplorerID())>0.8)
{
explorerReservationID=5000+aiRandInt(999999);
reserveResources(gNonPlannerEscrow, explorerReservationID, createResourceArray(200.0,0.0,0.0));
}
if(kbResourceGet(cResourceGold)>=200.0 && kbUnitGetHealth(aiGetFallenExplorerID())>0.9)
{
aiRansomExplorer(aiGetFallenExplorerID(),gNonPlannerEscrow,42);
registerResourceUsage(200.0,0.0,0.0);
if(explorerReservationID>=0)
{
reserveResources(gNonPlannerEscrow, explorerReservationID,-1);
explorerReservationID=-1;
}
}
}

[This message has been edited by plexiq_ (edited 03-17-2006 @ 05:38 AM).]

Felix Hermansson
Skirmisher
posted 03-17-06 05:37 AM EDT (US)     22 / 38       

Quote:

I can remember getting ransoming+levy to work.

Can I get that code piece (or a quick explanation) by email?

plexiq_
Skirmisher
posted 03-17-06 05:39 AM EDT (US)     23 / 38       
I knew u were going to ask for that, but was too slow w/ edit, lol. About levy: Actually, i just noticed that the Beta Standard AI had a levy-rule in it. That was actually one of the few functions that we re-used (except for the resource handling).

Levy still seems to be included in retail, line 5004+ in aiMain. Note that there seems to be an Error with the enemyCount/allyCount calculation - asuming the cPlayerRelationEnemyNotGaia already excludes Gaia units. (I think this player relation didnt exist back in beta.)

[This message has been edited by plexiq_ (edited 03-17-2006 @ 05:58 AM).]

tster123
Skirmisher
posted 03-17-06 11:12 AM EDT (US)     24 / 38       
is there some documentation out there that tells how to write AI scripts that interact with the game engine? I'd love to write an AI, but I don't have the time to figure this out just by studying the AI scripts. I'm taking 18 credit hours/semester and haven't the time for a 200 hour project
plexiq_
Skirmisher
posted 03-17-06 12:48 PM EDT (US)     25 / 38       
Hm, the xs system is quite easy to learn. CaptainKidd (i think it was him) posted some basic documentation for AoM AI scripting. Most of the calls remained unchanged. The guide should be somewhere in the modding forums.

For the new aoe3 functions, we just have the name+parameter list without an description, but most of the stuff is quite intuitive.

But i gues i can write a short intro to the xs system. If you know any c-like language its quite straightforward anyway. (Well, there are some nasty pittfalls...)

Just for a short summary, (propably) interested ppl atm:
tster, Felix, Strong Man, myself

EDIT, Link to AoM AI Tutorial:
http://aom.heavengames.com/downloads/showfile.php?fileid=2774

[This message has been edited by plexiq_ (edited 03-17-2006 @ 12:55 PM).]

« Previous Page  1 2  Next Page »
You must be logged in to post messages.
Please login or register

Hop to:    

Age of Empires III Heaven | HeavenGames