Jump to content
  • entries
    943
  • comments
    5,899
  • views
    923,763

Lua in Leadwerks 5 is Solved


Josh

4,356 views

 Share

When considering the script system in Leadwerks 5, I looked at alternatives including Squirrel, which is used by Valve in many games, but these gave me a deeper appreciation for the simplicity of Lua. There are only a handful of rules you need to learn to use the language, it’s fun to use, yet somehow it does everything you could ever need.

These were three big issues I had to solve. First, the Leadwerks 5 API makes extensive use of smart pointers, which our binding library tolua++ does not support. Second, I wanted better auto completion and a better user experience in the IDE in general. Third, if an external IDE is going to be used it needs to be able to interface with the Leadwerks debugging system.

To support smart pointers, I found a new library called sol2 that does everything we need. @Rick and I discussed the idea at great length and I am happy to say we’ve come up with a design that is simple to use and quite a bit easier than Leadwerks 4.x even. The binding code is nowhere near done but at this point I can see that everything will work.

@AggrorJorn suggested using Visual Studio Code as our official script IDE in Leadwerks 5, and after investigating I think it’s a great idea. The auto completion is quite good and the IDE feels more natural then anything I could come up with using a custom text editor made with Scintilla. In fact eliminating the built-in script editor in Leadwerks 5 relieves me of a lot of uncertainty and potential issues when this is written.

Finally, VS Code has support for custom debuggers. I wrote an example command line debugger for Leadwerks and I will use this to show another programmer how to interface with Leadwerks. (I don’t plan on writing the debugger myself.)

With your feedback and ideas are shaping up to make Leadwerks 5 a huge leap forward over our previous designs. The improved simplicity of the new script system is a big cognitive relief. Having fewer things to worry about makes life better in a subtle but definite way.

There’s something else that consumes a lot of mental attention. Social media and the internet have grown and changed over the years and become more efficient at consuming our attention. (Many features of this site are designed the same way.)

The scary thing is that normal non-technical people seem to be more vulnerable than nerds. We’ll fire up the Witcher and play for an hour, but regular people are checking their phones 24/7 for feedback and validation. It’s much much worse than any accusation we got as kids of being “Nintendo zombies” because we spent an afternoon playing games instead of staring passively at broadcast TV. People who play games generally don’t care about posting photographs of their food or collecting followers.

Somewhere along the line the internet went from being a weird thing on your computer to the collective consciousness of humanity. Reality is online and the physical world around us is just a mirage, one possible instance of a million possible individual experiences. Maybe it was around the time they started using AI to optimize clickbait that things got out of hand.

Although my career and the way I live my life are only possible through the internet, I am old enough to remember life before the web, and in many ways it was better. Things were more focused. Even the early web before clickbait ads and online echo chambers was pretty nice. You could go to a record store and hang out talking to people about new music. Printed paper magazines were a thing.

I already removed the link to our Google+ page in the website footer and no one noticed. I think about deleting our Facebook and twitter accounts, or at least not linking to them on our site. Why must every website pay homage to these monopolies? What are they doing for me, besides a limited flow of hits that pale in comparison to what my own email list brings in? I have written about this before but now that it is fashionable to criticize social media I might act on it. I don’t know, we’ll see.

Please like, share, and retweet.

  • Like 8
 Share

11 Comments


Recommended Comments

I woke up with a sore throat so I am going to stay home today and hopefully prevent this from becoming a full-blown cold.

What I’m saying about social media is also a function of where we’re at right now. Everyone here has enough experience with Leadwerks 4 that we can discuss how to make the next version have the absolute best user experience ever. Plus I made quite a lot of money on Steam and I can afford to spend some on artwork and other things for version 5 (which will not be called Leadwerks anymore). I want to focus on you guys and give you something really amazing. and not spend any time yelling into the wind on Facebook.

I’ve also been thinking a lot about the need to establish something independent from Steam, which is why I started the $5 subscription service on our site.

The only social network I care about is you guys, right here.

Link to comment

I had some worries about the lua bindings with the new pointer system myself, but glad a new library does the job. I might look into Sol for my personal projects.

The VSCode implementation seems really neat. My only criticism is that it ruins the "All in one package" model you have created for the current version if you decide to not do your own script editor. Regardless, VS Code is really nice, I use it all the time. I just wish it opened as fast as notepad or notepad++. 

I haven't had the time to really play with Leadwerks at all as of late. But I'm always looking forward to what's new in the engine.

Oh yeah, as a kid I got called anti social because I liked to be on the computer a lot while being in the comfort of my home. I went to roller skating at a place last weekend and noticed that mostly everyone there was on their phones most of the time. I on the other hand left my phone in the car so it wouldn't get broken.

The idea that people paid money for admission for a social event, to be on their phone is disgusting.

Anyway, glad everything is working out.

Link to comment
7 hours ago, Josh said:

version 5 (which will not be called Leadwerks anymore)

Really?  I assume you'll want to wait before announcing it but do you already have a name in mind?

