APOCALYX is a...

free Game Engine based on OpenGL (MAIL) (SITE) (FORUM) (BLOG)

Monday, June 16, 2008

Is it fast enough? (POLL)

The usual objection raised when a 3D engine, like APOCALYX, provides an interface based on scripts is: "Is it fast enough?"
To answer the question, you should consider that Lua scripts control only functions that are written in C++. Speed is not a real issue, if the critical functions are compiled, and the flexibility of a scripting language gives more freedom, especially in the prototyping phase. In practice, Lua is not used at a low level as happens for example in my TooDee engine (read here to know more), where a 2D engine is written in Lua passing through calls to the SDL functions.
In some cases, when no suitable support function is already available, it's also important to write portions of code in a language faster than Lua. If the programmer does not want to modify the original sources of the engine, another approach is possible: he can write the time critical functions in C and then compile them during the execution phase, thanks to the built-in TinyC compiler. The TinyC compiler can't optimize the code as other compilers do, but is very fast and the generated code is obviously executed faster than interpreted code. The programmer can also write the critical functions in ASM, then the object module in ELF format, generated by the FASM assembler, is linked by TinyC during the execution phase. The approach above solves in a script-like fashion any speed issues related to particular needs of the game.
I described above the core languages of the engine: Lua, TinyC and FASM. A normal user is going to write his scripts in Lua only, of course. I added also other scripting languages to the engine, but I'll drop their support in the next release to reduce the size of the executable, in fact, those languages has a limited access to the features of the engine and no one seems to need them. I'm talking about AngelScript, CSL and SMALL. They are there only because their interepreters can be controlled in a very fine detail, but recently I accomplished the same task also with the Lua interpreter (read the post), so I don't need them anymore.
That's why I start this new poll: to know if anyone needs those languages (as they are supported now) and also to know if other languages may be useful. For example, I received a suggestion some weeks ago about the implementation of a Java interface. In conclusion: look at the list of the poll and check all the languages that you think useful for your games and demos. Feel free also to suggest other ones: in that case check "other" and then discuss the topic in the comments. I don't promise anything, but at least is interesting to know which languages are preferred and deserve more attention.

1 comment:

Sunweaver said...

Preferred language: Delphi / Pascal

It's easy, extensible and powerful.