Page 1 of 1

GroupAI redo

Posted: 22 Sep 2005, 21:32
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.

Posted: 24 Sep 2005, 01:02
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?

Posted: 24 Sep 2005, 17:13
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

Posted: 24 Sep 2005, 17:50
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?

Posted: 24 Sep 2005, 18:01
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....

Posted: 24 Sep 2005, 18:09
by jcnossen
Ofcourse doh :oops:

Posted: 24 Sep 2005, 18:20
by SJ
I would probably be very sceptical about using an AI that changes my camera, but to each his own i suppose.

Posted: 24 Sep 2005, 18:26
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......

Posted: 24 Sep 2005, 18:27
by jcnossen
It could be used for a single player mission or an in game tutorial, like in the old TA.