Is it possible to have AI take over Dropped players in multi

Is it possible to have AI take over Dropped players in multi

Here is where ideas can be collected for the skirmish AI in development

Moderators: hoijui, Moderators

Post Reply
evilzippy2000
Posts: 13
Joined: 24 Oct 2008, 14:01

Is it possible to have AI take over Dropped players in multi

Post by evilzippy2000 »

Would it not be great not having to control 3 base's because 2 ally's dropped in battle, I have a feeling its possible todo this but just need to know if some one is working on something like this, games like sins of solar does this and has turned the tide of the whole game because the ai was sneaking behind enemy lines and bombardin the planets 8)

any info I would be greatfull !
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: Is it possible to have AI take over Dropped players in multi

Post by hoijui »

it is currently not possible.
what would be needed:
  • an AI that could initialize its self in the middle of a game.
  • a change to the engine to support this (probably not a big problem)
maybe it could work with the current AIs if you do this programmaticaly:
  • pause the game
  • let the AI initialize as if it were the start of the game
  • call UnitCreated on the AI for all units of the team
if you want to code it, go ahead! we will give advice if you need any.
maybe someone else has better tips.
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Re: Is it possible to have AI take over Dropped players in multi

Post by Tobi »

It seems to me that a /takebyai <AIname> command wouldn't be too hard to implement, in the way hoijui suggests indeed. Pause game, load AI, call UnitCreated for all units that are being given to it, unpause game (or let user do this?), and voilà, feature implemented.

Big risk of course is to not accidentally load AIs which then can't handle this and crash the entire game. There is unfortunately no way to prevent this apart from good testing of the AI.

Also if someone takes a look at this, I suggest making it so that there is another command with which you can still take the stuff from the AI later, in case it behaves too stupid :-)
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

Re: Is it possible to have AI take over Dropped players in multi

Post by Kloot »

I'll take a stab at it.
Reth
AI Developer
Posts: 70
Joined: 15 Aug 2006, 14:05

Re: Is it possible to have AI take over Dropped players in multi

Post by Reth »

I believe the give/take commands just use HandleEvent(AI_EVENT_UNITGIVEN & AI_EVENT_UNITCAPTURED) when AIs are involved (calling UnitCreated is unnecessary).

RAI makes no assumptions about what types of units it starts with or how many it receives, the only bug, I know of, that would occur under these circumstances is that if RAI had not played the map beforehand then the metal-map detection would fail. (it uses CanBuildAt() to check terrain for impossible build positions) Basically any position covered by an existing building would not be considered a valid metal-site.

I had previously tested giving away an entire team of units to and from a team controlled by RAI, so there should still be few to no bugs in the process of it.
evilzippy2000
Posts: 13
Joined: 24 Oct 2008, 14:01

Re: Is it possible to have AI take over Dropped players in multi

Post by evilzippy2000 »

awesome progress and yes RAI is great at taking over units normally and constructing, I can not seem to find a working RAI ai as the latest release has made it out of date do u have something more recent and im well impressed with feed back thanks would rock this working to a T 8) respect


just a theory even if rai struggled to locate metal spots u could donate power ect , im just one of these people that does not like giving up easy 8)
Reth
AI Developer
Posts: 70
Joined: 15 Aug 2006, 14:05

Re: Is it possible to have AI take over Dropped players in multi

Post by Reth »

evilzippy2000
Posts: 13
Joined: 24 Oct 2008, 14:01

Re: Is it possible to have AI take over Dropped players in multi

Post by evilzippy2000 »

Reth there's an issue with your ai it self d's when the commanders are dead ive set to kill everything yet me and ai vs 2 ai after they loose both commanders booom it self d's , would be happy if you could fix this thanks.
Reth
AI Developer
Posts: 70
Joined: 15 Aug 2006, 14:05

Re: Is it possible to have AI take over Dropped players in multi

Post by Reth »

Were you testing on BA, the mod has it's own option 'game end mode' that overrides the ordinary game server options. As I recall it was set to 'kill all commanders' by default.

Just to be clear, RAI currently does not issue self-d orders.
evilzippy2000
Posts: 13
Joined: 24 Oct 2008, 14:01

Re: Is it possible to have AI take over Dropped players in multi

Post by evilzippy2000 »

damn I think your right is there any way around this ? older versions of ba and your ai never had this issue before.
Reth
AI Developer
Posts: 70
Joined: 15 Aug 2006, 14:05

Re: Is it possible to have AI take over Dropped players in multi

Post by Reth »

With the default TASClient battle window, the option can be changed under the 'mod options' tab
evilzippy2000
Posts: 13
Joined: 24 Oct 2008, 14:01

Re: Is it possible to have AI take over Dropped players in multi

Post by evilzippy2000 »

Awesome nice easy fix thanks again man 8)
User avatar
1v0ry_k1ng
Posts: 4656
Joined: 10 Mar 2006, 10:24

Re: Is it possible to have AI take over Dropped players in multi

Post by 1v0ry_k1ng »

but AI plays so so much worse than human players...
evilzippy2000
Posts: 13
Joined: 24 Oct 2008, 14:01

Re: Is it possible to have AI take over Dropped players in multi

Post by evilzippy2000 »

lol in some cases I would have to disagree its handy having the ai spam while you donate a bit of e and metal its way especially with RAI making use of units you give it,so many times played games where players have no clue ie build 3 factories and have no metal extractors at the start 8)
Post Reply

Return to “AI”