Python script and C++

Marc 'BlackJack' Rintsch bj_666 at gmx.net
Tue Nov 28 04:12:23 EST 2006


In <1164691472.172783.151290 at n67g2000cwd.googlegroups.com>, Ravi Teja
wrote:

>>     I am new to python  and currently I am working on a traffic simulation
>> which I plan to define the various agents using scripting. It's kind of like
>> scripting for non-playable character in games. I am thinking of using python
>> for this but I am concerned with running time. Is scripting a lot slower
>> compared to direct implementation in C++? Does compiling the script help in
>> any way?
> 
> Python is perfectly suitable for this use. Python was in use in video
> games in this way when computers were a lot slower.

There's a difference between simulations and games.  The simulation will
not always be observed by a human being so it runs as fast as possible.
In games the speed of NPCs is usually limited to a level the player can
deal with.

But I think Python is fine for such a task.  The only way to find out if
it may be to slow is writing a prototype and measure.  Maybe it's a good
idea to design the API for the "NPCs" independent from the language so you
can also write them in C++ or another scripting language.

Ciao,
	Marc 'BlackJack' Rintsch



More information about the Python-list mailing list