[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Scripting

Jan Ekholm wrote:

> Why not write the game logic in Python/Perl/whatever and call C functions
> for stuff that needs more speed? Games that get developed for Linux aren'
> too complex and don't anyway need all the power that current machines can
> offer, so why not make the development process easy?

I'd object to the idea that development is easier in Python/whatever than
C++ - and once you take away that, why write slow code when for the same
effort or less, you can have fast code?  I know a lot of Python/whatever
enthusiasts are going to object to that view - but for me personally, it's

I'd also object to the idea that games that get developed for Linux aren't
too complex...if we give into that idea then it will become a self-fulfilling
prophesy.  Games I'm working on certainly *do* use all the resources of a
modern PC.  I *want* to write the most complex game I can within the mental,
temporal and physical resources at my disposal.

Yes, you can write yet-another-Tetris without concerns for performance - but
you CAN'T write a game like TuxKart, FlightGear, etc in a scripting language
without the script being little more than a loop that calls compiled code
that does 99% of the work and probably contains 99% of the sourcecode.

The reason (IMHO) for using a scripting language for AI and things like
high level scenario management is that it makes the kind of parallelism
that I described earlier much simpler.  This makes it much easier to think
about how the mental state of 50 computer-controlled characters might work.
It's hard to program with a state-machine approach - and running 50 parallel
pthreads isn't going to play well with a realtime game.  If there was a
reasonable way to get extremely lightweight threading into
a compiled language - I probably wouldn't be interested in scripting.

There are (as far as I know) no large commercial games that are written
in a scripting languages.  Many use scripting for AI and Scenario setup

There is a reason for that.  Those guys aren't stupid.

----------------------------- Steve Baker -------------------------------
Mail : <sjbaker1@airmail.net>   WorkMail: <sjbaker@link.com>
URLs : http://www.sjbaker.org
       http://plib.sf.net http://tuxaqfh.sf.net http://tuxkart.sf.net
       http://prettypoly.sf.net http://freeglut.sf.net
       http://toobular.sf.net   http://lodestone.sf.net