It seems every time I come up with an idea for a useful addition to the engine code (the addition of a new unitdef, or weapon tag, etc) someone's always present to say "that can be done with lua".
So really, what's the differences, pros and cons, of implimenting features into the engine and coding them via lua? It seems to my completely code-illiterate mind that we're operating under two programming systems here, with features able to be implimented with either (people are talking about writing entire rendering and animation systems in lua now).
Lua vs Engine
Moderator: Moderators
-
- MC: Legacy & Spring 1944 Developer
- Posts: 1948
- Joined: 21 Sep 2004, 08:25
Re: Lua vs Engine
Everything in the engine litters and slows down each and every mod.
Everything in Lua can only use provided engine functionality and is slower.
Oh and you don't have to wait for a new Spring version if you implement your own stuff using Lua.
Everything in Lua can only use provided engine functionality and is slower.
Oh and you don't have to wait for a new Spring version if you implement your own stuff using Lua.
Re: Lua vs Engine
If nearly every mod starts using certain Lua code snippets it is a good indication that the engine is missing something.
Re: Lua vs Engine
Hardly, the engine is always missing something for somebody. 
The point of Lua is that you get flexibility whereas extending the engine quickly leads to unmanageable complexity (imagine implementing and maintaining the code of all "missing function" *gets engine-side, on top of everything else that's sensitive to breaking).

The point of Lua is that you get flexibility whereas extending the engine quickly leads to unmanageable complexity (imagine implementing and maintaining the code of all "missing function" *gets engine-side, on top of everything else that's sensitive to breaking).
Those will mostly be limited to prototypes, which may or may not be integrated into the engine. Even so, Lua is ideal for that kind of experimentation too.people are talking about writing entire rendering and animation systems in lua now
Re: Lua vs Engine
Kloot, I think he means if 90% of the mods are using some LUA thing, then it should probably be provided engine side...
Re: Lua vs Engine
but somebody has to port it, right? we're happy to accept patches. there's usually something more critical to do than replicate a widget engine-side.
Re: Lua vs Engine
Well, lemme try to answer your questions a little more as one code-illiterate to another...So really, what's the differences, pros and cons, of implimenting features into the engine and coding them via lua? It seems to my completely code-illiterate mind that we're operating under two programming systems here, with features able to be implimented with either (people are talking about writing entire rendering and animation systems in lua now).
1. Lua's a lot slower, but it's all optional. Matters, because you don't need the fat to have the things you need.
2. Engine-side stuff adds maintenance hassle for the core devs. Think about how messy a big mod gets. Multiply that by, IDK, maybe 5 times. That's roughly how big Spring's core is. Huge, basically. Nobody knows all of it, or how it all works... even guys like Tobi.
Adding more stuff engine-side just makes it worse. It's a bad plan, for the future of the engine.
So... what the heck, I'll go ahead and write a lengthy essay, I've been thinking about some stuff for awhile. In another topic of course.
Re: Lua vs Engine
And while lua can do a lot, it's also very strictly limited in many ways. The lua APIs only have so much you can do.
Re: Lua vs Engine
More importantly Lua is interchangeable. For a hardcoded feature like nanospray if you don't like it the way it is you have to disable it and completely reimplement it, a Lua implementation can be altered easily. Also new engine features have a tendency to break some of the hack cases people have been relying on.