ValidAIs.lua - Page 2

ValidAIs.lua

Requests for features in the spring code.

Moderator: Moderators

Master-Athmos
Posts: 862
Joined: 27 Jun 2009, 01:32

Re: ValidAIs.lua

Post by Master-Athmos » 26 Jan 2010, 19:05

I think validating AIs is a good idea. If you don't want to do black- / whitelists why don't you do a traffic light system where in the AI choice window you get a green background for validated AIs, a yellow one for not yet validated AIs and a red one for blocked AIs?

Zwzsg imo is right about AI crashes being a wide spread noob trap...
0 x

User avatar
hoijui
Former Engine Dev
Posts: 4342
Joined: 22 Sep 2007, 09:51

Re: ValidAIs.lua

Post by hoijui » 26 Jan 2010, 19:24

AIInfo.lua exists already, each AI has it (needs it).

For me, it would be ok, as long as all AIs are always usable with every mod from the lobbies; as in: hide them (eg, one needs to click a button for "Unstable AIs"), mark them with a different color, change sorting, ...
0 x

User avatar
smoth
Posts: 22295
Joined: 13 Jan 2005, 00:46

Re: ValidAIs.lua

Post by smoth » 26 Jan 2010, 19:54

+1
0 x

User avatar
Pxtl
Posts: 6112
Joined: 23 Oct 2004, 01:43

Re: ValidAIs.lua

Post by Pxtl » 26 Jan 2010, 19:56

Well, that would be up to the lobby to decide how to implement.... iirc, that's how ValidMaps.Lua is handled, isn't it?

But either way, I think that would be the best approach: mods provide ValidAIs.Lua, and AIs include a "Mods" tag in their AIInfo (say, by ShortName) listing the mods they support that ValidAIs.Lua can optionally read for johnny-come-lately AIs.

(an odd funny: googling for ValidMaps.Lua revealed SpaceCA, an abandoned project to merge CA with FF).
0 x

User avatar
hoijui
Former Engine Dev
Posts: 4342
Joined: 22 Sep 2007, 09:51

Re: ValidAIs.lua

Post by hoijui » 26 Jan 2010, 20:14

soo.. this would have to be done in unitsync, right?

what possibilities do we have:
  • ValidAIs.lua
  • AIInfo.lua
  • ValidAIs.lua & AIInfo.lua
how exactly would you see it working?
eg:
Lobby calls unitsync.GetValidAIs("modX", "version")
unitsync calls mods ValidAIs.lua:GetValidAIs("modX", "version")
which calls the individual AIInfo.lua files?

or

unitsync fetches validModsRegex from AIInfo files, and matches mod names agaisnt it?

...?

(the first one would be bad, as this would break if AI layout changes, if it is even possible)
0 x

User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: ValidAIs.lua

Post by Argh » 26 Jan 2010, 20:18

Or just require that AIs that are allowed to ship with Spring have a very simple requirement: they will not crash the engine if they cannot play a given game, period, and will give end-users feedback if they aren't compatible (preferably, "This AI is not compatible with <game string>, please see documentation at <AI docs location> to learn how to configure <AI name> for this game."

That's a pretty easy minimum requirement to meet, frankly.
Last edited by Argh on 26 Jan 2010, 20:22, edited 1 time in total.
0 x

User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7009
Joined: 16 Nov 2004, 13:08

Re: ValidAIs.lua

Post by zwzsg » 26 Jan 2010, 20:22

So, that would leave us with only NullAI. Not sure it's the wisest move.

Having the engine ship with the most AI possible is good, because AI are incredibly hard to find, and the first thing a newcomer will want to play against. Just let the mod sort them out.
Last edited by zwzsg on 26 Jan 2010, 20:23, edited 1 time in total.
0 x

User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: ValidAIs.lua

Post by Argh » 26 Jan 2010, 20:23

No, it'd leave us with what I'm doing to yours, since I got rid of the silly map restrictions hehe.

And I totally disagree with the "mod is responsible". AI developers are incredibly lazy and making them stable when presented with a game they can't play is very, very easy. They should not be distributed with the engine if they can't meet that requirement, imo- it's not hard to make an AI not crash if it doesn't know what to do.
0 x

User avatar
Pxtl
Posts: 6112
Joined: 23 Oct 2004, 01:43

Re: ValidAIs.lua

