My Own Lua Graphics Thing

Whether you're a newbie or an experienced programmer, any questions, help, or just talk of any language will be welcomed here.

Moderator: Coders of Rage

sk1v3r
Chaos Rift Newbie
Chaos Rift Newbie
Posts: 25
Joined: Sun Jan 09, 2011 1:36 pm

My Own Lua Graphics Thing

Post by sk1v3r »

Hey there :)
I've just started (pretty much) integrating lua with c++, and as a test for myself I decided to see if I could create a c++ program that lets lua use graphics and stuff. Because I've never done something like this before I thought it would be a good challenge, and having started it I'm pleased with what's come out so far.
I was just wondering if this was an all right way to go about practising lua scripting, or if it would be better if I just stuck to making a game in c++ and using lua just for scripting that Kinda stuff.
User avatar
Falco Girgis
Elysian Shadows Team
Elysian Shadows Team
Posts: 10294
Joined: Thu May 20, 2004 2:04 pm
Current Project: Elysian Shadows
Favorite Gaming Platforms: Dreamcast, SNES, NES
Programming Language of Choice: C/++
Location: Studio Vorbis, AL
Contact:

Re: My Own Lua Graphics Thing

Post by Falco Girgis »

I mean, it is a fine idea to get practice... That's what LuaPlayer is...

But if your goal is to create a powerful, extendable engine, having Lua perform core functionality like that is a sign of a piss poor engine. You're also going to suffer performance penalties for doing it that way.

So is your goal to make an Engine in C/++ that is extendable through Lua, or is your goal to create a series of wrapper-type C/++ functions that allow entire games to be made in Lua?
sk1v3r
Chaos Rift Newbie
Chaos Rift Newbie
Posts: 25
Joined: Sun Jan 09, 2011 1:36 pm

Re: My Own Lua Graphics Thing

Post by sk1v3r »

Well, I wan't really trying to make an engine, this was just meant to be practice at my skills of combining the two. I think I'll carry it out till the performance drops, but just keep it at a practice level.
Also, why is lots of scripting a bad engine, Is it because it pushers too much work on the scripter or because it slows it down?
User avatar
Falco Girgis
Elysian Shadows Team
Elysian Shadows Team
Posts: 10294
Joined: Thu May 20, 2004 2:04 pm
Current Project: Elysian Shadows
Favorite Gaming Platforms: Dreamcast, SNES, NES
Programming Language of Choice: C/++
Location: Studio Vorbis, AL
Contact:

Re: My Own Lua Graphics Thing

Post by Falco Girgis »

Yeah.

Because clearly your engine doesn't implement the functionality that it should when a gigantic amount of work is delegated to scripting. It is not the duty of scripting to perform basic tasks that should be handled by the engine.
sk1v3r
Chaos Rift Newbie
Chaos Rift Newbie
Posts: 25
Joined: Sun Jan 09, 2011 1:36 pm

Re: My Own Lua Graphics Thing

Post by sk1v3r »

I see your point there ... Thanks for the advice :)
User avatar
MadPumpkin
Chaos Rift Maniac
Chaos Rift Maniac
Posts: 484
Joined: Fri Feb 13, 2009 4:48 pm
Current Project: Octopia
Favorite Gaming Platforms: PS1-3, Genesis, Dreamcast, SNES, PC
Programming Language of Choice: C/++,Java,Py,LUA,XML
Location: C:\\United States of America\Utah\West Valley City\Neighborhood\House\Computer Desk

Re: My Own Lua Graphics Thing

Post by MadPumpkin »

Here's something quite similar to what you're asking. Love 2D I just discovered it a few days ago. It's really quite interesting but as Falco has already stated having that much functionality and having lua handle all of it is really not a good idea because it will most definitely slow down your engine. Most games with Love 2D look like the lua is in the .exe file though. Not quite sure how it works, haven't bothered to download it.

Anyways, if you would like to read and get ideas from it have fun, if you just want to use it that's cool whatever. But I recommend if you're going to be implementing what you said, into an engine. DON'T use it in the final version, maybe for testing or seeing if you can and what have you.
While Jesus equipped with angels, the Devil's equipped with cops
For God so loved the world that he blessed the thugs with rock
Image
Image
Image
Rapid Cube
Chaos Rift Newbie
Chaos Rift Newbie
Posts: 22
Joined: Mon Mar 14, 2011 11:43 pm
Programming Language of Choice: C++

Re: My Own Lua Graphics Thing

Post by Rapid Cube »

In windows you can embed the lua scripts into the exe by using a resource scipt (.rc)
User avatar
Falco Girgis
Elysian Shadows Team
Elysian Shadows Team
Posts: 10294
Joined: Thu May 20, 2004 2:04 pm
Current Project: Elysian Shadows
Favorite Gaming Platforms: Dreamcast, SNES, NES
Programming Language of Choice: C/++
Location: Studio Vorbis, AL
Contact:

Re: My Own Lua Graphics Thing

Post by Falco Girgis »

