Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

 
Reply to this topicStart new topic
> Lua game programming
Rukiri
post Jul 19 2011, 02:50 PM
Post #1


emerge -avt awesome! Wait... it brings me.... HERE?!
Group Icon

Group: Revolutionary
Posts: 1,723
Type: Scripter
RM Skill: Advanced




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.


__________________________
Xeilsoft
- Follow your dreams to the very end..

Kits that I'm working on.
[Unity3D 4.0] LTTP/Minish Cap - I don't have time for custom gfx like what the pze folks are doing but I will try and work on some enhanced LTTP graphics.

Main PC
Core i7 3820 overclocked @ 4.8GHZ
Galaxy: Nvidia Geforce GTX 680 GDDR5 2GB
Asrock X79 Extreme9 w' creative sound
64GB corsair platinum @ 1600MHZ
Muchkin 128GB SSD(boot), OZKIN 2TB SSD, Western Digital GREEN 1TB HDD.
Rosewill Lightning 1000W PSU
OS: Funtoo Linux, Windows 8 (Virtual Machine)

iMac (March 2013)
3.4GHz Quad-core Intel Core i7, Turbo Boost up to 3.9GHz
16GB 1600MHz DDR3 SDRAM - 2X8GB
1TB Serial ATA Drive @ 7200 rpm
NVIDIA GeForce GTX 680MX 2GB GDDR5
Go to the top of the page
 
+Quote Post
   
Kread-EX
post Jul 20 2011, 12:37 AM
Post #2


(=___=)/
Group Icon

Group: +Gold Member
Posts: 4,136
Type: Scripter
RM Skill: Undisclosed




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.


__________________________
FRACTURE - a SMT inspired game (demo) made by Rhyme, Karsuman and me. Weep and ragequit.

My blog.

Click here for my e-peen


Go to the top of the page
 
+Quote Post
   
Rukiri
post Jul 27 2011, 09:40 PM
Post #3


emerge -avt awesome! Wait... it brings me.... HERE?!
Group Icon

Group: Revolutionary
Posts: 1,723
Type: Scripter
RM Skill: Advanced




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.

This post has been edited by Rukiri: Jul 27 2011, 09:48 PM


__________________________
Xeilsoft
- Follow your dreams to the very end..

Kits that I'm working on.
[Unity3D 4.0] LTTP/Minish Cap - I don't have time for custom gfx like what the pze folks are doing but I will try and work on some enhanced LTTP graphics.

Main PC
Core i7 3820 overclocked @ 4.8GHZ
Galaxy: Nvidia Geforce GTX 680 GDDR5 2GB
Asrock X79 Extreme9 w' creative sound
64GB corsair platinum @ 1600MHZ
Muchkin 128GB SSD(boot), OZKIN 2TB SSD, Western Digital GREEN 1TB HDD.
Rosewill Lightning 1000W PSU
OS: Funtoo Linux, Windows 8 (Virtual Machine)

iMac (March 2013)
3.4GHz Quad-core Intel Core i7, Turbo Boost up to 3.9GHz
16GB 1600MHz DDR3 SDRAM - 2X8GB
1TB Serial ATA Drive @ 7200 rpm
NVIDIA GeForce GTX 680MX 2GB GDDR5
Go to the top of the page
 
+Quote Post
   
lilcooldude69
post Jul 30 2011, 10:57 AM
Post #4


The pro-est eventer u know ;D
Group Icon

Group: Revolutionary
Posts: 297
Type: Event Designer
RM Skill: Masterful




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.


__________________________

My Userbars


Rated pg-13 part of signiture
Scientist A: "A single sperm has 37.5MB of DNA information in it. That means a normal ejaculation represents a data transfer of 1,587.5TB."
Scientist B: Too bad ejaculate has terrible packet loss
Scientist C:but the transfer does have a lot of redundancy

Go to the top of the page
 
+Quote Post
   
DragYou
post Aug 2 2011, 09:24 PM
Post #5


Level 2
Group Icon

Group: Member
Posts: 15
Type: Writer
RM Skill: Beginner




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.


__________________________
My last signature was a RTP sprite with my name. I think this one's better.
Go to the top of the page
 
+Quote Post
   

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 22nd May 2013 - 05:36 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker