WIP: Python frontend for Env3D/JMonkeyEngine

Hi all, just want to give you guys a heads up on what I’ve been doing, and also solicit some feedback from a technical standpoint:



Scripting languages are all the rage these days, especially in the computer science education circle (also among web and game development). I have been toying with the idea of using python (more specifically jython) in env3d (an educational game engine based on jmonkey).



This is what I have so far, as shown in the video below. This is very rough but hopefully give you guys an idea of what I’m going for.



http://youtu.be/vnx7eCLuW74

1 Like

Heh, cool. You used javas standard scripting support?

@normen, the project started a while back, with Java 6, so I am embedding jython.jar. I really should start looking into the new scripting support for Java, very interesting indeed.

Nice work!



@batkid What lib did you use plugin python in java? or is jython completely different?

@iamcreasy jython is a re-implementation of python using the Java language, to facilitate scripting for Java objects (so jython programs can access Java objects, very much like standard python can access C++ objects, etc.).



The jython project http://www.jython.org/ typically lacks behind the standard version in features, but for my use it’s totally fine.



I didn’t show it in the video above, but it’s totally possible to access standard jmonkey classes inside the scripting environment, so you can try out jmonkey features without write a full-blown project for it.

I though you were using Scripturian.

How big is the jar dependency load?



I like Python but I used Groovy because there is less overhead between the scripting language and Java… but Python is a very nice alternative. Especially if you are used to it. (The other nice thing about groovy is that it was trivial to overload operators for vectors and things… and it has a built in scripting console… but I will try not to turn this into a ‘yay groovy’ thread. :))

@iamcreasy, thanks for the link, I’ll take a look at that.



@pspeed, the jython jar is huge, around 10Mb. I haven’t really considered other alternatives as python is very popular in academia (that’s where I do most of my work). Sounds like Groovy is a great scripting language for the JVM, I’ll certainly check it out.

@batkid said:
@pspeed, the jython jar is huge, around 10Mb. I haven't really considered other alternatives as python is very popular in academia (that's where I do most of my work). Sounds like Groovy is a great scripting language for the JVM, I'll certainly check it out.


It's worth a look. The "groovy-all" jar is 6 meg. I like it because I can extend the language a bit to make it more DSL-like and it's got some really neat concepts. The fact that a full groovy console is included with syntax highlighting editor, etc. was just a bonus. But it did make it easy to have a pop-up scripting console right in Mythruna.

With some pics of the console: http://groovy.codehaus.org/Groovy+Console
1 Like

Thanks @pspeed! I checked out the Groovy link and it looks very slick. Having the editor built-in is such a nice feature, I had to put together a bunch of different components to get the editor to work in my case. Very nice indeed!



I also like the low overhead and the syntax of the language, almost like a cross between Ruby and Python.