Jump to content

qBot (yet another AI)


Recommended Posts

Another thing I would like to see improved is the general layout of the AI's town. If you play a specific map multiple times you will notice that the AI builds its base in exactly the same pattern every time. It leaves its Civ Centre completely exposed and puts houses out front. So, along with Pureon's suggested improvements, I suggest trying to fix the way the AI lays out its base to look something more like this:

CXLHL.png

Link to comment
Share on other sites

Infyquest is working on garrisoning currently, the basic functionality is there now. What needs to be done is working out when units need to be garrisoned, currently it just garrisons everything when a strong group of enemies comes within your territory.

I had forgotten about treasure, this should be fairly straightforward. Territorial expansion might be tricky, I am not sure exactly how I would play with it myself to be honest.

I am currently working on some code which will give a list of routes from one base to another. This will be useful for the attack code since it can become more unpredictable and possibly launch multiple attacks on opposite side of the base etc. Also for Mythos' idea since defensive buildings can be placed on the routes into a base. Organisation of other buildings would also be good but is lower priority.

Link to comment
Share on other sites

I think the AI could build its new CCs a little farther away than it does now for maximum advantage when grabbing new territory.

Currently it shares the same code for building mills and CCs. So it builds a mill if it is in territory and a CC otherwise. This is simplistic behaviour which should be upgraded at some point in the future.

Link to comment
Share on other sites

Currently it shares the same code for building mills and CCs. So it builds a mill if it is in territory and a CC otherwise. This is simplistic behaviour which should be upgraded at some point in the future.

I haven't tested the behavior nor looked at qBot's code, but does it check the BuildRestrictions minDistance between CCs before building? (Currently I think the minDistance is within the territory "range" of a single CC, so in theory only building outside territory would be OK, but we might change that distance and maybe certain maps allow building too close to an existing CC but outside territory.)

Link to comment
Share on other sites

I haven't tested the behavior nor looked at qBot's code, but does it check the BuildRestrictions minDistance between CCs before building? (Currently I think the minDistance is within the territory "range" of a single CC, so in theory only building outside territory would be OK, but we might change that distance and maybe certain maps allow building too close to an existing CC but outside territory.)

Currently it uses a fixed distance (200) rather than territory, but since they are pretty similar I said territory. I should switch it to use the minDistance value by reading the template. Currently I think min distance is calculated as a straight line but territories use the terrain so it would be possible to have outside of territory but with an invalid min distance.

Link to comment
Share on other sites

Just an update on progress in qBot. Work has been slowed by me having lots of university work to do. Recently infyquest has implemented garrisoning, this is fairly untested so far so it will be interesting to see how it works out. Also there have been a few random economic fixes over the last few weeks, one was pretty major causing unbalanced distribution of resources.

Coming up next should be some military stuff from me, if i can get the terrain analysis working. I have also decided that doing something like JuBots attack code where they engage enemies on the way to a target separate from attack move (which I also need to work on) will give the AI flexibility in its attacks above what attack move should provide. Infyquest is looking at gathering treasures.

Link to comment
Share on other sites

Just an update on progress in qBot. Work has been slowed by me having lots of university work to do. Recently infyquest has implemented garrisoning, this is fairly untested so far so it will be interesting to see how it works out. Also there have been a few random economic fixes over the last few weeks, one was pretty major causing unbalanced distribution of resources.

Coming up next should be some military stuff from me, if i can get the terrain analysis working. I have also decided that doing something like JuBots attack code where they engage enemies on the way to a target separate from attack move (which I also need to work on) will give the AI flexibility in its attacks above what attack move should provide. Infyquest is looking at gathering treasures.

Splendid (y) The AI should be a much tougher opponent in Alpha 8 :) (I'm starting to be certain it's going to be good enough to be included ;) But it's of course up to you if you think it's ready :) )

Link to comment
Share on other sites

Just tested the current qbot - when I attacked the AI's base it garrisoned most of its units into its CC and the one scout tower it had built, however it then didn't appear to ungarrison the units after my army had retreated back to base. Is there a time delay?

I tried to use my rush strategy, but that failed because of the garrison attack bonuses - my rush was quickly defeated by the number of arrows flying out of the CC.

Link to comment
Share on other sites

Just tested the current qbot - when I attacked the AI's base it garrisoned most of its units into its CC and the one scout tower it had built, however it then didn't appear to ungarrison the units after my army had retreated back to base. Is there a time delay?

I tried to use my rush strategy, but that failed because of the garrison attack bonuses - my rush was quickly defeated by the number of arrows flying out of the CC.

It was only ungarrisoning when there were 0 units within the attack radius (roughly territory sized) previously, which is why it seemed slow ungarrisoning, there is no time delay.

