Re: A few questions about scripting

Matt Gordon <[email protected]>
Newsgroups gmane.games.devel.sweng
Message-ID <7530E6461433DB4BA73E5C07756C6B5001881343@skoll.fareham.climax.co.uk>
+1.

 

I've seen "scripting languages in games" do quite a wide variety of things,
and solve different problems.

 

 

UE3 would be very slow to develop for without Unreal script (ok, maybe not
if you have the silly fast machines Epic buy - but that's another story!).
Unreal Script isn't something we ever gave over to the designers (they used
Kismet), but was used by the programmers to reduce iteration time (really,
the C++ compile times can be epic. Haha), reduce bugs, reuse engine
script-side functionality. Of course, the debugger didn't really work
(ouch!) and it's a slightly unusual language - but it was still more
productive than C++.

 

The "connected logic blocks" type tools are a very similar thing - a domain
specific language to move some of the game logic out from C++. I couldn't
say if they're faster/slower or smaller/bigger than a
bytecode/interpreted/whatever language, but I've not seen them cause an
(intrinsic) performance bottleneck yet - that is to say, they're fast enough
to drive game events or character logic.

 

 

I don't think our designers would be very happy being asked to learn Lua,
but they do get on OK with the graph type tools. This is partly a matter of
hiring policy - I'm aware other studios require some scripting aptitude from
their level designers (I also seem to remember seeing Bioware job ads for
"junior (script) programmers" in the NWN era).

 

 

The way I see it, using some "not C++" DSL gives you the opportunity to
gain:

 

1.	reduced iteration time 
2.	an easier to handle language for designers or junior programmers 
3.	a restricted environment in which it is safer to allow user code to
run in 
4.	auto-serialization (save/load, network, load balancing)
5.	executable content that can be versioned/sold separately from the
core code (expansions/add-ons)

 

What flavor of DSL you use etc, depends on your objectives. The node-graph
type tend not be so suitable for serialization, whereas the script language
type having a steeper learning curve for non-programmers.

 

Outright dismissal on grounds of performance is premature. Not all code is
performance critical, romantic notions of "getting the most from the
hardware" be damned. My $.02 :). 

 

 

-Matt

 

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Joe
Hegarty
Sent: 27 April 2010 17:00
To: [email protected]
Subject: Re: [Sweng-Gamedev] A few questions about scripting

 

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
<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
<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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.