Help - Search - Members - Calendar
Full Version: Lua game programming
RPG RPG Revolution Forums > Game Engines > RPG Maker 2000 / 2003 > General Game Engines Discussion
Rukiri
If you've been around the RPG Maker and Game Maker communities you would have heard about Lua at one point in time, I've personally been using lua for the past 3 months and come to love it! Lua can be very much like Ruby/RGSS and GML(Game Maker Language) if you use it in the right way.

Lua does not have classes but it does have functions which can make up for it if used in the right way. To do pseudo classes in lua it's pretty simple, just try and create your classes like so.

CODE
Account = class(function(acc,balance)
              acc.balance = balance
           end)

function Account:withdraw(amount)
   self.balance = self.balance - amount
end

-- can create an Account using call notation!
acc = Account(1000)
acc:withdraw(100)


You can find more about simple lua classes here, http://lua-users.org/wiki/SimpleLuaClasses . For more advanced classes please use your best internet buddy called GOOGLE!


Now let's get back to lua, Lua like every language will have a framework for creating games and I know 2 good ones and I'll recommend the one I use over the other one.

The 2 frameworks/engines that I know of are.
- Love 2D
- Agen

Love 2D is obviously a 2D game framework that will allow for rapid game development, now there is some setbacks if you're used to say RPG Maker or never called for external maps in Game Maker. There is no editor at all, it's just raw code with Love Commands and enhancements to lua. There is an IDE in the works but there is some good news as well, just because there's no IDE or editor doesn't mean it's hard to use. At first I thought it was a nightmare but after a couple hrs I had a pretty good platform engine using Box2D(you'll need to implement this yourself with Love)

Agen is also a 2D game framework that uses lua, so what makes it different than Love? well it comes with Box2D out of the box, it's easier to get started with(imo anyway) and it has some pretty nifty features.

If you're looking to do both 2D and 3D(leaving 2.5d out of the mix) than there is the Baja engine which is very powerful and uses lua 5.1.
Kread-EX
Lua is a great scripting language, way faster than Python or Ruby. I don't know Agen but Love2D is completely portable C++ and since creating a game in pure Lua isn't such a good idea you'll need C++ knowledge to use the framework to its full potential.
Haven't tried Baja engine, so I can't comment on it. Seems powerful according to its website, but I doubt it will top Unity anytime soon.
Rukiri
I will say Love2D has faults when it comes to tile-based games aka platformers or rpgs, I had no problem coding a zelda typed battle system in Love and it was pretty easy, even though I'm using C#/XNA for my actual project I really wished tile-games were easier with love as it could easily take over Game Maker if someone created a GuI for it, something similar to a C#/C++ project.

Lua is an awesome scripting language, it's fast and it's furious! I have even heard talks about YoYo dumping GML for lua for Game Maker 9!

The thing with Love/Lua is you can't code the same way you would with C#, C++, and GML or any other languages it's different! While syntax wise it's probably no it's exactly like GML depending on if you used brackets or just used the end syntax if you were used to python or ruby(I always use end, wish I could with C# though)

Though the only loader is for tiled and sorry but I can't stand tiled and much prefer Mappy as it can actually export to a lua file and also tiled studio which is one of my favorite map editors next to RPG Maker's(Enterbrain got at least 1 thing right lol)

Love2D still feels like it's not ready for an actual project yet as it's only at 0.7.2, I'd wait for 1.0 as many many things change within love releases which sucks if you're actually working on a serious project, which is why they kinda do not recommend working on a serious project such as a RPG as you'd have to change a lot to your code where as it'd just be easier to rewrite it.

I have not tried Agen but will say that it's written entirely in lua and has 2 very good games that were released with that engine, 8 bit commando(it's awesome well worth the money) and chains, it looked boring so didn't buy it but the demo was fun for awhile.

Love2D also has engine specific things you may or may not like, I'd prefer to use straight up lua but the modified stuff isn't bad.
lilcooldude69
Lua is used in ragnarok online, its used to help identify certain items and classes and such :X, i didnt know it was a language, i thought it was exclusive only to ragnarok online :X.
DragYou
I love Lua, mainly because it's one of the simplest programming languages out there and I've been using on Roblox for like a month... Until I found a way to- you know what, nevermind.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.