Hello, i ve read that using scripting language is usefull in videogame programming (expecially for ARtificial Inteligence), but why? And which is the most suitable scripting language for videogames on a java based game? Thanks
Why use scripting languages? And which one to use?
At least on of its benefits is that you dont need to rebuild the whole program to update lets say the behaviour of those AI's. You just need to edit a text file or something similiar. That is useful when you want to tweak the behaviour of something which might require you to rewrite the stuff multiple times and then keep adjusting the variables until it works properly.
I would also say that scripting languages are usually simpler to write code with than lets say C++
I would also say that scripting languages are usually simpler to write code with than lets say C++
Being able to change things on the fly without having to rebuild the game is the typical reason I see for embedding a scripting language into the game. AI is commonly implemented as scripts for this reason. It can also be used to develop extensions: WoW and other MMOs expose an API that can be used to write addons in Lua and possibly other languages.
Another thing I like Lua for is data. Pretty much anywhere XML is used, I prefer Lua. I find it less verbose and easier to read, and if I'm going to be using Lua anyway, then why not use it for this as well?
There are, of course, other scripting languages: Python, JavaScript, etc. Each has its own strengths, but I hope I've given you some ideas.
Another thing I like Lua for is data. Pretty much anywhere XML is used, I prefer Lua. I find it less verbose and easier to read, and if I'm going to be using Lua anyway, then why not use it for this as well?
There are, of course, other scripting languages: Python, JavaScript, etc. Each has its own strengths, but I hope I've given you some ideas.
Another big reason for using scripting languages is usability. The scripting language is generally sandboxed, so that if you make a mistake, it has very little consequence. For example, if you divide by zero in native code BOOM. But if your script pulls something like that, it generally just logs an error message somewhere and runs on it's merry little way. This allows you to give less experienced/senior dev's or even designers access to scripting with less fear of causing a completely meltdown if they screw up.
Additionally, scripting languages tend to be higher level and handle more of the details for the programmer, resulting in an increase in productivity.
Additionally, scripting languages tend to be higher level and handle more of the details for the programmer, resulting in an increase in productivity.
Let me just add that if you cannot think of a good reason to add scripting to your game, chances are you don't need it (yet). Don't add features just because you see them somewhere else. If you keep adding features that don't directly benefit your game, you will lose track and likely never finish.
I've only begun to use scripting, but the biggest thing it seems to be useful for (to me) is tweaking user-interface elements. By defining user interactions functions in a script, I can quickly evaluate the impact of UI changes on the fly without leaving my program. An example of this would be controlling the zoom levels of a map. You're never going to figure out the ideal parameters without using it, and you might not even know what the basic structure of the function should look like (polynomial, exponential, bounded?).
I agree with the previous comment, only add scripting if there are benefits to you.
I am a big fan of the V8 engine by Google. This could offer excellent scripting support for a game an is relatively easy to integrate.
For me the biggest benefit of scripting is usability, again like previously said. If you have multiple people working on various aspects of the game then it is likely that they will have varying levels of skill.
Allowing developers to script can make the game a lot easier to produce. So if you knew a web developer who wanted to get involved but doesnt know C++, chances are they could script with JavaScript.
I am a big fan of the V8 engine by Google. This could offer excellent scripting support for a game an is relatively easy to integrate.
For me the biggest benefit of scripting is usability, again like previously said. If you have multiple people working on various aspects of the game then it is likely that they will have varying levels of skill.
Allowing developers to script can make the game a lot easier to produce. So if you knew a web developer who wanted to get involved but doesnt know C++, chances are they could script with JavaScript.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement