views:

306

answers:

4

I am working on a project where I want users to be able to modify and customize as much as possible.

Open source might be a good choice but not due to the fact that I want to keep a few internal classes closed.

Two other options that I thought about were plug-ins as external libraries and Lua scripting.

The problem with libraries (DLLs) are that cross-platform compatibility is a must-have because it is some kind of a game server and it is mainly designed for use on dedicated servers (often Linux) yet many people will also use it on their local machine (mostly Windows).

Due to the fact that it's a game server application that should be able to handle lots of connections and actions related to the game performance is very important so I have doubts with Lua scripts.

Are my doubts reasonable or would Lua be a good solution? Also can you think of any better / other option for my concern?

To sum up the important aspects:

  • cross-platform compatibility
  • good performance (-> online game)
  • plug-ins / scripts that anyone can create as long as he/she knows about the language, may it be Lua, C or whatever
  • option for closed source plug-ins / scripts (not so important, but would be fine :)
+2  A: 

There's nothing to stop you providing different licensing for the different modules in your application, obviously that precludes using GPL 3 as that would immediately cover everything.

Lazarus
Depending on how the modules are coupled, GPL 2 might not work either. Generally, dynamic linking isn't a 'firewall' that prevents the GPL license from applying to other modules. Invoking a module as a separate process is usually enough to prevent the GPL license from applying across the process boundary.
Michael Burr
What about the LGPL?
Lazarus
Thanks a lot about the fast replies.Maybe my discription is a bit misleading but my concern is not what license to use but if LUA would perform fast enough for a game server application where speed is very high priority.Or in case it will not if anyone can think of a good option ;)
Spoofy
Ah! There I have nothing to offer I'm afraid.
Lazarus
+5  A: 

I'm afraid the only one who can answer if Lua will be fast enough for you is... you. We have no idea what exactly are you doing and how are you implementing it. My suggestion is to prototype and measure. Write a small, but relevant, part of your system in both Lua and C/C++, measure the performance of both and decide if Lua is fast enough. Having WoW as a case study, Lua seems to be fast enough for the client/UI part of the game, but I cannot say anything about the server. But anyway, I doubt there's language out there that's faster and easily embeddable compared to Lua (disclaimer: I haven't measured Lua performance myself, especially not against other similar languages, so take this with a grain of salt)

You mention something about DLLs not being cross-platform, so just FYI: if you want to use DLLs for plugins and load them dynamically, the same functionality exists on Linux. The "DLLs" are called "shared libraries" or "shared objects" and usually go by the extension of .so. And instead of the windows LoadLibrary, GetProcAddress and FreeLibrary, there are dlopen, dlsym and dlclose.

sbk
Sorry been very busy past days.Thanks for your help, I will try LUA asap.The game that my server app will be targetted at is Warcraft III.A lot of people put very high priority on very low response times on some maps like 50-100 ms so thats why I'm worried about the performance.My problem with dynamic libraries is that I want to provide some sort of packet management with repositories like Linux does.But I doubt there is any possibility to provide any kind of precompiled stuff that's still cross-platform.Maybe should have mentioned this earlier but.. Thanks :)
Spoofy
+1  A: 

Have you ever thought of AngelScript? I don't know much about it either but it seems to have a C++ like syntax and is pretty flexible and extremely cross-platform.

sonicbhoc
And unlike Lua which uses C API to embed C/C++ into it it uses a fully OOP C++ API if you feel more comfortable with it.
the_drow
A: 

You can also have a look on Squirrel

Ricky Lung