perbone / luascript

Lua language support for Godot Engine
Apache License 2.0
633 stars 45 forks source link

Current progress #1

Closed rosshadden closed 5 years ago

rosshadden commented 6 years ago

I know you called this a WIP, but I was wondering what the current state is. Is it usable at all?

I tried adding a simple lua script using your default template but it prevented the scene from getting loaded correctly and spammed the console with debug logs. I also tried adding a print 'hi' in the _ready function but never saw it. I'm not afraid of rough edges, I was kind of just wondering if you expected it to even work in a very basic way at this point.

Also I would love to help out, so please let me know if there's anything I can help with.

On an unrelated note I was looking into adding JavaScript support to Godot. Can you give me any tips to getting started? It looks like you're using the PluginScript API that godot-python pioneered, but it's a lot less code and a lot less confusing than godot-python itself, so I think I can learn a lot more from this project and from you.

perbone commented 6 years ago

Hi @rosshadden

I know you called this a WIP, but I was wondering what the current state is. Is it usable at all?

So basically at the current state it isn't usable at all. To fully implement a language backend to Godot the way I'm doing is a lot of work and at the moment a don't have the time for this so the progress is slow but stead.

I tried adding a simple lua script using your default template but it prevented the scene from getting loaded correctly and spammed the console with debug logs. I also tried adding a print 'hi' in the _ready function but never saw it. I'm not afraid of rough edges, I was kind of just wondering if you expected it to even work in a very basic way at this point.

It won't work just yet because Lua is not receiving the Godot callbacks. In my next drop of code I believe it'll begin functioning properly. We'll see...

Also I would love to help out, so please let me know if there's anything I can help with.

For the time been I don't want you to waste your time because as I said before, It's in its infancy and I don't have the time even to join other people in conversations and I don't think it is fair to create spectations I can't fullfill. Having said that, I really don't mind answering issues here so if it works for you I'll be glad to help you out sharing the knowledge I gathered during my researching into Godot's source code and language provider API. Just be ready, it's a mess!

On an unrelated note I was looking into adding JavaScript support to Godot. Can you give me any tips to getting started? (...)

So the better answer I can think now is to make yourself comfortable with the Godot's code base and look into others languages implementations. Current ones I would recommend would be GDScript and CSharpScript. For an extent you could look at LuaScript as well but obviously it has the little to contribute to your learning. This was my approach until now. Despite being messy the Godot's API is simple in concept so if you know your way into parsers, compilers, etc, you'll be fine.

(...) It looks like you're using the PluginScript API that godot-python pioneered,

Actually I'm not. From the beginning my plan was to give Lua the best integration with Godot, in pair with GDScript. By that I mean having full feature available to the Lua developer, from Godot's built in editor to full API access from Lua runtime. And to accomplish that you realy need to go with the module API, like GDScript and CSharpScript did. The PluginScript is just an abstraction layer above the language API (by it self a module abstraction) I think aimed to simplify the module API. But I may be wrong about that.

(...) but it's a lot less code and a lot less confusing than godot-python itself, so I think I can learn a lot more from this project and from you.

Well here I can think in two reasons about this. Firstly this project has a long way to go and in the end I believe it will have a very large code base too. And lastly, I believe I'm being quite academic, using the best programming practices I know of. Simplifying and being organized and consistent is one of the things I very much believe in. Maybe that's why you perceived my code as simple to understand.

I'm really passionate about Lua and Godot, so I'm not going to leave it abandoned. Actually I'm in the process of giving more attention to this project so I hope you stay around.

I hope it helps.

-- Perbone

rosshadden commented 6 years ago

Thanks for the very detailed response! What I am going to do for now is to keep using godot-nim. When this is further along I'll jump on board, and like I said I would love to help out. And then eventually after getting intimate with this codebase I will probably have a good handle on what I would do for JavaScript.

I was very active in the LÖVE community, but I got discouraged because it seemed like most people didn't approach it like you and I do: with best practices and evolving conventions. I "fell out of love with LÖVE", as I like to put it, because I had some problems with things like the lack of a good module manager solution. Seeing people just copy/paste libraries into their projects was very disconcerting... I ended up using git submodules for libraries I used, but I still had issues with how the module resolution worked. I eventually reached a point where I decided Lua/LÖVE really needed a defacto package manager (I hated all of the existing solutions, but yes I did my reaserch and experimentation), and I also decided it seemed like I would have to be the one to do it. And I didn't want to.

After that I went on to make my own game framework, which became the most popular Nim game framework while we actively worked on it, and later I migrated to Godot and eventually godot-nim.

naturally-intelligent commented 6 years ago

Thanks for this project - I'm a big fan of Lua and am also currently building prototypes with Godot and GDScript. I've developed games with MOAI Engine (https://github.com/moai/moai-dev) which is Lua on top of C++. It is a very nice engine but unfortunately I have had to move newer projects to Godot because of platform support and community activity. I'd rather use Lua because it's so smooth compared to GDScript which often feels clunky. GDScript is still not bad. Just thought I'd point out MOAI because it might have some interesting Lua binding code to reference.

rosshadden commented 5 years ago

Checking in again. Is this usable now @perbone? I can't contain my anticipation!

perbone commented 5 years ago

Hi! Sorry for the delay.

So development is slow but I'm about to dedicate a whole week of full time development on my vacation. Other than that, I'm gonna need some help on deciding how to map Godot's API to Lua. Probably I'll open an issue here so people can comment.

-- Perbone

perbone commented 5 years ago

Hi Just do you know, I no longer think this effort is worth anyone's time. The engine's developers seems to be difficult to work with and I don't have patient for arrogant people. Wether or not I close this project I'll let you know before. Again thanks for your interest. -- Perbone