Jump to content

  • Log In with Google      Sign In   
  • Create Account


Why use scripting languages? And which one to use?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
7 replies to this topic

#1 AndreaTux   Members   -  Reputation: 182

Like
0Likes
Like

Posted 05 May 2012 - 03:35 AM

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


AndreaTux~

Sponsor:

#2 Waterlimon   Crossbones+   -  Reputation: 2417

Like
1Likes
Like

Posted 05 May 2012 - 03:40 AM

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++

o3o


#3 yckx   Prime Members   -  Reputation: 1163

Like
1Likes
Like

Posted 07 May 2012 - 08:24 AM

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.

#4 Serapth   Crossbones+   -  Reputation: 5243

Like
1Likes
Like

Posted 07 May 2012 - 08:52 AM

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.

#5 kloffy   Members   -  Reputation: 882

Like
3Likes
Like

Posted 08 May 2012 - 11:26 AM

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.

Edited by kloffy, 08 May 2012 - 12:52 PM.


#6 Slavik81   Members   -  Reputation: 360

Like
0Likes
Like

Posted 10 May 2012 - 02:00 AM

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?).

#7 kruncher   Members   -  Reputation: 354

Like
1Likes
Like

Posted 10 May 2012 - 07:07 PM

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.
Rotorz Limited (http://www.rotorz.com)

Check out our latest game Munchy Bunny!
Editor Tool: Rotorz Tile System (for Unity 3D)

#8 AndreaTux   Members   -  Reputation: 182

Like
0Likes
Like

Posted 22 May 2012 - 09:00 AM

Thank you. Your answers are helpful!
AndreaTux~




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS