• Advertisement
Sign in to follow this  

Scripting; general advice.

This topic is 2254 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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. :)

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement