GroupAI redo

GroupAI redo

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

Moderators: hoijui, Moderators

Post Reply
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

GroupAI redo

Post by AF »

I propose that the GroupAI interface be updated. It isnt robust enough and is very limited in comparison tot he more sutied globalAI interface. I suggest that the GroupAI itnerface be able to add and remove other groups as the globalAI is, and that it be able to have more control over UI and camera.

For example, adding commandfinished or enemy destroyed to the GroupAI class would help a lot.
User avatar
jcnossen
Former Engine Dev
Posts: 2440
Joined: 05 Jun 2005, 19:13

Post by jcnossen »

UnitIdle is essentially the same as something like CommandFinished(), so you can use that instead.

I'm thinking of moving the shared global AI and group AI functions to a general ISpringCallback class (Such as the add and remove group AI functions). This could be useful in the future too for other DLL based stuff that might be added to the spring engine.
It will require some code changes in the group and global AI's though, are all AI developers ok with that?
I'll add an EnemyDestroyed function too while I'm at it.

Maybe SJ could comment on the UI stuff, since I'm not sure if that's located in the same thread (app thread, not forum thread ;) ). Is it possible to use OpenGL/font rendering/UI code in the AI callback?
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

No, there's no real way of changing the GUI save things such as refreshing the icons as shown by SJ's central build AI, adding panels and so on would have to be done by making new windows and hiding the toolbars/ borders and setting them as always ontop.

Camera position and direction control would be nice for GroupAI or GlobalAI helpers as SJ plans. And giving units to another player under GlobalAI would be useful for tutorials/ scenarios etc
User avatar
jcnossen
Former Engine Dev
Posts: 2440
Joined: 05 Jun 2005, 19:13

Post by jcnossen »

No, there's no real way of changing the GUI save things such as refreshing the icons as shown by SJ's central build AI, adding panels and so on would have to be done by making new windows and hiding the toolbars/ borders and setting them as always ontop.
Yes true, but the problem here is that you just can't start calling functions that might be running another thread, unless they have been made thread-safe by things like mutexes.

Since SJ has given me commit access to CVS, I'll be adding the camera positioning functions to the callback. I think SJ can spend his time in a better way.

What do you mean with direction control?
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

Well you can always position the camera at a particular position, but which direction it be facing? And for things such as scrolling the camera through a flightpath....
User avatar
jcnossen
Former Engine Dev
Posts: 2440
Joined: 05 Jun 2005, 19:13

Post by jcnossen »

Ofcourse doh :oops:
SJ
Posts: 618
Joined: 13 Aug 2004, 17:13

Post by SJ »

I would probably be very sceptical about using an AI that changes my camera, but to each his own i suppose.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

The camera functions are specifically for use for tutorials and missions. I wouldnt like to play a skirmish game and find the AI has decided to attack and neeeds my camera diverted......
User avatar
jcnossen
Former Engine Dev
Posts: 2440
Joined: 05 Jun 2005, 19:13

Post by jcnossen »

It could be used for a single player mission or an in game tutorial, like in the old TA.
Post Reply

Return to “AI”