IPB Style© Fisana

Jump to content


qBot (yet another AI)


  • Please log in to reply
244 replies to this topic

#121 feneur

feneur

  • 0 A.D. Project Leader

  • Cartographer of imaginary worlds
    (7,094 posts)

Posted 06 December 2011 - 12:21 AM

Just thought of another thing, it would be great if qbot would be able to barter, that way it could survive even if an enemy at that point is surrounding it and it has used used up all nearby wood, but there is plenty of stone and metal (and more long-term food, but if it hasn't resolved this particular issue by that time it probably has no chance). Not sure how much it would take to get it to do that though, and in general I'd say it's better to focus on expansion so it never finds itself in that situation. Just something to keep in mind.

Once trade is in qbot should definitely use that though, I'd say that should be higher priority. Both because that actually produces resources (compared to barter which just converts them to get you out of a tricky situation etc) and because it would be great for interacting with other players in a non-combat way (and even if you're not allied with qbot trade routes would be either a nice target or at the very least they'd make the map more alive :) ).

Erik Johansson [ aka feneur ]

Wildfire Games
Contact me: feneur@wildfiregames.com



Support Wildfire Games!


#122 Pureon

Pureon

  • 0 A.D. Art Team

  • Primus Pilus
    (3,242 posts)

Posted 06 December 2011 - 12:21 AM

Thanks for the summary ;)

Some possible additions:

  • Place foundations in safe areas - It shouldn't place new foundations where the enemy has already destroyed multiple building attempts.
  • Long range siege defense - It should be able to defend itself better against rock throwers.
qBot is already doing really well - It's much less predictable and does expand throughout the map (y)
Pureon
0 A.D. Designer / Texturer / 3D Artist
Contact email:
pureon{@}wildfiregames.com

#123 iap

iap

  • Community Members
    PipPip

  • Sesquiplicarius
    (101 posts)

Posted 06 December 2011 - 11:30 AM

A bit off topic: I would be happy if there was some source of information about how all the relations between the AI programming and the game engine, and some theoretical explanation of how each bot is programmed.
I'm a programmer, and took a look at the JS. Although there where lots of comments in the code, I still got comfused. My main question was "What is calling these functions and when?"

I can't promise anything, but I like this game and if I will have the knowledge and time I might contribute something.
:)

Thanks

#124 quantumstate

quantumstate

  • WFG Programming Team

  • Primus Pilus
    (1,086 posts)

Posted 06 December 2011 - 11:53 AM

View Postiap, on 06 December 2011 - 11:30 AM, said:

A bit off topic: I would be happy if there was some source of information about how all the relations between the AI programming and the game engine, and some theoretical explanation of how each bot is programmed.
I'm a programmer, and took a look at the JS. Although there where lots of comments in the code, I still got comfused. My main question was "What is calling these functions and when?"

I can't promise anything, but I like this game and if I will have the knowledge and time I might contribute something.
:)

Thanks

A little while back I wrote https://github.com/q...ucture-Overview which is a summary of how qBot works. I scanned over it quickly and it all seems to still be accurate although some new parts of the code aren't mentioned. If you are confused by any parts (which is pretty likely, given my documentation) please ask further questions.

Jonathan Waller [ aka quantumstate ]

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


Support Wildfire Games!


#125 historic_bruno

historic_bruno

  • WFG Programming Team

  • Primus Pilus
    (1,980 posts)

Posted 08 December 2011 - 10:40 PM

A minor suggestion, I notice qBot gets attacked by animals sometimes, but often the victim is a ranged unit that can never fight back because they have a minimum range and the animal is fast enough to take advantage with a melee attack. Anyway it looks very strange and always catches my eye :) Would it be possible to detect this and flee, or perhaps order a group attack? I guess this problem affects all ranged units really, so perhaps qBot should detect when a ranged unit has a melee unit attacking them within minimum range.
Ben Brian [ aka historic_bruno ]

Wildfire Games Programmer
Contact me: ben@wildfiregames.com

#126 feneur

feneur

  • 0 A.D. Project Leader

  • Cartographer of imaginary worlds
    (7,094 posts)

Posted 09 December 2011 - 12:20 AM

View Posthistoric_bruno, on 08 December 2011 - 10:40 PM, said:

A minor suggestion, I notice qBot gets attacked by animals sometimes, but often the victim is a ranged unit that can never fight back because they have a minimum range and the animal is fast enough to take advantage with a melee attack. Anyway it looks very strange and always catches my eye :) Would it be possible to detect this and flee, or perhaps order a group attack? I guess this problem affects all ranged units really, so perhaps qBot should detect when a ranged unit has a melee unit attacking them within minimum range.
Not sure whether this is something qbot should do as much as UnitAI should do. At least the general part, imho ranged units should always try and get farther away from melee units than just to the minimum range limit. As it is now they move just enough to be able to shoot if the attacker stays in the same spot, but that doesn't work since the attacker is getting closer. I'd say ranged units should always try and get to say 75% of the distance between minimum range and maximum range when being attacked by a melee unit. The "order a group attack" part is something I agree the AIs should do though :)

