Sign in to follow this  
Structural

Unity game programming... is all about scripting nowadays?

Recommended Posts

I recently bought a license for the Torque engine just so that I don't have to worry about the "plumbing" anymore and could start making games, and I was surprised about the elaborate scripting language. I was even more surprised when I read numerous posts in the community stating that game logic was usually implemented in script. I asked a colleague of mine today who worked in the game industry for a number of years if it was normal that game logic was often implemented in script (apart from the Torque engine), and he stated that it was becoming more and more common that games were created entirely in script languages because it's easier to work with. The reason I'm surprised comes ofcourse from my complete lack of experience of the "real games industry" and the trend of the threads I read on gamedev. Most of the things I read here are about C++/Java/other compiled languages. Thereby, my gut-feeling says that script is not being "easier to work with" because it is probably lacking decent (debugging/development)tooling and community support. Also, I'm sort of lost where one can draw the line between engine and script. What do I put in my engine? What do I put in script? Is there a rule of thumb? So, what do you think of this? Can you confirm the increasing popularity of scripting languages? Are you as surprised as I am? Do you think scripting is becoming more and more important? If so, also in the indie game development scene who might not be able to afford elaborate engines with scripting?

Share this post


Link to post
Share on other sites
Quote:
Original post by Structural
Thereby, my gut-feeling says that script is not being "easier to work with" because it is probably lacking decent (debugging/development)tooling and community support.

Why?

Quote:
Also, I'm sort of lost where one can draw the line between engine and script. What do I put in my engine? What do I put in script? Is there a rule of thumb?
Script everything you can without sacrificing performance. If there's any doubt, script it, and redo it in C++ if necessary.

Quote:
Can you confirm the increasing popularity of scripting languages?
Yep.
Quote:
Are you as surprised as I am?
Nope.

Now, when you say "scripting", that's sort of a misleading word to use. A "script" is a description of what characters in a play or movie say. It's fully linear, without control structures or logic. Most of the so-called "scripting languages" you're looking at here are better defined as "high-level programming languages". And the march from C/C++ to high-level programming languages is as natural as the march from assembler to C/C++ was.

Share this post


Link to post
Share on other sites
I hope scripting is becoming more important.

Even my own game uses a simple lua interface for lots of game logic. Its really great to be able to work on my game without having to run it through a compiler. My game logic is simple enough ( its an asteroids clone ) that I haven't run into anything that would require serious debugging tools yet. I was pleasantly surprised at how easy it was to integrate lua and my own code ( which I would hesitate to call an "engine", its a bit too simple for that ).

I don't play lots of games, but some of the ones I've bought recently ( Civ 4 and prey ) have scripting language support, or so I've heard.

So yeah, I think its becoming about scripting. But its a really good trend [smile]

Share this post


Link to post
Share on other sites
Scripting is the lifeblood of modern game development. It drives things, and is far, far more important in most cases than most of the underlying C++ code that forms the "engine". To that end, scripting languages have become increasingly refined, tested, supported, and optimized. Lua and Python are popular choices, with commercial games using them extensively and fairly sophisticated development environments appearing. They're also brutally efficient; even N64 and PSX games had scripting systems, despite the decidedly low end hardware.

Current trends indicate that scripting languages will continue to become more and more important. The need to rapidly prototype and develop games makes it necessary.

Share this post


Link to post
Share on other sites
Quote:
Original post by Sneftel
Quote:
Original post by Structural
Thereby, my gut-feeling says that script is not being "easier to work with" because it is probably lacking decent (debugging/development)tooling and community support.

Why?

Because the user base of such a language is much smaller than that of say, C#. And the availability and quality of tooling and support is, in my opinion, directly related to the number of people using the language.
I am aware that comparing C#, a fulfledged can-do-anything language, with a scripting language with much less features. So when you take that into account the smaller community might not be such an issue. But I still have a very strong feeling that the availability and quality of tooling is less of what you can expect of other languages.
But as I said, this is a gut-feeling and I could be completely wrong.


