Can anyone explain why I would like or need Lua mixed with C ++ for the game?

I learned a bit of Lua, and I'm pretty familiar with C ++, but still don't see the real reason why I would like to use Lua (or any scripting language) in combination with C ++. If I already make a game in C ++ (fast language), why don't I just do everything in C ++? In the end, I am already familiar with C ++. Why should I spend time learning a new language and integrating it into my C ++ code? I am sure that there will be problems with the configuration of the interface and work. Learning will take some time, how would it really pay off? Will it really be useful only to large development teams?

+4
source share
3 answers

I repeat the above and want to add my own thoughts, because at this moment I am integrating Lua into my game engine!

It depends on what kind of game you are doing, but regardless of your feelings that allow fans to moderate your game, it’s just great practice to separate the engine components from the components of the gameplay.

The first major benefit is a quick iteration. The best solution I made was to connect the F5 key to reload the Lua state (like updating the F5 browser if this is not obvious). I can edit the script and then just run F5 in my running engine to see the result right away. This is much more efficient than restoring your own code. You are less likely to lose your train of thought, and you can very quickly debug (gameplay) problems.

, Lua . , #YOLO. HP 32- ++? . - , . HP , "", .

++ - Lua : / , ; ///.

Lua ( ++), . Lua OGG PCM 5 ; . Lua : " , ".

, , Lua - . mumbo jumbo .

+5

, -, script , .

, Cryengine ( Crysis): http://docs.cryengine.com/display/SDKDOC5/Script+Usage

MMORPG, ​​ ++ Lua: https://github.com/otland/forgottenserver/

+3

, .

.

, . , UB.

, , .

, , ( , , ..) . QA .

, , "" : ++ . - , ( "" )

+3

Source: https://habr.com/ru/post/1535644/


All Articles