I'm interesting in making games in my future, and I've heard that my favourite game's engine is made with c++, but its embedded with python. I have little experience with programming, but I greatly understand how object orientation works.
-
Runtime execution of commands or code to alter the game's state and see how it gets affected as a result. – Brandon Oct 12 '15 at 18:51
-
1A question like this, formulated a bit differently and more tightly, might be better received at programmers.stackexchange.com... Or not. – hyde Oct 12 '15 at 18:55
-
Changed my mind about closing. At it's current level, the question is well answerable. – πάντα ῥεῖ Oct 12 '15 at 19:07
2 Answers
Why would someone need/want to embed a scripting language into a programming language?
The main reason obviously is to allow to provide extensions to the game engine without need to recompile the entire game executable program, but have the extensions loaded and interpreted at run time.
Many game engines provide such feature for extensibility.
... but I greatly understand how object orientation works.
Object orientation comes in with the interfaces declared, how to interact with the particular scripts.
So python is itself an object oriented language which supports OOP principles quite well.
For instance integration of non OOP scripting languages, like e.g. lua scripts (also oftenly used for extensions), makes that harder, but not impossible after all.

- 1
- 13
- 116
- 190
There are many reasons, but the primary motivations are customization and "playback". By playback, I mean the ability to automate or repeat a series of tasks in the program without requiring programming expertise. Blender is a good example of this.

- 7,966
- 3
- 26
- 30