Post by Pxtl » 26 Jan 2010, 20:28

@HoiJui

My idea is that ValidAIs.lua is In Charge. However, it can (by convention, not enforced or required by the engine) to check the Mods entry within AIInfo.Lua to check if the mod is mentioned. The idea is that this would handle every case - Z makes his mod with a specific list of AIs in mind, but he's not averse to the idea that a 3rd-party could make a nice Lua AI, and so provides a vector for getting that information from the AI (without zwzsg's suggestion of mangling the AI's name). Alternately, say Argh decides that no 3rd-party AIs are really up to snuff for PURE, and so he can lock out all 3rd-party AIs from his mod without bothering to even check the "Mods" entry in AIInfo.Lua.

And meanwhile, BA can go on assuming that every AI will work.

However, I should mention I'm not really stakeholder. I've a couple of budding mod projects, but haven't touched AI stuff.
0 x

User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: ValidAIs.lua

Post by Argh » 26 Jan 2010, 20:35

I totally disagree with that. I, as game developer, should not have to worry whether some incompetent programmer made a show-off project that's unstable as hell when presented with novel gametypes and then got it shipped with Spring somehow.

I already delete all of the C++ AIs from P.U.R.E. when it ships because of this issue; I think it's high time to make AI developers meet minimal standards before we ship their products with the engine... and one of those standards is not crashing, ever, if presented with a novel game, and providing the end-user with feedback.

IOW, no more free riders; if you're just building AIs for academic purposes or w/e, then you can release in the AI forum and try to find enough testers to make things work out. Otherwise, you need to meet some standards in terms of the end-user's experience.

Meh, more on this when I'm done hacking at the KP AI source, and have something practical to show.
Last edited by Argh on 26 Jan 2010, 20:37, edited 1 time in total.
0 x

User avatar
hoijui
Former Engine Dev
Posts: 4342
Joined: 22 Sep 2007, 09:51

Re: ValidAIs.lua

Post by hoijui » 26 Jan 2010, 20:37

Argh, what you assume is not true.
Eg. AAI, when it misses a config file for a mod, it kills itsself (gracefully), and informs the user that a config file is missing and so on...
the user will then see the "You have won the game" dialog, and will not notice the message of AAI in the background, and for sure will not check infolog.txt. He will then come to the forum, and explain that (meaning: A)AI does not work with Spring (meaning: BA).
of course it would be better if mods would never crash, i agree, and would like to see that too, but .. there is just nobody willing to test that.
.. and/or implement in AIs ;-)
0 x

User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: ValidAIs.lua

Post by Argh » 26 Jan 2010, 20:41

Eg. AAI, when it misses a config file for a mod, it kills itsself (gracefully), and informs the user that a config file is missing and so on...
the user will then see the "You have won the game" dialog, and will not notice the message of AAI in the background, and for sure will not check infolog.txt. He will then come to the forum, and explain that (meaning: A)AI does not work with Spring (meaning: BA).
First off, that's 100% preventable.

Simply write a Widget to pass AI messages to end-users in a very obvious way (like, IDK, play a sound, show a nice alert box and a detailed message).

Second off, that's no excuse, and not all of the AIs shipping with Spring meet that standard.

Thirdly, we're back to the "we aren't going to test that or work on it", which is precisely why I'm working on these things. There's no excuse for this attitude- AIs that ship with commercial products aren't unstable when presented with novelty; at worst, they just don't do anything and quit.

There's more to real, deployable AI in a game design setting than just some clever algorithms; there's the requirement to keep it stable and able to at least hang gracefully if it can't deal with things. You guys aren't really doing Spring, the project, any favors by including AIs that can't meet these requirements- the end-user's experience is that your product crashes the engine, which (end-users being what they are) reflects poorly on the engine.
0 x

User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14550
Joined: 17 Nov 2005, 02:43

Re: ValidAIs.lua

Post by Forboding Angel » 26 Jan 2010, 22:57

I'd have to say I'm on Argh's side here. The only halfway competent AI that will play the most mods in spring is RAI, and even then it will crash sometimes when it is presented with something it can't handle.

AI's should fail gracefully so that the end user knows what happened, not just a big "YOU WIN! CONGRATUFUCKINLATIONS!". :-p
0 x

User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7009
Joined: 16 Nov 2004, 13:08

Re: ValidAIs.lua

