Lua is a powerful, fast, lightweight, embeddable scripting language. Lua is widely used as a scripting language by game programmers, perhaps owing to how easy it is to embed, its fast execution, and its short learning curve.

learn more… | top users | synonyms

40
votes
7answers
7k views

How does Lua work as a scripting language in games?

I'm a little hazy on what exactly Lua is and how a game that is programmed in C++ would use it. I'm asking primarily about how it is compiled and run. For instance when you use a program written in ...
32
votes
5answers
9k views

What are the pros and cons of incorporating Lua into a C++ game?

I have a C++ game programming book and it has a Lua section in it. I've started to read the Lua section, and it sounds interesting, but I can't determine the pros and cons of using Lua in my C++ game. ...
30
votes
6answers
8k views

Should I be using Lua for game logic on mobile devices?

As above really, I'm writing an android based game in my spare time (android because it's free and I've no real aspirations to do anything commercial). The game logic comes from a very typical ...
16
votes
7answers
3k views

Is there any Lua API that works with C# for PC & XBox 360 Development?

I am reading a book on Game Development in which they show you how to make scripts for your game in Lua. They program Lua and use it from C++, but I was wondering if there is a library or API to use ...
12
votes
5answers
3k views

What is the recommended library for using Lua from C++? [closed]

I am currently planning how to integrate Lua scripting in my 2D Game Engine, and i would like to go straight to the most adequate solution for having C++ classes and objects exposed. I've read this ...
11
votes
8answers
17k views

Love2D engine for Lua; What about 3D? [closed]

Lua has been really awesome to learn, it's so simple. I really enjoy scripting languages, and I had an equally enjoyable time learning Python. The Love engine, http://love2d.org/, is really awesome, ...
11
votes
3answers
2k views

Does Apple currently accept iPhone apps with embedded Lua?

I was researching this and I can't seem to find a concrete answer.
11
votes
4answers
4k views

Game engine with good Lua entity creation/management [closed]

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 ...
10
votes
3answers
10k views

Good Tutorial For Lua and LÖVE

I want to make a very simple 2D game, and have been reading a lot of good things about LÖVE, so I want to try it out. However I can't seem to find any good tutorials. The ones on the LÖVE page are ...
10
votes
2answers
1k views

Handling scripted and “native” components in a component-based entity system

I'm currently trying to implement a component-based entity system, where an entity is basically just an ID and some helper methods tying a bunch of components together to form a game object. Some ...
8
votes
2answers
2k views

Would using Lua scripts to define game logic for an MMO server be a lot slower than compiled in C++?

I am using an entity system for my MMO server and I was thinking about defining the behavior of "actions" using Lua scripts. The server is written in C++. I am not very familiar with the speed/memory ...
8
votes
2answers
5k views

Lua as a stand-alone for game programming like Python?

I've used Python before with PyGame to make games, but PyGame doesn't seem to be so popular anymore, and there arent that many good resources for it. I hear lots of buzz about Lua as a fast scripting ...
8
votes
2answers
855 views

How would you code an AI engine to allow communication in any programming language?

I developed a two-player iPhone board game. Computer players (AI) can either be local (in the game code) or remote running on a server. In the 2nd case, both client and server code are coded in Lua. ...
8
votes
2answers
2k views

How to use LuaJIT the same that Lua in a C++ program?

I'm using Lua in my C++ program, as an library. But I read that LuaJIT is a better implementation. Is it posible to replace with LuaJIT with little change? How?
7
votes
6answers
2k views

Game state management (Game, Menu, Titlescreen, etc)

Basically, in every single game I've made so far, I always have a variable like "current_state", which can be "game", "titlescreen", "gameoverscreen", etc. And then on my Update function I have a ...
7
votes
3answers
1k views

Component based entity system API naming problems

My engine uses a component-based entity system internally, and I want to bind it to Lua for scripting. Now, I want to save people who write scripts for it typing work. In C++, to set the position of ...
6
votes
1answer
2k views

Fixing Slow XNA Game

