Jump to content
  • Advertisement

Archived

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

KaneTHP

Java instead of a custom scripting language??

This topic is 6700 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Maybe this is the wrong place to ask this but.. I was reading a thread that was talking about the JVMs getting faster, etc. and I am currently writing a scripting lanaguage for my game library/engine. Then I thought - wouldn''t it be cool if instead of using a custom scripting language I just used a Java virtual machine - and had some builtin engine interface classes. So I guess what I''m asking is is there source for the JVM available (or some detailed language descriptions, etc.) yea, yea maybe I should just check Sun''s website first but..I''m lazy, you know?

Share this post


Link to post
Share on other sites
Advertisement
I think Freshmeat (www.freshmeat.net) has a few free JVM implementations listed. On the whole, though, I''m not crazy about the idea of using Java as a scripting language for a game. It seems like a better idea to create a new language that is more tightly integerated with the game objects rathar than through a set of native interfaces, as Java would have to be.

Share this post


Link to post
Share on other sites
Pros of using existing languages for scripting: Users may already be proficient with the language - well defined existing language reference - compliler / lexer / parser / interpreter often already done, just needs integrating - common algorithms and solutions may be available in snippet form.

Pros of using your own new language: No added baggage or bloat from unneeded features - no unseen security holes where language intrinsically allows for more than desired - guarantee that the language is relevant to your application and optimised as such - may be easier to integrate than many premade languages - will undoubtedly be easier to extend to add new functionality.

If you can answer all those questions, you will know what to do

Share this post


Link to post
Share on other sites
Don''t use java as a scripting language. That''s just wrong, you would need to create an object for everything, that would get annoying. Most scripting lanuages are interperted anyhow. If you visit alphaworks.ibm.com they have plenty of scripting languages for java, so they''d probably have good scripting languages for whatever your games is in. Also, I''ve been thinking that php would be a good scripting language, www.php.net and www.zend.com.

Share this post


Link to post
Share on other sites
I''d have to say that I think Java still isn''t ready to be used as a scripting language for games. Its still a bit heavy, even if you cut out all the graphics and other unneeded APIs.

My suggestions for good gaming scripting languages would be:

Python (www.python.org) OO goodness without the bloat!

or

Lua (http://www.tecgraf.puc-rio.br/lua/) Very light-weight. Has been used in the scripting engines of various commercial games, including Grim Fandango, MDK2 and Baldur''s Gate.

Share this post


Link to post
Share on other sites
Hi !

Well, I created my own scripting language (full OOP) and it basically works the same as Java (syntax, technologie), however it''s very fast and very small. The Virtual Machine DLL is about 50 KB big.
A scripting language is about 20-30 times slower than native C++ code. So, you will need a scripting language that is very fast. If you fail to create or use a fast scripting language your game will be very slow.
And Java is too big to be a very fast scripting language for a game engine.

Instead, study java and based on their technologie create your own scripting language. That''s what I did and it worked fine. It took me just 2 months to create my full-featured OOP scripting language.

Phillip Schuster

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!