Post by zwzsg » 26 Jan 2010, 23:43

Argh, Forb, your plan doesn't address the main issue: Ensure the newbie get a properly working skirmish on their first try:

1) The AI included in the installer all work given the right conditions. And when they work, they are helpful for newbies! Without them, people trying Spring would be left with zero possibility for skirmishes (most mods don't have Lua AI).

2) If you keep AI that shut down gracefully instead of crashing, then the noob will see them, try them, and still not have a skirmish going. No, the newb will not read the AI message, even less understand it. He'll just think that Spring is crap cause the AI doesn't do anything, and move on.

So, we need a ValidAIs.lua.
- That way, I can hide AI that are stable but don't know how to play.
- That way, if an AI crash for mod X but not for mod Y, then mod Y can still have its skirmish AI.
0 x

User avatar
hoijui
Former Engine Dev
Posts: 4342
Joined: 22 Sep 2007, 09:51

Re: ValidAIs.lua

Post by hoijui » 27 Jan 2010, 00:08

i agree Z, so.. lets decide how exactly to do it.

i do not yet have a clear view, so maybe some others may describe their ideas in more detail.
0 x

User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7009
Joined: 16 Nov 2004, 13:08

Re: ValidAIs.lua

Post by zwzsg » 27 Jan 2010, 00:23

Like ValidMaps.lua! :P

In the mod, there would be a Lua file that return a list of AI shortNames.

Like:

Code: Select all

return {"KAIK","NTAI","BaczekKPAI","Chicken Lua AI""}
UnitSync would use that file, and make it available to lobbies.

When hosting a game, lobbies would only show the AI in that files, unless the secret advanced mode is triggered.

When that file is not present, then all AI are available like now.
0 x

User avatar
AF
AI Developer
Posts: 20667
Joined: 14 Sep 2004, 11:32

Re: ValidAIs.lua

Post by AF » 27 Jan 2010, 01:26

The problem is your assuming that supports or does not support is a simple true or false affair.

Its also subjective to who your talking to, which I wont get into.

Allow 'recommended AIs', and allow listing of AIs that aren't reccomended. Then a list of AI name + version that definitely works, and definitely does not work.

However if my AI does not work and I fix it, and it still wont work because of a list in a text file on the mod side, what am I supposed to do? Modders won't re-release to fix this, they'll change it then wait for their normal release cycle to finish, and a lot of the time, this can take months or not happen at all!!

At the end of the day I know more about my AI, and if it doesnt work, it should fail gracefully and not crash, but even then, If there are white lists and black lists, I should be the one to write them, not the content developers!!!! Its MY project, not theirs, I should be the one dictating which games are supported and aren't supported.

If a user wishes to disable it and go against my wishes then fine, but they're treading in untested waters, and its not because a content dev who doesn't do any AI stuff tried it once and it didn't work as expected, its because someone who lives and breathes AI code tested it out and couldn't fix it there and then and declared it unsafe.

Besides, why should AI developers be told to shutup and not complain about it when YOU lot kicked up such a fuss about mappers doing exactly the same thing to you!!

To those AI developers who actually challenged the failing gracefully doctrine and allow their AIs to crash I have only one thing:

You should be ashamed of yourself, your users certainly are.
0 x

User avatar
Pxtl
Posts: 6112
Joined: 23 Oct 2004, 01:43

Re: ValidAIs.lua

Post by Pxtl » 27 Jan 2010, 02:27

@AF, this is why I think mods should read the AI's AIInfo.Lua - to check if the AI thinks it works. A semi-permissive mod can provide
a) an explicit whitelist, and
b) read the AInfo.Lua to check.

Imho, this should be the approach for everything - maps too.
1) Provide a whitelist for stuff you're sure will work
2) Check the map for tags that indicate whether it thinks it will (or will not) work with your mod.

By convention, each AI and Map would include in AIInfo/MapInfo, a list of "valid_mods" and "invalid_mods" that are readable through unitsync.

Then It's up to the mod developer to decide
1) Show everything (less a blacklist)
2) Show everything (less a blacklist) except for stuff that has requested it not be listed
3) Show only a whitelist plus stuff that has requested it be listed
4) Show only a whitelist and who cares what the content/AIs thinks.
depending on how the mod developer codes ValidMaps and ValidAIs - after all, it's a Lua script - he can either hard-code the list or use the UnitSync information to inspect the map/AI files before approving/rejecting them.

