Jump to content

AI-Amsterdam

Community Members
  • Posts

    19
  • Joined

  • Last visited

AI-Amsterdam's Achievements

Discens

Discens (2/14)

0

Reputation

  1. @Lexa Did you see our behaviour tree? I hope you can use some of our code so you don't have to start over We do plan on finishing ours, so it hopefully will be finished before Alpha 7
  2. Hey guys, we've improved our AI a little bit more this time. It now managed to defeat jubot on oasis as player 1 and player 2 (both greeks), and on death canyon as player 2 (iberians). We got a strange error there upon exiting though, but there was no error message unfortunately. It might still be a bit slow though, but maybe we will optimise our code some other time. Deadline is coming awfully close (about 7 hours from now, and we have to give a presentation, so an all-nighter is not an option) so we will probably stick with this for a while. Enjoy! And again, tell us what you think. Our report should be handed in tomorow (friday), so if you are quick, we could quote you in it. VICTORY IN OASIS.zip
  3. Thanks for trying our AI out. @k776 We'll fix the identation and things like that when we've finished programming. @historic_bruno Yes, the leafs under a node are also sorted on priority from left to right. If the WorkersManager is true, it will execute the code from the WorkersManager and it will not look at the other conditions of the leaves at that same level. If you want to change the priority of the leaves (or of the nodes) you just have to change the order of the children in the constructor of the node. We did write code that made the builders gatherers once they were finished building, but that wasn't working yesterday so we left it out. It does work now though And when we need builders again we pick the nearest builders next to the foundation. The condition for the EconomyManager is indeed vague, but it's hard to find a good condition for it, so now we have as a condition that it's true if one of the leaves is true. It's not really good, but we don't have much time to rearrange the EconomyManager. We've changed the GatheringManager so that it now gatherers a bit of everything and if there's an unaffordable plan, we shift a couple of workers to those resources. This is more similar to JuBot's code except that we look at the unaffordable plans too and change the weights. We did let the Citizensoldiers gather by the way. Our EconomyManager should be much more efficient now, because first we reassigned all the gatherers and now we only reassign the idle gatherers so it hopefully lags a little less now Oh and we've fixed the errors now btw. I think RootBot should attack the opponent when it has enough soldiers and siege units, but that takes a while and with the Celtics it didn't came into that node at all, because we didn't realise they had two fortresses with different names And we didn't include the defensive node, because it wasn't quite finished yet.
  4. It seems we have forgotten to include the behavior tree, heh It's a big image so here's the link; Behavior Tree However the tree is still under development, some nodes aren't implemented/included and changes are being made almost constantly. The tree might not be 100% up to date, but it should give you an idea on how it runs trough the code, and what were trying to do. Team AI-Amsterdam
  5. Sure, we are four 2nd year Artificial Intelligence students: Sander, Michael, Richard and Anna (from the University of Amsterdam). We have chosen improving the AI from 0 A.D. as our 2nd year project of 4 weeks. We found 0 A.D. when we looked for open-source games and this one was the first one on the list And we all knew Age of Empires so we thought it would be fun to make an AI for this game.
  6. Hey everyone! Thanks for helping us so far! We would like to ask you a small favor. We have to submit our code this Friday, and it would be nice if we got some input from the programmers (especially the ones involved in A.I. programming) from this forum. We have attached our code to this post, which does a few basic things (it is by no means a finished product, we are still adding things as we speak!). As you can tell by the name, our code uses behavior trees as a framework. This technique was developed for shooters, but we thought it could also be used for a real time strategy game. A behaviour tree is a tree with nodes which will constantly be traversed during the game. Each node has a condition, which decides if the node can be chosen as a child node. The children are evaluated by priority (starting with the child with the highest priority). If the condition is true, this child will be chosen, if it's not, the child with the next best priority will be evaluated. A node can also have actions associated with it, though usually only leaf nodes contain actions. When a leaf is reached the actions will be carried out, and the tree will be traversed from the root again. Would you be so kind as to answer the following questions? - Is this code easy to understand? - Is it easy to write a new module and integrate it with the existing tree? - How does this compare to the JuBot code in general? - Any ideas to improve our framework? - Anything else you would like to add? We tried running our bot via the command line on windows, but then it gave errors and warnings, while we don't have that problem if we run the game normally. Any ideas on why this is? The way locations for new buildings are picked is a bit strange (we tested primarily on the Death Canyon map), but we haven't changed the plan-building.js file so far. It would be a good idea to improve this at some point. AI-Amsterdam.zip
  7. It's definitely our intention that others can work with our AI after we've finished it. We think we've structured it better so that it's easier to change and add things now. We'll add more information this week on how it's structured. I think that the AI is playable in less than two weeks. Actually the plan is to have our AI beat JuBot by the end of this week so we could show that at our presentation. We'd love it if our AI was included in the next Alpha version.
  8. Yep, works like a charm . I think I know how to read that file now, so maybe we will ask less of this kind of questions. Is there a similar file which handles queries to the engine? @historic_bruno, where and how can we read these events? Also, we have up until now been working on windows, but we would like to do AI vs AI battles on linux. Do we have to build our whole code, or can we get away with a shortcut? Or is it possible to do an AI vs AI using windows command line? With the same query as the one on the previous page? Also, we are going to publish a part of our code (maybe today, maybe tomorow), and would like you all to rate it for the report we have to hand in this Friday. A quick look over our code would probably suffice, and we would be very thankful if you'd take the time to do that.
  9. Thanks for that link! unfortunately, both didn't work. We got the following: JavaScript warning: simulation/helpers/Commands.js line 233 Script value conversion check failed: JSVAL_IS_NUMBER(v) (got type undefined) any suggestions for what our engine call would have to look like?
  10. Well Rasunadon, as you can see they have not implemented a rock-paper-scissors algorithm, so AI world domination is still a few releases away . We have another question. Garrisoning works like a charm, but we can't seem to find the command to ungarrison units. we tried something like ungarrison: function() { Engine.PostCommand({"type": "Ungarrison", "entities": [this.id()], "target": null, "queued": false}); return this; }, but we got a message that the engine does not recognise the command. Ignoring unrecognized command type 'Ungarrison' We found a function called ungarrison in UnitAI, but this doesn't seem to work with the engine command. Please help
  11. Guess you will have to counter the units countering your units then.
  12. Thanks, we will try that. Meanwhile, we've been working on a module to attack the enemy. What we would like to know, is the following. Is there a way to see which unit has a bonus against which? For example, the infantry spearman has a bonus against cavalry units. Is there a function that does this, for example: vs(templateA, templateB){ if(templateA beats templateB) return 1; if(templateB beats templateA) return -1; return 0; } vs("units/{civ}_infantry_spearman_b", "units/{civ}_cavalry_swordsman_b") //returns 1 What we would like to do is give entities one of our soldiers is good against a higher priority to be attacked.
  13. I wasn't able to read if a unit is under attack. So I tried to define being under attack as being within the range of an enemy unit. To find the range of an enemy I tried to use the code given above, but I get an error: IID_Attack is not defined. When I searched through different codes I found that no IID_foo was ever instantiated. What's going on here? thanks in advance, team-ai
  14. @gudo: We might, but there is also a little thing called summer break ;-). We will try to document our code and make everything as clear as possible, so other people (maybe even you?) can continue our work. We have another question: For several things we would like to check how many entities exist and are queued with a certain class. For example, we would like to see how many "Melee" units we have with the role "defenders". We already tried to write something like this (borrowing some code from JuBot's gamestate): countEntitiesAndQueuedWithClass: function(theClass) { var count = 0; this.getOwnEntities().forEach(function(ent) { if (ent.hasClass(theClass)) ++count; var queue = ent.trainingQueue(); if (queue) { queue.forEach(function(item) { var x = this.getTemplate(item.template).hasClass(theClass); RootBot.prototype.chat(x); if (x) count += item.count; }); } }); return count; but that doesn't seem to work. I'm also trying to write a function that takes a role argument too, to solve the query above, by doing this, but that might be wrong for the smae reasons: countEntitiesAndQueued: function(theClass, role) { var count = 0; this.getOwnEntities().forEach(function(ent) { if (ent.hasClass(theClass) && ent.getMetadata("role") == role) ++count; var queue = ent.trainingQueue(); if (queue) { queue.forEach(function(item) { var x = this.getTemplate(item.template).hasClass(theClass); RootBot.prototype.chat(x); if (x && item.metadata && item.metadata.role == role) count += item.count; }); } }); return count; }, Oh, and what are the commands Engine.profileStart("some stuff") and Engine.profileStop() doing Again, your help would be much appreciated ;-)
  15. @Ykkrosh Thanks! Too bad the API is outdated/not complete... @Jubalbarca We're doing this as a 4 week project for our study and we're halfway now. We're using a behaviour tree so our A.I. is structured differently from yours. We'll definitely share the results when we're finished
×
×
  • Create New...