Skip to main content
gamedev.net
🔒 Locked

Scripting; general advice.

Started by Nanook Dec 19, 2011 at 1:27 PM 1 replies 800+ views
Original Post
Nanook
Nanook
I'm working on a game/engine and want to use stackless python for scripting as I use python at work.

But what parts of the game is normal to script? Gui states? AI (what parts)? File loading?

I'm thinking about using it for file loading would that be to slow? I guess for pre loading the level its fine, but what If I use it for live streaming of resources? I've been thinking of designing it so the python script loading the file could be fired of in a new thread and the game would only render it when its done loading it.

With the threading. Should I run it as a seperate thread from c++ or should I have message system where I fire off jobs to a python "engine" and then collect the results from it?

Some general advice on how to organize scripting in my game/engine would be good.
c_olin
c_olin
The answers to these questions depend on your project. Where would scripting be the most useful in your game? If you support a large amount of file formats and would like them to be extensible then script the file IO. Otherwise, I don't think scripting file IO is that useful. If your game will have a lot of complex GUI then script it. Otherwise, don't. etc...

Add it where it is needed rather than searching for a place to add it. Usually, the place where you get the most benefit is in the game entity logic.
rip-off
rip-off
The answer depends on the scope of your project. Personally, I find that gameplay/AI is where rapid iteration is most useful, so I would probably start there.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.