Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (489)
Games in Android Showcase (112)
games submitted by our members
Games in WIP (553)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Use of Scripting Languages ?  (Read 4725 times)
0 Members and 1 Guest are viewing this topic.
Offline happybirthday

Senior Newbie





« Posted 2011-06-23 05:17:29 »

I have heard time and again that scripting languages can be used to quickly speed up the development process for a game.

Using scripting languages we don't have to build the whole game from scratch every time we make a small change. and it can also help with keeping different parts of the game like the logic from the main engine etc. separate

So can anyone tell me :

1. What exactly are the uses of a Script
2. How can I use scripts in my java game for the logic part or other things ... (a Guide or Tutorial regarding this would be great)

Thanks a lot guys Smiley
Offline appel

JGO Wizard


Medals: 50
Projects: 4


I always win!


« Reply #1 - Posted 2011-06-23 11:14:39 »

I don't think scripts are necessary for a small pie project.

If you have 10 or 20 developers then yes, perhaps.

If you're 1 or 2 guys, I'd just make a Java class.

Check out the 4K competition @ www.java4k.com
Check out GAMADU (my own site) @ http://gamadu.com/
Offline avm1979
« Reply #2 - Posted 2011-06-23 19:00:50 »

Yeah, I wouldn't bother. Even for a largish project, building it is literally as fast as saving the current file you're editing, provided you're using a decent IDE.

About the only time it makes sense, IMO, is if you're trying to make some functionality moddable.

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Eli Delventhal

JGO Kernel


Medals: 42
Projects: 11
Exp: 10 years


Game Engineer


« Reply #3 - Posted 2011-06-24 21:44:51 »

I did a cool thing in an RPG where each level file had a class file generated too from some Java code you could write into the level editor. Then you just use javac and, voila, you've accomplished what a lot of people use scripts to do.

See my work:
OTC Software
Offline zoto

Senior Member


Medals: 4



« Reply #4 - Posted 2011-06-24 23:12:53 »

Is there a way to compile Java source like that in an applet without breaking out of the sandbox?
Offline happybirthday

Senior Newbie





« Reply #5 - Posted 2011-06-25 02:07:07 »

I did a cool thing in an RPG where each level file had a class file generated too from some Java code you could write into the level editor. Then you just use javac and, voila, you've accomplished what a lot of people use scripts to do.

how did you do that ? That is exactly what I am trying to achieve Smiley
Offline zoto

Senior Member


Medals: 4



« Reply #6 - Posted 2011-06-25 03:01:56 »

You are supposed to be able to use the javax.tools package. But ToolProvider.getSystemJavaCompiler() keeps returning null for me. Anyone know how to fix that?
Offline cylab

JGO Ninja


Medals: 43



« Reply #7 - Posted 2011-06-25 07:43:51 »

The java tools are not part of the JRE but of the JDK, so you will be out of luck for this approach on the client side (you are not allowed to bundle the JDK or JDK classes with your game). I think Eli used this on his development-system, so he simply can execute javac or start an ant buildscript on the commandline (using the java.lang.Runtime class).

If you really need this (which I doubt) on the client side, the best bet would probably be using janino.

Mathias - I Know What [you] Did Last Summer!
Offline avm1979
« Reply #8 - Posted 2011-06-25 15:53:30 »

I've been using Janino for a bit. It's great, except for an issue I ran into a couple of weeks ago - it doesn't seem doesn't seem to handle break and continue! It compiles the source using those just fine, but then fails on next compilation unit. Kind of a bummer, because it's so good otherwise.

Offline Conner_

Senior Newbie




~ Java Game Dev ~


« Reply #9 - Posted 2011-09-05 17:43:35 »

I personally only find myself utilizing scripts (and usually only for plug-ins built alongside an API of mine) when I'm wanting other people to contribute to parts of the game's development...people that are less experienced with Java.

Scripts are overall just a waste of environment building time if you're going to develop by yourself.

Find me on GitHub: connergdavis
My current project is called Obsidian Framework and is a private Minecraft server application used to play Multiplayer.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Nate

JGO Kernel


Medals: 145
Projects: 4
Exp: 14 years


Esoteric Software


« Reply #10 - Posted 2011-09-06 08:04:58 »

Develop something without any scripts first, then introduce scripts where it makes sense.

Offline ReBirth
« Reply #11 - Posted 2011-09-06 12:05:53 »

You are supposed to be able to use the javax.tools package. But ToolProvider.getSystemJavaCompiler() keeps returning null for me. Anyone know how to fix that?


Your java may haven't set in the classpath. some IDE can detect java folder by themself but if you try it on cmd prompt, javac can't work.

Offline Eli Delventhal

JGO Kernel


Medals: 42
Projects: 11
Exp: 10 years


Game Engineer


« Reply #12 - Posted 2011-09-06 21:59:08 »

The java tools are not part of the JRE but of the JDK, so you will be out of luck for this approach on the client side (you are not allowed to bundle the JDK or JDK classes with your game). I think Eli used this on his development-system, so he simply can execute javac or start an ant buildscript on the commandline (using the java.lang.Runtime class).

If you really need this (which I doubt) on the client side, the best bet would probably be using janino.

LOL no wonder other people had trouble running it! XD I didn't even think of that - this game obviously never made it to prime time. Cheesy

See my work:
OTC Software
Offline oNyx

JGO Coder


Medals: 2


pixels! :x


« Reply #13 - Posted 2011-09-07 00:48:14 »

>I have heard time and again that scripting languages can be used to
>quickly speed up the development process for a game.

Essentially, that's true. But strictly speaking, this actually isn't limited to scripting languages. Replacing old code with new code on-the-fly can be even done with C or plain Java.

>What exactly are the uses of a Script[?]

Generally speaking, any kind of "cold" code (i.e. code which gets executed rarely and which isn't processing intensive) can be replaced with scripts.

Scripting in games is often used for some sort of hybrid which is somewhere between configuration and code. Basically, it's some configuration with logic thrown in. E.g. there are conditions here and there and arrays/dictionaries and some loops to keep things DRY (don't repeat yourself -> less repetitive) and maintainable.

E.g. if this weapon (a shotgun) is fired, there shall be 12 randomized projectiles each one got a knockback of 5, this particular sound file should be played, this animation is triggered, and the next shot can be fired in 500 msec.

Or things like UI, HUD/overlays, menu transitions, etc.

There are many AAA games which use Lua for this kind of thing.

弾幕 ☆ @mahonnaiseblog
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

TehJavaDev (18 views)
2014-08-28 18:26:30

CopyableCougar4 (26 views)
2014-08-22 19:31:30

atombrot (39 views)
2014-08-19 09:29:53

Tekkerue (36 views)
2014-08-16 06:45:27

Tekkerue (33 views)
2014-08-16 06:22:17

Tekkerue (22 views)
2014-08-16 06:20:21

Tekkerue (33 views)
2014-08-16 06:12:11

Rayexar (70 views)
2014-08-11 02:49:23

BurntPizza (47 views)
2014-08-09 21:09:32

BurntPizza (38 views)
2014-08-08 02:01:56
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!