Quote:
Now, when you say "scripting", that's sort of a misleading word to use. A "script" is a description of what characters in a play or movie say. It's fully linear, without control structures or logic. Most of the so-called "scripting languages" you're looking at here are better defined as "high-level programming languages". And the march from C/C++ to high-level programming languages is as natural as the march from assembler to C/C++ was.


Ah, sorry for the wrong use of words. :)
But I agree that high-level languages are making things much easier. I am currently working in a research facility where we create demo's and implement research concepts and the use of modern languages makes implementing a demo much easier (C#, as opposed to C++).
But still, my doubt for scripting languages in games mainly comes from the tooling perspective.

Share this post


Link to post
Share on other sites
Quote:
Original post by Structural
I am aware that comparing C#, a fulfledged can-do-anything language, with a scripting language with much less features.

You need to define "full-fledged". Are you talking about syntactic features, or base libraries? Yes, C# includes functions to calculate the date of the Chinese new year, and things like ActionScript don't. But a video game probably doesn't need that anyway. Likewise, on the syntactic front C# has delegates and suchlike, but really offers very few extras which are frequently used.

Quote:
But still, my doubt for scripting languages in games mainly comes from the tooling perspective.
Then I suggest you do research to determine what tools are available for these "scripting languages", and what tools are required.

Share this post


Link to post
Share on other sites
The commercial game i'm working on is using the Unreal engine, and we are hardly touching c++ for it. Its practically all in Unreal Script. The excellent tools mean the designers and artists can do most in the engine, which runs efficient c++ code without project programmers.

Say the 3 most intensive parts of a game were gfx, physics and ai. The first 2 are in the engine in c++, and the AI specific to our game is in half in c++, half in unreal script.

Share this post


Link to post
Share on other sites
Script engines in games have been around for a long time. They have become more popular for a few reasons:
  • The types of games that use scripts have become more popular.
  • The complexity of NPC behavior has grown.
  • Processing power has increased.
Some advantages of scripts over compiled code:
  • Scripts are easier to modify and the turn-around time is faster. In some cases, they can even be modified while the game is running.
  • The languages are generally simpler and higher-level, making script-writing accessible to non-programmers.
  • Less people modifying the code makes management of the code easier.
  • Level designers are much cheaper than programmers.
Some of the drawbacks are:
  • Execution is slower.
  • Circular dependencies can be a problem.
  • Tools are lacking.
  • Non-programmers writing scripts can be a problem because it does require some level of programming ability.

Share this post


Link to post
Share on other sites
Quote:
Original post by Structural
Because the user base of such a language is much smaller than that of say, C#.

No. TorqueScript is not representative of "scripting" languages as used in games. In reality, the trend is to use widely available languages that have long been employed in other domains - Lua, Python, JavaScript, even Perl - and these are languages with huge user bases and long histories.

Quote:
And the availability and quality of tooling and support is, in my opinion, directly related to the number of people using the language.

There is a measure of proportionality, but it is by no means the largest factor. Language design is a much greater influence; languages with native support for reflection and introspection are easier to write debuggers for than opaque languages with horrendous type systems (C++), but also have less need for debuggers because so much meta information is readily available to the programmer during the development of his solution.

Quote:
I am aware that comparing C#, a fulfledged can-do-anything language, with a scripting language with much less features.

Perl has more features than C#. Python has even more than Perl. All of them are dependent on their libraries (.NET in the case of C#... which is available to IronPython) for the majority of said functionality.

Quote:
But still, my doubt for scripting languages in games mainly comes from the tooling perspective.

Do some research. Tool growth has been explosive in modern high level languages. Look outside the games domain and see what's being done in rich internet applications/web apps with JavaScript. Look at the tools that are emerging to support various paradigms in those areas. nunit isn't as old as Perl's SimpleTest, after all...

Share this post


