Jump to content

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

Recommended Posts

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
Link to post
Share on other sites
  • Replies 159
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

Planned, but will not be added in the following days. I've got to get the rest to work first.

Allright... This being my last day of holidays before at least 3 weeks of hard work ( ), I'm releasing Marilyn in its current state as a "proof of concept", if you will. Please report any error, susp

Bad news. I'm pretty sure, after much thinking, that I'll never have time to recreate the economic manager completely and properly. Thus, I'm abandoning Marilyn's development to focus on merging some

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
Link to post
Share on other sites

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.

Link to post
Share on other sites

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.

Link to post
Share on other sites

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.


Link to post
Share on other sites

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.

Link to post
Share on other sites
  • 2 weeks later...

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.

Link to post
Share on other sites
  • 3 weeks later...

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
Link to post
Share on other sites
  • 2 weeks later...

I think optimization, Water support, LOS support are bigger priorities.

Of course, better entity/template support is always better.

Edit: this will look dumb, but I just found out where the AI saved the screenshots it takes. Could prove useful.

Edited by wraitii
Link to post
Share on other sites

Speaking of which: Here is a new version of Marilyn, again changing barely anything but streamlining.

The attacks should now work properly (ie no units left behind, and the AI now can plan it's next attack while there's still one going on). I've also tweaked a few stuffs.

edit: see below for latest version

Basically, my TODO list is now "get the AI better at attacking/defending". Defense is still very very dumb.

Edited the front post.

Edited by wraitii
Link to post
Share on other sites

You're going to say I do this a lot, but here's a penultimate update (the last for the day, rest assured :) ).

I've started tackling the attack problem. It's still a very early development, but I implemented a class for dealing with inter army fighting (very-very basic for now), which should serve as a framework for further progress.

I changed a few stuffs in the way Marilyn attacks: she will now do one or two early raids, and will retaliate if you attack her and she's still got a standing army.

edit: see below for latest download.

I did a few tests against qBot (on Oasis, though , but I think Marilyn is, if anything, more adaptable), and while she isn't way stronger, she's got the upper hand:

-qBot craves for more food, but this might be civ-specific, and anyway Marilyn collected much more wood, stone and metal than qbot.

-qBot built more units, but lost more too (again, I think this is civ specific)

-qBot lost more buildings (including a town centre), and Marilyn regularly managed to send units in his base while qBot couldn't.

Any remarks and testing will be appreciated :)

Edited by wraitii
Link to post
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.

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.

  • Create New...