Jump to content
  • Advertisement
Sign in to follow this  
fuzinavl

Seperating AI functions from MapLevel functions

This topic is 4765 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

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?

Share this post


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

Share this post


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

Share this post


Link to post
Share on other sites
Only drawback is more memory use. It has to keep redundant information for every function registered with both.

Share this post


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

Share this post


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

Share this post


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

Share this post


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

Share this post


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

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!