4 ms·
Yeah, it's very similar conceptually to adding a scripting language. But the point isn't to add user extensibility to the system, it's to have an introspectable
by habitue 7y ago
Yeah, it's very similar conceptually to adding a scripting language. But the point isn't to add user extensibility to the system, it's to have an introspectable description of the program.
So in the scripting analogy, what you'd do is take the program you wrote in C++ or whatever, and write a little mini-language that allows you to express all of the functionality needed to write the game in. So for example, C++ features like template metaprogramming aren't necessarily something you need to write games, but "spawn an NPC" is a very common task, for example. You reduce this language to just whats needed to write the game with.
The difference from a scripting language is that instead of the game being written in C++, with a little interpreter for the scripting language, instead the C++ is just a compiler for the scripting language. You take the script description of the game, and compile it down to the final game.
That little level of indirection allows you to do things like optimization, but also lets you do things like easily swap out how the program is evaluated. For example, in a graphical game, you could skip rendering to the screen, or advance time in jumps instead of needing to wait for timers, etc.