I'm kind of new to XNA (and games in general). I'm trying to make a young relative of mine (10yo) a simple fun game where he is the main character. I'm down to the wire (I have to get it to him by ...
6
votes
2answers
2k views

Lightweight lua objects vs. inheritance

Although I did this a couple of times from scratch, still no solution really fits. I'm using lua for scripting in my games. Lua holds the "prototypes" of the game elements, that are copied to each ...
6
votes
2answers
539 views

How to share Lua script between instances?

I'm doing an agent based framework with C++ and Lua. I want to use Lua to code the Agent behaviour having an AgentClass class that have the name and source code and an AgentInstance class that have ...
6
votes
2answers
1k views

How do I build games with scripted actors?

The idea I have an idea for a game. A few games, actually, that can built on top of the same general design. There is a game world that the player and the other actors exist in. The player can get ...
6
votes
1answer
127 views

Power Distribution amongst connected nodes

In my game the map is represented by connected nodes, each node has a number of connected nodes. The nodes represent a system in which players can build structures and move units about. If you're ...
6
votes
1answer
3k views

Entity system in Lua, communication with C++ and level editor. Need advice

I have a 2D basic editor written in Qt, and I'm in the process of adding entities. I want the editor to be able to receive RTTI information from entities to change properties, create some logic being ...
6
votes
1answer
1k views

Huge slowdown when running Lua as statically linked lib versus stand alone interpreter

I'm developing some algorithms in Lua which are run mostly in Lua (few calls to C++) and I'm noticing a huge slowdown when I'm running them from my app rather than the default Lua interpreter. The ...
5
votes
3answers
225 views

A* : Partial recalculation when one node *changes*

I have implemented an A* library. Its most interesting feature is that it is "interruptible"; for example, you can stop the calculation loop on a game frame, and resume it later on the following ...
5
votes
2answers
376 views

How to keep Lua bindings from cluttering up C++ code? [closed]

I'm writing a game engine that uses C++ and Lua (and Luabind). Currently, I'm writing all the bindings inside the constructor of the class being binded. I really don't like this because it's ...
5
votes
3answers
1k views

How to protect Lua scripts in IOS game?

I'm developing an iOS game and was considering putting level info and monster info in a Lua script for ease of use. However, since I'm using Game Center for multiplayer I'm concerned users will ...
5
votes
1answer
322 views

How do I change a LÖVE2D game executable's icon?

I merged my game.love file and the love.exe with the command copy /b love.exe+app.love game.exe. But the resulting executable has the default LÖVE2D icon. Is there a way to change that icon to ...
5
votes
2answers
293 views

Lua Implementation

I'm struggling to get Lua implemented into my game engine. I've read dozens of blogs and articles revolving around how to wrap C++ classes and I seem to have hit a wall. No matter how I structure the ...
4
votes
4answers
435 views

Obscuring stored info in a flat-text file

I have an idea for an addon for World of Warcraft which would basically be a minigame within the game itself. Eventually, I'd like to have players be able to compete against each other directly. The ...
4
votes
3answers
1k views

Protobuf vs Lua for custom file format

I'm defining a custom/simple file format for loading textures in my game. I narrowed my choice of file formats to two options: Lua protobuf I chose Lua, because my game is already using Lua, I ...
4
votes
3answers
1k views

How can i run my .LÖVE game directly from the lua interpreter?

