[gameprogrammer] Re: About using KVM as a game script engine.

  • From: Siyuan <csy97@xxxxxxx>
  • To: gameprogrammer@xxxxxxxxxxxxx
  • Date: Tue, 14 Dec 2010 18:15:55 +0800 (CST)

Dear All,

Thanks for your reply.

"using JAVA as a game script" as I mentioned before  is "KVM" not "JDK X.X"

I list some benefit if using java as a game script engine:

1.KVM is compiled by standard C,so it is suitable in every platform.

2.KVM is a small java runtime environment.(164KBytes could be run.)

3.KVM could support "Thread-Concept" in the game script.
For example:
You can create 2 threads in your games.(They are native threads)
One is Game-loop thread,another thread runs KVM. [JNI will be used bewteen 
them.]
Game-loop thread is responsible for the the bottom layer behavior. example: 
rendering,physics,etc...
KVM thread is responsible for the upper layer logic. example: scenario,AI,NPC 
behavior,etc...
Please note:The KVM thread is a native thread,but it still cound run many 
java-threads!

4.Since Java is a Object Oriented Language, If you want to update your 
game,replace the classes.
For example:
When you want to add a new BOSS who has more attack-skill in your games,create 
a new boss class.


Declaration:
I am not a java preacher.:-)

Br,
csy97

At 2010-12-14 06:23:54,"Paulo Pinto" <pjmlp@xxxxxxxxxxxxx> wrote:
Since Java 6, it is.
http://openjdk.java.net/

The recent patent issues between Oracle and Google are another matter.


2010/12/13 Samuel Batista<coder4hire@xxxxxxxxxxxxxx>


Hello陈思远,

 

Paulo is mostly correct, using Lua would be much easier (or Python, but don’t 
use Python, it’s much slower than other solutions, including Lua). The reason 
for that is that Lua contains a C api that lets you call functions and share 
data between your native application (C, C++) and the scripting Virtual Machine.

 

In addition, the Java VM itself is not open source (as far as I know), which 
would only make things drastically more complicated when creating the “Glue” 
code between the VM and native application.

 

If you have a problem against Lua itself, or other non-OOP scripting languages, 
I would recommend looking at Mono:

 

http://www.mono-project.com/Main_Page

 

Mono is a VM that is embeddable, it compiles C#, Javascript and other languages 
into bytecode that is very fast (not sure if faster than Lua, but I know that 
C# and Javascript run very fast on Mono). With Mono you get the full power of 
Object Oriented managed languages, with an embeddable, fast VM that is Open 
Source. The Unity engine uses this for their scripting layer, and they’ve had 
great success! Keep in mind though, Mono is drastically more complicated to 
embed than Lua, and will probably cause many headaches to you.

 

But if implementing fast, powerful Object Oriented VM is your objective, you 
really can’t to better than Mono.

 

I would still recommend Lua though, it’s quite lovelyJ

 

Cheers,

Sam Batista

 

From:gameprogrammer-bounce@xxxxxxxxxxxxx 
[mailto:gameprogrammer-bounce@xxxxxxxxxxxxx]On Behalf OfPaulo Pinto
Sent: Monday, December 13, 2010 3:17 PM
To:gameprogrammer@xxxxxxxxxxxxx
Subject: [gameprogrammer] Re: Welcome new members!

 

Hi,

welcome to the list.

Although I do prefer managed languages, I think that on your case you are better
off with Lua or Python for that matter.

Lua is very small language, yet it is very flexible and very easy to interface 
with C,
hence the main reason why so many engines are using it nowadays.

You can also use OO with Lua in a way similar to how OO is done in Javascript.

Java is also possible of course, but usually it is used the other way around. 
With
Java and C#, the complete game is mostly written in one of these languages and 
C/C++/Assembly
are used for the game engine areas where more performance is required. It 
sounds similar, but actually is like you
would have an inverted design.

Still I would advise you to try to use Lua with C or C++, since it is more 
widely accepted solution
in the gaming industry.

Paulo



2010/12/13陈思远 <csy97@xxxxxxx>

 

Dear Gameprogrammer Friends,
I 'am very happy to join this mail-list. (Sorry for the later reply.)

A bit self-introduction:
I'm from China.(so...sorry for my pool english)
My major is mathematics.(I always want to use some mathematic tool to develop a 
real game AI. ex: using neural network,ha~~)

I am learning DirectX and some opensource game library.(ex:SDL HGE)
But I found there few material discussing game architecture design.(I did not 
worked in a game company and I want to be a indie game developer.)

Since I have some study on virtual-Machine before,I want to use JVM to script 
game's logic.  (like War3 editor, I dont like Blizzard's "jass" )
Because Java coud use an object-oriented architecture to model and implement 
game's logic.(I found some game engine use LUA.Why not Java?)
....Is this idea correct?

And now,I will start from the beginning of the most basic.

Thanks.

Best regards,
csy97


At 2010-12-11 11:26:21,"Bob Pendleton" <bob@xxxxxxxxxxxxx> wrote:
 
>I want to welcome bala.8644 and csy97 to the list. Hi folks! As always
>I invited you to tell us a little bit about your selves and to tell us
>what you are interested in. I especially want you to ask questions and
>to feel free to answer questions. If folks don't ask questions, they
>can't learn. If folks don't answer questions, the rest of us don't
>learn.
> 
>Bob Pendleton
> 
> 
>-- 
>+-----------------------------------------------------------
>+ Bob Pendleton: writer and programmer
>+ email: Bob@xxxxxxxxxxxxx
>+ web: www.TheGrumpyProgrammer.com
> 
>---------------------
>To unsubscribe go to http://gameprogrammer.com/mailinglist.html
> 
> 

 

网易163/126邮箱百分百兼容iphone ipad邮件收发

 


Other related posts: