• Advertisement

Archived

This topic is now archived and is closed to further replies.

How do you use AngelScript?

This topic is 4981 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 just finished my current project, so I have just been looking back at how I used things like AngelScript, and thinking about what might be a better approach for other projects. My engine was single threaded. During each pass through the engine''s update loop, I would ExecuteStep on each script that was running. That made it so each script essentially ran concurrently. I actually called ExecuteStep on each script a bunch of times during each pass, just so it would speed up their execution. My question is, how does everyone else deal with integrating AngelScript with their project? I was thinking about how multithreading with AS might work. I''m sure that I would need to protect the call to asIScriptEngine::CreateContext with some form of critical section, but can two contexts be running in seperate threads without crashing AS?

Share this post


Link to post
Share on other sites
Advertisement
In my project I have no need for concurrent scripts as they are not attached to individual game objects. As such my script usage is rather basic - during initialisation the script registers what callbacks it wants to receive (input, timers, etc...), and then on those events the registered script function is called.

- Xavier

Share this post


Link to post
Share on other sites
Angelscript is all over our game............Xtreeme Forces. its heavoly used and to just name a few, the AI file right now is 5000 lines of AS Code. my only issue is its so tightly integrated with our game, i have to literally struggle to update every new version to make sure everything works perfectly fine!

Jayanth.K
Raptor Entertainment Pvt. Ltd.
http://www.raptorentertainment.com

Share this post


Link to post
Share on other sites
Desdemona:

Angelscript will probably not work very well in multiple threads. I know for sure that asGetActiveContext() will present problems, as it is not thread aware. This doesn''t prevent you for using threads for other tasks.

I''ll correct this behaviour for a future version though.




__________________________________________________________
www.AngelCode.com - game development and more...
AngelScript - free scripting library - Tower - free puzzle game

Share this post


Link to post
Share on other sites

  • Advertisement