I've just started with LOVE and LUA , i'm interested in LOVE because i want to play around with something different from my dayjob(i'm a webdeveloper) and since it uses LUA and is interpreted , i ...
4
votes
2answers
2k views

Accessing C++ class members with LuaPlus

I've implemented LuaPlus in my engine eventmanager successfully and really like the flexibility I gained. But I'm still not exactly where I want to be, because I can't link my c++ classes to a Lua ...
4
votes
3answers
692 views

What technology would you use to communicate between an iOS game and a Lua-based AI server?

What technology would you use to communicate between a two-player,turn-based, board game (like checkers or Othello) running native on iOS, and a remote game server The remote game server is just the ...
4
votes
3answers
483 views

Use of classes for lua extensions

I'm asking about a very small domain. One-off extension scripts. IE, defining a new weapon for scorched earth. When providing and API for small extension I've seen two approaches. The API exposes ...
4
votes
2answers
596 views

Basic procedural generated content works, but how could I do the same in reverse?

My 2D world is made up of blocks. At the moment, I create a block and assign it a number between 1 and 4. The number assigned to the nth block is always the same (i.e if the player walks backwards or ...
4
votes
1answer
1k views

Defining GUI control event responses using Lua in C++

I'm using Irrlicht(C++) for a 3D engine, and it has a built in GUI system. The GUI events are something like this: switch(eventtype) case button_pressed:     stuff case ...
4
votes
1answer
806 views

Lua or C++ in Cococ2d-x

I am going to use Cocos2d-x to make a game for Android and ios, but my question is, do I use the Lua integration or only c++, I see Lua useful here because the compilation thing. Or do I use only Lua ...
4
votes
2answers
942 views

Experience embedding javascript

I'm looking into scripting languages to embed in my game. I've always assumed Lua was the best choice, but I've read some recent news about embedding V8 as was considering using it instead. My ...
3
votes
3answers
2k views

How should I manage the AI using lua scripts?

My game is in C++ and I want to make AI being managed by lua scripts, but I have no idea how should the scripts look like and the integration in C++. Should the script be like if ...
3
votes
1answer
757 views

Is it possible to develop a game with Lua/Löve and have the source code compiled? [closed]

I've been looking at Lua and Löve for developing simple 2D games. But since Lua is interpreted and I know it can be compiled to some point, but how secure is that to decompiling. Or is there a better ...
3
votes
2answers
719 views

Does it make sense to use Lua scripting in a game developed in Python?

Well for C++ written games using Lua scripts for easy changing ai, quets etc is very reasonable and it's common. However now I'm going to write a game in pure python and I don't know if I should use ...
3
votes
2answers
2k views

Calling C++ functions in Lua

I'd like to use Lua to write some scripts which should allow me, given the state of certain variables of a specific instance, to determine a number to be assigned to a variable of that instance. Let ...
3
votes
1answer
670 views

Drawing an outline around an arbitrary group of hexagons

Is there an algorithm for drawing an outline around around an arbitrary group of hexagons? The polygon outline drawn may be concave. See the images below, the green line is what I am trying to ...
3
votes
2answers
2k views

What shall I choose between CoronaSDK or AirPlay?

1st Question is I want to write a board game for iOS and Android so I'm coming up with CoronaSDK and AirPlay. Since I have a mac, development platform is not an issue but the problem is which one ...
3
votes
3answers
3k views

How do I move an existing display object behind another in Corona Lua?

If I have two existing display objects in Corona, lets say do1 and do2. Assume do1 is drawn first then do2, so do2 will be on top. Is there a way to say "put do2 behind do1" in corona Lua? If yes can ...
3
votes
1answer
192 views

Platform independent replacement for LuaInterface

I'm currently working on a project in C#/XNA, however I'm planning to migrate this to MonoGame so that it can go onto more platforms. The problem is that I am currently using a lot of Lua, and for ...
3
votes
1answer
152 views

Twitter integration

My computer game is powered using Love2d in Lua, there is dead space in the menu of my game and I'd like to fill it up with something. So I'll like to put a twitter feed there, how can I receive all ...
3
votes
1answer
522 views

How can I manage entities(in entity component system) using Lua scripts?

Suppose I have a code like this in C++ // Game.cpp Entity* hero; Entity* witch; ... // entity initialization if(/player near witch/) { if(hero->get<HealthComponent>()->getHealth() ...
3
votes
1answer
158 views

Make an object follow the mouse pointer with LÖVE2D

I've been trying to make a picture follow the mouse pointer with LÖVE2D. I want that the object follow the mouse, and not just be the mouse coordinates, I did that. So I toked the distance between ...
3
votes
2answers
729 views

How to bind std::map to Lua with LuaBind

Is this possible in lua to achieve? player.scripts["movement"].properties["stat"] = "stand" print (player.scripts["movement"].properties["stat"]) I've done getter method in c++ with this approach: ...