Link to post
Share on other sites
It's not just games - Adobe Lightroom uses Lua [PDF] for 40% of its code (and maybe more since when that was written). I suppose Mozilla is an atypical example since they're heavily into scripting already, but it's still interesting that they're planning to move much of their "middleware" C++ code into JavaScript (actually JavaScript 2, on the Tamarin JITting VM).

Share this post


Link to post
Share on other sites
Quote:
Original post by JohnBolton
Scripts are easier to modify and the turn-around time is faster. In some cases, they can even be modified while the game is running.


So can C and C++ code, depending on the target platform. Check out edit and continue.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Quote:
Original post by Rand
The commercial game i'm working on is using the Unreal engine, and we are hardly touching c++ for it. Its practically all in Unreal Script. The excellent tools mean the designers and artists can do most in the engine, which runs efficient c++ code without project programmers.

Say the 3 most intensive parts of a game were gfx, physics and ai. The first 2 are in the engine in c++, and the AI specific to our game is in half in c++, half in unreal script.


That is actually a really bad idea with UnrealScript, as you will no doubt find out when you come towards the end of your project.

Share this post


Link to post
Share on other sites
Quote:
Original post by Rand
Quote:
Original post by JohnBolton
Scripts are easier to modify and the turn-around time is faster. In some cases, they can even be modified while the game is running.


So can C and C++ code, depending on the target platform. Check out edit and continue.


Actually, you still have to recompile. Plus, there might not be trivial changes which will force you to shutdown and restart. With a script, the engine just reloads the new script and you are ready to go.

Share this post


Link to post
Share on other sites
Quote:
Original post by jkleinecke
Quote:
Original post by Rand
Quote:
Original post by JohnBolton
Scripts are easier to modify and the turn-around time is faster. In some cases, they can even be modified while the game is running.


So can C and C++ code, depending on the target platform. Check out edit and continue.


Actually, you still have to recompile. Plus, there might not be trivial changes which will force you to shutdown and restart. With a script, the engine just reloads the new script and you are ready to go.


Depending on the scripting language you have to recompile too. You are right about the edit and continue bugs though that can crop up.

Share this post


Link to post
Share on other sites
'Scripting' languages are far from being a new concept in game development. Since TorqueScript was mentioned, it should be noted that it was used in Tribes 2, which is an evolved form of the Tribes 1/Starsiege scripting language. It goes even further back to the Earthsiege titles and this was in the early 90's.

It most likely wasn't the first. Scripting language use in game development has been around for well over a decade.

Share this post


Link to post
Share on other sites
I've not read the rest of the thread, so I apologise if I repeat some things that have already been said.

Quote:
Original post by Structural
I recently bought a license for the Torque engine just so that I don't have to worry about the "plumbing" anymore and could start making games, and I was surprised about the elaborate scripting language.
I was even more surprised when I read numerous posts in the community stating that game logic was usually implemented in script.


It shouldn't be surprising; that specific engine was obviously created with scripting in mind. They wouldn't add an elaborate scripting language if there was little reason to use it.

Quote:
The reason I'm surprised comes ofcourse from my complete lack of experience of the "real games industry" and the trend of the threads I read on gamedev. Most of the things I read here are about C++/Java/other compiled languages. Thereby, my gut-feeling says that script is not being "easier to work with" because it is probably lacking decent (debugging/development)tooling and community support.


You've made several mistakes in the logic there.

Firstly, most people here are not in the "real games industry" and therefore the balance of topics here wouldn't match those on a professionals-only forum.

Secondly, many people here are not working with existing engines, and therefore they are forced to use C++/Java/etc to create their game. Professionals often have pre-existing engines which not only already contain extensive scripting support (eg. Unreal/UnrealScript), but also have most of the C++ level problems already 'solved'.

Thirdly, community support and extensive tooling is less important when the language itself is easier to use. Many of the posts on these forums address basic architectural or structural issues which tend to cease to exist with higher level languages, doubly so when that language is already embedded into a working system.

Quote:
Also, I'm sort of lost where one can draw the line between engine and script. What do I put in my engine? What do I put in script? Is there a rule of thumb?


