Jump to content

Jubot: A Marginally Improved Ai


Recommended Posts

I've just released the first and very basic public version of my new AI program, called "JuBot". It's basically an improvement on the TestBot scripts, particularly militarily (economics still leave something to be desired, but I'm working on it.)

- Troops given at game start will now be sent on the first attack wave instead of sitting around the whole time.

- The AI will build some scout towers around its base for defence.

- Women are now trained in 2s, so the AI builds up more quickly.

- Some men are created in the gathering workforce as well as women.

- Slightly improved & more varied military strategy

- Defence forces created as well as attackers.

- Each force can train 3 troop types, not just 2.

Main thread & downloads;

http://s9.zetaboards.com/exilian/topic/7271009/1/

Thanks to everyone who's given advice etc so far.

Link to comment
Share on other sites

  • Replies 96
  • Created
  • Last Reply

Top Posters In This Topic

Cool, I gave it a try. It would be awesome if you could make some siege equipment to go after enemy buildings ;) Possibly attack more often and different players. Also who is constructing towers? Females shouldn't be able to build towers by themselves (only a soldier can do that). Not sure if that is an AI behavior issue, or more like a failure of a lower level component.

Link to comment
Share on other sites

Bruno: I think with the towers, as long as the AI has some sort of troop somewhere on the map that can place the foundation the women can do the actual construction (I believe this works for the player in the same way). As for siege stuff, I'm planning to do a bit of econ work then I'll go back and see if I can get it training super units and siege kit.

Mythos: No idea about the buildings, I haven't even touched the building creation code... does that happen on all maps?

Link to comment
Share on other sites

Bruno: I think with the towers, as long as the AI has some sort of troop somewhere on the map that can place the foundation the women can do the actual construction (I believe this works for the player in the same way).

Yeah, this is what I described here some time ago: http://www.wildfiregames.com/forum/index.php?showtopic=13404&st=0&p=210126entry210126. Maybe we will change this logic eventually.

Link to comment
Share on other sites

Good work Jubalbarca, I like your improvements!

Are you able to define buildable units by their civ? So for example the Hellenes have an infantry_archer_a unit but the Celts don't. This is also relevant for building fortresses, where currently filenames are unique (e.g. fortress_briton.xml) to both civs.

Link to comment
Share on other sites

I haven't made proper timed tests yet, but how essential is it for players to create female villagers? I mean, you could just spawn cheap military troops and get two functions (military and economic) out of them. They'd be faster, and harder for raiders to pick off, as well as being able to hunt with less risk. I don't know what difference in speed there is for construction (female villagers are already restricted in the types of buildings they can construct) and gathering compared to soldiers.

Link to comment
Share on other sites

@Pureon: I've gotten to the stage where the Hellenes can train archers and the Celts can train cavalry, but the unit creation system's still based around a fairly simple loop. I can probably get it to build fortresses, but the next step planned is more work on the economic stuff.

Link to comment
Share on other sites

I haven't made proper timed tests yet, but how essential is it for players to create female villagers? I mean, you could just spawn cheap military troops and get two functions (military and economic) out of them. They'd be faster, and harder for raiders to pick off, as well as being able to hunt with less risk. I don't know what difference in speed there is for construction (female villagers are already restricted in the types of buildings they can construct) and gathering compared to soldiers.

Right now the female villagers are bonused at gathering food from berries and farms, while the men are bonused at mining. Also, the men will get worse at econ while they get better at war. When a soldier levels-up his armor and attack increase, while his gathering decreases. And as others have said, the females will have an aura that boosts the gathering of other units around her. Females are also cheap (only 50 Food) and easily massed from Houses.

Link to comment
Share on other sites

I've been having some fun battles against your AI :)

This error showed up just now for the first time as I was destroying the AI's remaining buildings:

ERROR: JavaScript error: simulation/ai/jubot/military.js line 61 TypeError: target is undefined ([object Object],[object Object])@simulation/ai/jubot/military.js:61 ([object Object],[object Object])@simulation/ai/jubot/military.js:146 ()@simulation/ai/jubot/testbot.js:115 ([object Object])@simulation/ai/common-api/base.js:90

ERROR: JavaScript error: simulation/ai/jubot/military.js line 61 TypeError: target is undefined ([object Object],[object Object])@simulation/ai/jubot/military.js:61 ([object Object],[object Object])@simulation/ai/jubot/military.js:146 ()@simulation/ai/jubot/testbot.js:115 ([object Object])@simulation/ai/common-api/base.js:90

ERROR: JavaScript error: simulation/ai/jubot/military.js line 61 TypeError: target is undefined ([object Object],[object Object])@simulation/ai/jubot/military.js:61 ([object Object],[object Object])@simulation/ai/jubot/military.js:146 ()@simulation/ai/jubot/testbot.js:115 ([object Object])@simulation/ai/common-api/base.js:90

One error every few seconds. Could be because the AI had no CC or Barracks left, I'm not too sure.

Link to comment
Share on other sites

I confirm Pureon's errors.

I get Javascript errors - target undefined

jubot/testbot.js: 115

jubot/military.js: 61

jubot/military.js: 146

common-api/base.js: 90

Then later after I kill their Civ Centre...

jubot/plan.js: 28

common-api/base.js: 145

common-api/entity-collection.js: 98

common-api/entity-collection.js: 74

common-api/entity-collection.js: 10

And after a few minutes of getting those errors constantly, I started getting 'out of memory' errors too. :)

Link to comment
Share on other sites

Yup, I reckon I've fixed that now. The issue was that the Civ Centre was given as the point for forces to regroup to; without a Civ Centre, their regrouping target no longer exists. Fingers crossed it should be all fine for next release.

As for other updates;

- Greeks can get an Epiteichisma

- Celts can get a Brythonic Broch

- Both sides train a few SUs

- A third strategy type, for pure cavalry raids, has been added.

Link to comment
Share on other sites

Awesome progress with this.

Hopefully at some point we can get a GUIless command line arg to setup maps, which you can then run AI v.s. AI super quickly, and see how many times your AI beats it.

That'd be very helpful when making changes to your own AI. You can compare changes against the previous implementation of it.

@Phillip: Think that'd be possible?

Link to comment
Share on other sites

You can already run the game like "pyrogenesis -quickstart -autostart=Oasis -autostart-ai=1:testbot -autostart-ai=2:testbot" to set up AIvAI, then use the 'time warp' mode in the game or do Engine.SetSimRate(10) etc in the console to speed it up. (It should give the same outcome each time since it's deterministic - I guess at some point I should let the random seed be changed.)

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