It's not like that's any faster. It's just ensuring people can't tamper with them. (and not even completely doing that).
Rapid Cube
Chaos Rift Newbie
Chaos Rift Newbie
Posts: 22
Joined: Mon Mar 14, 2011 11:43 pm
Programming Language of Choice: C++

Re: My Own Lua Graphics Thing

Post by Rapid Cube »

MadPumpkin wrote:Here's something quite similar to what you're asking. Love 2D I just discovered it a few days ago. It's really quite interesting but as Falco has already stated having that much functionality and having lua handle all of it is really not a good idea because it will most definitely slow down your engine. Most games with Love 2D look like the lua is in the .exe file though. Not quite sure how it works, haven't bothered to download it.

Anyways, if you would like to read and get ideas from it have fun, if you just want to use it that's cool whatever. But I recommend if you're going to be implementing what you said, into an engine. DON'T use it in the final version, maybe for testing or seeing if you can and what have you.
From what I've read love2d doesn't store anything inside in the exe file. It stores everything inside a .love file like what flash does with .swf files.
User avatar
MadPumpkin
Chaos Rift Maniac
Chaos Rift Maniac
Posts: 484
Joined: Fri Feb 13, 2009 4:48 pm
Current Project: Octopia
Favorite Gaming Platforms: PS1-3, Genesis, Dreamcast, SNES, PC
Programming Language of Choice: C/++,Java,Py,LUA,XML
Location: C:\\United States of America\Utah\West Valley City\Neighborhood\House\Computer Desk

Re: My Own Lua Graphics Thing

Post by MadPumpkin »

Ahh, so I read this, but it appears that you can convert .love files into .exe's because the game I downloaded made in love2D was a .exe file
While Jesus equipped with angels, the Devil's equipped with cops
For God so loved the world that he blessed the thugs with rock
Image
Image
Image
User avatar
TheBuzzSaw
Chaos Rift Junior
Chaos Rift Junior
Posts: 310
Joined: Wed Dec 02, 2009 3:55 pm
Current Project: Paroxysm
Favorite Gaming Platforms: PC
Programming Language of Choice: C++
Contact:

Re: My Own Lua Graphics Thing

Post by TheBuzzSaw »

What's wrong with letting people tamper with them? ;)
User avatar
dandymcgee
ES Beta Backer
ES Beta Backer
Posts: 4709
Joined: Tue Apr 29, 2008 3:24 pm
Current Project: https://github.com/dbechrd/RicoTech
Favorite Gaming Platforms: NES, Sega Genesis, PS2, PC
Programming Language of Choice: C
Location: San Francisco
Contact:

Re: My Own Lua Graphics Thing

Post by dandymcgee »

TheBuzzSaw wrote:What's wrong with letting people tamper with them? ;)
Seriously. I understand the need to prevent mass pirating in commercial games, but I don't seen anything wrong with leaving some things to be modified. I also don't like being told I'm not allowed to break apart software (or hardware) I legally purchased for personal use.
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches! :twisted:
User avatar
Falco Girgis
Elysian Shadows Team
Elysian Shadows Team
Posts: 10294
Joined: Thu May 20, 2004 2:04 pm
Current Project: Elysian Shadows
Favorite Gaming Platforms: Dreamcast, SNES, NES
Programming Language of Choice: C/++
Location: Studio Vorbis, AL
Contact:

Re: My Own Lua Graphics Thing

Post by Falco Girgis »

dandymcgee wrote:
TheBuzzSaw wrote:What's wrong with letting people tamper with them? ;)
Seriously. I understand the need to prevent mass pirating in commercial games, but I don't seen anything wrong with leaving some things to be modified. I also don't like being told I'm not allowed to break apart software (or hardware) I legally purchased for personal use.
You guys have to beat ES first, then you can fuck with our Lua...
User avatar
dandymcgee
ES Beta Backer
ES Beta Backer
Posts: 4709
Joined: Tue Apr 29, 2008 3:24 pm
Current Project: https://github.com/dbechrd/RicoTech
Favorite Gaming Platforms: NES, Sega Genesis, PS2, PC
Programming Language of Choice: C
Location: San Francisco
Contact:

Re: My Own Lua Graphics Thing

Post by dandymcgee »

GyroVorbis wrote:
dandymcgee wrote:
TheBuzzSaw wrote:What's wrong with letting people tamper with them? ;)
Seriously. I understand the need to prevent mass pirating in commercial games, but I don't seen anything wrong with leaving some things to be modified. I also don't like being told I'm not allowed to break apart software (or hardware) I legally purchased for personal use.
You guys have to beat ES first, then you can fuck with our Lua...
I'm fine with that. ;)
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches! :twisted:
User avatar
TheBuzzSaw
Chaos Rift Junior
Chaos Rift Junior
Posts: 310
Joined: Wed Dec 02, 2009 3:55 pm
Current Project: Paroxysm
Favorite Gaming Platforms: PC
Programming Language of Choice: C++
Contact:

Re: My Own Lua Graphics Thing

Post by TheBuzzSaw »

Seriously, I respect "the original". I wouldn't cheat at all during a first playthrough. But seriously, don't lock down the Lua at all. No binary encryption nonsense.
Post Reply