IPB Style© Fisana

Jump to content


qBot (yet another AI)


  • Please log in to reply
244 replies to this topic

#81 quantumstate

quantumstate

  • WFG Programming Team

  • Primus Pilus
    (1,072 posts)

Posted 12 November 2011 - 05:47 PM

View PostMythos_Ruler, on 12 November 2011 - 02:23 PM, said:

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.

Jonathan Waller [ aka quantumstate ]

Wildfire Games AI Scripter
Contact me: jonathanmarkwaller at gmail dot com


Support Wildfire Games!


#82 Mythos_Ruler

Mythos_Ruler

  • 0 A.D. Project Leader

  • Megas Philhellene
    (13,778 posts)

Posted 13 November 2011 - 06:52 AM

View Postquantumstate, on 12 November 2011 - 05:47 PM, said:

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.
You're doing a good job. Your AI has surprised me a time or two. :)
Michael D. Hafer [aka Mythos_Ruler]

Wildfire Games Project Leader
Contact me: michaeldhafer[at]gmail.com
Support Wildfire Games!


0 A.D.

#83 historic_bruno

historic_bruno

  • WFG Programming Team

  • Primus Pilus
    (1,923 posts)

Posted 13 November 2011 - 09:46 PM

View Postquantumstate, on 12 November 2011 - 05:47 PM, said:

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.)
Ben Brian [ aka historic_bruno ]

Wildfire Games Programmer
Contact me: ben@wildfiregames.com

#84 quantumstate

quantumstate

  • WFG Programming Team

  • Primus Pilus
    (1,072 posts)

Posted 13 November 2011 - 09:51 PM

View Posthistoric_bruno, on 13 November 2011 - 09:46 PM, said:

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.

Jonathan Waller [ aka quantumstate ]

Wildfire Games AI Scripter
Contact me: jonathanmarkwaller at gmail dot com


Support Wildfire Games!


#85 quantumstate

quantumstate

  • WFG Programming Team

  • Primus Pilus
    (1,072 posts)

Posted 19 November 2011 - 12:35 AM

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.

Jonathan Waller [ aka quantumstate ]

Wildfire Games AI Scripter
Contact me: jonathanmarkwaller at gmail dot com


Support Wildfire Games!


#86 feneur

feneur

  • 0 A.D. Project Leader

  • Cartographer of imaginary worlds
    (7,059 posts)

Posted 19 November 2011 - 12:41 AM

View Postquantumstate, on 19 November 2011 - 12:35 AM, said:

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 :) )

Erik Johansson [ aka feneur ]

Wildfire Games
Contact me: feneur@wildfiregames.com



Support Wildfire Games!


#87 Pureon

Pureon

  • 0 A.D. Art Team

  • Primus Pilus
    (3,220 posts)

Posted 19 November 2011 - 01:50 PM

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.
Pureon
0 A.D. Designer / Texturer / 3D Artist
Contact email:
pureon{@}wildfiregames.com

#88 quantumstate

quantumstate

  • WFG Programming Team

  • Primus Pilus
    (1,072 posts)

Posted 19 November 2011 - 07:31 PM

View PostPureon, on 19 November 2011 - 01:50 PM, said:

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.

Jonathan Waller [ aka quantumstate ]

Wildfire Games AI Scripter
Contact me: jonathanmarkwaller at gmail dot com


Support Wildfire Games!


#89 Pureon

Pureon

  • 0 A.D. Art Team

  • Primus Pilus
    (3,220 posts)

Posted 20 November 2011 - 03:30 PM

A few more things I've spotted:

  • Laying foundations in places it cannot build - Neareastern Badland's flat-top cliffs.

    Posted Image

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

Pureon
0 A.D. Designer / Texturer / 3D Artist
Contact email:
pureon{@}wildfiregames.com

#90 feneur

feneur

  • 0 A.D. Project Leader

  • Cartographer of imaginary worlds
    (7,059 posts)

Posted 20 November 2011 - 03:50 PM

View PostPureon, on 20 November 2011 - 03:30 PM, said:

  • 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 :)

Erik Johansson [ aka feneur ]

Wildfire Games
Contact me: feneur@wildfiregames.com



Support Wildfire Games!


#91 quantumstate

