Re: A few questions about scripting
Joe Hegarty <[email protected]>
| Newsgroups | gmane.games.devel.sweng |
|---|---|
| Message-ID | <428C492D3392CD47B2C3EDF41F8083521F070D38@DB3EX14MBXC307.europe.corp.microsoft.com> |
On the whole I agree with that. I think "it's too slow" is something programmers say about scripting because they just don't like it, or don't like change. The reality is that most code in a game is not performance critical. On the whole I think having a scripting language generally has a positive effect when you balance everything. We make heavy use of Lua in the Fable games and it makes our lives a whole lot easier. Our designers and scripters can do most of the game-logic themselves (to drive quests etc). It also makes prototyping and development extremely quick as we can replace scripts on the fly, this is particularly useful if you're tweaking something trying to get it to look right. The other thing I think is a really positive benefit is that most scripting languages allow you to just serialize the execution state very easily, which makes implementing your save system vastly more simple. We often prototype features in Lua and then move them to C++. We're constantly on the lookout for scripts which might make more sense in code (scripters sometimes get a little carried away and try to do everything themselves). All of this means saved time and money, it also frees up my time (and the rest of the programmers) to work on improving the core game technology and large performance centric features. Joe Hegarty Network Programmer Microsoft Game Studios [email protected] From: [email protected] [mailto:[email protected]] On Behalf Of Juan Linietsky Sent: 27 April 2010 16:46 To: [email protected] Subject: Re: [Sweng-Gamedev] A few questions about scripting I asked this and discussed with several developers all around the world, so i'd like to wrap up my experience. Several (and I mean SEVERAL) developers are completely against scripting in any way or form. I even heard this argument from tech leads of "large" studios. Their reasoning is simple "Why bothering? It's slow". That seems to be a common position. I even heard some claiming that they implemented their own language based on connecting logic blocks and forcing content developers to use it because it's faster than a VM. Some propertary game engines i worked with also use this, and even force it to the developer. >From other developers i think i've heard more flexible answers, such as that it doesn't make much of a difference performance-wise to write scripting or native, as long as the code is not critical. A common approach seems to be having a design that allows to transparently refactor components from scripting to native when they are showing to be a performance bottleneck, so based on their experience i've always done this. About the benefits of scripting over native code, I've usually heard the following arguments: 1) Hacked code (not nice looking or comprehensible) is often written much faster. If the engine architcture is nice and organized , hacking away scripting over it is a very optimal approach, given that most scripting languages have more flexible data structures. 2) Scripting is easier to debug (and I mean, dynamically typed languages, not C# used as scripting) and can be changed/reloaded on the fly. 3) In most scripting languages, the bytecode is often much smaller than compiled native code, allowing to have a lot more content loaded (I've heard this from GBA/DS developers who are very limited in memory and physical storage). 4) Most scripting languages are MUCH easier to learn than C or C++ to newcomers, so less experienced programmers (read: easier/cheaper to hire/find) can be used to write content. Cheers. Juan Linietsky On Tue, Apr 27, 2010 at 11:23 AM, Tim Stowell <[email protected]<mailto:[email protected]>> wrote: argh, sorry I meant "which parts might be best left to scripting and which parts might best be a fit for native c++/c etc" -Tim On Tue, Apr 27, 2010 at 8:23 AM, Tim Stowell <[email protected]<mailto:[email protected]>> wrote: I don't think it's pointless to ask about how much of a game is written in a scripting language because for someone who may be trying to design their own engine, it's useful to know how much of the engine's functionality might best be left to scripting and which parts would be a better fit for scripting. While it's true that it's all programming, implementing a scripting engine takes a whole different work flow as compared to just hitting the c++ compiler. -Tim On Tue, Apr 27, 2010 at 8:17 AM, Thaddaeus Frogley <codemonkey.uk<http://codemonkey.uk>@gmail.com<http://gmail.com>> wrote: UnrealScript is compiled to bytecode, and executed by the UnrealEngine virtual machine. The distinction between "scripting language" and "not scripting language" is arbitrary and not clear cut. Getting your nickers in a twist about how our pet language is "not a scripting language" does you no favors. Trying to work out "what percentage of a game is written in scripting languages" is as pointless as asking what percentage of fixing are nails rather than to screws. At the end of the day, it's all programming. Thad -- Thaddaeus Frogley Senior Programmer, Climax Games _______________________________________________ Sweng-Gamedev mailing list [email protected]<mailto:[email protected]> http://lists.midnightryder.com/listinfo.cgi/sweng-gamedev-midnightryder.com _______________________________________________ Sweng-Gamedev mailing list [email protected]<mailto:[email protected]> http://lists.midnightryder.com/listinfo.cgi/sweng-gamedev-midnightryder.com _______________________________________________ Sweng-Gamedev mailing list [email protected] http://lists.midnightryder.com/listinfo.cgi/sweng-gamedev-midnightryder.com