I've been reading up on incorporating scripting into a C++ program and I understand the pros and cons of doing so. It seems that the pros outweigh the cons in my situation, but one thing still escapes me.
I know the kind of stuff that I need to script, but I don't know how to go about doing it. If I were to script a cutscene, for example. What would that script look like? What needs to be scripted about the cutscene and what needs to be compiled with C++?
Say I'm creating a class for the hero of a game. What aspects of the character need to lie in the .AS file and vice versa? What would the script look like? Do I create a class for the hero in C++ as well as in AngelScript and just transfer between the two?
The questions could go on forever. Pretty much anything could help at this point in time. Code, psuedo, even just simple answers the above questions (teach a man to fish; feed him for life).
Regards,
Tresky
What to Use This For
I've been reading up on incorporating scripting into a C++ program and I understand the pros and cons of doing so. It seems that the pros outweigh the cons in my situation, but one thing still escapes me.
I know the kind of stuff that I need to script, but I don't know how to go about doing it. If I were to script a cutscene, for example. What would that script look like? What needs to be scripted about the cutscene and what needs to be compiled with C++?
Say I'm creating a class for the hero of a game. What aspects of the character need to lie in the .AS file and vice versa? What would the script look like? Do I create a class for the hero in C++ as well as in AngelScript and just transfer between the two?
The questions could go on forever. Pretty much anything could help at this point in time. Code, psuedo, even just simple answers the above questions (teach a man to fish; feed him for life).
Regards,
Tresky
Scripting in games can be anywhere from the entire game, to simple interpolation functions for animation, truely scripting can be anything, and it's up to you to draw the line between "This is controlled by the binary game" and "This is controlled by the loaded scripts"
to use your example of scene scripting, your game might control pathfinding mechanisms, so the script well take control of the scene, tell the actor to move to target position(this can be controlled by the script, or by the game engine), and then initiate the appropriate dialog, etc. of course, this leads to awkward situations in some games where a cutscene intitates, but the player is stuck, and so the cutscene just sits their(i've seen some games eventually teleport the player after x amount of time)
the best way to look at scripting is an extension of mechanics of your game, if you think something can be changed later for distribution(and don't want to have to re-compile and distribute a new binary), then scripting might be the better way to go.
Check out https://www.facebook.com/LiquidGames for some great games made by me on the Playstation Mobile market.
Like slicer4ever said. It really depends on how much control you want to give to the scripts, and whom you expect to write those scripts.
Some like to expose the innermost components of the game engine, and write the whole game logic in the scripts. Others prefer to expose only higher level functions/objects to the scripts. The first option gives a more flexible system but also much more complex, the second restricts flexibility but make smaller customization much simpler.
I'm personally more interested in the latter. In the AngelScript SDK I include a very basic game sample that shows one way of integrating the scripting engine in a game engine. That sample is basically a simplified version of my own game engine. In the sample the scripts are only used to control the player and enemy characters, but in my game engine, I allow different scripts to control different parts of the game, e.g. initial menu, ingame gui, campaign progression, global level scripts, etc.
Regards,
Andreas
Some like to expose the innermost components of the game engine, and write the whole game logic in the scripts. Others prefer to expose only higher level functions/objects to the scripts. The first option gives a more flexible system but also much more complex, the second restricts flexibility but make smaller customization much simpler.
I'm personally more interested in the latter. In the AngelScript SDK I include a very basic game sample that shows one way of integrating the scripting engine in a game engine. That sample is basically a simplified version of my own game engine. In the sample the scripts are only used to control the player and enemy characters, but in my game engine, I allow different scripts to control different parts of the game, e.g. initial menu, ingame gui, campaign progression, global level scripts, etc.
Regards,
Andreas
AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement