Seperating AI functions from MapLevel functions

Started by
8 comments, last by WitchLord 18 years, 8 months ago
In the game I'm designing (similar to openglad), I want players to be able to design the AI for their teammates. I will be using AngelScript for both AI and MapLevel scripting. I don't want AI scripts to have access to MapLevel functions though. Players shouldn't be able to dry up lakes and spawn large gold piles at will. The solution I'm thinking of is setting up two AngelScript engines. Then the MapLevel and AI engines would be binded seperately with the appropriate functions. Is there a better solution?
Advertisement
Not yet.

WL is planning on a system specifically for that sort of situation, but until it's released there is no other option than seperate script engines.
Initializing 2 seperate engines shouldn't be difficult.

Other than some redundancy in having to bind the same functions to 2 seperate engines,
is there any real drawback to that technique?

I want the api to remain clean and simple.
Only drawback is more memory use. It has to keep redundant information for every function registered with both.
Thanks! :)
I'm working on improving this right now. Version 2.4.0 will allow the application to make groups of configurations and define which script modules should have access to which groups. It will probably be another month before this version is finished though.

Until then, the only thing that can be done is what you already decided, to set up two engines.

Regards,
Andreas

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

Speaking of 'configuration grouping', will this be back compatible with 2.3.0 and older versions? Perhaps it might be a good idea to retain the old configuration functions and use a 'default' group. Even nicer would be the notion of having an engine-wide 'super' group accessible throughout the engine.
tIDE Tile Map Editorhttp://tide.codeplex.com
It will be backwards compatible.

Those that need the more specialized configurations will be able to use the new methods to group the registrations, but if not needed it is not necessary. The grouping is made with a couple of extra calls: BeginConfigGroup() and EndConfigGroup() so the actual registation functions will remain the same.

Regards,
Andreas

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

Quote:Original post by SharkBait
Speaking of 'configuration grouping', will this be back compatible with 2.3.0 and older versions? Perhaps it might be a good idea to retain the old configuration functions and use a 'default' group. Even nicer would be the notion of having an engine-wide 'super' group accessible throughout the engine.


Would this need library support or could it be just as easily handled through the application. I think it is a great idea, but when I gave it more thought it seemed like it would be just as easy to create this through the applocation
The support for configuration groups must be implemented in the library, since that is the only way that common resources can be shared. If the application was to try something like this with the current implementation, it would have to use multiple engine instances. It would also complicate other matters behind the scene, e.g. registered object types and script structures can't be passed between engines (at least not without special care to make sure they are indeed compatible).

Anyway, the implementation won't change the way current projects work, it will just give extra flexibility for those projects that may need it.

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