Erik Johansson [ aka feneur ]

Wildfire Games
Contact me: feneur@wildfiregames.com



Support Wildfire Games!


#127 Mythos_Ruler

Mythos_Ruler

  • 0 A.D. Project Leader

  • Megas Philhellene
    (13,898 posts)

Posted 09 December 2011 - 10:25 AM

There is a huge exploit now to use against qBot that is crippling for it.

Right now, qBot garrisons all of its females and a lot of its soldiers whenever I send only a few soldiers into its base. This cripples qBot economically, as the units will remain garrisoned as long as I have my little raiding party in its base. Secondly, if a garrisonable building is already full, females will continue to crowd around this building and wait to be slaughtered by my men. Both behaviors are extremely damaging to the qBot player.
Michael D. Hafer [aka Mythos_Ruler]

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


0 A.D.

#128 Pureon

Pureon

  • 0 A.D. Art Team

  • Primus Pilus
    (3,242 posts)

Posted 09 December 2011 - 10:40 AM

View PostMythos_Ruler, on 09 December 2011 - 10:25 AM, said:

There is a huge exploit now to use against qBot that is crippling for it.

Right now, qBot garrisons all of its females and a lot of its soldiers whenever I send only a few soldiers into its base. This cripples qBot economically, as the units will remain garrisoned as long as I have my little raiding party in its base. Secondly, if a garrisonable building is already full, females will continue to crowd around this building and wait to be slaughtered by my men. Both behaviors are extremely damaging to the qBot player.
I've noticed this too. Unfortunately qBot performed much better without garrisoning
Pureon
0 A.D. Designer / Texturer / 3D Artist
Contact email:
pureon{@}wildfiregames.com

#129 historic_bruno

historic_bruno

  • WFG Programming Team

  • Primus Pilus
    (1,980 posts)

Posted 09 December 2011 - 07:24 PM

View PostMythos_Ruler, on 09 December 2011 - 10:25 AM, said:

Right now, qBot garrisons all of its females and a lot of its soldiers whenever I send only a few soldiers into its base
I think AoK AIs would only garrison females locally after they were attacked (I'm not sure if you attacked or not) and it would never garrison soldiers. qBot could be smarter by doing both but only after it weighs the enemy's (local) strength with its own, if it's even close I'd say fight it out :)
Ben Brian [ aka historic_bruno ]

Wildfire Games Programmer
Contact me: ben@wildfiregames.com

#130 quantumstate

quantumstate

  • WFG Programming Team

  • Primus Pilus
    (1,086 posts)

Posted 09 December 2011 - 08:44 PM

Garrisoning seems to be a tricky problem. I think one of the big problems at the moment is locality, it is currently garrisoning females when enemies get too close (line of sight distance), there seems to be a bug in the garrisoning code which causes them to not look for another building when the first gets full. Troops are just garrisoned when too many enemies get close to the base without any locality check. I will try making garrisoning more of a last resort for now, hopefully I can get females to move away from attackers but keep working.

The eventual plan for soldiers will be to have them garrison if the enemy is close to a defensive structure, and ungarrison as soon as the enemy move out of range. To make this effective the soldiers should try not to engage defensively until the enemy is threatening something vital but this is fairly long term. For now I guess removing garrisoning would be best in general.

Another thing which should help will be dynamic priorities, then the AI will train more troops if you have lots of troops, so it should be easier to fend off attacks. This will help defence but isn't directly relevant to garrisoning.

Jonathan Waller [ aka quantumstate ]

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


Support Wildfire Games!


#131 Pureon

Pureon

  • 0 A.D. Art Team

  • Primus Pilus
    (3,242 posts)

Posted 09 December 2011 - 09:01 PM

When completed, your plans for building placement within the main base will also help garrisoning be much more effective - towers and fortresses will be at the front defending the civilian buildings at the back.
Pureon
0 A.D. Designer / Texturer / 3D Artist
Contact email:
pureon{@}wildfiregames.com

#132 Pureon

Pureon

  • 0 A.D. Art Team

  • Primus Pilus
    (3,242 posts)

Posted 11 December 2011 - 09:31 PM

