[java] Java-based scripting engine/VM for game

Started by
5 comments, last by stani 23 years, 5 months ago
Hi everybody! I''m looking for pointers in the incorporation of Java scripting engines into games. I''m new to Java, and more or less to sripting engines also (there i read some papers). If anybody could possibly tell me where to start, what is requred, do i need to get the EmbeddedJava source code for this? How do I then go about the virtual machine and stuff? Sorry I''m really new. Thanks in advance for your patience and answers.
Advertisement
First, if you are new to Java I suggest you start by learning general Java programming first. Incorporating Java as a scripting engine is not the simplest in this world and requires fairly intimate Java knowledge.

There are generally approaches:
1. License the Java VM source code from Sun and incorporate it in your C++ program. This is expensive. I think this was the solution used in Vampire.
or
2. Require the presence of the Java JRE on the computer and use the Java Invocation API to start it up and run the Java class files.

The scripts that user use use a java library that you have written that uses JNI to access the internals of your game engine in order to control what it should do and when. In the same way you engine can call the scripts back.

so start by learning general Java and then some JNI but especially the Java Invocation API is interesting for you.

Jacob Marner
Jacob Marner, M.Sc.Console Programmer, Deadline Games
thank you so much!

i''ll look into this jni and invocation.
This might help a little...

http://games.cpbinc.com/faq/cc.asp#t3
exactly what i was looking for
shame it's only a short presentation

ah, the gamasutra article referenced on that page is interesting.

thanx a lot!

Edited by - stani on November 2, 2000 1:14:09 PM
You should also check out systems like jPython and other scripting -> java compilers that can be used inside normal java programs.

Jpython''s interperter ( compiler ) can be a single 200K. With this jar file you can complie python to native java and run scripts with a fairly simple interface. Best part is that the language is fairly simple and allows seamless integration with existing java applications ( as it produces real java objects ).
the nebula device is a good example of java scripting in a 3d engine
http://sourceforge.net/projects/nebuladevice/
or
http://www.radonlabs.de

This topic is closed to new replies.

Advertisement