Killa: a new scripting language for Love 0.8.0

General discussion about LÖVE, Lua, game development, puns, and unicorns.
User avatar
OmarShehata
Party member
Posts: 259
Joined: Tue May 29, 2012 6:46 pm
Location: Egypt
Contact:

Re: Killa: a new scripting language for Love 0.8.0

Post by OmarShehata »

I just finished porting over my code to Killa and the code wasn't much but I already found a silent bug! And the new code is a *lot* more organized. I love how I can also add public properties to my "class" and keep them away from local variables. (That *is* what the : operator does right?)

The fact that you found and fixed a bug in Love means everyone should switch over to Killa now!

Now I really don't want to let Killa go, but some things are worrying me.
_ex_ wrote: Love-Killa has only being compiled in Windows, there are no MacOSX/Linux binaries, last time I tried to compile Love for mac I failed miserably due to a lot of missing dependencies, it was not simple and I didn't have enough time, also I don't have a mac at hand. You'll need to be proficient with compiling Love and making the changes for mac and linux if it's not ready by me, it's just a matter of updating the projects but is not trivial if you don't have the target system at hand and have some familiarity with the building tools, so I'll say that you'll need to be able to do this if you want to use Killa in a commercial product and fix any possible bugs still not found in these operative systems.
Would that just entail taking the project files you have prepared for Mac and Linux and attempting to compile them on their platforms (And if any functions fail in the source code, or are done differently in the other OS's I take care of those) and then the .kia code will work without having to change anything? I would need of course to compile a "love-killa" for each platform. I do have experience with C++ and I was planning on making my engine in C++ anyway, so I think if it's just learning how to modify the code to different platforms it shouldn't be *too* big of an issue, as I also have these platforms at hand.
_ex_ wrote: Please use the latest version on bitbucket, the HEAD is the stable version, if you have visual 2008 compile the exe, I'm not sure if the last exe is compiled, if it is not I'll upload a new version, but this is for windows only, you'll need to distribute the Love-killa exe with the folder of your game with the *.kia files, there is no need to add a batch or modify shortcuts because Love-killa looks for the folder "game", this way you only need to drop the folder to the user and start the program, Love-killa must run the same as Love 0.8.0, I didn't changed or modified the rendering support, just the scripting support.
I'm also a bit worried about this. I wouldn't want to just distribute my source files openly like that when it's time for a commercial release. I haven't tried but I'm sure there's some way to package all that into an .exe..right?

If all else fails, I could always just write the whole game in Killa and then port it back in the end.

Thanks for your reply! And I really hope you continue working on Killa, because I really wouldn't mind donating to the project because I just love it so much!

(This is the game I'm using KIlla for if there's any interest: www.concerned-joe.com)
User avatar
_ex_
Citizen
Posts: 65
Joined: Thu Dec 08, 2011 2:59 pm

Re: Killa: a new scripting language for Love 0.8.0

Post by _ex_ »

OmarShehata wrote:I just finished porting over my code to Killa and the code wasn't much but I already found a silent bug! And the new code is a *lot* more organized. I love how I can also add public properties to my "class" and keep them away from local variables. (That *is* what the : operator does right?)
I checked your web site, great work there! also your game look very promising. Have you used Love physics box2d support?
OmarShehata wrote: Would that just entail taking the project files you have prepared for Mac and Linux and attempting to compile them on their platforms (And if any functions fail in the source code, or are done differently in the other OS's I take care of those) and then the .kia code will work without having to change anything? I would need of course to compile a "love-killa" for each platform. I do have experience with C++ and I was planning on making my engine in C++ anyway, so I think if it's just learning how to modify the code to different platforms it shouldn't be *too* big of an issue, as I also have these platforms at hand.
In theory yes, just compile Love for mac and linux adding the killa sources and pre-processor definitions: LOVE_USE_KILLA, KILLA_COMPAT_ALL.
the Killa interpreter alone has been tested in mac and linux and it works the same as in windows, so the bugs (if any) must be few and rare and would require some Lua API tinkering, ie: for android and cocos2d-x I needed to fix an index error in some android only C++ code. (Killa uses indexes base zero while Lua uses index 1)
OmarShehata wrote: I'm also a bit worried about this. I wouldn't want to just distribute my source files openly like that when it's time for a commercial release. I haven't tried but I'm sure there's some way to package all that into an .exe..right?
Well again in theory you could just use compiled scripts, embedding the scripts as Love does is also possible but would require more work. About the security concerns Love-killa has the same security as stock Love (none), I was planning to add some kind of encrypted support in the future but it won't be that "secure". Actually nothing can be secure because the engine needs to translate the scripts to work so the magic cipher is susceptible to attack.
OmarShehata wrote: If all else fails, I could always just write the whole game in Killa and then port it back in the end.
Thanks for your reply! And I really hope you continue working on Killa, because I really wouldn't mind donating to the project because I just love it so much!
Well I hope there is no need to port back your game to Lua, however if you need LoveJIT I see not other option, I was wondering in doing KillaJIT but the code of that project is really magic and many levels of complexity ahead of the simple Lua compiler and VM, so it's going to take some time :D
User avatar
OmarShehata
Party member
Posts: 259
Joined: Tue May 29, 2012 6:46 pm
Location: Egypt
Contact:

Re: Killa: a new scripting language for Love 0.8.0

Post by OmarShehata »

_ex_ wrote: I checked your web site, great work there! also your game look very promising. Have you used Love physics box2d support?
Thanks! And yes, I wanted to confirm that box2d in Killa with Love is working perfectly!
_ex_ wrote: Well I hope there is no need to port back your game to Lua, however if you need LoveJIT I see not other option, I was wondering in doing KillaJIT but the code of that project is really magic and many levels of complexity ahead of the simple Lua compiler and VM, so it's going to take some time :D
About the security, I don't think it's really important as long as getting the source code isn't too trivial for a non-programmer. Like how you can produce a packaged exe with love which I'm assuming isn't as easy to crack as renaming a .love file.

I'll try compiling for Mac and Linux myself but if you get to that first in the next few months, then that's all the merrier :D

I'll probably end up donating to the project towards the end of ours and hopefully more people will start using Killa!
User avatar
Nixola
Inner party member
Posts: 1949
Joined: Tue Dec 06, 2011 7:11 pm
Location: Italy

Re: Killa: a new scripting language for Love 0.8.0

Post by Nixola »

It's easier, actually. All you have to do is extract the .exe and you've got a folder with sources and resources.

...Wait, it's exactly the same.
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
User avatar
OmarShehata
Party member
Posts: 259
Joined: Tue May 29, 2012 6:46 pm
Location: Egypt
Contact:

Re: Killa: a new scripting language for Love 0.8.0

Post by OmarShehata »

Nixola wrote:It's easier, actually. All you have to do is extract the .exe and you've got a folder with sources and resources.

...Wait, it's exactly the same.
Well...that's a bummer. I'll probably try to invest in some cheap security or hey, make my own. It'd probably be laughably insecure, but all I really care about is that the layman can't really just go screwing around in the code and/or assets.

Another question about Killa, I'm noticing some Lua functions are missing. Both ways to get the number of elements of a table don't seem to work (using # or getn() ) I'm guessing that's because tables and dictionaries were separated in Killa? I made my own "Len()" function. "math.round()" also doesn't seem to be there. And the last one I found was "toString()" isn't there either. Are these work in progress or are there other functions that do the same thing in Killa? Are there any more differences between Killa and Lua?
User avatar
_ex_
Citizen
Posts: 65
Joined: Thu Dec 08, 2011 2:59 pm

Re: Killa: a new scripting language for Love 0.8.0

Post by _ex_ »

OmarShehata wrote: Another question about Killa, I'm noticing some Lua functions are missing. Both ways to get the number of elements of a table don't seem to work (using # or getn() ) I'm guessing that's because tables and dictionaries were separated in Killa? I made my own "Len()" function. "math.round()" also doesn't seem to be there. And the last one I found was "toString()" isn't there either. Are these work in progress or are there other functions that do the same thing in Killa? Are there any more differences between Killa and Lua?
Killa is based on Lua 5.2 anything in Lua 5.2 must be in Killa I have still not deleted functions (not even deprecated ones), but I'll do it in the future to leave only the best ones if required. Killa is focused on game development.

Please re-check the test.kia script that comes with the distribution, there are little snippets there that can help you to grasp the basics of Killa, of course a proper tutorial is missing.

- Length: changed to '$', '#' will be used by the preprocessor
- It is not toString, is tostring
- there is not math.round in Lua, http://lua-users.org/lists/lua-l/2008-04/msg00420.html

use floor or ceil:
print(math.floor(34.5)) // 34
print(math.ceil(34.5)) // 35

Caveat: string funtions will be changed to use index zero in 0.2
User avatar
OmarShehata
Party member
Posts: 259
Joined: Tue May 29, 2012 6:46 pm
Location: Egypt
Contact:

Re: Killa: a new scripting language for Love 0.8.0

Post by OmarShehata »

_ex_ wrote:
OmarShehata wrote: Another question about Killa, I'm noticing some Lua functions are missing. Both ways to get the number of elements of a table don't seem to work (using # or getn() ) I'm guessing that's because tables and dictionaries were separated in Killa? I made my own "Len()" function. "math.round()" also doesn't seem to be there. And the last one I found was "toString()" isn't there either. Are these work in progress or are there other functions that do the same thing in Killa? Are there any more differences between Killa and Lua?
Killa is based on Lua 5.2 anything in Lua 5.2 must be in Killa I have still not deleted functions (not even deprecated ones), but I'll do it in the future to leave only the best ones if required. Killa is focused on game development.

Please re-check the test.kia script that comes with the distribution, there are little snippets there that can help you to grasp the basics of Killa, of course a proper tutorial is missing.

- Length: changed to '$', '#' will be used by the preprocessor
- It is not toString, is tostring
- there is not math.round in Lua, http://lua-users.org/lists/lua-l/2008-04/msg00420.html

use floor or ceil:
print(math.floor(34.5)) // 34
print(math.ceil(34.5)) // 35

Caveat: string funtions will be changed to use index zero in 0.2
Thanks for the quick reply! Would it be a good idea if I start gathering all this info into one place and run it by you? I could perhaps contribute to a documentation/tutorial even though I'm still grasping the language myself.
User avatar
_ex_
Citizen
Posts: 65
Joined: Thu Dec 08, 2011 2:59 pm

Re: Killa: a new scripting language for Love 0.8.0

Post by _ex_ »

OmarShehata wrote: Thanks for the quick reply! Would it be a good idea if I start gathering all this info into one place and run it by you? I could perhaps contribute to a documentation/tutorial even though I'm still grasping the language myself.
Yes please, I'll help you with the doubts you'll have. Just running your game with Killa would help me a lot for more testing cases.
Thanks for that!
User avatar
_ex_
Citizen
Posts: 65
Joined: Thu Dec 08, 2011 2:59 pm

Re: Killa: a new scripting language for Love 0.8.0

Post by _ex_ »

I have updated the project to use the latest engine.
It's in Bickbucket.
User avatar
OmarShehata
Party member
Posts: 259
Joined: Tue May 29, 2012 6:46 pm
Location: Egypt
Contact:

Re: Killa: a new scripting language for Love 0.8.0

Post by OmarShehata »

Hey Laurens! It looks like I've encountered a bug in Killa.

The problem is in box2d where userData's don't always output correctly, seemingly sporadic.

I attached two files in the last post of this topic: viewtopic.php?f=4&t=9686&p=59605#p59605

You can see the strange output in the killa version, outputting the function instead of the userData.

Any ideas on this one?
Post Reply

Who is online

Users browsing this forum: No registered users and 44 guests