lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> Funny you say that, because I used my game engine to write a
> simple 3d shooter, and everything is implemented in Lua with the
> luaglut binding.  I certianly wouldn't argue with your assertion
> that Lua is slower than a compiled language, but writing a 3D
> game engine in Lua isn't that bad of an idea.  At least in my
> experience, the framerate of a game is influenced most by the
> geometry it is trying to render, not by the language in which it
> was written.  For example, my engine's framerate doesn't improve
> at all when I use LuaJIT, because in reality there isn't much Lua
> code being interpretted each frame.

Interesting. I can see from what you, David, and Chris wrote that singling
out 3D wasn't the best way to get my point across. Let me phrase it another
way: I wouldn't want to do a high-speed twitch game using Lua to do event
handling. Hard-core gamers can tell (and will complain) when a game takes
1/100th of a second to respond.

My point, which I think most people understood, is that Lua has its
strengths and weaknesses, like any language. Its weakness is that it is
inherently slower than a compiled (or assembled) language. One of its
strengths is that, if you understand how it works, you can work around, and
overcome, that inherent [relative] slowness.

Most programs spend about 90% of their time in 10% of the code (YMMV). Chris
picked up on my comment about using C++ to clear bottlenecks in that 10%.

I work for a game company, and we use Lua for things ranging from kids'
games to ITV Know those menus you get on your digital cable TV? I may have
written those in Lua. Do your preschoolers play that new game from Disney
Online? We used a lot of Lua in that. I'm not criticizing Lua when I point
out that it can be slow. Merely pointing out that you should be aware of how
Lua works, and write your code accordingly.

Cordially,

Kerry Thompson