jesus man, you've gone full black sabbath. love it!
@lilGyros4 жыл бұрын
nib my favorite song especially the bass solo at the beginning
@BryanChance2 жыл бұрын
I thought i clicked on the wrong channel lol
@user-vf7tu6nr4d4 жыл бұрын
Hi,İ am in high school and starting learning programming 4months ago with python and now cpp i really appreciate your work and I wanna be a softeare maybe even ai engineer just like u i almost understand nothing from that high level codes but i watch you and i know it worths thanks for all of your high efforts you put on your videos and the attention you pay to your followers i really thank you and btw i really d like to visit britain
@CottidaeSEA4 жыл бұрын
You'll understand things eventually. Take things one step at a time.
@javidx94 жыл бұрын
Hey thanks man! It takes time, patience and practice, like it does with all things, but if you find it fun, Im sure you'll stick with it. Good luck with your studies, and my best wishes for your future projects!
@user-vf7tu6nr4d4 жыл бұрын
@@javidx9 thank you for your advices and wishes and the motivation i appreciate them
@user-vf7tu6nr4d4 жыл бұрын
@@CottidaeSEA thank you as well i appreciate it
@I_SEE_RED2 жыл бұрын
Hey, how’s it going a year later?
@dankduelzperuvian Жыл бұрын
Would love to see a part 3
@jouniosmala99214 жыл бұрын
I've decided that one month of productivity was worth the price of portable air conditioning unit. Of course when you realize that you need one they are out of stock. But you should consider putting reminder right before the next hot season in your calendar, if temperature is real issue. The recommended room sizes are for maximum temperature change, however having twice the area to cool wasn't issue. My goal wasn't to make hot room cold, but hot room acceptable. I got my air conditioning unit from my friends mother who had left it in basement storage because her new apartment was cool without it when I was totally unable to work in the same weather where I lived.
@Yusuf-me5pd4 жыл бұрын
When Javid writes in Java, he becomes Javad
@oHakimen4 жыл бұрын
lul
@teucay73744 жыл бұрын
I'm so glad to see a continuation of Lua! As always, great work and very inspiring content!
@NORBERTOPG4 жыл бұрын
Lua is a very simple, lightweight and very incredible extensible language. I really enjoy it, and enjoy the potential. Definitely will encourage anyone who wants to challenge themselves to use it
@IrizarryBrandon4 жыл бұрын
Lua was the first programming language I learned well. From picking up PIL, and digesting it from the first page, up to where the C API stuff begins (only stopping there because I don't know C), Lua has been a pleasure to learn and use, and it's great to see it getting represented in your videos. It's also great to see (along with the first video) C API stuff in particular!
@DFPercush4 жыл бұрын
A really good example of Lua integration in a popular game is Factorio. They have really good documentation for modding as well. Btw I'm glad you showed off coroutines, that's something I haven't come across very much, but it's such a natural fit for these scripted events!
@ItsHyomoto4 жыл бұрын
I was thinking about writing a scripting language but I wasn't sure how to go about it. While that part still needs to be figured out, you've provided another video that had given me just the nudge I needed to get started.
@carlhudson833 жыл бұрын
Yes Javid! Thanks again for your wisdom! Neat trick of passing the instance pointer to Lua and back again.. Beats trying to get convoluted binding libraries to work..
@Shadow-bc5nr2 жыл бұрын
Very nice video. I've been working on a 3d vulkan API engine and now I am convinced that I need to integrate lua for gameplay. Thanks for this video!
@gelgavish90364 жыл бұрын
I'm about to finish the ECS in my game engine, this will be useful :>
@operatingsauce4 жыл бұрын
this is like, the greatest youtube channel. excellent video!
@CareyMcDuff3 жыл бұрын
Great video! It would be nice to see this series continue (is there a part 3?). Even though I don't know C++ this is very useful to me because it explains how Tabletop Simulator interfaces with the Lua scripting.
@bkucenski4 жыл бұрын
Languages that start from 1 are generally for non-programmers who are domain experts. COBOL and FORTRAN were two of the first programming languages designed for non-programmers. COBOL is for business people with its floating point math support and FORTRAN is for mathematicians. FORTRAN is literally "formula translator." COBOL and FORTRAN also start arrays at 1.
@jhfoleiss4 жыл бұрын
I've been waiting a long time for a video on this subject! Thanks Javid!
@NoMercy80084 жыл бұрын
First of all and most importantly, thank you so much, this is a super interesting and extremely powerful concept and you are one of the best teachers i've ever had :) There is obviously millions of things you can do with that, so I kinda wonder how this way of using Lua scales performance-wise. You can see that your little demo is running perfectly fine, but I wonder what happens if the lua scripts are getting much more complex (for example when I use them to implement more complex AI) or if there are thousands of dynamic objects each having some behaviour implemented in lua. I know that this question is probably everything but easy to answer :D But it would be very interesting to know. In many other languages using things such as reflection to achieve similar effects is usually pretty horrible in terms of performance, at least in my experience. Anyways, again thanks a lot, I've learned a ton from this video alone, really really appreciate it :)
@NoMercy80084 жыл бұрын
@@Joorin4711 Thank you! :) That kinda reminds me of graphics/rendering. It sounds similar to how the CPU issues draw calls to the GPU, which typically is one of the main bottlenecks.
@22RH5444 жыл бұрын
First off I highly like your videos and they are a great source of inspiration. I kind of see where this idea comes from... (as you said, compile times e.t.c.). Still in my mind I find it hard to justify the usage, as all of this stuff can easily be implemented in C / C++ natively (must admit I haven't worked on really huge projects requiring +20min to compile). I see tons of LUA --> C++ stitch code just to include scripting functionality. The fact that you have to write all of the stitch code kind of negates the advantage given by the scripting language. This reminds me of a discussion I had with a colleague when he wrote a program in Python and used Numpy to speed it up. His code was 90% calls to Numpy (for simple array related stuff), thereby making his code highly unreadable and convoluted. I said, if 90% of your code interfaces with C code... then maybe write it in C.
@Progrematic4 жыл бұрын
Sure, there is an up-front cost associated with exposing C++ methods to Lua. The real benefit comes from, as he mentioned throughout the video, the fact that once all of that overhead is dealt with, you're left with a very flexible system. If I wanted to write a new behaviour coroutine for platform4 in level 7 I'd have to recompile the C++ code. This also hints to having some sort of hardcoded game state in the C++ code. By exposing the required functions to Lua piecemeal, you're able to take those building blocks and _iterate_ over the design of a level much more rapidly. Javid doesn't do it here, but nothing stops you from re-parsing that lua file at runtime. Now you can visualize and test level changes on-the-fly!
@lucadavidian5441 Жыл бұрын
Please Javid, make a part 3, I'd love to know how events can trigger cutscenes or how complex behaviours sequences can be scripted and interact with the game in C++ (a dialogue system for an adventure?) THANKS
@lucjacob71953 жыл бұрын
I really like your videos. Where is part 3 ? or did i miss it...
@AllenKll4 жыл бұрын
Your videos contain a lot of great information. They are just too long. I fall asleep every time, because of your silky smooth voice.
@lordskeletorde4 жыл бұрын
Great video, always excited when a new one pops up
@army66699901014 жыл бұрын
Fellas... I think is too early for us to leave a meaninful comment.
@pkeod4 жыл бұрын
I love Lua. Lua + Defold is amazing.
@ChrisLeeW004 жыл бұрын
What a coincidence, I just started my first Lua project in Love2D
@glowiever4 жыл бұрын
this is exactly what I'm looking for.
@MichalKottman4 жыл бұрын
Lua! Coroutines! On KZbin, wow, nice to see this "leaking" to wider audience :-)
@hudsonator7259 Жыл бұрын
As a person who loves lua, I feel like I must clarify coroutines. They're basically functions or methods that you can pause and resume
@leonardkupper50574 жыл бұрын
Great video! I really enjoyed it and also the first part. You are a good teacher. I’d be happy to see this series continued. What I’d also really like to see are some lua sandboxing techniques. Most of the approaches found online seem outdated. The recent approach (Lua >= 5.2) seems to use lua_load for setting a custom environment, but my understanding of the language is not yet at the point that I could figure out how to use this through the api.
@atrumluminarium4 жыл бұрын
Why the hell was I not notified about this? I've been waiting for more Lua/C++ videos ever since the first one
@3atsleeprepeat4 жыл бұрын
Javid be killing with that new look haha
@petrkassadinovich27054 жыл бұрын
Thanks, I am so glad I found this channel!
@flamendless4 жыл бұрын
Really? You're a metal fan? Hard to believe as your voice is so smooth and relaxing
@AJSquirrel534 жыл бұрын
Ooh, 3 minutes in. I like it.
@DjSapsan4 жыл бұрын
Hey Gilfoyle, nice tutorial
@minirop4 жыл бұрын
Even if you don't do error checking, you should tell viewers to keep the stack clean. If "lua_isfunction" returns false, there should be a "lua_pop" (stack smashing is the worst kind of bug with lua)
@blayblam42594 жыл бұрын
Oh, hello, LETS ROCK YEAH!! I'm iron coder!!
@Jonnio4 жыл бұрын
More Lua stuff, cool
@PablitoTheChicken2 жыл бұрын
Hey, this video helped me a lot! Will there be a part 3? I am quite interested about collisions.
@UnionBytes4 жыл бұрын
Thumbs up for your good tutorials! I really like your videos. ... please do more videos :)
@CottidaeSEA4 жыл бұрын
I personally prefer having something simple like "PATROL A, B, C, D" for a patrolling NPC, rather than actually scripting the movement pattern. As long as I have the coordinates, the "PATROL" enum should be enough to tell the program what to do, and then add the following values to a list/array/vector (yay for different names) which the NPC AI will simply iterate between. It's fairly basic, but I honestly think anything more advanced is like reinventing the wheel every time you want to do something.
@CedLePingouin4 жыл бұрын
Wouldn't it be better to implement the setting of the tiles on the C++ side, so you wouldn't have to repeat that step in each lua file ? That's assuming the loading of levels is always done the same way, of course. But it would avoid the duplication of TILE_EMPTY and friends between C++ and Lua. And the Lua side could still use the ascii characters to represent the level.
@javidx94 жыл бұрын
Possibly, but at the moment lua can dynamically change the level, perhaps as part of a sequence
@quickscopesheep59943 жыл бұрын
David likes his Vimto!
@harryh5666 Жыл бұрын
#3 available yet? Good stuff so far!
@ChrisLeeW004 жыл бұрын
Btw, you may want to include the OpenAL audio into the PGE, it can do a lot!
@foamyrocks6654 жыл бұрын
All my friends in UK are complaining about that heat wave and all of them were telling me that they stay outside almost the entire day 😂😂
@trafficface4 жыл бұрын
Javid, try emacripten compiler and cpp, it's a good challenge. I'm currently trying to get Lua in the browser.
@ratchet1freak4 жыл бұрын
I personally don't like coroutines for statemachines like that, when debugging they obscure which state (yield position) a coroutine is in which makes it more difficult than it needs to be to figure out what is happening. Those coroutines can all be replaced by a switch on a state variable and returning which the next state will be.
@johnathonlequinta13334 жыл бұрын
He is in the matrix.
@swaytornado8327 Жыл бұрын
We don't have a picture of actors.png for your videos. How can I add players in this case using a different picture? Please tell me. Thank you.
@BlazertronGames3 жыл бұрын
Could you add the episode number to the title? I had no idea part 2 existed!
@blakescott85704 жыл бұрын
I wish I was this mans sub
@adrianomachado56294 жыл бұрын
nice!
@_syedmx864 жыл бұрын
one lone metalhead
@philtoa3344 жыл бұрын
So nice
@mousiekebabs4 жыл бұрын
This video brought to you by Vimto!
@marcorademan84334 жыл бұрын
Never got such a good look at your hair before. It's booootafulll.
@Johannes004 жыл бұрын
I know this is about Lua but I feel like mentioning the coroutines coming in C++ 20? That seems interesting, yeah?
@SpazeOfficial2 жыл бұрын
Vimto
@SpazeOfficial2 жыл бұрын
why aren't u using vim tho? ^^
@syntaxed24 жыл бұрын
Its middle of august...and it was 29c today...in fucking sweden! hahah The past 5-6 years weather has just gone bonkers...every year has had a temperature record.
@NeZversSounds4 жыл бұрын
Have you checked out languages as: Gravity - intended as better Lua. Wren - class-based and Lua inspired. BEEF - C# like, but with manual memory management and automatic memory leak detection. I used Lua in the Defold engine and made tile-based physics and advanced platformer movement (TTC - true tile collision as I call it), but didn't like Lua's way of coding.
@gower19734 жыл бұрын
So c++=build the engine and lua=build the game, if you added imGUI you could build a rudimentary level editor?
@hawns32129 ай бұрын
Yes
@Drakkar61632 жыл бұрын
This is extremely helpful, thank you! I cannot find the source code though :(
@smartito_974 жыл бұрын
The Javidx9 primal form is a metalhead? O.O
@SmashingKurty4 жыл бұрын
Javid is full on Black metal/;;\
@fictionalist_7 ай бұрын
javid, could you please add "embedding lua in c++ #2" to the title of this video? i came here from the first and third video and it took me a whole day to find this one because it didnt have that in the title
@MoKaLu4 жыл бұрын
we would need someone like you to help enhance gideros studio :-)
@iProgramInCpp4 жыл бұрын
What about the source code? You said you'd upload it "soon", it's been a while since you uploaded this...
@dagonmeister4 жыл бұрын
Great content! Noticed you are using your own engine olc , briefly someone can mention how is he doing the rendering? GPU or CPU?
@hawns32129 ай бұрын
GPU
@vadym35344 жыл бұрын
finally
@luismaschietto4 жыл бұрын
Can you use chomebook to program?
@outsider1st4 жыл бұрын
I recommend anyone checking out sol2 on github. Amazing CppLua bridge!
@Jarzap2 жыл бұрын
Is there part 3?
@BlondeCowlick3 жыл бұрын
Don't mean to rush you, but when is the source code coming?
@tahwnikcufos4 жыл бұрын
omg... never noticed before; you could be related to serpentza "Winston Sterzel", most likely not, just as engaging of a presenter though.
@LanevujBk4 жыл бұрын
Can you program using a Chromebook?
@yadsarwat63254 жыл бұрын
Greetings legend, I am new to C++ programming language and I seek your advice. For starters I am a university student and I have fairly good idea about Java programming language and other parts of the requirements languages like sql, php, javascript, and other basic internet parts like html. I expect c++ to be very flexible, fastest and light (that is what I have gathered). I would be really glad if you could share or advise me about C++ as a beginner. Many thanks.
@dagonmeister4 жыл бұрын
Just pick up a decent C++ book and take it from there. C++ Primer is really good for beginners, but if you come the Java world, Thinking in C++ can be the best option for you (there is a Java version of this book and they follow very similar style). Do not worry about the latest C++ features, start with C++11 or earlier, you will figure out the rest later if you really need it.
@yadsarwat63254 жыл бұрын
@@dagonmeister thank you very much for your comment. Appreciate it
@baks16782 жыл бұрын
how to make mod menu on any games my friend function lua and c++
@AusSkiller4 жыл бұрын
TBH while Lua is easily the best scripting language for games that I've used, I still end up finding it is just too slow for any substantial use. I'll implement something in Lua, find that it is a significant bottleneck for performance convert it to a C++ function for performance, find that the extra transitions between Lua and C++ also have too big an impact on the performance, move the calling functions into C++ and just end up with 90% being C++ code anyway, and none of the remaining Lua ends up justifying the use of Lua at all :(. Though I suspect that it may just be that my performance expectations for it are just too high ;)
@zatherz24984 жыл бұрын
Look into LuaJIT and its FFI library.
@ncot_tech4 жыл бұрын
What’s on your Chromebook? I’ve got the same one and am starting to find its lack of performance a bit annoying.
@javidx94 жыл бұрын
I use Chrome Remote Desktop, its very good
@ncot_tech4 жыл бұрын
javidx9 oh, I completely forgot that existed. Useful.
@mayushkumar16234 жыл бұрын
Oh yes....we gonna use Visual Studio on a Chromebook
@MrEW19854 жыл бұрын
It really is summer holiday, isn't it?
@javidx94 жыл бұрын
Its tooo hot.
@MrEW19854 жыл бұрын
I can relate. ;)
@TanjoGalbi4 жыл бұрын
@@javidx9 It's set to cool down this week thankfully
@gosnooky4 жыл бұрын
Hot in England... Must have hit a boiling 25 ;)
@itsyourenotyour91013 жыл бұрын
The source ever released for this?
@ventingking4 жыл бұрын
I don't agree with the way you are using the shared pointer. The pUnderPlayerControl member does not need to be a smart pointer and the list of dynamic objects should be unique pointers. my reasoning is that smart pointers are about who has responsibility for the pointer and not about if other things are going to use whats being pointed to. the list of dynamic objects is going to be persistent throughout the lifetime of the game and will be destroyed when the game is closed. the under player control member is not going to be persistent because it could change any number of times throughout the life of the program. so the list should have the unique responsibility of deleting the pointer. the under player control member does not need the responsibility of the pointer since the pointer is already being managed by something else and it could hold a different pointer at some point. this also avoids the hack you had to do to make sure you get the same instance of the shared pointer. besides that great video!
@Buttersaemmel4 жыл бұрын
i'm just here to ask a "simple" question because i'm hoping someone can explain it to me. why should i use pointers? when i simply can check the variable why should i instead check the value in the memory-location where the variable is? i understand what pointers are but not the advantage over just using the variable directly. would really appreciate somone who can explain the advantages to me (maybe with an example where pointers are better and why). ^^
@javidx94 жыл бұрын
The variable is wholly defined by where it is in memory. But aside, consider this... what if your variable was 500bytes in size. As that variable moves from function, do you want to keep the cpu busy copying all those bytes every time? Or do you just want to send the starting address, which is just 4 to 8 bytes?
@ipa_stor Жыл бұрын
18:20 looks like löve 2d work in that way? How is it possible? I understand now so much😂😂😂
@walidjabari49854 жыл бұрын
I get that this is a tutorial, but for crying out loud, this is the reason people run away from c++ just split the damn project into multiple blocks (libraries) and only change the code that needs to be changed for configurations, use external yaml, json or even xml files if build time is a worry, try ccache, if that's not enough, use dll's, that way not all of the dependencies have to be recompiled
@iProgramInCpp4 жыл бұрын
Hello world
@byejason4 жыл бұрын
C# programmer here so this may not apply, but, instead of passing your game object (this) into lua and then back out to the wrapper functions, why not just hang onto it in a static variable in your C++ program that the static wrapper functions can then access.
@javidx94 жыл бұрын
Hi Jason, its a sensible question, and in this instance, I could just store static member variable. But suppose instead I had an object like "RobotBrain" which was a class that had access to lua functions. I might have several RobotBrains in my application, all using unique lua scripts, but they are bound by the same static functions - in such a situation, I need a way to discriminate between the objects, as storing it statically wouldnt work.
@danmorris49044 жыл бұрын
like;
@Domarius644 жыл бұрын
"Avoid having to wait 20 mins or longer for changes to compile..." or, just use Unity ;)
@TF2Gaming1014 жыл бұрын
i know some lua from roblox
@Wowthatsfail4 жыл бұрын
Whoever down voted this needs a swift kick in the plums 😡
@Sfaxx6 ай бұрын
Working KZbin dislike button seen in the beginning of video brings some nostalgia in 2024😁
@DM-qm5sc4 жыл бұрын
No skinning cats plz 😢
@SCARRIOR4 жыл бұрын
Lmao, delete comments much?
@javidx94 жыл бұрын
Hmmm, I dont understand sorry - In the 50K+ comments the channel has received, i think i've deleted
@delqyrus26194 жыл бұрын
I love your videos, but i don't like your "this is how i do things"-stuff. That's simply wasted time: People who accept this, already know it, people who don't, won't be lectured just because you mention it. Maybe you should make some compact sentence as a disclaimer at the beginning - something like "this is how i do it, to make it easier to understand and should not be adopted literally for production.". If you think you need it. I am actually annoyed of this stuff: I came here to learn new stuff, it's obvious that this isn't what i want to replicate. Copy-Paste-Tutorials are not helpful at all. That's why i love your work. Overall LUA and C++ have some issues in working together. The whole thing about "simulated oop" in LUA makes it sometimes pretty hard to adopt to C++. It is clearly possible, but maybe there is a reason, why everybody is more likely to use python as a script-engine.
@No-ge1fq4 жыл бұрын
Write neural network for example.Or physic engine. Please stop stop making games
@javidx94 жыл бұрын
Lets say i made a physics engine, then wanted to put objects into it, or control various impulses to initiate movement. I would use Lua to do that. I use games as a demonstration for broader programming and computer science topics, because on the whole, they are more appealing and engaging for people. Very rarely are my videos really about making games. As for neural networks, probably not going to happen - I've served my time in machine learning, and do not enjoy it at all anymore.
@TanjoGalbi4 жыл бұрын
No, there are plenty of other KZbin videos that cover neural networks and physics engines. Go search for them instead of making rude demands!