Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Author
Message
Lucas Tiridath
AGK Developer
15
Years of Service
User Offline
Joined: 28th Sep 2008
Location: Kings Langley, UK
Posted: 28th Dec 2013 11:17 Edited at: 12th Feb 2014 17:37
Hi. I've been interested in learning Lua for a while now and so I thought it might be handy to have a Lua wrapper for AGK. Therefore I've gone ahead and had a go at writing one. I thought other people might have a use for it too so I thought I'd share what I've got with you. You can download the current version here.

The wrapper is basically just a modified Tier 2 template. I've currently only made templates for Windows and Android, as I don't have access to a Mac and so I can't do iOS or Mac OSX. I don't think making the port should be too difficult if you're interested though.

In the download, you'll find a few things. First off, there are are the Windows and Android templates. I've also included the SciTE IDE, modified to do syntax highlighting for the AppGameKit command set, to open the documentation and to run your programs with the AppGameKit Lua interpreter. As an extra, I've made a port of Rick's Snake Snacker game which he distributed as an AppGameKit BASIC example, so you can have a play around with that if you want to see how it works.

One major thing that I've not included is the interpreter. The reason for that is that if I offer the interpreter as a download, then that's tantamount to just giving out the AppGameKit game engine, as anyone can then write their own games using it just by modifying the Lua scripts. Therefore if you want to use it for development, the first thing you'll have to do is to build the interpreter and put it in the correct place. There is some guidance on doing that in the documentation but if you have any trouble, do just ask.

I've also set up the templates so that (in theory) when you're ready to ship your app, you can build the lua files into the executable so that you can delete the scripts before distribution. This protects both TGC and your own source code.

To demo how extensibility works, I've added a handful of vector maths commands as well. There's lots more that I would like to add but anyhow, the foundation is there now so it should be quite easy to add new commands if you want to.

If you're wondering whether to use this, here are a few thoughts on the pros and cons.

Pros
- Lua is a more mature language than AppGameKit BASIC, and so offers greater stability and some additional structures.
- Whilst developing, there is no need to recompile anything because you are just launching the interpreter which will compile and run the scripts at run time.
- Lua is widely used in the games industry, so for those with an eye to a little CV building, it might be a useful skill to have.
- The framework is extensible, meaning that you can add your own commands in C++ whist doing most of the development from the comfort of a high level scripting language.
Cons
- You have to work with Tier 2 templates to build the interpreter and then to deploy your apps, and so you're not as shielded from such things as you are in AppGameKit BASIC.
- Only Windows and Android are currently supported out of the box.
- The wrapper is largely untested and completely unofficial. I will of course try and fix bugs that I find/are reported to me but there is nothing like the same level of guarantee as you get from using an official TGC product.

OK well that's it for now. I hope you find it useful. If you have any questions or problems with it, please just let me know.

The Zoq2
13
Years of Service
User Offline
Joined: 4th Nov 2009
Location: Linköping, Sweden
Posted: 28th Dec 2013 16:10
Really interesting project, I integrated LUA into my own game a while back but I didn't go as far as "porting" AppGameKit to it . I might have to give this a try at some point.

Say ONE stupid thing and it ends up as a forum signature forever. - Neuro Fuzzy
Lucas Tiridath
AGK Developer
15
Years of Service
User Offline
Joined: 28th Sep 2008
Location: Kings Langley, UK
Posted: 31st Dec 2013 10:29
Thanks Zoq2! It was quite fun to implement, although wrapping all the commands got a bit tedious (turns out AppGameKit has a lot of commands!!). I'm quite interested in the possibilities of extensibility the wrapper offers. If I get time, I might try and port my Tier 2 library that wraps FreeType for AppGameKit to this as well. Anyhow thanks for the support .

Lucas Tiridath
AGK Developer
15
Years of Service
User Offline
Joined: 28th Sep 2008
Location: Kings Langley, UK
Posted: 12th Feb 2014 17:43
Just a quick update. I'm afraid I've not had much time to work on this but I've fixed a few of the remaining issues and I've changed the templates so that including the extra commands I've added (at the moment just a few vector maths commands) is optional.

I hope in the future to add more extra commands, and eventually to start supporting AppGameKit V2. However for the moment, I'm calling the current version V1 (e.g. no longer in beta). If you find any remaining bugs though, please do let me know and I will try and fix them ASAP. Thanks!

Login to post a reply

Server time is: 2023-09-30 00:41:54
Your offset time is: 2023-09-30 00:41:54