Link to comment

surprising you would want to walk away from your brand recognition that you have built up for over a decade by abandoning the Leadwerks name... :huh:

Link to comment

Branding is a difficult thing to achieve.  Companies re-brand themselves many times over the course of company solvency.  The only input I can give on this subject is when there is a core shift in the cultural ideas of said company.  This isn't to Josh, whom is more business oriented actually running one while I still work for one, this is to anybody reading in general.  Successful companies know when they evolve so does its culture and its ideas and that is where re-branding comes in.

Regarding pointers and Lua.  Lua is so highly underrated for a scripting language.  Of all scripting languages it's the closest to C in simplicity.  Combine that with C++, which as an aside by the time C++23 comes out raw pointers are *OUT*.  C++ was always meant to lean towards references but that backward compatibility with C made it what it was; although now you don't hear about pedantic conversations of C/C++ being interchanged.  They are two different languages now and continue to diverge.  

Hate to sound like I am ranting or rambling but I will say this:  Leadwerks is the only proprietary piece of software I am not only willing to shell out my own money for, I actually do with every opportunity...pitching ideas in unrelated circles to Steam or the wanna be game programmer and that whole "speaking with your money" part in the States where I reside this means something.  I have seen many pro's and con's with Josh, Leadwerks, etc. on social media that it made me a late comer to this product and community.  Some things I have not liked but in the end the actual product speaks for itself which is what matters most; even if I disagreed with Josh.

I believe, and I may be wrong, but it is my belief Josh wants a successful business while still having a loyal customer base not because of his company or his product but both and that is something I have subscribed myself to supporting as a customer.

Apologies if this sounds like some pointless rant but I am juggling a family, a successful Principal Engineer/Manager, and ready to work for myself instead of someone else.  I have to finish cooking dinner, get the kids to bed, and then get back to my side project with LeadWerks.  After 25+ years doing this I see a way to break the cycle without being beholden to the hamster wheel.

 

Link to comment

I would not consider a name change unless the new one was very good at making the brand spread faster and telling people what the product does. The name will be revealed when the Kickstarter campaign launches, which will be near the end of development. The point of the Kickstarter campaign is to launch the larger marketing campaign. GDC will come next, with a booth and maybe a lecture.

My first speaking gig at GDC was a nightmare. I had spent threee years writing my first C++ program. Unity had just announced a free mobile version the day before. There was a bad echo in the sound system so all my words were bouncing back to my after a short delay, making it extremely difficult to speak. And there were 600 people in the audience, from Apple, EA, Microsoft, etc., and everyone hated me, thought I was crazy, or didn’t know who I was. But I did it and I am proud of myself for that.

That happened before Leadwerks had any success. It was just an idea and I was an unproven nobody, with no track record of success. This was before Steam and before our first Kickstarter campaign. When Leadwerks 3 was launched I did not have all the contacts in the game industry that I have now. I did not know a dozen people at Valve. I was also broke. There’s a lot more I can do with the launch of 5 but at the core of that has to be a great, not good product.

The feedback I get from you guys is going to make this great, so I am definitely listening.

  • Like 2
  • Upvote 1
Link to comment

It was really interesting to follow along with the lua/C++ discussion with Josh and Rick. I feel like I learned a lot by just reading the comments. 

My money is on Gearhead Engine (a person who pursues mechanical or technological interests (as in automobiles or computers). Fits with the gear logo too. But seriously surprised about the name change.

Either way, I like how you are open to the feedback of the community.

Link to comment
4 hours ago, Josh said:

I would not consider a name change unless the new one was very good at making the brand spread faster and telling people what the product does. The name will be revealed when the Kickstarter campaign launches, which will be near the end of development. The point of the Kickstarter campaign is to launch the larger marketing campaign. GDC will come next, with a booth and maybe a lecture.

My first speaking gig at GDC was a nightmare. I had spent threee years writing my first C++ program. Unity had just announced a free mobile version the day before. There was a bad echo in the sound system so all my words were bouncing back to my after a short delay, making it extremely difficult to speak. And there were 600 people in the audience, from Apple, EA, Microsoft, etc., and everyone hated me, thought I was crazy, or didn’t know who I was. But I did it and I am proud of myself for that.

That happened before Leadwerks had any success. It was just an idea and I was an unproven nobody, with no track record of success. This was before Steam and before our first Kickstarter campaign. When Leadwerks 3 was launched I did not have all the contacts in the game industry that I have now. I did not know a dozen people at Valve. I was also broke. There’s a lot more I can do with the launch of 5 but at the core of that has to be a great, not good product.

The feedback I get from you guys is going to make this great, so I am definitely listening.

Wow I didn’t know those details. Much respect as that took massive courage to do!

Link to comment

@Rick Yep, I was pretty shaky but when I showed them a deferred renderer running on an iPad 2 they **** their pants.

Anyways, my point is that I have enough contacts in the industry that if the product is great it will get a fair chance and won't be ignored. We just need to make sure it's great.

Link to comment
Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...