I'm looking for an engine that constructs it's entities using Lua or other scripting language. This is in order to find inspiration and do it in my own engine as well.

I know that CryEngine does use Lua to make their entities, but I wanted to know if there are some other alternatives that I can look up.



I'd recommend taking a look at LÖVE "an awesome framework you can use to make 2D games in Lua. It's free, open-source, and works on Windows, Mac OS X and Linux." It's clearly not an alternative to the Cryengine, but should certainly demonstrate how to effectively utilize the potential of Lua for entity creation and game logic. Combine that knowledge with how Cryengine/other AAA engines utilize script backends, and you should have all the inspiration you need to create your own engine with robust scripting capabilities. :)


To the best of my knowledge Relic's Essence Engine Series (as used in Company of Heroes and Dawn of War II) uses Lua or a dialect of it for unit stats and mission scripting. There are no real web sources for it, but you could always check out some of the mods at RelicNews.com to ask your way around if you are interested.

The Spark Engine by Unknown Worlds as used in their upcoming game Natural Selection 2 allows most of the game code to be in Lua as far as I know. The SDK comes with the game pre-order and is currently in beta as is the game.

Another game that was once promoted heavily relying on Lua would be Eufloria (formerly Dyson). There is a Lua modding reference on their forums as well.

Valve's free co-op game Alien Swarm heavily uses a scripting language called "Squirrel" that has been influenced by Lua. The Alien Swarm SDK should be available for download on Steam. (Dev wiki)

EDIT: How could I have forgotten about World in Conflict! The game does a whole lot of stuff in Python as becomes obvious when looking at mods like the Modern Warfare Mod that implement completely new mechanics.

  • \$\begingroup\$ Added your links in for you. \$\endgroup\$ Jan 20 '11 at 22:00
  • \$\begingroup\$ Thank you! //Deleted the comment containing unformatted links... \$\endgroup\$
    – Koarl
    Jan 20 '11 at 23:23
  • \$\begingroup\$ Great answer, I hope more people can add to this question since in the future I'm absolutely sure that there will be more answers. Thank you very much Koarl ( I'm a big Relic Fan btw ) \$\endgroup\$
    – Mr.Gando
    Feb 10 '11 at 2:15

Here are some examples of (open source) games that use scripting to implement entity behaviour:

Frogato implements entities using a custom scripting language. Battle for Wesnoth implements entities using a custom description language in which Lua scripts can be embedded. KQ implements entity behaviour using Lua scripts.

Edit: Posted links now that I'm allowed to...

  • \$\begingroup\$ Frogato looks very close to what I'm looking for, it's a bit verbose though, but still very interesting. An equivalent example in Lua would rock :) \$\endgroup\$
    – Mr.Gando
    Nov 1 '10 at 19:20

I do that in my engine (source available, but probably not worth deciphering).

In my case, an "entity" is a concept that exists wholly within Lua. There's no C++ backing for "entities". As such, an "entity" is whatever that specific game needs. Sometimes it's just a table with a little data attached to it, sometimes it's a 2d Frame element (note that Frames are entirely Lua constructions as well, I just have a standard UI library), sometimes it's something complicated with AI and rendering and then it's still just a thing created in Lua.

Many people use Lua to script object systems that have C++ backing, such that the entity "lives" in C++ and calls Lua for its scripting. I used to do that, but I found myself getting happier and happier as I moved code out of C++ and into Lua. At this point, I use C++ solely to handle the OS API calls, and all layout/rendering/AI/game logic is in 100% pure Lua.


Feel free to ask questions, I'm quite willing to answer :)

  • \$\begingroup\$ How does glorp compare to love2d? \$\endgroup\$
    – deft_code
    Feb 16 '11 at 2:42
  • \$\begingroup\$ As I understand it, love2d has a significantly set-in-stone rendering pathway. glorp doesn't - it has OpenGL bindings, and you just render whatever you want (although it does have helper functions for standard stuff.) glorp has a built-in "main menu/pause/return to menu" system, it does remote error reporting on crashes, and it will automatically generate installers for whatever OS you're building it on. glorp isn't really designed as an API, however - it's a framework that is constantly modified for whatever I need. Not as reverse-compatible at all :) \$\endgroup\$
    – ZorbaTHut
    Feb 16 '11 at 13:21

Not the answer you're looking for? Browse other questions tagged or ask your own question.