I have made it ungarrison more optimistically, this has the effect of making it not garrison female citizens who are under threat if a big defensive force is marching to their aid. This is not necessarily a good thing but is simple for now and prevents things like female citizens popping in and out of where they are garrisoned in some situations. Ideally in this situation I woud like the female citizens to go and gather somewhere else which is safer.

Link to comment
Share on other sites

A few more things I've spotted:

  • Laying foundations in places it cannot build - Neareastern Badland's flat-top cliffs.
    qbotbuildthing.jpg
  • Trying to gather resources from places it cannot gather - Latium's cliffs that sometimes have resources on them. (The random map should really be fixed to prevent resources on cliffs)
  • When defending it's territory, the defending soldiers walk all the way to the enemy base when enemy soldiers retreat. They shouldn't defend that far out of territory.
  • In the first few minutes, qbot builds horse soldiers that don't do anything until it's time to attack/defend - it could instead build the horses much later and focus only on citizen-soldiers in the first few minutes to help with economy.

Link to comment
Share on other sites

  • In the first few minutes, qbot builds horse soldiers that don't do anything until it's time to attack/defend - it could instead build the horses much later and focus only on citizen-soldiers in the first few minutes to help with economy.

Terminologically speaking the cavalry are citizen soldiers as well =) But yeah, if you don't use them to hunt they're not much use in the early game, so I'm not arguing with the point your making :)

Link to comment
Share on other sites

  • Laying foundations in places it cannot build - Neareastern Badland's flat-top cliffs.
  • Trying to gather resources from places it cannot gather - Latium's cliffs that sometimes have resources on them. (The random map should really be fixed to prevent resources on cliffs)
I just committed the enabling code for accessibility checking recently, I have enabled it for building placement quickly, I will try and get it done for resource fairly soon.

  • When defending it's territory, the defending soldiers walk all the way to the enemy base when enemy soldiers retreat. They shouldn't defend that far out of territory.

I just committed a fix for this.

  • In the first few minutes, qbot builds horse soldiers that don't do anything until it's time to attack/defend - it could instead build the horses much later and focus only on citizen-soldiers in the first few minutes to help with economy

This needs dynamically adjusting priorities for the different queues, the code is there but what needs to be worked out is how they should vary for good game play. If anyone feels like working out a decent system then I could code it in quickly. Otherwise I will get round to it eventually. Basically it would be a function of the number of female citizens and the number of citizenSoldiers and possibly time (female citizens are much more stable than citizenSoldiers because the citizenSoldiers get sent off to die fairly regularly). (Note for qBot cavalry aren't considered citizenSoldiers because of their limited economic benefit)

I am hoping to get through your suggestions list (excluding advanced territory expansion) along with some extra military improvements in time for Alpha 8. The next week will be busy with maths work but hopefully by Friday I will have finished all the work due in this term.

Link to comment
Share on other sites

Long time no post. I made that rusher bot long time ago from qbot but never posted codes... I should start again and this time make it available for everyone :D How do I get your qbot newest code again in github? Since there has been so many updates for qbot that current rusher code is old in many ways.

Link to comment
Share on other sites

Long time no post. I made that rusher bot long time ago from qbot but never posted codes... I should start again and this time make it available for everyone :D How do I get your qbot newest code again in github? Since there has been so many updates for qbot that current rusher code is old in many ways.

To get the newest code you can either download the zip or set up git on your computer and follow the instructions on github to download the repository through git. I found http://nathanj.github.com/gitguide/tour.html is one of the easiest tutorials to follow for learning git. Git makes it easier to keep up to date.

Link to comment
Share on other sites

To get the newest code you can either download the zip or set up git on your computer and follow the instructions on github to download the repository through git. I found http://nathanj.githu...guide/tour.html is one of the easiest tutorials to follow for learning git. Git makes it easier to keep up to date.

Deleted my old rusher fork and forked yours again.

edit: too bad my tweaks to older version of rusher code are on brtfs filesystem. Can't access them atm :D

Edited by Linux_Eki
Link to comment
Share on other sites

Error about 25 minutes into game:

WARNING: JavaScript warning: simulation/ai/qbot/terrain-analysis.js line 148 variable pos redeclares argument

ERROR: JavaScript error: simulation/ai/qbot/military.js line 426 TypeError: attackers is undefined ([object Object],[object Array])@simulation/ai/qbot/military.js:426 ([object Object],[object Object],[object Array])@simulation/ai/qbot/military.js:585 ()@simulation/ai/qbot/qbot.js:101 ([object Object])@simulation/ai/common-api/base.js:92 @:0

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