Scripting Languages.
Hi. I am working on a shader subsystem for my little 3D engine. Something like Quake 3, only simpler. I need a scripting language to implement them. I will also use a scripting language later on for GUI and possibly for the game itself.
I am looking for a scripting language. I know there are some online, but I don''t know how good they are, what they are for, and how do their implementations fit into my code. Can someone give me some links and information?
Thanks in advance.
If I remember correctly, there is an article on the main page here somewhere... It''s from the series about scripting languages, part two! Maybe you should have a look! :-)
------------------------------
There are only 10 kinds of people: those that understand binary and those that don't.
November 15, 2000 01:27 AM
I have found the scripting language Lua very suitable for most of my game development needs. It is, in fact, driving the GUI in a game I''m working on now. It''s VC++ 6 Release build, with parser, is 70k.
Find out more about it at http://www.egroups.com/group/lua-l
Thanks,
Joshua Jensen
Author, Workspace Whiz! - A Visual Studio Add-in
http://workspacewhiz.com/
Find out more about it at http://www.egroups.com/group/lua-l
Thanks,
Joshua Jensen
Author, Workspace Whiz! - A Visual Studio Add-in
http://workspacewhiz.com/
Python is freely available with a large library of scripts. You can do GUIs, COM, Sockets, XML and a lot of other stuff as well. Someone even created a library for OpenGL. The source is also available. The actual scripting language is a DLL that you load and initialize at the start of your program. You provide an interface to your application by giving it a list of function names and matching function pointers. All your functions take the same parameters which is basically a handle to the parameters you were called with. You then tell it how you want those parameter broken up and it tells you if it can. You can also add predefined variables once you load it. You then tell it to run a script. That script may make decisions based upon those predefined variables and then call the functions you provided.
Using an editor as an example you might provide a function for adding an object that takes a name, type, orientation, position and scale. With Python you can actually create a class to for manipulating objects as well. So your function might return a handle to the object and as far as the user is concerned they have an object representing the object they just added with attributes such as name, type, orientation, position and scale. They change those through the member functions which in turn calls your functions to actually do it.
An example of where you would predefine variables is in a script for the AI in the game. You would predefine something like This for whatever the script is suppose to be implementing the AI for. Rather than the script being dedicated to a single NPC it handles any NPC it is assigned to. Also rather than assigning one big script to all AI for that NPC it might only handle something like selecting a weapon or deciding what to do when attacked. Basically it is an event handler. The user interface for the editor allows the designer to attach scripts to various events for an object. Scripts are not fast so you really only want to call them at state transitions rather than every frame loop or every them they move. So perhaps a script is called when the NPC becomes idle and the script has the NPC patrol by calling a function that says move to a location. The script doesn''t get called again until the NPC actually arrives at that destination or some other event occurs like sighting the player. Your code handles all the little details and the script just addresses the big things. It doesn''t detect that the player is in sight or figure out how to go around an obsticle. Rather your code does than and it just says what to do when the player is detected or it arrives at it''s destination.
Using an editor as an example you might provide a function for adding an object that takes a name, type, orientation, position and scale. With Python you can actually create a class to for manipulating objects as well. So your function might return a handle to the object and as far as the user is concerned they have an object representing the object they just added with attributes such as name, type, orientation, position and scale. They change those through the member functions which in turn calls your functions to actually do it.
An example of where you would predefine variables is in a script for the AI in the game. You would predefine something like This for whatever the script is suppose to be implementing the AI for. Rather than the script being dedicated to a single NPC it handles any NPC it is assigned to. Also rather than assigning one big script to all AI for that NPC it might only handle something like selecting a weapon or deciding what to do when attacked. Basically it is an event handler. The user interface for the editor allows the designer to attach scripts to various events for an object. Scripts are not fast so you really only want to call them at state transitions rather than every frame loop or every them they move. So perhaps a script is called when the NPC becomes idle and the script has the NPC patrol by calling a function that says move to a location. The script doesn''t get called again until the NPC actually arrives at that destination or some other event occurs like sighting the player. Your code handles all the little details and the script just addresses the big things. It doesn''t detect that the player is in sight or figure out how to go around an obsticle. Rather your code does than and it just says what to do when the player is detected or it arrives at it''s destination.
Keys to success: Ability, ambition and opportunity.
Perl, as powerful as C, with the simplicty of Basic (theres an article on that at the site ), its extremely good at: String parsing, Reports(formats), CGI, alot of other things.
-----------------------------
A wise man once said "A person with half a clue is more dangerous than a person with or without one."
The Micro$haft BSOD T-Shirt
-----------------------------
A wise man once said "A person with half a clue is more dangerous than a person with or without one."
The Micro$haft BSOD T-Shirt
-----------------------------A wise man once said "A person with half a clue is more dangerous than a person with or without one."The Micro$haft BSOD T-Shirt
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement