Light Style© by Fisana

Jump to content


Photo

A challenger appears : Marilyn (Yet-yet another AI)


  • Please log in to reply
159 replies to this topic

#1 wraitii

wraitii

    Primus Pilus

  • WFG Programming Team
  • 1,495 posts

Posted 02 January 2012 - 12:50 PM

Please excuse the topic description, as it's widely inaccurate, but it's pretty much the reason why I named my AI (improvement over qBot) Marilyn.

So anyway, I was on holidays last week with very little to do and a really bad weather, and I started trying to improve qBot, which, while already very capable, isn't perfect. I've come up after one week with a fairly acceptable improvement, I think. It's not incredibly better, it isn't vastly superior, but it's overall , in my testings, more reliable and a bit less game-able.
It's still a work in progress, but I'm going back to school tomorrow and won't have that much time, so I'm releasing it as is and I'll upgrade it over time.

18/02/12 update: okay, I've done some fair changes over the original description, so here is a review list of changes over qBot:
-Marilyn will go for crates first, then hens/bushes, then only start farming, and will try to build only the required amount of farm.
-Better dropsite placement. Marilyn will build dropsites where needed, and in the best way possible.
-Improved defense. She detects intrusion in her territory, can detect an attack on a unit, can garrison her citizens. Still a work in progeess.
-Attack Plans.Basically, instead of building units and one day saying: allright, I attack, it will create units specifically for attacking and then attack. This is also very much a work in progress.
-Slightly different queue-ing system, though this you won't be able to see.
-Building things rotated!

What remains to be done:
-Handling anything water.
-Better defense: detecting attacks by ships, buildings, individual units or whole armies, and proper retaliation in each cases.
-Better defensive reactivity: remembering where the enemy last attacked, remembering chockepoints, creating armies to counter the enemy...
-Improving attacks: different attack types, a better targeting system, sieging, tricking, decoying, retreating, basically anything.
-Handling resource gathering better. The system works fairly well but fairly blindly, so there is likely room for improvement.
-Handling the bartering.
-More diverse strategies (will have to wait for a true random generator)
-Dealing with allies/multiple enemies
-Likely a few other things.

Marilyn should behave better early game than qBot, and about the same in the late game (with the little advantage from the better start).

Activate the debugging option in "Marilyn.js", this file is basically the same as "qbot.js".
I encourage anybody to try the AI and report whatever they notice. Ask questions if you have any.

Download link (as of 02/24/12, a more recent version could be in available in the later posts)

Edited by wraitii, 24 February 2012 - 08:43 AM.

  • 0
Lancelot de Ferrière le Vayer [ aka Wraitii ]
Wildfire Games Programmer, AI developer, auxiliary map designer, dealing with anything water.
Contact me: wraitii@wildfiregames.com

Also the world's only three-dimensional poodle.

#2 Echelon9

Echelon9

    Discens

  • Donator
  • 66 posts

Posted 02 January 2012 - 01:36 PM

Thanks for the new bot to test. Will offer some suggestions once I've given it a few runs.
  • 0

#3 MishFTW

MishFTW

    Primus Pilus

  • Web Development Team
  • 1,858 posts

Posted 02 January 2012 - 02:59 PM

Lets see if this guy girl can beat me in naval combat :P
  • 0
Mish [ aka MishFTW]
Wildfire Games Webmaster
Email Me | About Me

#4 infyquest

infyquest

    Discens

  • Community Members
  • Pip
  • 66 posts

Posted 02 January 2012 - 04:04 PM

Well, I have been asking for a way to detect for water for use in qBot.
I will probably use your crate code in qBot :P
  • 0

#5 wraitii

wraitii

    Primus Pilus

  • WFG Programming Team
  • 1,495 posts

Posted 02 January 2012 - 04:13 PM

For those looking through the codes: it's really not cleaned up... There are many unused variables, many unused functions that I haven't erased from qBot. For simpler reading, check the "update" functions first. This is particularly noticeable in the "defence" and "economy" files.

Edited by wraitii, 02 January 2012 - 04:15 PM.

  • 0
Lancelot de Ferrière le Vayer [ aka Wraitii ]
Wildfire Games Programmer, AI developer, auxiliary map designer, dealing with anything water.
Contact me: wraitii@wildfiregames.com

Also the world's only three-dimensional poodle.

#6 MishFTW

MishFTW

    Primus Pilus

  • Web Development Team
  • 1,858 posts

Posted 02 January 2012 - 06:07 PM

So I messed around with it for a while. I didn't get raided (YES!, but a slight disappointment). There were a couple warnings. It seems each time it was training cavalry. Error in Attack_city.js, line 181; regarding Melee Cavalry. I'll test it some more, and next time, I'll reveal the map and observe it.
  • 0
