dice3 for RPGs

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
Jasoco
Inner party member
Posts: 3726
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: dice3 for RPGs

Post by Jasoco »

slime wrote:LuaJIT is as fast or faster than Java, AFAIK - especially when you use FFI bindings rather than the traditional lua-c api for things like the OpenGL functions. Check out https://github.com/malkia/ufo and https://github.com/ncarlson/eiga .
Minecraft utilizes OpenGL for most of its graphics work, instead of relying on software-side Java code to transform a 3d scene into 2d screen-space (which is what LÖVE "3D" things are doing, essentially).
Could Löve potentially perform and render a Minecraft-like game if it were given the correct access to OpenGL?

Also, what's the Illusionary Engine? The only "3D" game I see on StabYourself is Ortho, which is a 3D orthogonal puzzle game that is extremely simple. (But still pretty damn awesome and complex) I'd like to try this Illusionary thing if it's still around.
User avatar
ishkabible
Party member
Posts: 241
Joined: Sat Oct 23, 2010 7:34 pm
Location: Kansas USA

Re: dice3 for RPGs

Post by ishkabible »

While yes, LuaJIT is faster than interpreted JVM code it's definitely *not* faster than JITed JVM code which is what all major desktop distributions do now. Sun has payed *really* smart people large chunks of money to make very well optimized translations from JVM bytecode to JITed x86.

In fact, if Java was more C like, it could be as fast as C or C++. Unfortunately Java uses reflection, bulky objects, quirky C to Java interfaces, only has arrays and objects instead of pointers, and over encourages polymorphism(speed being the issue that is). But I digress.

LuaJIT is very well optimized but due to the even more dynamic nature of Lua than Java and the fact that LOTS of work has been done on Java optimization, LuaJIT doesn't beat JITed Java code. LuaJIT with proper OGL exposure could definitely play minecraft but it would always be a bit behind in performance of the real thing. but yes, the performance is all there to do this, definitely, the size of a chunk might just be a bit smaller so it can fit in cache. you could do more computationally expensive parts in C or C like code(using cdata) however, that would put it on a level playing field.
User avatar
slime
Solid Snayke
Posts: 3161
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: dice3 for RPGs

Post by slime »

ishkabible wrote:While yes, LuaJIT is faster than interpreted JVM code it's definitely *not* faster than JITed JVM code which is what all major desktop distributions do now. Sun has payed *really* smart people large chunks of money to make very well optimized translations from JVM bytecode to JITed x86.

In fact, if Java was more C like, it could be as fast as C or C++. Unfortunately Java uses reflection, bulky objects, quirky C to Java interfaces, only has arrays and objects instead of pointers, and over encourages polymorphism(speed being the issue that is). But I digress.

LuaJIT is very well optimized but due to the even more dynamic nature of Lua than Java and the fact that LOTS of work has been done on Java optimization, LuaJIT doesn't beat JITed Java code. LuaJIT with proper OGL exposure could definitely play minecraft but it would always be a bit behind in performance of the real thing. but yes, the performance is all there to do this, definitely, the size of a chunk might just be a bit smaller so it can fit in cache. you could do more computationally expensive parts in C or C like code(using cdata) however, that would put it on a level playing field.
Do you have benchmarks handy to back this up? From my understanding, a large part of the performance issues of Minecraft are due to Java's GC and OpenGL rendering - Minecraft looks simple graphically, but the voxel style makes optimization a little different than most other games.
(plus, LuaJIT is not at its peak yet - there are still plenty of optimizations that have not been done yet but are planned, especially dealing with the garbage collector).

I would also like to point out that the gameplay code of both Natural Selection 2 and Cobalt are written in Lua. :)
User avatar
Camewel
Prole
Posts: 20
Joined: Thu Apr 19, 2012 5:58 pm

Re: dice3 for RPGs

Post by Camewel »