But ultimately, the lobby includes the ability to ignore the mod's "Valid" decision and run anything with anything.

This way, everybody has a way to have a say - the mod developer has the best idea of what will or will not work - is my mod just like BA? Then look for BA-related tags. Is my mod just like KP? Look for KP related tags. Meanwhile, the mapper and AI can provide as much information as they can to mod-developers to allow their ValidX files to make an informed decision.

Like I said, I'm not a stakeholder - my mod work is still embryonic. It just seems like this infighting could be handled by everybody just putting out the information of "what I think this will work with" and the mods scrupulously consuming that info.
0 x

User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: ValidAIs.lua

Post by Argh » 27 Jan 2010, 04:48

Without them, people trying Spring would be left with zero possibility for skirmishes (most mods don't have Lua AI).
No, because any AI worth releasing with Spring would support all of the major games that are currently being maintained, at release. Not an impossible goal, it may not be possible with really fancy AIs, but it's certainly possible with something robust and simple.
If you keep AI that shut down gracefully instead of crashing, then the noob will see them, try them, and still not have a skirmish going. No, the newb will not read the AI message, even less understand it. He'll just think that Spring is crap cause the AI doesn't do anything, and move on.
A. If the above is implemented, this won't happen a lot with a real newbie trying the current games- it'll just happen with back-catalog stuff.

B. If a message is loud and clear, not just some obscure infolog spam or at most, a console message, then I do not think players will not know something is wrong, and why. They may still blame the engine, but more likely they will contact the developer of the AI, who can then point them at configuration documentation (or just write a simple config, if it's something simple like porting a BA config over to OTA Mod 9000+).
If there are white lists and black lists, I should be the one to write them, not the content developers!
I agree with this POV, in principle. A game's release schedule is often months in length, an AI can update very frequently.

I also think that if AIs actually gave end-users more feedback about why they aren't operable with Game X and how to contact the developers / get help / RTFM, there would be a much better feedback loop.

Consider this: for every person we get on these Forums, complaining that AI X crashed Spring, we probably have 10 people who concluded Spring was a piece of crap and deleted it off their hard drive, because they went through the overall process of setting up a single-player game (which is currently very un-intuitive) and then had a crash. I'd do the same, in their shoes.

We get... idk, at least 2-3 of those posts every week? That's a lot of lost opportunities.
0 x

User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7009
Joined: 16 Nov 2004, 13:08

Re: ValidAIs.lua

Post by zwzsg » 27 Jan 2010, 10:17

However if my AI does not work and I fix it, and it still wont work because of a list in a text file on the mod side, what am I supposed to do? Modders won't re-release to fix this, they'll change it then wait for their normal release cycle to finish, and a lot of the time, this can take months or not happen at all!!

At the end of the day I know more about my AI, and if it doesnt work, it should fail gracefully and not crash, but even then, If there are white lists and black lists, I should be the one to write them, not the content developers!!!! Its MY project, not theirs, I should be the one dictating which games are supported and aren't supported.
Oh well, if you assure me that all AI will come with their own list of compatible mod, and will not show on any other mod than those specifically listed, why not. I just thought I'd save the AI devs the hassle of testing their AI against every mod, but if they're willing to, sure.


Besides, why should AI developers be told to shutup and not complain about it when YOU lot kicked up such a fuss about mappers doing exactly the same thing to you!!
I have yet to see a map cause a crash or a sitting duck AI when played with certain mods. While it's certainly possible, it happens far far less. All the maps do is tweak the gameplay in ways too subtle for newbs to notice.


Argh wrote:
Without them, people trying Spring would be left with zero possibility for skirmishes (most mods don't have Lua AI).
No, because any AI worth releasing with Spring would support all of the major games that are currently being maintained, at release. Not an impossible goal, it may not be possible with really fancy AIs, but it's certainly possible with something robust and simple.
Of all the persons, I thought you would be the one most able to understand we need some pragmatism here. Sure, having AIs that work with everything would be best. But the reality is, there is zero Spring AI in existence that meets this requirement.


Argh wrote:for every person we get on these Forums, complaining that AI X crashed Spring, we probably have 10 people who concluded Spring was a piece of crap and deleted it off their hard drive
Truth!
0 x

Post Reply

Return to “Feature Requests”