Bohemia Interactive (OFP, ARMA) will use Java for scripting.
Yeah, so they've announced such an addition to their games at their forums. They first use it with a helicopter simulator but it will apparently also come to their military simulation games, I guess ARMA 3 will have it.
They say performance is much better. They have had their own scripting engine but now they seem think Java is better.
What do you think of using Java in such games for scripting? My immediate reaction was that the language is more difficult to understand than their own scripting language. But it appears that they may keep both side-to-side. I guess we will have to wait and see whether it will actually happen that they will keep both - I think it'd be a good idea as there are a lot of old scripts, especially user-made since 2001 and counting.
Bohemia Interactive (OFP, ARMA) will use Java for scripting
-
- Ogre Magi
- Posts: 1120
- Joined: Wed Nov 15, 2006 7:41 pm
- Location: Finland
- x 5
-
- Old One
- Posts: 2565
- Joined: Sun Sep 11, 2005 1:04 am
- Location: Paris, France
- x 56
Re: Bohemia Interactive (OFP, ARMA) will use Java for script
Well with an game-context optimized vm that does pre-compilation or really optimized JIT compilation, why not? As far as the binding is not so too problematic it's a better alternative than Python on the speed performance side. As far as it's for game-specific scripting I guess.
However on the memory side I'm wondering.
However on the memory side I'm wondering.
-
- Minaton
- Posts: 921
- Joined: Sat Jul 31, 2010 6:29 pm
- Location: Belgium
- x 80
Re: Bohemia Interactive (OFP, ARMA) will use Java for script
If you want you can already have a high speed javascript engine ready in Ogre.
Just use berkelium or awesomium.
The javascript can run in the browser process, which is in a separate thread. Using API calls to the game engine the javascript can communicate with game specifics. You would of course need to lay down a game-specific API that is accessible from javascript, but I think this is inevitable and has to be done in any case.
Of course you could argue that running a full chromium process just to have javascript support is bloated, and who knows maybe you'd be right.
Then again, you could also use it for rendering GUIs and mission layouts and such. Since both those GUIs as your game logics can be controlled by javascript you would unify all of this using one scripting language.
Just use berkelium or awesomium.
The javascript can run in the browser process, which is in a separate thread. Using API calls to the game engine the javascript can communicate with game specifics. You would of course need to lay down a game-specific API that is accessible from javascript, but I think this is inevitable and has to be done in any case.
Of course you could argue that running a full chromium process just to have javascript support is bloated, and who knows maybe you'd be right.
Then again, you could also use it for rendering GUIs and mission layouts and such. Since both those GUIs as your game logics can be controlled by javascript you would unify all of this using one scripting language.
Developer @ MakeHuman.org
-
- Goblin
- Posts: 287
- Joined: Mon Dec 08, 2008 4:49 pm
- x 10
Re: Bohemia Interactive (OFP, ARMA) will use Java for script
Lets just not confuse java and javascript. They are so totally different that they are not the same. 
I think java would be fast, however in this comparison java is a very big loser (compared to scripting engines like python and lua)

I think java would be fast, however in this comparison java is a very big loser (compared to scripting engines like python and lua)
-
- Old One
- Posts: 2565
- Joined: Sun Sep 11, 2005 1:04 am
- Location: Paris, France
- x 56
Re: Bohemia Interactive (OFP, ARMA) will use Java for script
Yeah, JavaScript and Java are not the same at all. On a side note, you don't need to embedd whole Chrome to get it, you just need the JavaScript executor : V8. It have been embedded in games several times.
-
- Minaton
- Posts: 921
- Joined: Sat Jul 31, 2010 6:29 pm
- Location: Belgium
- x 80
Re: Bohemia Interactive (OFP, ARMA) will use Java for script
Oh, I guess I was a bit too fast here.jonim8or wrote:Lets just not confuse java and javascript. They are so totally different that they are not the same.
Because it was intended to be used as a "scripting language" I assumed it was javascript.
Does it really make sense to use java in this scenario?
And of course you can do it more efficiently and include only the js runtime. I was just pointing out that a potential prototype was already made and almost useable out of the box.
Also, depending on what you use the java for, its speed won't really matter in a lot of scenarios. You shouldn't be coding AI or pathfinding algorithms in it, nor any graphics stuff or other algorithms that need a lot of computation. Just for your average game logic scripts you probably won't even notice the difference between LUA, Python, Java, or even C code.
Developer @ MakeHuman.org
-
- Gnome
- Posts: 393
- Joined: Thu Dec 08, 2005 9:57 pm
- x 1
Re: Bohemia Interactive (OFP, ARMA) will use Java for script
I'd be worried a bit about the fact that it is hard to control how java does garbage collection and memory management in general. JIT compiler will probably eat some resources as well (and that is not easily controllable either).
I think adapting existing scripting language to LLVM could be a viable alternative.
I think adapting existing scripting language to LLVM could be a viable alternative.
-
- Minaton
- Posts: 921
- Joined: Sat Jul 31, 2010 6:29 pm
- Location: Belgium
- x 80
Re: Bohemia Interactive (OFP, ARMA) will use Java for script
Given the fact that quite a lot of new processors these days effectively have 2 or 4 cores that might even not be such a problem. Just make sure only one core is used for the java stuff.
Since it's very hard to make full use of multi threading, a lot of (even recent) games tend to only use on or two cores effectively, which leaves some resources free that can be used for java.
Of course I didn't account for the complexity of shared resources like memory, that might still introduce a bottleneck if managed badly.
Since it's very hard to make full use of multi threading, a lot of (even recent) games tend to only use on or two cores effectively, which leaves some resources free that can be used for java.
Of course I didn't account for the complexity of shared resources like memory, that might still introduce a bottleneck if managed badly.
Developer @ MakeHuman.org
-
- Halfling
- Posts: 47
- Joined: Mon Apr 09, 2007 4:29 pm
- x 3
Re: Bohemia Interactive (OFP, ARMA) will use Java for script
Vampire The Masquerade Redemption used Java as a scripting language 12 years ago 
Personally, I can't really imagine it for my purposes, though. In my eyes a game scripting language should allow for massive multithreading (i.e. each game object being driven by a script, all simultaneously). Lua has coroutines, Unity uses a hacked version of Mono with coroutines, so does Second Life. I don't think one can achieve the same with "real" threads. Or does Java support any kind lightweight multithreading? Another issue is serialization (often needed in games). It's much easier to serialize an entire virtual machine state with simple VMs (such as Lua), than a huge monster like Java.

Personally, I can't really imagine it for my purposes, though. In my eyes a game scripting language should allow for massive multithreading (i.e. each game object being driven by a script, all simultaneously). Lua has coroutines, Unity uses a hacked version of Mono with coroutines, so does Second Life. I don't think one can achieve the same with "real" threads. Or does Java support any kind lightweight multithreading? Another issue is serialization (often needed in games). It's much easier to serialize an entire virtual machine state with simple VMs (such as Lua), than a huge monster like Java.
-
- Minaton
- Posts: 921
- Joined: Sat Jul 31, 2010 6:29 pm
- Location: Belgium
- x 80
Re: Bohemia Interactive (OFP, ARMA) will use Java for script
You don't need to serialize the whole VM state, only the objects that you created and that matter.Cougar wrote:It's much easier to serialize an entire virtual machine state with simple VMs (such as Lua), than a huge monster like Java.
Java has good serialization support.
Developer @ MakeHuman.org