Archived

This topic is now archived and is closed to further replies.

stani

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

Recommended Posts

stani    122
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.

Share this post


Link to post
Share on other sites
felonius    122
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

Share this post


Link to post
Share on other sites
stani    122
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

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
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 ).

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
the nebula device is a good example of java scripting in a 3d engine
http://sourceforge.net/projects/nebuladevice/
or
http://www.radonlabs.de

Share this post


Link to post
Share on other sites