Using dialog boxes in an AI???

Using dialog boxes in an AI???

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

Moderators: hoijui, Moderators

Post Reply
User avatar
hughperkins
AI Developer
Posts: 836
Joined: 17 Oct 2006, 04:14

Using dialog boxes in an AI???

Post by hughperkins »

It's possible to add forms to an AI pretty easily. This makes it possible to do things like :
*have buttons/ checkboxes/radiobuttons to easily configure the AI
*display messages, chat-history etc

The downside is that this doesnt work really well in FullScreen mode, at least not at the moment. The forms appear, one for each AI, but you have to alt-tab out to see them, which significantly reduces their usability, which is what they are trying to improve. Does anyone know:
*if we had the appropriate window handle for the Spring window, would our form be displayed over the top of the fullscreened spring?
*if there's some way that we can, or could, obtain that window handle, through the AI interface or otherwise?

Of course, the interface wouldnt be available if the AI were ever working in Mono, but we could always just not use it when building for Mono.

Here's a screenshot of a first prototype:

Image
User avatar
Masse
Damned Developer
Posts: 979
Joined: 15 Sep 2004, 18:56

Post by Masse »

awesome !
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

I had thought of doing that with debug mode, however I would really like it if we could draw simple arbitrary panels and buttons with text.

btw the call to the interface that retrieves the boolean value of wetehr the user is in debug view (pressed b) is broken, I tried to make NTai debugging data only visible when b was pressed but it just didnt show up at all, whereas the same constraint tied to the pause call worked.
User avatar
hughperkins
AI Developer
Posts: 836
Joined: 17 Oct 2006, 04:14

Post by hughperkins »

awesome !
Thanks!
I had thought of doing that with debug mode, however I would really like it if we could draw simple arbitrary panels and buttons with text.
You mean draw panels and buttons via the Spring interface UI itself? That would probably be the best approach long-term, for consistency.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

It'd allow me to create a new range of groupAIs even more useful than all that came before them.
Chojin
Posts: 141
Joined: 04 Oct 2006, 11:22

Post by Chojin »

About in-game dialogs: Any reason why one can't use the mouse to select a group ai ?
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Post by Tobi »

Because it uses list selection code that doesn't support mouse :-) (hence the single player menus dont support mouse too, same code)
trepan
Former Engine Dev
Posts: 1200
Joined: 17 Nov 2005, 00:52

Post by trepan »

You coud script a ctrlpanel.lua file that
provided mouse-selectable aiselect buttons.

EDIT: Hm, I forgot, you actually can't do that
at the moment (aiselect is a unit command,
which are not directly accessible via the lua
interface). This will soon be remedied.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

Actually I think it would be better if the select AI button was actually removed and instead groupAI's specified an icon to represent them and then those icons are displayed instead, it would sure clear up a lot of confusion amongst n00bs as to howto enable and use groupAIs.
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Post by Tobi »

That would only pollute the default menu (with commands and build orders mixed) even more, so I don't think that is a really good solution. If it was a proper combobox, optionally using icons, or icons and text, it would be ok, but that sorta falls under the *kuch*new gui*kuch*.
User avatar
Masse
Damned Developer
Posts: 979
Joined: 15 Sep 2004, 18:56

Post by Masse »

Tobi wrote:*kuch*new gui*kuch*
YOU SAID IT ! NOW LEAVE SPRING COMMUNITY BEFORE YOU DO MORE HARM !
:lol:
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

I think it would be a lot more user friendly than what we have now. The command box already has a lot of icons what mroe can 2 or 3 icons do?
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Post by Tobi »

For e.g. the commander it wouldn't be 2 or 3, it would be 7 or 8 with the current amount of GroupAIs in SVN...
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

simpleformation+economyAI+centralbuildAI+mexupgraderAI

4. And simpleformation is not needed so that can be removed.
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Post by Tobi »

+radarAI+reportIdleAI
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

It still represents a miniscule number of the total icons.

And ais such as report idle and radar AI neednt be displayed once they're assigned to a random idle unit if they're coded correctly. And the selectAI button is usually on the very last page with enough room underneath it to fit 10-15 icons anyway.

It also removes the ambiguity of the selectAI button.
Arco
Posts: 75
Joined: 17 Jun 2006, 16:28

Post by Arco »

AF wrote:It also removes the ambiguity of the selectAI button.
Why not just rename it from SelectAI to "Advanced Function" or something? (That's a bit too long a name though.) Maybe a "Do" button? If the groupAIs had better names, this would work a bit better; why have something called "Radar AI" when it can be called "Report Radar Contacts"? That describes what it does, which I think is more important.

Regardless, if each AI is given an icon, those icons must be differentiated from the others. Right now commands are text, and build icons are pretty pictures. I don't like the idea of the groupAIs having text icons, because there isn't enough room for a descriptive name, and the AI titles as they are are not descriptive enough. (Some are too long anyhow.) So a graphical icon might be nice, but graphical icons must stand out from build icons. Perhaps they could have a different (very noticible) border, maybe they'll all have some big symbolic "AI" icon on the left of the image or something, but they must be displayed as the same sort of "thing"--after all, they function radio-button style and as such are inherently grouped together and apart from everything else.

I'm really not a fan of giving each AI its own icon, though. I already feel like it's bad enough having the orders buttons flow directly into the build buttons; they represent fundamentally different ideas (all the orders buttons mean something different, but all the build buttons mean "build ___ where I click"; while a "build" command is certainly on the same level as the other orders, the individual buildings/units are one level lower in the descriptive hierarchy). I'd much rather have a sort of drop-down menu for the groupAI, since you can only have one selected at a time.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

Advanced functions is even worse as you need to know howto use it to be able to tell it has anything todo with AIs

"Assign Helper AI" would be better. As for the naming of groupAI's, you'll have to speak to colorblind about that as its his groupAI.

But other than that maybe it would be better if we had the groupAI list replaced with another panel of buttons but each button being a long width button than a square, aswell as a little description bit for the groupAI at the bottom.....
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Post by Tobi »

I've made it a bit better already, can at least click on an AI with the mouse now.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

yay
Post Reply

Return to “AI”