Page 1 of 2

My Own Lua Graphics Thing

Posted: Fri Jul 22, 2011 9:50 am
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.

Re: My Own Lua Graphics Thing

Posted: Fri Jul 22, 2011 10:57 am
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?

Re: My Own Lua Graphics Thing

Posted: Fri Jul 22, 2011 11:29 am
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?

Re: My Own Lua Graphics Thing

Posted: Fri Jul 22, 2011 11:34 am
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.

Re: My Own Lua Graphics Thing

Posted: Fri Jul 22, 2011 11:39 am
by sk1v3r
I see your point there ... Thanks for the advice :)

Re: My Own Lua Graphics Thing

Posted: Fri Jul 22, 2011 1:36 pm
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.

Re: My Own Lua Graphics Thing

Posted: Fri Jul 22, 2011 5:20 pm
by Rapid Cube
In windows you can embed the lua scripts into the exe by using a resource scipt (.rc)

Re: My Own Lua Graphics Thing

Posted: Fri Jul 22, 2011 5:22 pm
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).

Re: My Own Lua Graphics Thing

Posted: Sat Jul 23, 2011 3:03 pm
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.

Re: My Own Lua Graphics Thing

Posted: Tue Jul 26, 2011 4:33 am
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

Re: My Own Lua Graphics Thing

Posted: Tue Jul 26, 2011 10:26 am
by TheBuzzSaw
What's wrong with letting people tamper with them? ;)

Re: My Own Lua Graphics Thing

Posted: Tue Jul 26, 2011 4:27 pm
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.

Re: My Own Lua Graphics Thing

Posted: Tue Jul 26, 2011 4:42 pm
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...

Re: My Own Lua Graphics Thing

Posted: Tue Jul 26, 2011 4:47 pm
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. ;)

Re: My Own Lua Graphics Thing

Posted: Tue Jul 26, 2011 6:18 pm
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.