Page 1 of 1

LuaAI volunteer request (BA)

Posted: 30 Sep 2010, 14:01
by TheFatController
Hi

I'm posting this as a request here first as I know there are talented coders here who are much more familiar with AI writing for Spring than me and I believe there will be interest in the opportunity to have your work included in the most popular spring mod so don't mob me for making a request please :P

With the new Spring feature of reconnecting players I'm looking to add a mod option (or player specific option) to allow the blocking of taking of a players units for x minutes to allow players to reconnect and resume play - I'm looking to trial the idea of letting a defensive/passive AI jump in and mind their base while this is happening.

What i'd be looking for is a Lua based AI that can take over a base at any point and carry out tasks such as:
- Defending/rebuilding existing structures
- Maintaining economy production
- Creating additional units for defense
- Sending builders to help nearby allies buildings
- Possibly assisting attacks where an ally is already attacking
- Defending its commander

It shouldn't be expected to win a game on its own or give newbies any kind of advantage by any stretch of the imagination but equally players shouldn't come back to find their base full of solars and all their units gone.

The other important requirements for the code would be Stability as a must and also as low system footprint as possible.

If anyone is interested in this please let me know here or on lobby, alternately feel free to just get to work on a mutator and I'd be happy to merge the results into BA if it's suitable.

Thanks!

Re: LuaAI "BAI" volunteer request

Posted: 30 Sep 2010, 14:04
by AF
Out of curiosity what is the potential in the APIs for allowing a native AI to be loaded and take over? That would be useful for this if not for experimentation and research purposes

Re: LuaAI "BAI" volunteer request

Posted: 30 Sep 2010, 14:12
by zwzsg
I have made some sort of Lua AI that rebuild any lost unit, move them to their position and reassign their order queues. Already released as a BA mutator.

But you weren't happy about merging.

Re: LuaAI "BAI" volunteer request

Posted: 30 Sep 2010, 16:58
by slogic
You need to emulate executing of /aicontrol command from disconnected player to attach any _existing_ AI. AI is executed by host. The problem is: can it be done in current Spring? Another problem: can you pass config options to AI (e.g. to set "easy" preset to make AI more passive) in /aicontrol command?

Re: LuaAI "BAI" volunteer request

Posted: 30 Sep 2010, 17:32
by hoijui
Lua AIs are executed on all clients running the game, they are synced.
BAI is already taken as a name for an AI:
http://springrts.com/phpbb/viewtopic.php?t=22590

if i remember right, /aicontrol does support passing in options. if not, it should not be hard to add. it most certainly does not work with LuaAIs though, or it will not be required for an AI that is designed to take over control and give it up again in the mid-game.