Jump to content

How to let the AI build walls?


Fluxkompensator
 Share

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
Link to comment
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.

Link to comment
Share on other sites

  • 3 weeks later...

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...