Is it possible to use Java as a scripting language for a C++ engine/game?
I understand that you need to make a binding to the interpreter, but I haven't seen any around.
feedback
|
Quite possible. You could probably use the GNU Interpreter for Java or some other such system. However I think you'll find a lot more cases (as mentioned above) of people using Lua, Python or other languages in games. Lua in particular is very well suited for the task of embedded scripting. Additionally, you might check the jog interpreter project, which touts itself as, "...a lightweight but reasonably full-featured and fast Java compiler and interpreter." that is written in C++. Amusingly, googling for "java interpreters in C++" seems to yield as many (if not more) hits for C++ interpreters written in Java instead of the other way around :) | |||
feedback
|
Yes it is possible. Game Vampire the Masquerade - Redemption uses Java as a scripting language. And that game is the only serious game i know of using Java. Bear i mind, they are not using Java for their Nod engine. Edit: There is JMonkeyEngine written completely in Java. | |||
feedback
|
Yes, it's possible. Way back in 1999, an article was published in Game Developer on the subject, entitled "Dirty Java: Using the JNI Within Games." I still have my copy of issue in fact. Fortunately the article also appears to be available online. Of course, the code in that article is probably a tad out of date, so you can also check out these articles as well: However, these days it's probably better to consider a language like Python, Lua or Javascript for your embedding needs. They're a lot more lightweight and, in the case of Lua in particular, designed with embedding and scripting in mind. | |||
feedback
|