Jump to content

C++ or Lua?


DigitalHax
 Share

Recommended Posts

Hello. I am going to purchase leadwerks soon, but i was wondering about some things, but they are a bit tricky.

 

I simply want to know, what should I use. Lua, or C++.

 

I have been mostly messing around with C++, and it is going ok i guess, but there has been many problems. Especially when I was having a go at some Post Processing stuff and more complex render features. These are not necessarily build errors, but errors on launch, or just not working. Basically I am asking whether I should keep trying with C++, or start learning lua.

 

I would hope that most of the opinions are unbiased, but I also would like to now about the support tutorials out there for both, and options for utilities such as GUI and maybe networking.(for future use)

 

Thanks in advance.

Win7 64bit, Leadwerks SDK 2.5, Visual Studio 2012, 3DWS, 3ds Max, Photoshop CS5.

 

 

 

Life is too short to remove USB safely.

Link to comment
Share on other sites

I would use C++, because then you don't ever face performance problems when your game grows bigger and more complex.

For example in my robot walker demo, I had to do quite a lot of iterations to calculate all the robots limbs, and I first made the demo with Lua, and then with C++ and the C++ version was about of 30-40 FPS faster.

 

With C++ it's also easier to include various 3rd party libraries like SQLite3, WxWidgets, Qt, Force Feedback controllers, etc... Which you need to wrap and implement for Lua yourself.

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Link to comment
Share on other sites

I would agree with Metatron and recommend C++ for all the same reasons.

 

When you really need to get that little bit extra performance your choice of language does make a difference. Most of the time working with Leadwerks and C++ is no harder/complicated than working with Leadwerks and LUA and the availability of integratable libraries is much greater when using C++. There are benefits and downfalls of using either but hey ... that's life, nothing is perfect.

 

On balance I'd say C++ is the better bet in the long run; but both are valid options as indeed BlitzMax is too.

Intel Core i5 2.66 GHz, Asus P7P55D, 8Gb DDR3 RAM, GTX460 1Gb DDR5, Windows 7 (x64), LE Editor, GMax, 3DWS, UU3D Pro, Texture Maker Pro, Shader Map Pro. Development language: C/C++

Link to comment
Share on other sites

Thanks for the suggestions. Mostly what is shaking my choice is the fact that I have been trying some things for C++ and a lot of things are coming up with errors. But in my head C++ is the better of the two(rather three). But like some people have done, what is the possibility of using both, to some extent?

Win7 64bit, Leadwerks SDK 2.5, Visual Studio 2012, 3DWS, 3ds Max, Photoshop CS5.

 

 

 

Life is too short to remove USB safely.

Link to comment
Share on other sites

You can mix C++ and Lua quite seamlessly. You can have all the models have their own Lua scripts, which saves you a lot of coding on the C++ side.

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Link to comment
Share on other sites

Thanks for the suggestions. Mostly what is shaking my choice is the fact that I have been trying some things for C++ and a lot of things are coming up with errors. But in my head C++ is the better of the two(rather three). But like some people have done, what is the possibility of using both, to some extent?

 

..while it is perfectly possible to mix C++ and LUA, I would recommend to first do necessary steps with C++..reason for that is simple..if at this moment, you have difficulties with C++ itself, chances are that you will have a nightmares with any attempt to combine two, at this moment..so, take your time, go carefully trough all possible examples and try to do first steps with C++ and then systematically expand it..at some point you will be able to do mixing with LUA if it is necessary, but at stage of learning, I highly recommend not to do it..

 

Link to comment
Share on other sites

I tend to agree with this too. It's better to concentrate on a single language initially till you have a good grounding in fundamental programming techniques and get used to working with the Leadwerk's API.

 

However the LUA object scripting in Leadwerks is nicely implemented though and doesn't require you to integrate it with your main development language; as it's already hooked into the Leadwerk's engine itself. So you are unlikely to face technical issues if you did work on both, it's just you have a steeper learning curve.

 

If you already have a good understanding of programming then I'd say take the mixed route, otherwise learning two languages simultaneously and familiarizing yourself with the Leadwerk's API is probably not the best strategy!

Intel Core i5 2.66 GHz, Asus P7P55D, 8Gb DDR3 RAM, GTX460 1Gb DDR5, Windows 7 (x64), LE Editor, GMax, 3DWS, UU3D Pro, Texture Maker Pro, Shader Map Pro. Development language: C/C++

Link to comment
Share on other sites

As someone who has spend a lot of time with Lua, I can advise to use C++. Lua is nice for object scripting, but like everyone else says: C++ has a larger horizon. Personnaly I think you will find more (well documented) libraries for C++ than Lua.

 

official C++ tutorials:

http://www.leadwerks...e2/_/tutorials/

 

Official Lua tutorial:

http://www.leadwerks...ed_With_Lua.pdf

 

Unofficial Lua

there used to be a Lua tutorial section but I can't find it any more. I have a youtube playlist with Lua en leadwerks tutorials:

http://www.youtube.com/lua_leadwerks_playerlist

Link to comment
Share on other sites

Thanks for all the help! I just hope I will be able to overcome any errors I encounter whilst programming. rolleyes.gif

 

But I have to say I had no real doubt that C++ would come out on top, I really just wanted to know exactly why.

Win7 64bit, Leadwerks SDK 2.5, Visual Studio 2012, 3DWS, 3ds Max, Photoshop CS5.

 

 

 

Life is too short to remove USB safely.

Link to comment
Share on other sites

Thanks for all the help! I just hope I will be able to overcome any errors I encounter whilst programming. rolleyes.gif

 

But I have to say I had no real doubt that C++ would come out on top, I really just wanted to know exactly why.

 

..right now, you cant see C++ as a option because you hitting too many obstacles, while at same time, your apettites are much larger and you want to succeed with something..my advice is, dont get fooled, C++ will take some of your time before you start properly using it. Initially it may look like a waste of time, but once you 'clibm' on to it, you will see whole horizon open in front of you. Having said that, I feel that you trying to learn C++ already merged with LE..thats bad, thats wrong..I highly recommend, unplug LE and learn C++ as a language, its structure and way you do OO..once you master that, you are ready for just about any engine out there, as well as LE..and whole point is...dont give up after first few problems u have had, because it will be many along the way, but with your progress, less and less will be left..simple as it is..

  • Thanks 1
  • Upvote 2

 

Link to comment
Share on other sites

@NA I totally agree with that NA.

 

@DHax Like I have mentioned to you in the past through chat head over to www.cprogramming.com or another site and do the tutorials. They may be boring but they are so essential.

 

Read about OO (object oriented programming) and learn how it works. You won't regret it.

STS - Scarlet Thread Studios

AKA: Engineer Ken

 

Fact: Game Development is hard... very bloody hard.. If you are not prepared to accept that.. Please give up now!

Link to comment
Share on other sites

For leadwerks engine, c++ is probably best. For leadwerks3d, Lua will have better debugging support, and be easier to use than installing all the different SDKs for mobile platforms.

  • Upvote 1

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Ah well I seemed to finally get a post processing basis working laugh.png

 

I guess I just needed to keep trying.

 

But thanks for everything. I really like all the support you have been giving me!

Win7 64bit, Leadwerks SDK 2.5, Visual Studio 2012, 3DWS, 3ds Max, Photoshop CS5.

 

 

 

Life is too short to remove USB safely.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   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.

 Share

×
×
  • Create New...