Jump to content

qBot (yet another AI)


Recommended Posts

Some more warnings and bugs I found just now (using latest svn qbot):

WARNING: JavaScript warning: simulation/ai/qbot/attackMoveToLocation.js line 93 reference to undefined property this.path[0][0]

WARNING: JavaScript warning: simulation/ai/qbot/attackMoveToLocation.js line 93 reference to undefined property this.path[0][1]

WARNING: JavaScript warning: simulation/ai/common-api/utils.js line 3 reference to undefined property b[0]

WARNING: JavaScript warning: simulation/ai/common-api/utils.js line 4 reference to undefined property b[1]

WARNING: JavaScript warning: simulation/ai/qbot/attackMoveToLocation.js line 216 reference to undefined property this.path[0][0]

WARNING: JavaScript warning: simulation/ai/qbot/attackMoveToLocation.js line 216 reference to undefined property this.path[0][1]

ERROR: JavaScript error: simulation/ai/qbot/attackMoveToLocation.js line 93 TypeError: this.path[0] is undefined ([object Object],[object Object])@simulation/ai/qbot/attackMoveToLocation.js:93 ([object Object],[object Object],[object Array])@simulation/ai/qbot/military.js:586 ()@simulation/ai/qbot/qbot.js:103 ([object Object])@simulation/ai/common-api/base.js:92 @:0

ERROR: JavaScript error: simulation/ai/qbot/attackMoveToLocation.js line 93 TypeError: this.path[0] is undefined ([object Object],[object Object])@simulation/ai/qbot/attackMoveToLocation.js:93 ([object Object],[object Object],[object Array])@simulation/ai/qbot/military.js:586 ()@simulation/ai/qbot/qbot.js:103 ([object Object])@simulation/ai/common-api/base.js:92 @:0

qbottreasurehunt.jpg

This treasure is very close to the AI's starting base on Peloponnese, but it caused some lag.

qbotarmystuck.jpg

The AI managed to get stuck sending it's attack force towards my base. This caused a lot of lag. Not sure what can be done to prevent that.

Link to comment
Share on other sites

no LOS restrictions etc

This is true, they don't have LOS restrictions yet, so they can attack buildings and units not yet explored, which I think is mostly a technical issue rather than a deliberate cheat. My hope is that our AIs get good enough so as to be competitive with our best players, without cheating, and then we can let them cheat if needed for an extra challenge (and dumb them down for easier levels).

Link to comment
Share on other sites

I would say that it uses the no LOS to cheat a bit at the moment. Basically it uses it to measure your army strength and uses this to affect how many troops it trains and when it attacks. There are no resource benefits though.

Pureon: I fixed the first one by stopping qBot for trying to gather those kinds of treasure. The second is more tricky, I might be able to sort something out so it can recover after a period of time, I will see.

Link to comment
Share on other sites

qbotarmystuck.jpg

The AI managed to get stuck sending it's attack force towards my base. This caused a lot of lag. Not sure what can be done to prevent that.

I've had something similar happen to me during a game, so it's not only AIs. The siege units in formation cause pathfinding nightmares, for one thing, and formations generally are garbage when there's only a narrow path (as over a cliff). The best thing would be to have no maps with narrow passes for now, including cliffs.

Link to comment
Share on other sites

Some more warnings and bugs I found just now (using latest svn qbot):

WARNING: JavaScript warning: simulation/ai/qbot/attackMoveToLocation.js line 93 reference to undefined property this.path[0][0]

WARNING: JavaScript warning: simulation/ai/qbot/attackMoveToLocation.js line 93 reference to undefined property this.path[0][1]

WARNING: JavaScript warning: simulation/ai/common-api/utils.js line 3 reference to undefined property b[0]

WARNING: JavaScript warning: simulation/ai/common-api/utils.js line 4 reference to undefined property b[1]

WARNING: JavaScript warning: simulation/ai/qbot/attackMoveToLocation.js line 216 reference to undefined property this.path[0][0]

WARNING: JavaScript warning: simulation/ai/qbot/attackMoveToLocation.js line 216 reference to undefined property this.path[0][1]

ERROR: JavaScript error: simulation/ai/qbot/attackMoveToLocation.js line 93 TypeError: this.path[0] is undefined ([object Object],[object Object])@simulation/ai/qbot/attackMoveToLocation.js:93 ([object Object],[object Object],[object Array])@simulation/ai/qbot/military.js:586 ()@simulation/ai/qbot/qbot.js:103 ([object Object])@simulation/ai/common-api/base.js:92 @:0

