Now, i am confused. While the wiki says that luaAi's need to be executed on every machine in game. Then, there's a mention here that says they don't run on every machine.
So, how do LuaAi's work exactly, and what is the proper way to do them? So far i've just used a gadget that reads GetTeamLuaAI and assumes control of whoever has this set -- is this the way it's supposed to be?
What is the proper way to implement LuaAI?
Moderators: hoijui, Moderators
Re: What is the proper way to implement LuaAI?
The proper way is however the heck you want to do it.
If you want it to run synced, then make it a gadget that latches on. If you want it to be a real AI that you can set up more than one of, you'll want the gadget to create instances of itself or be written in an OO way.
If you want it to run on one computer, you could, for example, have it run in the unsynced gadget area, sending commands to a small bit of synced code that passes them on to the units.
AF's wording isn't the best in that post. 'no longer run synced' isn't true here nor there; they never had to run synced, but still can run synced.
If you want it to run synced, then make it a gadget that latches on. If you want it to be a real AI that you can set up more than one of, you'll want the gadget to create instances of itself or be written in an OO way.
If you want it to run on one computer, you could, for example, have it run in the unsynced gadget area, sending commands to a small bit of synced code that passes them on to the units.
AF's wording isn't the best in that post. 'no longer run synced' isn't true here nor there; they never had to run synced, but still can run synced.
Re: What is the proper way to implement LuaAI?
Lua changes and someone says one thing and someone says another and you don't know whose right or if theyre both right.
If I'm not mistaken the reason it says it no longer runs synced is because of an objection by you yourself. I'm going to edit the post and remove both the strikeout text and the correction.
If I'm not mistaken the reason it says it no longer runs synced is because of an objection by you yourself. I'm going to edit the post and remove both the strikeout text and the correction.
Re: What is the proper way to implement LuaAI?
lurker originally wrote:doesn't need to run synced
See the difference? It never had to run synced and doesn't have to run unsynced.AF wrote:no longer runs synced
Re: What is the proper way to implement LuaAI?
Do not manipulate sentences and take quotes out of context in order to attack somebody, especially not in this forum. Most of the people who actively post in this forum are developers, newbie coders, or academics, it is not in your interests to troll, and it is not in the interests of this projects survival to allow that in this forum.
Re: What is the proper way to implement LuaAI?
I'm not trolling, nor am I taking things out of context. Here is the entire quote, my post and your response:
I don't know why you think I'm attacking you, just trying to explain that it can be synced or unsynced, because the wiki being wrong is confusing enough. Anarchid, which wiki page? I can't find it searching quickly.
I do apologise that I'm not quoting what your blog said, I don't have a copy of what was there before you deleted it.AF wrote:Heh I didn't know that, I was going off of something trepan said on the forums when he implemented lua AIs, Ill issue a correction!lurker wrote:Now don't you FUD too. A lua AI doesn't need to run synced. Still going to be slow, though.
I don't know why you think I'm attacking you, just trying to explain that it can be synced or unsynced, because the wiki being wrong is confusing enough. Anarchid, which wiki page? I can't find it searching quickly.
Re: What is the proper way to implement LuaAI?
I modified my blogpost accordingly admitting it was incorrect. But you still took that quote out of context and snipped words either side to get the bits you wanted.
Re: What is the proper way to implement LuaAI?
I know I snipped a bit quoting your post, but I was trying to get what the blog post had said, and that was your own summary of what it had said.
I had gotten the impression you were still unsure, and were just removing it entirely. I was trying to clarify it, not attack you. v_vAF wrote:I modified my blogpost accordingly admitting it was incorrect.
Re: What is the proper way to implement LuaAI?
I said they can run unsynced with the text saying they had to run synced striked out. Semantics! But as I said, I edited my blog post a second time to remove that entirely so ti didnt mention synced or unsynced at all.
Re: What is the proper way to implement LuaAI?
You said 'can'? Then I horribly misread it; sorry. Again, my only intent has been to clarify.
Re: What is the proper way to implement LuaAI?
Finally, i guess the simplest answer would be: if you're creating a SkirmishAI then it should be synced & you should write a gadget (but better use any of the AI interfaces), otherwise it is a HelperAI & it should be written as widget (e.g. SmartNanos widget). By the way, i think widgets are true cheats cause if i'm a top coder i could create a superb helper AI widget which will do everything (or most of things) for me.
Re: What is the proper way to implement LuaAI?
I don't know; it's certainly easier to the write a synced AI, but not by a whole lot, and you can get a big speed improvement if you make a skirmish AI unsynced. In this case you have a miniature bit of synced code to actually implement orders, and it sends lua messages back and forth to the unsynced majority. This could be gadget unsynced or widget, but another benefit of having the majority of the code run in the widget arena is that you can have permanent config files and load external libraries.