🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

How do you use AngelScript?

Started by
2 comments, last by Desdemona 20 years ago
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?
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
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
Jayanth.KRaptor Entertainment Pvt. Ltd.http://www.raptorentertainment.com---------------------------------------------------------Why Mr. Anderson? Why? ...Why keep fighting? Do you think you're fighting for something - for more than your survival? Can you tell me what it is? Do you even know? Is it freedom, or truth, perhaps peace, could it be for love? Illusions Mr. Anderson, vagaries of perception. Temporary constructs of a feeble human intellect trying desperately to justify an existence without meaning or purpose.
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

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

This topic is closed to new replies.

Advertisement