No. You do what is right for the game. At one extreme, some people may use no script at all, or only use scripts for tiny aspects of event-callback processing. At the other extreme, some people may write the entire game in a so-called 'scripting' language, and just convert some parts to C++ to gain extra speed as an optimisation pass.

Quote:
So, what do you think of this? Can you confirm the increasing popularity of scripting languages? Are you as surprised as I am? Do you think scripting is becoming more and more important? If so, also in the indie game development scene who might not be able to afford elaborate engines with scripting?


Yes, they're increasingly popular.
No, I'm not at all surprised, because I've spent enough time with Python/javascript/Lua/my own scripting languages to see the benefits.
Yes, it's becoming more and more important.
Yes, I think the indie scene will eventually integrate more scripting, since the scripting languages themselves are typically free.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

  • Announcements

  • Forum Statistics

    • Total Topics
      628333
    • Total Posts
      2982121
  • Similar Content

    • By BAG Labs
      Mobile SoS

      Platform: Android
      Genre: Board
      Link: Google Play
       
      This games sharpen memory and test your strategies to place S-O-S pattern within time limit and serve 3 difficulties as Easy, Normal, and Hard.

      Goals of the game is to put S-O-S words in patterns (Horizontal, Vertical, and Diagonal) alternately with enemy.
       
      Features:
      Single Player Multiplayer Achievements Leaderboards  
       
      Screenshot:

       

       

       
      Link: Google Play
       
      Please help us improve this game with review
    • By abarnes
      Hello!
      I am a game development student in my second year of a three year program and I would like to start building my portfolio. I was thinking of creating some games to show what I can do to potential employers since I wont have any work related experience when I graduate. But as I'm sure you all know there are tons of ways to approach developing/designing a game and I'm curious if anyone had any insight as to any "standards" that come with this? Is it okay to use game engines like Unity, Unreal, Game Maker etc? Or would it be better to make a game from scratch to better show case your skills? Any and all advice will be greatly appreciated!
    • By Hilster
      Hello 2D Artists,
      I've started making a 2D Puzzle Adventure game for mobile and I'm looking for someone who would want in on creating assets for the game. The core of the programming is pretty much complete, you can walk within the grid laid out and push boxes, when there is an object on top of a pressure pad it will activate the linked objects or if there is one object with multiple linked pressure pads it requires you to activate all points for the object to become active. 

      The level iteration for the game is quick and simple, a Photoshop file that is made of individual pixels that represents objects is put into the game and it creates the level out of those pixels with the assigned objects.
      The objects that need sprites created so far is the character, box, pressure pad, door, trap door, the walls, the stairs and the tiled background.
      I intend to add more objects so the amount I'd like to add will be extended.
      My motivations for posting here is to have something that looks nice to be able to display on my portfolio, so if you're looking for a working game that you can place your art into and improve the look of your portfolio then we're in business.
      Please reply with a few past examples of your art below and I'll be in touch!
    • By thefollower
      Hi
      I have set up my TcpClient to connect to my server and that works fine. But i am a bit confused how i read messages from the network stream with it continuously running via async, without ever closing the connection ?
      My TcpClient Manager class has:
       
      public async Task<bool> Connect(string address, int port) { try { await _tcpClient.ConnectAsync(address, port); IsConnected = true; return true; } catch(Exception e) { Debug.Log(e); return false; } } public async Task<int> Read(byte[] readBuffer) { if (!IsConnected) return -1; using (var networkStream = _tcpClient.GetStream()) { try { var bytesRead = await networkStream.ReadAsync(readBuffer, 0, readBuffer.Length); return bytesRead; } catch (Exception e) { Debug.Log(e); IsConnected = false; return -1; } } }  
      So i thought to just run a co-routine and call Read constantly to get the most recent message, but that doesn't make much sense to me since a co-routine would be blocked with the await. How is this actually done? The MS Docs don't have very good Async examples with the TcpClient class so i don't know fully get how to keep calling Read correctly.
  • Popular Now