TonyF Posted October 21, 2015 Share Posted October 21, 2015 I see this come up every now and then over the years with most engines and thought its a great idea. Im aware Panda3D is python based which was a bit of fun but it is also nice to have an editor such as leadwerks in the mix. I understand the choice for lua as a permanent commercial solution (Simpler, low interpreter overhead) but i could never let it catch on. Python on the other hand has a fair bit more overhead as you would imagine compared to lua but it also opens up plenty of added advantages (Simple & Complex, plenty of support libraries ie networking etc, 'smarter' code editors with auto complete, sometimes friendlier debugging) I will say that originally i absolutely hated python. I thought it looked ugly and the lack of braces made my head explode coming from predominantly a C++ and PHP background (amongst many others but these primarily). Eventually i started to properly try it and now i program with almost nothing BUT python these days. Personally i feel like its 'a lazy scripted c++' and although that sounds 'bad' its actually quite a compliment. I know previously i had several performance issues with Leadwerks last year that couldnt be explained (game coded completely in c++ and lag with only a few DLC zombies. The lua project was the same) although now that i have installed windows 10 and brought a new graphics card i thought it was time to play again. Now with that spiel i thought i would do a prototype instead of being another person asking for it. The project goal for me is to embed a python interpreter and create an interface wrapper to the leadwerks header and create a python interface api. (Major pain) The ultimate goal for me is to be able to quickly script ideas, tests, prototypes for my game together, test with a debugging environment better than visual studio (IMO), watch updates to the script run instantly without restarting the game. (Classes can be injected at runtime with some python magic added or do a quick reload) The added advantage of using python with the same API is that i can very easily convert the code to C++ for the final commercial product or for speed. (albeit with the additions of adding any supported libraries ie networking with twisted however the concept is proven) The end result is a minimum 2 python scripts that get called (Which matches the app.h) startup.py runtime.py Lua scripts still work as normal The C++ side profiles and outputs the python execution time into the python namespace as well which helps determine some bottlenecks 8 Quote Link to comment Share on other sites More sharing options...
Einlander Posted October 22, 2015 Share Posted October 22, 2015 Good work. It's always interesting to see what personal projects Leadwerks users come up with. Quote Link to comment Share on other sites More sharing options...
Wedmer Posted October 31, 2015 Share Posted October 31, 2015 I think the easiest way to enable prototyping with python is to compile library which implements bindings to python. https://wiki.python.org/moin/IntegratingPythonWithOtherLanguages Quote Link to comment Share on other sites More sharing options...
Ionus_Primus Posted September 8, 2016 Share Posted September 8, 2016 Hi TonyF, did you get it working ? Quote Link to comment Share on other sites More sharing options...
martyj Posted September 8, 2016 Share Posted September 8, 2016 I've thought about doing this with Java. Nice work on Python! Would love to give it a go myself if you wouldn't mind sharing your libraries. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.