How to set a global LuaAI?
Moderator: Moderators
How to set a global LuaAI?
I'm working on a LuaAI right now that will support a number a games (and fail quietly on those it doesn't support). Rather than require each game to package the gadget I want to ship it separately.
Trouble is I'm not sure how I'd go about adding it the list returned by LuaAI.lua. In a quick test it looks like lobbies will only read the mods LuaAI.lua and not one in the spring root.
Is there an existing workaround for this or does it require modifying the lobbies and/or unitsync?
Trouble is I'm not sure how I'd go about adding it the list returned by LuaAI.lua. In a quick test it looks like lobbies will only read the mods LuaAI.lua and not one in the spring root.
Is there an existing workaround for this or does it require modifying the lobbies and/or unitsync?
Re: How to set a global LuaAI?
some time ago in lobby i was told it is not possible (atm?) for technical reasons :/
might also raise a cheats problem?
Still would be nice to have.
btw:
to delete as long as no replies
might also raise a cheats problem?
Still would be nice to have.
btw:

Re: How to set a global LuaAI?
Put your AI in an archive/SDD and then make a mod/game that specifies your AI and the chosen game as a dependency?
Re: How to set a global LuaAI?
if i am not mistaken the point is to make a LuaAI play a game without modifying the game
Re: How to set a global LuaAI?
The issue there is players would have to select the mod (ie, BA + Nemesis AI) and I'd need one of these mods for every Spring game. Then I'd need variations for other mods (BA + Chickens + Nemesis AI) and other AIs (BA + Chickens + Nemesis AI + Shard AI). It's not a very practical solution compared to supporting a master AI file in addition to the mod one.AF wrote:Put your AI in an archive/SDD and then make a mod/game that specifies your AI and the chosen game as a dependency?
No button like that and forum says I don't have permission to delete postsknorke wrote:btw:
to delete as long as no replies
Re: How to set a global LuaAI?
No because eventually you'd declare that version fit for purpose and it'd be rolled into BA or whichever game itself either directly or as a versioned dependency
Re: How to set a global LuaAI?
That's a terrible idea. It would mean instead of releasing 1 version of the AI there would be multiple versions floating around in different states depending on when a mod was last updated and how cooperative the game authors are. How could you possibly expect that to be easier than allowing non game-specific AI in the engine (like all other AI bindings do already)?
If it can't be done now then the answer is not messy hacks, it's adding support where it's needed (whether that's in the lobbies or unitsync or both).
And before anyone brings up the state of other non-specific AI's that crash the game you must realise this is different. LuaAI's are just gadgets so the worse they can do is play badly or not at all - they aren't likely to crash the whole engine like C++ bindings can.
If it can't be done now then the answer is not messy hacks, it's adding support where it's needed (whether that's in the lobbies or unitsync or both).
And before anyone brings up the state of other non-specific AI's that crash the game you must realise this is different. LuaAI's are just gadgets so the worse they can do is play badly or not at all - they aren't likely to crash the whole engine like C++ bindings can.
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: How to set a global LuaAI?
Once again an AI dev falls into the trap of thinking that we don't want the best AI possible for our games.
This is the biggest bitch that we gamedevs have with you aidevs. We want a static version of your ai included that works. Not a version that we can't control when it works and when it breaks. If, after testing, your ai works correctly, the version would of course be bumped by any decent moddev.
I'll tell you what to do.
Create your luaia as a separate sd7 package, give it modtype 0, a name and a version.
Inform games that you support of it's existence and give them the option of calling your packaged-ai-SD7 as a dependency, thereby adding support for it in the various lobbies. Also, if your sd7 is on springfiles, the lobbies will automatically dl it for the users if the game calls on it as a dependency.
Release each new version on springfiles, as a separate file (so as not to break backwards compatibility for new users (as well as avoiding royally pissing off gamedevs)). Announce your new versions here or via email to mod authors. They'll get tested, and once they are, the moddev can jsut change the version number in the dependency and the new version of your sd7 will be downloaded by the lobbies.
However, most of us may just crack open the sd7 and include the ai directly. Most of us lothe depending on outside sources (hence the demise of the C++ AI).
So you can either go that route, or post an svn of your luaia ready to be dropped into games. If it's worth a shit, it'll get used and updated. If you AI devs would stop being so ridiculously pedantic in trying to control every little fucking facet and realize that the majority of us gamedevs aren't lazy fucktards, you might get more cooperation from us.
As an example, if your AI supported evo, and was decent, I would happily include it, and if I was notified of new significant updates I would update it quite regularly (might wanna keep it to a weekly or bi-weekly/monthly large update, because it's hard to test an ai so often along with all the other shit we have to do on a daily basis).
This is the biggest bitch that we gamedevs have with you aidevs. We want a static version of your ai included that works. Not a version that we can't control when it works and when it breaks. If, after testing, your ai works correctly, the version would of course be bumped by any decent moddev.
I'll tell you what to do.
Create your luaia as a separate sd7 package, give it modtype 0, a name and a version.
Inform games that you support of it's existence and give them the option of calling your packaged-ai-SD7 as a dependency, thereby adding support for it in the various lobbies. Also, if your sd7 is on springfiles, the lobbies will automatically dl it for the users if the game calls on it as a dependency.
Release each new version on springfiles, as a separate file (so as not to break backwards compatibility for new users (as well as avoiding royally pissing off gamedevs)). Announce your new versions here or via email to mod authors. They'll get tested, and once they are, the moddev can jsut change the version number in the dependency and the new version of your sd7 will be downloaded by the lobbies.
However, most of us may just crack open the sd7 and include the ai directly. Most of us lothe depending on outside sources (hence the demise of the C++ AI).
So you can either go that route, or post an svn of your luaia ready to be dropped into games. If it's worth a shit, it'll get used and updated. If you AI devs would stop being so ridiculously pedantic in trying to control every little fucking facet and realize that the majority of us gamedevs aren't lazy fucktards, you might get more cooperation from us.
As an example, if your AI supported evo, and was decent, I would happily include it, and if I was notified of new significant updates I would update it quite regularly (might wanna keep it to a weekly or bi-weekly/monthly large update, because it's hard to test an ai so often along with all the other shit we have to do on a daily basis).
Re: How to set a global LuaAI?
That's all very nice but first you accuse me of being a control freak then go on to demand absolute control over your game. That's nice in theory if user widgets and mutators didn't exist.Forboding Angel wrote:... rant ...
The issue for me isn't about controlling your game. It's that the AI I'm writing is 95% framework (shared code) and 5% game-specific logic. When I find a bug in the framework code I want to push 1 archive not 10.
Everything you just said could have been reduced to these two lines - the rest is just rage and insults. As it happens I have no problem with that option because it solves my only 2 concerns: 1.) that I'm only maintaining and packaging 1 set of code and 2.) that users won't have to host a "Game + AI" version of the game.Forboding Angel wrote:Create your luaia as a separate sd7 package, give it modtype 0, a name and a version.
Inform games that you support of it's existence and give them the option of calling your packaged-ai-SD7 as a dependency, thereby adding support for it in the various lobbies
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: How to set a global LuaAI?
I didn't insult you personally. I just called ai devs control freak, which you are, yet you guys are omgshocked when you find out that gamedevs are too.
Well... duh.
And no, I conveyed some very important information in my post. Read it again without taking everything so damn personal.
Also this was the only part of my post that was a rant:
It's like *A advertising, claiming to have singleplayer and pointing at AAI.
Well... duh.
And no, I conveyed some very important information in my post. Read it again without taking everything so damn personal.
Also this was the only part of my post that was a rant:
What you have to realize is that AI's are an addon essentially, and a bad AI makes the game look bad as well.If you AI devs would stop being so ridiculously pedantic in trying to control every little fucking facet and realize that the majority of us gamedevs aren't lazy fucktards, you might get more cooperation from us.
It's like *A advertising, claiming to have singleplayer and pointing at AAI.
Re: How to set a global LuaAI?
Of course LuaAIs should be able to work just like any other AI, without having to alter the game in any way!
It is only like that because of <some technical reason> or because nobody thought of changing it yet.
So does a a bad non-Lua AI, a bad lobby, a bad map, a bad widget, etc
Of those you can only block the widgets.
Or ask for white/black list support.
Or make such list yourself as gadget:
If ai != "whatever ai works with evo" then echo ("big fat warning")
In the end it just depends on engine devs anyway. if they explain or implent global Lua AIs
It is only like that because of <some technical reason> or because nobody thought of changing it yet.
Forb I can not believe you want to "block" global LuaAI because it might look your game look bad?What you have to realize is that AI's are an addon essentially, and a bad AI makes the game look bad as well.

So does a a bad non-Lua AI, a bad lobby, a bad map, a bad widget, etc
Of those you can only block the widgets.
Then make an installer and include whatever you like.We want a static version of your ai included that works.
Or ask for white/black list support.
Or make such list yourself as gadget:
If ai != "whatever ai works with evo" then echo ("big fat warning")
In the end it just depends on engine devs anyway. if they explain or implent global Lua AIs

- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: How to set a global LuaAI?
Why would I want to block it knorke? That's just silly. I was telling him how to do it currently with no necessary change to anything.
Also, this make an installer shit is getting old. Do you want me to continue supporting current spring users or not?
Also, this make an installer shit is getting old. Do you want me to continue supporting current spring users or not?
Re: How to set a global LuaAI?
because some AIs dont work with your game? I plan to soon-ish add such warning to spring tanks, for maps too.Why would I want to block it knorke? That's just silly.
at least in infolog:
"You are playing on a water map. Noticed how you can not even move your units? look at this map list: blabla"
"Noticed how the AI players do not do anything? Use one of those AIs: blabla"
i see. But just because there is some (imo) hackish way does not mean a better solution is needed.how to do it currently with no necessary change to anything.
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: How to set a global LuaAI?
You confuse me. First you say that blocking a global luaai feature is bad, then you go on to explain why it should be. Huh?
Suffice it to say, spliff, you should probably work with some gamedevs and get them to include it. If you would like to support evo (which should be really easy, evo has a lot of AI exceptions built in to make it easy for AIs to support it. For example, AI's are exempted from the power/teching requirements, etc) I'll be happy to help out wherever I can.
Unfortunately, I am more or less anti c++ AI anymore, because c++ AI devs go on hiatus and ai breaks and I can't do shit to fix it because I can't compile it, blah blah blah, I want no part of that anymore. So luaai is the only type of ai that holds my interest anymore.
Seriously, why are AI devs so worried about us including their AI's with our games? It's silly. I think that most of us would give the ai dev svn access so that they can make changes, or if they just wanted to work out of their svn and have us update our own copies, that would be fine with me.
But the thing is, AIs such as c++ ai's give us gamedevs no control over it, and therefore we don't want any part of it. Moreover, a luaai in our project we can just revert to an earlier version if the dev goes retarded and breaking crap. Moreover, barring changes to lua, it will ALWAYS work, and that, is attractive.
P.S. Spliff, on a personal note, you seem to think I have it in for you. Well I don't.
Suffice it to say, spliff, you should probably work with some gamedevs and get them to include it. If you would like to support evo (which should be really easy, evo has a lot of AI exceptions built in to make it easy for AIs to support it. For example, AI's are exempted from the power/teching requirements, etc) I'll be happy to help out wherever I can.
Unfortunately, I am more or less anti c++ AI anymore, because c++ AI devs go on hiatus and ai breaks and I can't do shit to fix it because I can't compile it, blah blah blah, I want no part of that anymore. So luaai is the only type of ai that holds my interest anymore.
Seriously, why are AI devs so worried about us including their AI's with our games? It's silly. I think that most of us would give the ai dev svn access so that they can make changes, or if they just wanted to work out of their svn and have us update our own copies, that would be fine with me.
But the thing is, AIs such as c++ ai's give us gamedevs no control over it, and therefore we don't want any part of it. Moreover, a luaai in our project we can just revert to an earlier version if the dev goes retarded and breaking crap. Moreover, barring changes to lua, it will ALWAYS work, and that, is attractive.
P.S. Spliff, on a personal note, you seem to think I have it in for you. Well I don't.
Re: How to set a global LuaAI?
global LuaAIs are (afaik) not possible at the moment.First you say that blocking a global luaai feature is bad, then you go on to explain why it should be.
Saying that the engine should not be changed to make them possible: stupid.
Added checks/filters in your game to notice players of failing AI: good.
AIs saying "i cant play this but ill try. ill probally fail." instead of just failing: good
I would be fine too, see:I think that most of us would give the ai dev svn access so that they can make changes, or if they just wanted to work out of their svn and have us update our own copies, that would be fine with me
http://springrts.com/phpbb/viewtopic.php?f=15&t=25642
But only because it is the only way ATM. But does not make it a good way.
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: How to set a global LuaAI?
Ok I understand what you're saying now, and I agree. However, if global ais are allowed, won't it jsut lead to the same issue we have currently with c++ ais?
Imo it is better to force the ai devs and the gamedevs to work together. Lets be honest, neither side is that bad to work with, and for the most part, the vast majority of us devvy types (beit engine, game, ai...) are really nice people.
Imo it is better to force the ai devs and the gamedevs to work together. Lets be honest, neither side is that bad to work with, and for the most part, the vast majority of us devvy types (beit engine, game, ai...) are really nice people.
Re: How to set a global LuaAI?
Forboding Angel wrote:
As an example, if your AI supported evo, and was decent, I would happily include it, and if I was notified of new significant updates I would update it
.....
Unfortunately, I am more or less anti c++ AI anymore, because c++ AI devs go on hiatus and ai breaks and I can't do shit to fix it because I can't compile it, blah blah blah, I want no part of that anymore. So luaai is the only type of ai that holds my interest anymore.
Seriously, why are AI devs so worried about us including their AI's with our games? It's silly. I think that most of us would give the ai dev svn access so that they can make changes, or if they just wanted to work out of their svn and have us update our own copies, that would be fine with me.
But the thing is, AIs such as c++ ai's give us gamedevs no control over it, and therefore we don't want any part of it. Moreover, a luaai in our project we can just revert to an earlier version if the dev goes retarded and breaking crap. Moreover, barring changes to lua, it will ALWAYS work, and that, is attractive.
P.S. Spliff, on a personal note, you seem to think I have it in for you. Well I don't.
Im sorry foreboding about my Hiatus due to major internet issues but your forgetting:
- This is a two way path, be it C++ or lua, you need ot tell me or whichever AI developer that your game has become horribly broken.
- You made ZERO attempt to contact me, and when you finally said it, it was because I had contacted you to check
- During my Hiatus the only messages I recieved was a post from zwzsg saying 'omg it still works'
- The problem you complained about required no C++ knowledge or my involvement to fix.
To be precise, all you had to do was add a few extra parameters to a function call in a file, numbers to be precise, and change them one by one to see which spacing value worked best.
So why did Shard break while I was away?
It didnt, it was working exactly the same when I left as when I came back properly. So whatever issues it had must have been present when me and you were testing before I went and gone unnoticed
If I had never gone come back, would you all be buggered?
No, Abma and Hoijui are perfectly capable of making sure the c++ continues to work, as it is a very thin layer. There's nothing stopping a pure luaAI port, and the lua that Shard has is simple, and highly modular, with an API that is written out with full parameters in files
Was this because Shard is a C++ AI?
Considering that 90% of Shards code is lua, and the c++ portion is a glorified API wrapper, no it is not. Would the same thing have happened if it was a pure lua AI? YES This is a story of negligence, not technical implementation. No AI interface changes occurred, no binary recompilations were required. The behaviour of Shard did not change
Why have I not investigated the problem with Evolution RTS yet
- Outright lies on the forum about the demise of native AIs that rely on events that happened 'after' the said demise took place
- Snarky comments in threads such as this
- A complete and utter lack of information
But when your being two faced and bitchy about it on the forums, referring to me like this without naming me, when you yourself aren't exactly smelling of roses either makes me think is it worth offering you everything you want on a silver platter. Why should I help you with your game when your being bitchy? Maybe I should go help someone nice who shows gratitude for what help I give and avoid mud throwing on forums.
Wether your being a two faced b*stard or not, that's what it looks like from here, so I would be more tactful if I were you, and maybe I and others will pretend you didnt post in this thread and forget about it
Any replies to this post are to be made in private, it's amazing this thread isnt any more derailed than it is
Last edited by AF on 02 May 2011, 20:19, edited 2 times in total.
Re: How to set a global LuaAI?
thisknorke wrote:Of course LuaAIs should be able to work just like any other AI, without having to alter the game in any way!
It is only like that because of <some technical reason> or because nobody thought of changing it yet.
Re: How to set a global LuaAI?
+1 It would reduce the needed logistics greatlysmoth wrote:thisknorke wrote:Of course LuaAIs should be able to work just like any other AI, without having to alter the game in any way!
It is only like that because of <some technical reason> or because nobody thought of changing it yet.
Re: How to set a global LuaAI?
+1 from me too.AF wrote:+1 It would reduce the needed logistics greatlysmoth wrote:thisknorke wrote:Of course LuaAIs should be able to work just like any other AI, without having to alter the game in any way!
It is only like that because of <some technical reason> or because nobody thought of changing it yet.
Does anyone have an explanation of the technical problem stopping this?