Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: External AI bindings  (Read 651 times)

j0nas

  • Bay Watcher
    • View Profile
External AI bindings
« on: July 29, 2009, 03:34:50 am »

I have many times been frustrated by small things, like how dwarves sometimes run away 20 squares from a pursuing enemy, then decide they're safe and turn back to head towards the enemy in order to get back inside the fortress.  While I could certainly write a suggestion to the effect that they should do this no more, it would be far more expedient if I could fix this myself.  The best way to accomplish that seems, to me, to be (optional) external AI bindings.

Basically each faction could optionally be given a replacement AI, which can toggle whether it or the default AI controls individual dwarves.  Preferably this AI should be in-game, perhaps as some sort of DLL or Lua-script or something, whichever solution strikes the best balance of ease-of-use/performance.  A way to communicate externally would be useful, with say a listening TCP-socket or something of that nature.  The ability to have several concurrent AIs with the locking of individual dwarves would be interesting as well.

Implementing this would no doubt take a lot of work, but it would provide quite a few interesting possibilities.

* Intelligent, self-organizing armies to repel invaders
* Easily implemented dig/build templates (just an AI combined with an external program to design/store)
* Increased depth of modding possibilities (sieges with pickaxes and a willingness to dig?  With understanding to avoid traps after finding them?)
Logged

Dae

  • Bay Watcher
    • View Profile
Re: External AI bindings
« Reply #1 on: July 29, 2009, 05:38:50 am »

That would be quite interesting, but I'm unsure whether Toady would share this opinion.
First, that would require access to game data, which would force Toady to unveil a part of his code, or at least of how it is organized, even through documentation. There is a reason why Toady's code is not openSource (I'm unsure what it is though).

Then, Toady would sort of lose the control of the project with each and everyone being able to implement whole AI. Well, this argument seems a little paranoid to me, yet there is a risk.

However, if an abstraction layer is added and Toady controls what the possibilities are, it seems feasible. Yet I doubt Toady would have the time to design it, so we could start thinking about it.
Logged