Scripting In C++
Hi all. Many people say that C++ may be used as a game engine, but not as the game itself. They say that the game itself is all scripting. How can you use scripting or whatever, when you have a C++ engine? What is scripting?
You have your terms a little mixed up there.
C++ is a programming language in which you can make a game engine; C++ itself cannot be used as an engine for anything, other than expressing your ideas in a manner that seems insane to other, more normal humans.
Scripting usually refers to a language that is interpreted rather than compiled, although some notable languages are compiled to bytecode, so I suppose the connection is a little odd.
You don't have to do the game entirely in a scripted language, most people say this though because it's much easier to edit a script than to have to recompile a C++ project. Not only that, many scripting languages are much easier to express concepts of a game in than C++.
C++, in this case, would be used for lower level functionality such as allocating resources, creating device contexts, networking and so forth. You can almost think of it as the relation between a publisher and a writer. The publisher has all the muscle behind it, but all it can show is an empty book. The writer is what gives you the story.
Of course, that's all personal opinions from past experiences, and you're best off doing what's most comfortable to you. But I'd also have to recommend performing your game logic in script.
As far as how you would use scripting in an engine written in C++, the scripting engine usually offers a way to bind itself into your project, so it can refer to internal objects of your engine.
I've never used it myself, but many people say Python is a good language, and has a relatively easy process of binding. You may want to look into it.
C++ is a programming language in which you can make a game engine; C++ itself cannot be used as an engine for anything, other than expressing your ideas in a manner that seems insane to other, more normal humans.
Scripting usually refers to a language that is interpreted rather than compiled, although some notable languages are compiled to bytecode, so I suppose the connection is a little odd.
You don't have to do the game entirely in a scripted language, most people say this though because it's much easier to edit a script than to have to recompile a C++ project. Not only that, many scripting languages are much easier to express concepts of a game in than C++.
C++, in this case, would be used for lower level functionality such as allocating resources, creating device contexts, networking and so forth. You can almost think of it as the relation between a publisher and a writer. The publisher has all the muscle behind it, but all it can show is an empty book. The writer is what gives you the story.
Of course, that's all personal opinions from past experiences, and you're best off doing what's most comfortable to you. But I'd also have to recommend performing your game logic in script.
As far as how you would use scripting in an engine written in C++, the scripting engine usually offers a way to bind itself into your project, so it can refer to internal objects of your engine.
I've never used it myself, but many people say Python is a good language, and has a relatively easy process of binding. You may want to look into it.
C++ isn't the actualy engine C++ is used to creat the game engine. Scripting is used to create interaction in games and add events to objects. So scripting virtualy makes things a whole lot easier to do other than hard coding it since you don't need to hard code events when using scripts.
Ahh you beat me to it lol.
Ahh you beat me to it lol.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement