Jump to content

Jubot: A Marginally Improved Ai


Recommended Posts

Should prolly put some work into just where it builds it's towers as it keeps building them all willy nilly behind the civ center instead of in defensive positions. I imagine figuring out how to tell it to take advantage of hills and passes would be difficult, but could you get it to at least build them in something like a square around the civ center?

Link to comment
Share on other sites

  • Replies 96
  • Created
  • Last Reply

Top Posters In This Topic

  • 2 weeks later...

Could you just set it up that the AI will maintain one mill near each standing metal or stone mine? That would likely be enough to boost them in the right direction even if they literally build one near every mine on the map. Plus its easier than calculating what constitutes a forest for the purpose of building mills near wood sources and it would be odd if they built a mill just to harvest one tree.

Link to comment
Share on other sites

"Building directions now 100% random"

I don't think it is a good idea, to be honest. It quickly looks like a disorganized mess of buildings.

My proposal (for Hellenes in this specific case) is to define the directions upon the direction of the ( main) roof of the civil centre. This shouldnt be done for all buildings of course, but worth a try maybe.

(If I'm not making sense i ll try to add a screenshot)

Edited by plumo
Link to comment
Share on other sites

I think to look nice, the "front" of buildings should point to the bottom right of the screen. This is how we've modeled the buildings to look.

wRIP8.jpg

Buildings should generally point this direction (except the Dock of course, which should point perpendicular to the shoreline), maybe within a 10 degree variance.

EDIT: Hehe, the Jubot yesterday made TONS of Mills along the back side of the map (and didn't make any Towers at all). I rolled in with my armies and slaughtered them like cattle on festival day!

LGHtHl.jpg

Link to comment
Share on other sites

I keep getting this one sort of randomly :

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

No clue on how to cause it. I suppose it could be related to the new helepolis since I'm playing with that alot, trying to figure out how to produce the error I keep getting about it's arrows not firing or somesuch.

Edited by chaosislife
Link to comment
Share on other sites

I keep getting this one sort of randomly :

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

No clue on how to cause it. I suppose it could be related to the new helepolis since I'm playing with that alot, trying to figure out how to produce the error I keep getting about it's arrows not firing or somesuch.

None of those files are referenced by the siege tower, so it's not that. The siege tower does however produce a BuildingAI.js error if used a lot (at least it does for me).

Link to comment
Share on other sites

None of those files are referenced by the siege tower, so it's not that. The siege tower does however produce a BuildingAI.js error if used a lot (at least it does for me).

yeah thats the one I'm getting, it also apears that i get the shots from the tower coming at the enemy from off-screen occasionally. Well actually it is if it looks like this :

ERROR: Error in timer on entity 5065, IID 35, function FireArrows: TypeError: Engine.QueryInterface(target, IID_Position) is null ("Ranged",5491)@simulation/components/Attack.js:160 ([object Object],0)@simulation/components/BuildingAI.js:159 ([object Object])@simulation/components/Timer.js:89

Edited by chaosislife
Link to comment
Share on other sites

Perhaps, for clarity's sake, we should say lagging instead of slow or that the code is slowing things down? Lag is generally understood by gamers to mean a drastic performance decrease. It could be understood that we're talking about the rate of military and economic growth by the AI otherwise.

Oh also, I'm not certain that the enemies standing idle is directly related to the recent lag. As I've seen it in the past if the enemy has several gatherers that seem to be standing around in a group it does create lag, but the lag is most likely due to either pathing or perhaps something more directly to do with them not being able to get at the resource that's off the edge of the map. My units do it all the time too. Perhaps something could be figured out to make them skip resources they can't actually get close enough to to gather. Either that or something in the editor that calculates and removes unattainable resources?

Edited by chaosislife
Link to comment
Share on other sites

Ok, haven't noticed any more obvious lag issue but :

ERROR: JavaScript error: simulation/ai/common-api/utils.js line 3 TypeError: a is undefined VectorDistance((void 0),[object Array])@simulation/ai/common-api/utils.js:3 ([object Object],"4529",[object Object])@simulation/ai/jubot/economy.js:450 ((function (centre) {'use strict';if (centre.hasClass("CivCentre")) {var centrePosition = centre.position();var currentdistcheck = VectorDistance(supply.position, centrePosition);if (currentdistcheck < distcheck) {distcheck = currentdistcheck;}}}))@simulation/ai/common-api/entitycollection.js:99 ([object Object],1128,[object Array])@simulation/ai/jubot/economy.js:446 ([object Object],"5122",[object Object])@simulation/ai/jubot/economy.js:440 ((function (ent) {'use strict';var types = self.pickMostNeededResources(gameState);for each (var type in types) {if (!resourceSupplies[type]) {continue;}var workerPosition = ent.position();var supplies = [];resourceSupplies[type].forEach(function (supply) {if (supply.entity.isUnhuntable()) {return;}var distcheck = 1000000;g...

Joy, eh?

Link to comment
Share on other sites

Hi

I try to make my 1st contribution in AI scripting.

Would you have some tips and tricks? Especially for testing, reproducing scenarios?

And any clue about where to find the up to date API for javascript scripting? I still looking for all the methods of the Entity class, like move or setMetaData...

Thank you in advance,

Bye

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