ERROR: JavaScript error: simulation/ai/qbot/attackMoveToLocation.js line 93 TypeError: this.path[0] is undefined ([object Object],[object Object])@simulation/ai/qbot/attackMoveToLocation.js:93 ([object Object],[object Object],[object Array])@simulation/ai/qbot/military.js:586 ()@simulation/ai/qbot/qbot.js:103 ([object Object])@simulation/ai/common-api/base.js:92 @:0

I'm pretty sure I've finally removed the source of these errors. They seem to have been a bit troublesome though, if the happen again I may ask someone else to try and sort it out for the sake of my sanity :).

Link to comment
Share on other sites

Just saw the "Observer-Oasis" map and decided to see how JuBot and qBot played against each other. qbot won, but it took 40 minutes (I used the warp time feature at times ;) ). I think it would have been much quicker if qBot had used siege weapons earlier. JuBot didn't really survive that long if you look at actually being able to strike back, all its units were lost long before that, so it was more that it took a long time before qBot actually managed to destroy all its buildings (and because it sent a lot of troops after my observer camel instead of finishing off JuBot in the end-game =) ). That it took a while before qBot actually built any siege is probably a good thing in most games as the enemy is likely to be more offensive, but there was another thing that was a bit confusing. Instead of taking down a building completely qBot destroyed it partly, but then moved on to the next, which really doesn't do much harm. Not sure if that's a bug or just a feature gone wrong in this case =) But overall I'd say qBot seems to manage its economy really well, and is pretty good defensively once it gets going. The area that needs some work atm imho is attacking buildings, at least from what I could see in that game :)

Link to comment
Share on other sites

qBot's trying to gather from enemy farms (as in sending dozens of females into enemy territory, where they just stand around a farm). I guess it needs to distinguish between player owned, gaia, and enemy resources when building its resource map?

Edit: I can't always reproduce this, I guess it depends on the map and game state, but still I think it would be a good fix, there's really no cause for qBot to ever send so many females to an enemy farm, and least of all when it's well defended :)

Link to comment
Share on other sites

just for my interest: how much time takes it to manage such a problem for you? seems you are pretty fast! ;)

good stuff

This depends a lot on the problem ;). For this problem it was very fast because not much code needed to be added and the problem was exactly known beforehand. I try and prioritize bugs in general because it encourages feedback and it is nice not to have lots of issues piling up. Here it was instant knowing the problem, less than 10 minutes writing code, then 5 minutes testing (by repeatedly deleting farms in the bots base so it had to go further afield for food) and then committing the code which was simple.

There are basically two sections to a problem. First is finding out what is going wrong, this currently involves thinking about what the code is doing and sticking lots of statements in which print things at various points so I can narrow down what is happening. e.g. Pureon found that on Hellanized Egypt qBot stopped producing anything after a while, the cause was that the maximum resource gather distance was too small so the fix was one number being changed. Finding the problem took maybe 45 minutes though since every test took a while to reach the point where qBot stopped working and I needed several attempts to narrow down the problem. In other cases such as siege not being used properly (still the case) the problem is obvious, since there is no siege specific attack code but implementing it requires careful thought and quite a lot of code so will take a good few hours probably.

Link to comment
Share on other sites

Haha, I just played against Qbot in Alpha 8 and it is so much smarter than Jubot! Still, it doesn't have any sort of way to communicate and work with allies. I feel it would add tons if the AI would "type" out things depending on what it is trying to do. For example, if the AI is attacking an enemy, it should say to it's allies that it will be attacking the enemy, or if it "wants" to trade with a teammate, it should tell them to build a market, but only if the teammate doesn't have one.

However, it is still a great improvement over Jubot, keep up the amazing work!

Link to comment
Share on other sites

i've played a game in Median oasis map. At the beginning the ai is aggressive, but after some time it became inactive: i think that ai players finish their resources and don't know how to use the bartering system... when i have attacked their territories, i've found plenty of women doing nothing near the border of the map ready to be slaughtered.

I'm a very slow player (the game finished after 2 hours), so maybe the ai players are just tired :P

but overall the ai has made great improvements since the last alpha release (y)

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.

Guest
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.

 Share

×
×
  • Create New...