quantumstate

  • WFG Programming Team

  • Primus Pilus
    (1,072 posts)

Posted 20 November 2011 - 07:03 PM

View PostPureon, on 20 November 2011 - 03:30 PM, said:


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

Quote

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

Quote

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

Jonathan Waller [ aka quantumstate ]

Wildfire Games AI Scripter
Contact me: jonathanmarkwaller at gmail dot com


Support Wildfire Games!


#92 Pureon

Pureon

  • 0 A.D. Art Team

  • Primus Pilus
    (3,220 posts)

Posted 20 November 2011 - 08:32 PM

Sounds great! qBot will be a beast to defeat once you implement your military improvements. Can't wait! :D
Pureon
0 A.D. Designer / Texturer / 3D Artist
Contact email:
pureon{@}wildfiregames.com

#93 Linux_Eki

Linux_Eki

  • Community Members
    Pip

  • Discens
    (36 posts)

Posted 20 November 2011 - 09:17 PM

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.
http://adf.ly/3o5Po My youtube channel. Videos about 0.A.D and maybe something else.

#94 quantumstate

quantumstate

  • WFG Programming Team

  • Primus Pilus
    (1,072 posts)

Posted 20 November 2011 - 10:03 PM

View PostLinux_Eki, on 20 November 2011 - 09:17 PM, said:

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.githu...guide/tour.html is one of the easiest tutorials to follow for learning git. Git makes it easier to keep up to date.

Jonathan Waller [ aka quantumstate ]

Wildfire Games AI Scripter
Contact me: jonathanmarkwaller at gmail dot com


Support Wildfire Games!


#95 Linux_Eki

Linux_Eki

  • Community Members
    Pip

  • Discens
    (36 posts)

Posted 20 November 2011 - 10:25 PM

View Postquantumstate, on 20 November 2011 - 10:03 PM, said:

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, 20 November 2011 - 10:28 PM.

http://adf.ly/3o5Po My youtube channel. Videos about 0.A.D and maybe something else.

#96 Pureon

Pureon

  • 0 A.D. Art Team

  • Primus Pilus
    (3,220 posts)

Posted 20 November 2011 - 10:29 PM

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

Pureon
0 A.D. Designer / Texturer / 3D Artist
Contact email:
pureon{@}wildfiregames.com

#97 Pureon

Pureon

  • 0 A.D. Art Team

  • Primus Pilus
    (3,220 posts)

Posted 24 November 2011 - 12:39 AM

I recorded a video showcasing qBot's new defense:


The guys are still working on AI improvements for Alpha 8 release, but even now the AIs are looking very promising.
Pureon
0 A.D. Designer / Texturer / 3D Artist
Contact email:
pureon{@}wildfiregames.com

#98 Mythos_Ruler

Mythos_Ruler

  • 0 A.D. Project Leader

  • Megas Philhellene
    (13,778 posts)

Posted 24 November 2011 - 03:00 AM

I think the bots need to put up new expansions by the 10 minute mark. Then every 5 minutes after that.

This will of course change once we implement Settlement Phases (Ages).
Michael D. Hafer [aka Mythos_Ruler]

Wildfire Games Project Leader
Contact me: michaeldhafer[at]gmail.com
Support Wildfire Games!


0 A.D.

#99 Mythos_Ruler

Mythos_Ruler

  • 0 A.D. Project Leader

  • Megas Philhellene
    (13,778 posts)

Posted 25 November 2011 - 03:21 AM

Both players start with 50 units. qBot rushes me immediately. :)

Michael D. Hafer [aka Mythos_Ruler]

Wildfire Games Project Leader
Contact me: michaeldhafer[at]gmail.com
Support Wildfire Games!


0 A.D.

#100 Pureon

Pureon

  • 0 A.D. Art Team

  • Primus Pilus
    (3,220 posts)

Posted 25 November 2011 - 09:27 AM

View PostMythos_Ruler, on 25 November 2011 - 03:21 AM, said:

Both players start with 50 units. qBot rushes me immediately. :)
haha - quantumstate must be teaching qBot his own sneaky tactics, he himself recently rushed feneur after only 30 seconds into a multiplayer game ;)
Pureon
0 A.D. Designer / Texturer / 3D Artist
Contact email:
pureon{@}wildfiregames.com




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users