Jasoco wrote:
slime wrote:LuaJIT is as fast or faster than Java, AFAIK - especially when you use FFI bindings rather than the traditional lua-c api for things like the OpenGL functions. Check out https://github.com/malkia/ufo and https://github.com/ncarlson/eiga .
Minecraft utilizes OpenGL for most of its graphics work, instead of relying on software-side Java code to transform a 3d scene into 2d screen-space (which is what LÖVE "3D" things are doing, essentially).
Could Löve potentially perform and render a Minecraft-like game if it were given the correct access to OpenGL?

Also, what's the Illusionary Engine? The only "3D" game I see on StabYourself is Ortho, which is a 3D orthogonal puzzle game that is extremely simple. (But still pretty damn awesome and complex) I'd like to try this Illusionary thing if it's still around.
Maurice wrote:Yeah, the game has cubes. Thus it's minecraft.
User avatar
Xgoff
Party member
Posts: 211
Joined: Fri Nov 19, 2010 4:20 am

Re: dice3 for RPGs

Post by Xgoff »

Jasoco wrote:
slime wrote:LuaJIT is as fast or faster than Java, AFAIK - especially when you use FFI bindings rather than the traditional lua-c api for things like the OpenGL functions. Check out https://github.com/malkia/ufo and https://github.com/ncarlson/eiga .
Minecraft utilizes OpenGL for most of its graphics work, instead of relying on software-side Java code to transform a 3d scene into 2d screen-space (which is what LÖVE "3D" things are doing, essentially).
Could Löve potentially perform and render a Minecraft-like game if it were given the correct access to OpenGL?

Also, what's the Illusionary Engine? The only "3D" game I see on StabYourself is Ortho, which is a 3D orthogonal puzzle game that is extremely simple. (But still pretty damn awesome and complex) I'd like to try this Illusionary thing if it's still around.
in theory it could, or at least a luajit build of love could

