• Advertisement
Sign in to follow this  

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

This topic is 3987 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
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
Why? Its not the first project we've done this way.

Unless your talking about all the save game/memory card stuff etc...

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
Sign in to follow this  

  • Advertisement
  • Advertisement
  • Popular Tags

  • Advertisement
  • Popular Now

  • Similar Content

    • By Vu Chi Thien
      Hi fellow game devs,
      First, I would like to apologize for the wall of text.
      As you may notice I have been digging in vehicle simulation for some times now through my clutch question posts. And thanks to the generous help of you guys, especially @CombatWombat I have finished my clutch model (Really CombatWombat you deserve much more than a post upvote, I would buy you a drink if I could ha ha). 
      Now the final piece in my vehicle physic model is the differential. For now I have an open-differential model working quite well by just outputting torque 50-50 to left and right wheel. Now I would like to implement a Limited Slip Differential. I have very limited knowledge about LSD, and what I know about LSD is through readings on racer.nl documentation, watching Youtube videos, and playing around with games like Assetto Corsa and Project Cars. So this is what I understand so far:
      - The LSD acts like an open-diff when there is no torque from engine applied to the input shaft of the diff. However, in clutch-type LSD there is still an amount of binding between the left and right wheel due to preload spring.
      - When there is torque to the input shaft (on power and off power in 2 ways LSD), in ramp LSD, the ramp will push the clutch patch together, creating binding force. The amount of binding force depends on the amount of clutch patch and ramp angle, so the diff will not completely locked up and there is still difference in wheel speed between left and right wheel, but when the locking force is enough the diff will lock.
      - There also something I'm not sure is the amount of torque ratio based on road resistance torque (rolling resistance I guess)., but since I cannot extract rolling resistance from the tire model I'm using (Unity wheelCollider), I think I would not use this approach. Instead I'm going to use the speed difference in left and right wheel, similar to torsen diff. Below is my rough model with the clutch type LSD:
      speedDiff = leftWheelSpeed - rightWheelSpeed; //torque to differential input shaft. //first treat the diff as an open diff with equal torque to both wheels inputTorque = gearBoxTorque * 0.5f; //then modify torque to each wheel based on wheel speed difference //the difference in torque depends on speed difference, throttleInput (on/off power) //amount of locking force wanted at different amount of speed difference, //and preload force //torque to left wheel leftWheelTorque = inputTorque - (speedDiff * preLoadForce + lockingForce * throttleInput); //torque to right wheel rightWheelTorque = inputTorque + (speedDiff * preLoadForce + lockingForce * throttleInput); I'm putting throttle input in because from what I've read the amount of locking also depends on the amount of throttle input (harder throttle -> higher  torque input -> stronger locking). The model is nowhere near good, so please jump in and correct me.
      Also I have a few questions:
      - In torsen/geared LSD, is it correct that the diff actually never lock but only split torque based on bias ratio, which also based on speed difference between wheels? And does the bias only happen when the speed difference reaches the ratio (say 2:1 or 3:1) and below that it will act like an open diff, which basically like an open diff with an if statement to switch state?
      - Is it correct that the amount of locking force in clutch LSD depends on amount of input torque? If so, what is the threshold of the input torque to "activate" the diff (start splitting torque)? How can I get the amount of torque bias ratio (in wheelTorque = inputTorque * biasRatio) based on the speed difference or rolling resistance at wheel?
      - Is the speed at the input shaft of the diff always equals to the average speed of 2 wheels ie (left + right) / 2?
      Please help me out with this. I haven't found any topic about this yet on gamedev, and this is my final piece of the puzzle. Thank you guys very very much.
    • By Estra
      Memory Trees is a PC game and Life+Farming simulation game. Harvest Moon and Rune Factory , the game will be quite big. I believe that this will take a long time to finish
      Looking for
      Programmer
      1 experience using Unity/C++
      2 have a portfolio of Programmer
      3 like RPG game ( Rune rune factory / zelda series / FF series )
      4 Have responsibility + Time Management
      and friendly easy working with others Programmer willing to use Skype for communication with team please E-mail me if you're interested
      Split %: Revenue share. We can discuss. Fully Funded servers and contents
      and friendly easy working with others willing to use Skype for communication with team please E-mail me if you're interested
      we can talk more detail in Estherfanworld@gmail.com Don't comment here
      Thank you so much for reading
      More about our game
      Memory Trees : forget me not

      Thank you so much for reading
      Ps.Please make sure that you have unity skill and Have responsibility + Time Management,
      because If not it will waste time not one but both of us
       

    • By RoKabium Games
      We've now started desinging the 3rd level of "Something Ate My Alien".
      This world is a gas planet, and all sorts of mayhem will be getting in our aliens way!
      #screenshotsaturday
    • By Pacoquinha Studios
      Kepuh's Island is Multiplayer 3D Survival Game where you survive on the Kepuh's Islands, confronting challenges that are not only other players but also bosses, and even the environment itself.
      We have a lowpoly faster battle-royale idea, where about 12 players on the map fighting for survival! Also adding some more things into that style such as bosses around the map giving you abilities and much more such as vehicles, weapons, skins, etc...
      Now we are on cartase which is a crowdfunding online which purpose is to raise funds for the development of the game. Come and be part of this development.
      Link for Cartase: https://www.catarse.me/kepuhsisland?ref=project_link
      We post updates and trailers on
      Twitter: https://twitter.com/pcqnhastudios
      Facebook: https://www.facebook.com/pacoquinhastudios/
      Site: http://pacoquinhastudios.com.br
      If you could check out it would be great
      Thnks
      Some images:





  • Advertisement