Bug report: On Arcadia II set qBot as Player 1 (Hellenes), and yourself as Player 2 (Celts) - qBot does nothing, the starting units just stand in their starting positions. When I move an attack force into their territory, they garrison in the CC and only then begin working/building when they ungarrison. I've tried it 4 times, each time with the same result.
Pureon
0 A.D. Designer / Texturer / 3D Artist
Contact email:
pureon{@}wildfiregames.com

#133 quantumstate

quantumstate

  • WFG Programming Team

  • Primus Pilus
    (1,086 posts)

Posted 12 December 2011 - 09:59 PM

View PostPureon, on 11 December 2011 - 09:31 PM, said:

Bug report: On Arcadia II set qBot as Player 1 (Hellenes), and yourself as Player 2 (Celts) - qBot does nothing, the starting units just stand in their starting positions. When I move an attack force into their territory, they garrison in the CC and only then begin working/building when they ungarrison. I've tried it 4 times, each time with the same result.

Thanks, this should now be fixed.

Jonathan Waller [ aka quantumstate ]

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


Support Wildfire Games!


#134 Pureon

Pureon

  • 0 A.D. Art Team

  • Primus Pilus
    (3,242 posts)

Posted 15 December 2011 - 11:05 PM

Bug report: Siwa Oasis, latest svn qBot - 2 unassigned players, 1 Persian qBot, 1 Iberian human player. AI errors produced during the match: http://pastebin.com/j3Y0U30U
Pureon
0 A.D. Designer / Texturer / 3D Artist
Contact email:
pureon{@}wildfiregames.com

#135 historic_bruno

historic_bruno

  • WFG Programming Team

  • Primus Pilus
    (1,980 posts)

Posted 16 December 2011 - 01:16 AM

Warning on Granicus River with qBot as player 2:
WARNING: JavaScript warning: simulation/ai/qbot/economy.js line 290 reference to undefined property supplies[resource]

(Also check out the weird unit movement of the AI on that map :))
Ben Brian [ aka historic_bruno ]

Wildfire Games Programmer
Contact me: ben@wildfiregames.com

#136 quantumstate

quantumstate

  • WFG Programming Team

  • Primus Pilus
    (1,086 posts)

Posted 16 December 2011 - 10:48 AM

View Posthistoric_bruno, on 16 December 2011 - 01:16 AM, said:

Warning on Granicus River with qBot as player 2:
WARNING: JavaScript warning: simulation/ai/qbot/economy.js line 290 reference to undefined property supplies[resource]

(Also check out the weird unit movement of the AI on that map :))

I think the warning is because there is no food on that map, I have added another check for that.

When I watch it the movement didn't seem especially strange. It isn't very clever at moving/fighting though, I never really designed it to handle that many troops. One thing which might look slightly strange is that when the formations stops it is actually told to move to its current position, this can lead to some units running back to reform the formation.

Edit: I think I have fixed Pureons error, I have been making fairly extensive changes to that section of the code so I can't commit it immediately though.

Jonathan Waller [ aka quantumstate ]

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


Support Wildfire Games!


#137 infyquest

infyquest

  • Community Members
    Pip

  • Discens
    (48 posts)

Posted 17 December 2011 - 03:00 PM

I will be working on qbot in the next year.
This will be a hectic month for me, work, work and moar work :(

#138 Pureon

Pureon

  • 0 A.D. Art Team

  • Primus Pilus
    (3,242 posts)

Posted 17 December 2011 - 04:46 PM

View Postinfyquest, on 17 December 2011 - 03:00 PM, said:

I will be working on qbot in the next year.
This will be a hectic month for me, work, work and moar work :(
Hope it all goes well for you Infy
Pureon
0 A.D. Designer / Texturer / 3D Artist
Contact email:
pureon{@}wildfiregames.com

#139 quantumstate

quantumstate

  • WFG Programming Team

  • Primus Pilus
    (1,086 posts)

Posted 17 December 2011 - 08:34 PM

View Postinfyquest, on 17 December 2011 - 03:00 PM, said:

I will be working on qbot in the next year.
This will be a hectic month for me, work, work and moar work :(

Hopefully you have a bit of time off over Christmas and it goes well. I'll look forward to having you back working on qBot :).

Jonathan Waller [ aka quantumstate ]

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


Support Wildfire Games!


#140 quantumstate

quantumstate

  • WFG Programming Team

  • Primus Pilus
    (1,086 posts)

Posted 17 December 2011 - 10:11 PM

I have just committed the last set of features before Alpha 8. See http://trac.wildfire...changeset/10755 for a list of the significant changes.

Garrisoning is disabled for now because of the issues it was causing and the defence should generally behave a bit better now, it seemed to have a few quirks before.

Jonathan Waller [ aka quantumstate ]

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


Support Wildfire Games!





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users