for example, since love provides a gl context, you could just use the ffi to bind to opengl functions and call those directly (the ufo library slime posted has opengl bindings already written, although you'd probably want to bind to glee or glew as well). in fact i'm already doing this to prototype something.
User avatar
Jasoco
Inner party member
Posts: 3726
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: dice3 for RPGs

Post by Jasoco »

Camewel wrote:
Jasoco wrote:Also, what's the Illusionary Engine? The only "3D" game I see on StabYourself is Ortho, which is a 3D orthogonal puzzle game that is extremely simple. (But still pretty damn awesome and complex) I'd like to try this Illusionary thing if it's still around.
Maurice wrote:Yeah, the game has cubes. Thus it's minecraft.
Thing is, it's not perspective, in that further objects aren't rendered smaller like in MineCraft and every other 3D game. All "cubes" are rendered at the same size straight back. It's more like Fez than MineCraft. You can see how they used this engine for Ortho though. It works there. But not as a Minecraft game.
User avatar
ishkabible
Party member
Posts: 241
Joined: Sat Oct 23, 2010 7:34 pm
Location: Kansas USA

Re: dice3 for RPGs

Post by ishkabible »

Do you have benchmarks handy to back this up? From my understanding, a large part of the performance issues of Minecraft are due to Java's GC and OpenGL rendering - Minecraft looks simple graphically, but the voxel style makes optimization a little different than most other games.
(plus, LuaJIT is not at its peak yet - there are still plenty of optimizations that have not been done yet but are planned, especially dealing with the garbage collector).
My observations are based off of the general performance of Java as apposed to LuaJIT. Here is the most recent benchmark I could find between the 2 in the language benchmark game; I had to use the wayback machine but the information is still good.

http://web.archive.org/web/201011140817 ... luajit.php

It shows Java being, in general, much faster but *FAR* less memory efficient. Certainly locality, fragmentation, allocation times, and poor interfaces to native libraries(like OpenGL) could make Java less efficient in many cases but on a more general scale Java will be faster than LuaJIT. It could be that the large memory requirements of Minecraft make it better suited for LuaJIT but I think Java would still win if just speed was being measured.

That said, I think LuaJIT would still work very well.
User avatar
slime
Solid Snayke
Posts: 3161
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: dice3 for RPGs

Post by slime »

ishkabible wrote:
Do you have benchmarks handy to back this up? From my understanding, a large part of the performance issues of Minecraft are due to Java's GC and OpenGL rendering - Minecraft looks simple graphically, but the voxel style makes optimization a little different than most other games.
(plus, LuaJIT is not at its peak yet - there are still plenty of optimizations that have not been done yet but are planned, especially dealing with the garbage collector).
My observations are based off of the general performance of Java as apposed to LuaJIT. Here is the most recent benchmark I could find between the 2 in the language benchmark game; I had to use the wayback machine but the information is still good.

http://web.archive.org/web/201011140817 ... luajit.php

It shows Java being, in general, much faster but *FAR* less memory efficient. Certainly locality, fragmentation, allocation times, and poor interfaces to native libraries(like OpenGL) could make Java less efficient in many cases but on a more general scale Java will be faster than LuaJIT. It could be that the large memory requirements of Minecraft make it better suited for LuaJIT but I think Java would still win if just speed was being measured.

That said, I think LuaJIT would still work very well.
Keep in mind that benchmark is using LuaJIT version 2.0 beta 5 or lower (the most recent is 2.0 beta 9). There have been numerous performance increases since then, especially in version 2.0 beta 6 and beta 7. As you mentioned, one of Java's main weaknesses ia memory management, and the roadmap for LuaJIT shows significant plans for improving garbage collection beyond its current (fairly good, especially compared to Java) state. Automatic GC taking up several milliseconds at inopportune times is one of the current major downsides to using a language like Java and Lua for games.
User avatar
Xgoff
Party member
Posts: 211
Joined: Fri Nov 19, 2010 4:20 am

Re: dice3 for RPGs

Post by Xgoff »

slime wrote:
ishkabible wrote:
Do you have benchmarks handy to back this up? From my understanding, a large part of the performance issues of Minecraft are due to Java's GC and OpenGL rendering - Minecraft looks simple graphically, but the voxel style makes optimization a little different than most other games.
(plus, LuaJIT is not at its peak yet - there are still plenty of optimizations that have not been done yet but are planned, especially dealing with the garbage collector).
My observations are based off of the general performance of Java as apposed to LuaJIT. Here is the most recent benchmark I could find between the 2 in the language benchmark game; I had to use the wayback machine but the information is still good.

http://web.archive.org/web/201011140817 ... luajit.php

It shows Java being, in general, much faster but *FAR* less memory efficient. Certainly locality, fragmentation, allocation times, and poor interfaces to native libraries(like OpenGL) could make Java less efficient in many cases but on a more general scale Java will be faster than LuaJIT. It could be that the large memory requirements of Minecraft make it better suited for LuaJIT but I think Java would still win if just speed was being measured.

That said, I think LuaJIT would still work very well.
Keep in mind that benchmark is using LuaJIT version 2.0 beta 5 or lower (the most recent is 2.0 beta 9). There have been numerous performance increases since then, especially in version 2.0 beta 6 and beta 7. As you mentioned, one of Java's main weaknesses ia memory management, and the roadmap for LuaJIT shows significant plans for improving garbage collection beyond its current (fairly good, especially compared to Java) state. Automatic GC taking up several milliseconds at inopportune times is one of the current major downsides to using a language like Java and Lua for games.
i know luajit's binary-trees benchmark is in fact gc-bound. probably the same for fasta
User avatar
Codex
Party member
Posts: 106
Joined: Tue Mar 06, 2012 6:49 am

Re: dice3 for RPGs

Post by Codex »

Should this topic be split and a new thread about LOVE/3D/Minecraft be made? It seems like discussion has trailed off from OP.
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests