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

Re: Where do I begin?

Mark Collins wrote:

>>>3) Performance boosts. I'm not sure
>>>how fast Python is, but I doubt it's as fast as standard compiled code.
>>I estimate it's about 50x slower than C++ - but you aren't generally
>>running much code for AI (although some of the support functions like
>>line-of-sight testing, route planning and collision detection will be
>>slow - you can keep those in C++).  The additional flexibility is worth
>>the extra couple of percent of CPU time IMHO.
> I'm writing the manual for VectorC, an optimizing C compiler (Linux version 
> due out in April). I like to squeeze every ounce of CPU performance I can, 
> which means nothing wasted on scripting languages. But, that's just me.

No Mark, it's not just you. Here's my point of view (warning, long rambling 
waffle incoming..)

One of the major justifications I hear for the use of interptreted scripting
languages for AI in games is that it allows the behaviour of the NPCs etc to
be modified without the need to recompile the whole project, possibly even 
modify behaviour without quitting the game. Other people talk about it being 
easier for the AI guys - no need to get grubby with a compiler and so on. In 
Windows games this probably has some weight I suppose, but on Linux?

Assuming that your AI guys have a modicum of C or C++ coding knowledge 
(which most will I expect, especially on Linux) creating dynamically
loaded librarires is fairly simple - trivial if you give them templates, a 
makefile and good documentation on the interface functions. dynamic 
libraries, by their nature, can be unloaded and reloaded and they give
you far higher performance, lower memory use, no need to write or try to 
integrate an interpreter (which can be a headache on its own) and you can
do so much more with compiled code in the same space. The single advantage
I can see for interpreted stuff is platform independance - you only need
recompile your game code if you are changing platforms whereas dynamic libs 
require the game code and all the librarires to be recompiled. But if 
portability or compile times aren't a problem then interpreted scripting 
languaes are, IMO, a waste of good CPU cycles.

  .------{ http://www.starforge.co.uk }-----. .--------------------------.
=[     Explorer2260, Designer and Coder     \=\ P: TexMaker, ROACH, site \
=[___You_will_obey_your_corporate_masters___]==[ Stack: EETmTmTRRSS------ ]