Jump to content
Sign in to follow this  
Fluxkompensator

How to let the AI build walls?

Recommended Posts

Hello guys

In headquarters.js is a function named "buildDefenses".

In this function is the line:

queues.defenseBuilding.addItem(new m.ConstructionPlan(gameState, "structures/{civ}_defense_tower"));

In this way I can tell the AI (_petrabot.js) to build defens towers, but what about walls?

Does anyone know a way to do this or have any idea?

Thanks for your time and attention.

  • Like 1

Share this post


Link to post
Share on other sites

hi, that's not implemented. The difficulty with walls is in the positioning and checking of obstructions.

But if you want to look at it, you can take inspiration from the function findDefensiveLocation (also in headquarter.js) which find the best location for towers and fortresses. It is called from the constructionPlan (in queueplan-building.js) when asked to build a tower.

Share this post


Link to post
Share on other sites

hi, that's not implemented. The difficulty with walls is in the positioning and checking of obstructions.

But if you want to look at it, you can take inspiration from the function findDefensiveLocation (also in headquarter.js) which find the best location for towers and fortresses. It is called from the constructionPlan (in queueplan-building.js) when asked to build a tower.

...yet another argument for shared libraries for simulation and RMGen IMO.

Make walls buildable through trees. This can remove 75% of obstructions. my opinion.

I agree. An RMGen patch for this is in progress - maybe that could help for the in-game wall placement as well as for AI wall placement, not sure.

Edited by FeXoR

Share this post


Link to post
Share on other sites

> ...yet another argument for shared libraries for simulation and RMGen IMO

I wish, I could use my JS helper lib for simulation, rmgen, trigger and bot...

  • Like 1

Share this post


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.

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.

Sign in to follow this  

×
×
  • Create New...