Live data from Hacker News

Grid – A Lua Game Engine

planimeter.org

11–20 of 79 posts

Re: Grid – A Lua Game Engine

#12

Why do people use Lua in a world where we have Python?

Lua is very easy to parse fast in a way python isn’t. It makes it adaptable to embedding, JIT and other optimizations.

The cost is a less elegant syntax. I understand a lot of folks hate working with Lua, but it fits a certain niche.

Re: Grid – A Lua Game Engine

#13

Why do people use Lua in a world where we have Python?

Seriously asking or just trolling? This statement could be made for almost any language. Why did we start with Python when there was Perl? Why did we start with Perl when we could use shell and awk? Why did we start writing something like awk when we could just have dedicated C programs? Why C when we had BCPL/Algol? Why Algol when we had... okay, granted, there's a limit.

Regarding the specifics: Lua is very simple, you can keep the whole language in your head easily, the table mechanism is very powerful, and the whole thing is easy to embed. Which is why it was used in commercial games and thus is industry/genre-relevant.

Re: Grid – A Lua Game Engine

#14

any examples of games made with this?

I'm making a mobile mmorpg using this engine.

We're currently in the early spriting & game mechanic planning phases but Grid has been a perfect starting point.

It's the sweet spot in-between LÖVE (Grid extends LÖVE) and a heavier engine like Defold, the multiplayer features are killer.

If you're wanting to make a tile-based multiplayer game, I highly recommend it.

Re: Grid – A Lua Game Engine

#16

Why do people use Lua in a world where we have Python?

Ease of embedding has been pointed out.

Another reason for using Lua in games is that its garbage collection strategy is well-suited for the task.

Python uses reference counting (which has a predictable performance profile but can lead to long pauses if a large object graph is deallocated at once) and stop-the-world GC for reference cycles.

Re: Grid – A Lua Game Engine

#17

Why do people use Lua in a world where we have Python?

IMO, these are the main reasons; 1. Embeddability. You can create a game engine in a performant systems language like c++ and embed lua in it for the scripting. 2. Speed. The lua interpreter is much faster than python in general. When you throw luajit into the fix, they are not really comparable at all. 3. simplicity: lua is tiny. and one of the easier languages for non coders (game designers, artists) to get started…

To be clear: Python does have embeddability, but it is orders of magnitude more complicated to integrate.

Re: Grid – A Lua Game Engine

#18

Why do people use Lua in a world where we have Python?

Have you ever tried to embed a python interpreter?

Lua is both easier to embed and allows you to have a strict interface. Look up the history of bastion/rexec in Python - with python there's no possibility of controlling untrusted code.

Re: Grid – A Lua Game Engine

#19
Lua is a little confusing language for me because you need to throw out most of the things you know because it has its own way of doing things, it is not necessarily a bad thing but it is confusing. Luckily, it is a very small language so it wouldn't take that long to grasp it all. The most confusing thing was the fact that (almost) everything seems like a hashtable.

Re: Grid – A Lua Game Engine

#20
Thank you for posting this, Bambo! I was curious why we were seeing 10s of new stars all of a sudden and trying to figure out where the GitHubbers were coming from.

Grid Engine 9 is now the largest pure-Lua game engine on GitHub. As s_y_n_t_a_x has mentioned in this thread, I built the Grid Engine on top of LÖVE.

I came from the hlcoders world, having used the Source Engine for several years, and was upset the 2D world didn't have sophisticated game engine technology like the 3D solutions in the field.

There's tons of great game software out there! But to me, a game engine isn't just a load, update, draw framework. There's a lot of hard work involved past binding libraries together.

A game engine needs an architecture, it needs to do multiplayer serialization for you, and give you a meaningful way to load maps out-of-the-box, and so much more.

Too many hobbyists are rolling this themselves, and I hope to continue to bring rich game development features OOTB to other hobbyists like myself.

If you're interested in Grid, but don't find something quite right with it, could you tell me? I've worked on this project for at least the past 6 years from what my logs tell me, but it only continues to get better thanks to people like you all reading posts like this and giving me feedback over the years.

Thanks again, Andrew

Post reply on HN