Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

AFAIK people like scripting because it's easier, and it makes development cycle faster. But what about when games are shipped. No one expects shipped binaries to be changed, unless there is an update or a DLC. So why developers don't compile their script files before shipping?

Potential benefits:

  1. Faster run time
  2. Obfuscating binary a little mode

and I can't think of any possible draw backs.

Examples:

  1. Civilization 5 had lots of lua scripts inside their assets folder.
  2. Angry birds also had a lot those scripts along side binary.
  3. Age of Mythology had lots of xs scripts for their AI.
  4. Civilization 4 had lots of python scripts.

I'm pretty sure the list could have gotten a lot longer if I had more games installed on my device.

share|improve this question
    
I wouldn't say "usually", rather "exceptional". Any game code I saw and game I worked for was pretty "closed" and under walls of NDAs including the scripts. Impossible to ship or publish the scripts. –  Maik Semder Jan 19 '13 at 21:32
    
@MaikSemder it's not exceptional as far as I can browse in my game folders! also I remember Generals series had lots of scripts included. –  Ali.S Jan 19 '13 at 21:40
    
+1 good question. The same with Battlefield 2, had a few dozen python scripts. It's strange as why just not compile the python script? Leaving the source closed. –  Vincent P Jan 19 '13 at 21:51
1  
Besides the obvious modding reasons, we can only speculate and guess. Hence voting to close as the question doesn't fall under the "practical, answerable questions based on actual problems that you face" - rule, just polling a discussion. –  Maik Semder Jan 19 '13 at 22:06
1  
Tend to agree with @Maik. The only people who can state with authority why <game x> did something in a particular way are the people who made that specific game. It's why "what technology some particular game used" is explicitly called out as being off-topic in the FAQ. –  Trevor Powell Jan 20 '13 at 5:56

2 Answers 2

The reasons for each game is really only known to the developer. I plan on including the scripts in my game for one simple reason, I want users to be able to customize the game.

There are a few benefits I can think of for not compiling the scripts:

  • User customization: Allows the users to modify certain aspects of the game play or units in the game. Then users can just drop in new scripts and add a new AI difficulty level or add a custom unit.
  • Localization data: Allows developers to deploy specific data to specific locals without needing to recompile the binary for each location.
  • Segregation of code: The people working on creating the code behind the binary are not necessarily the same people working on the scripts. Keeping them separate means the two groups don't rely on each other.
  • Easy updates: Updating just the scripts is a simpler process and might be easier permission-wise to update files than replacing an executable.
share|improve this answer
1  
I know the benefits of scripts themselves, I'm wondering why games are shipped with their script sources included. –  Ali.S Jan 19 '13 at 21:37
    
@Gajoo For the same reasons. The scripts are read at run time, so the sources you're seeing can be changed and the game play will be altered at the next run. –  Byte56 Jan 19 '13 at 22:09
    
However, it may be dangerous when an unknowing user wants to edit the scripts. To create availability for customizing the game, the developers should create some panel that lets the user set the values that are used in scripts. Such way also gives the ability to list all of the available values. –  tobi Jan 20 '13 at 0:24

I suspect it's because that one of the advantages of using scripts over C++ code is that there is no compile process so it makes for quick and easy editing during development.

Lua also gains no run-time performance from compiling it off-line. It's just load time it speeds up.

Adding the extra compile step in then just slows down development and makes the process more error-prone (e.g. the script can get out of sync with the compiled version).

Compiling all the scripts just before you ship the game has obvious risks that you did all your testing with the scripts in their uncompiled state, and shipping something that's not been tested is a bad idea.

On any single player game there's also no harm done if your users want to modify the game in some way by editing scripts.

share|improve this answer
    
+1 just for your last paragraph, the rest doesn't really apply to publishing phase. Also one will obviously test the game after compiling the scripts. meaning the risk wouldn't be that much. –  Ali.S Jan 21 '13 at 2:36
    
There's no great risk, but extra testing isn't free. –  Adam Jan 21 '13 at 20:34

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.