Mish [ aka MishFTW]
Wildfire Games Webmaster
Email Me | About Me

#7 infyquest

infyquest

    Discens

  • Community Members
  • Pip
  • 66 posts

Posted 02 January 2012 - 06:12 PM

host your code on github, so others can look into it and send you updates
  • 0

#8 quantumstate

quantumstate

    Primus Pilus

  • WFG Programming Team
  • 1,150 posts

Posted 02 January 2012 - 11:07 PM

This looks interesting. I haven't had a detailed look at the code yet, but I had a rough glance and watched a match. I have also removed qbot's raiding for now, this makes it play better in bot v bot matches because bots are very good at spotting a raid, and will probably improve play vs humans because of the economic boost (though maybe less interesting).

One thing I am curious about is your changes to the queue manager. You seem to try and fill up the building queues which is an inefficient way to train since a group of n units takes n^0.7 time to train so bigger groups take less time per unit. I can see that individual priorities might be useful in some cases, but I have found that by adding enough queues I haven't needed that. In what circumstances does your system lead to an improvement over qBot? I was recently thinking about improving qBot's system so if you can persuade me, I will merge the changes, but at the moment i am not seeing the advantage (probably because I don't understand ti well enough).

Your farm building seems to be much better, I am unsure about the speed at which your build advanced military structures, I think it may be too fast, which wastes resources.

I will take a more thorough look at it when I have more time.
  • 0
Jonathan Waller [ aka quantumstate ]

Wildfire Games Programmer
Contact me: jonathanmarkwaller at gmail dot com


Support Wildfire Games!

#9 MishFTW

MishFTW

    Primus Pilus

  • Web Development Team
  • 1,858 posts

Posted 03 January 2012 - 01:25 AM

So Marilyn chooses to not raid me. So I send out a little party to see how the bot reacts. I knew there was an army waiting, but they weren't attacking. It seems this bot is more defense oriented. Anyways, my 5 cavalry were *chased* to my civ center and Marilyn ended up doing some damage.
Posted Image
  • 0
Mish [ aka MishFTW]
Wildfire Games Webmaster
Email Me | About Me

#10 wraitii

wraitii

    Primus Pilus

  • WFG Programming Team
  • 1,495 posts

Posted 03 January 2012 - 07:46 AM

Yeah, that's actually a side-effect of the code as it is: since Marilyn waits to have enough units to start an attack, it waits on average 6 minutes before attacking ( in case of a "CityAttack" ). It simply creates an army meanwhile. It could attack earlier, but only if it had reached the "maximum amount" of units, which is about 150 for a "City Attack"...
However, if you attack it, it will detect you, and the standing army will chase you. Still, it chases for a very long distance, right now, which is not really intentional.
I'll look at the code, I deactivated the "cavalry raids" and the "early rushes" for now, but will put them back as soon as I can.


@quantumstate: I said improvement, but I'm not actually sure it's one... It's merely a different way of doing about the same things. The benefits of my systems are that economic and military buildings are always built as soon as possible... The AI usually won't try to build 50 at a time, so it's not really a problem. And the benefit is that as soon as the code decides to build a building, you can expect it to pop up in under 1 minute, which I couldn't always see with qBot.
I found my system easier to predict, but it's perhaps not as efficient in some cases.
Btw, the "flooding the building queue" is because I wasn't sure there was an improvement... And it's also because I didn't take the time to implement it completely. I did that because as a former AOE : AOK player, I figured building one villager at a time in the early game would bring more resource per villager in the early game (since each spawned villager starts collecting...). I haven't done the math, as I didn't know it. Will have to check.
Individual priorities are useful in my attack plans, because this allows to balance armies more easily, I found, while not having too many queues. Again, perhaps it's only a matter of philosophy in the coding.

Marilyn does build military buildings fast, but that's likely a side effect of females being built at an insane rate in this game ( as a player of AOE II, getting 50 villies was not easy to do in under 10 minutes.. in 0ad, it can be done in about 5 it seems. )

Farm building is not yet perfect: in the beginning, it detects the amount of available food, and if there's not enough it starts building farms... But then, when the farms deplete, there's usually a small time where he hasn't built new ones.
  • 0
Lancelot de Ferrière le Vayer [ aka Wraitii ]
Wildfire Games Programmer, AI developer, auxiliary map designer, dealing with anything water.
Contact me: wraitii@wildfiregames.com

Also the world's only three-dimensional poodle.

#11 MishFTW

MishFTW

    Primus Pilus

  • Web Development Team
  • 1,858 posts

Posted 15 January 2012 - 02:50 AM

Any updates? I still use this AI from time to time.
  • 0
Mish [ aka MishFTW]
Wildfire Games Webmaster
Email Me | About Me

#12 Seru

Seru

    Discens

  • Community Members
  • Pip
  • 16 posts

Posted 15 January 2012 - 06:35 AM

Like, it play against she.
  • 0

#13 wraitii

wraitii

    Primus Pilus

  • WFG Programming Team
  • 1,495 posts

Posted 16 January 2012 - 04:56 PM

I've been quite busy right now with school... And I've been searching for a good idea to improve the attack system once more, I'm not really satisfied by what I have know... And I've also improved the economic aspect of things slightly.
The thing is, for newer change, I think I'll need to change a much bigger part of the code and I haven't got time yet to do that? Perhaps this week as I've got more free time.
  • 0
Lancelot de Ferrière le Vayer [ aka Wraitii ]
Wildfire Games Programmer, AI developer, auxiliary map designer, dealing with anything water.
Contact me: wraitii@wildfiregames.com

Also the world's only three-dimensional poodle.

#14 quantumstate

quantumstate

    Primus Pilus

  • WFG Programming Team
  • 1,150 posts

Posted 05 February 2012 - 12:12 AM

There has been a breaking change in svn, with the scout tower being renamed. It is a simple fix, I just thought I should let you know.
  • 0
Jonathan Waller [ aka quantumstate ]

Wildfire Games Programmer
Contact me: jonathanmarkwaller at gmail dot com


Support Wildfire Games!

#15 wraitii

wraitii

    Primus Pilus

  • WFG Programming Team
  • 1,495 posts

Posted 05 February 2012 - 08:05 AM

There has been a breaking change in svn, with the scout tower being renamed. It is a simple fix, I just thought I should let you know.

Allright. I'll likely release a newer version with the changes I did since last time... There are not too many but I'm sure I changed a few stuffs.

I'm encountering a weird problem, in fact, with the attack plans... For some reason, it appears there are units that are "forgotten" each time a new plan restarts, and I can't seem to know why... Is there any way to check the metadata on a unit?

Edited by wraitii, 05 February 2012 - 08:07 AM.

  • 0
Lancelot de Ferrière le Vayer [ aka Wraitii ]
Wildfire Games Programmer, AI developer, auxiliary map designer, dealing with anything water.
Contact me: wraitii@wildfiregames.com

Also the world's only three-dimensional poodle.

#16 wraitii

wraitii

    Primus Pilus

  • WFG Programming Team
  • 1,495 posts

Posted 05 February 2012 - 08:48 AM

Okay, here is the fixed version. I made it so it will work with the release and the SVN version.

I'm not sure if there's any real change... I know I tweaked a few stuffs about farming, but I'm having trouble with my attack plans for some reason.

Download link
  • 0
Lancelot de Ferrière le Vayer [ aka Wraitii ]
Wildfire Games Programmer, AI developer, auxiliary map designer, dealing with anything water.
Contact me: wraitii@wildfiregames.com

Also the world's only three-dimensional poodle.

#17 wraitii

wraitii

    Primus Pilus

  • WFG Programming Team
  • 1,495 posts

Posted 17 February 2012 - 08:42 PM

Okay, so I got around to fixing the plan bug... So I'm working on the AI again. I'm not sure what I can improve exactly before 0.9, but I'll likely be able to add some stuffs.
  • 0
Lancelot de Ferrière le Vayer [ aka Wraitii ]
Wildfire Games Programmer, AI developer, auxiliary map designer, dealing with anything water.
Contact me: wraitii@wildfiregames.com

Also the world's only three-dimensional poodle.

#18 Kazu Kun

Kazu Kun

    Discens

  • Community Members
  • Pip
  • 79 posts

Posted 17 February 2012 - 11:42 PM

Need to add in the ability to use the market for the bots as a top priority, that way their attacks can continue even when a lot of resources are gone, or for when your a tiny map..
  • 0
Reality?
No..
AnIMaTE LiFE

[system]
Spoiler

#19 Mythos_Ruler

Mythos_Ruler

    Megas Philhellene

  • 0 A.D. Project Leader
  • 14,877 posts

Posted 18 February 2012 - 02:21 AM

Need to add in the ability to use the market for the bots as a top priority, that way their attacks can continue even when a lot of resources are gone, or for when your a tiny map..

I usually destroy the bot before this becomes an issue. ;)
  • 0

Michael D. Hafer [aka Mythos_Ruler]

Wildfire Games Project Leader

Contact me: michaeldhafergmailcom

 

Support Wildfire Games!

 

10298.png


#20 Kazu Kun

Kazu Kun

    Discens

  • Community Members
  • Pip
  • 79 posts

Posted 18 February 2012 - 03:12 AM

I usually have the option to, but having them use less resources by using the market would indeed be better, while I also like to sit around to see how long I can last before I force myself to attack.
  • 0
Reality?
No..
AnIMaTE LiFE

[system]
Spoiler