FOnline Development > General Discussion

FOnlineServer with Mono

<< < (6/11) > >>

wladimiiir:

--- Quote from: scypior on June 06, 2013, 08:15:20 pm ---Nice, it reminds me of behavior trees

--- End quote ---
Thanks, finally I know how to name the framework. ;D
It is, indeed, something that is supposed to be very close to it (even if I have never heard of it before). Good to know something like that exists and I can use it as a knowledge base. ;)

Bartosz:
There used to be tons of info about in on AiGameDev.net

wladimiiir:
First of all, thanks for those missing critter events in the newest revision. :)

Second of all I have a question for you:
Is it possible to define interface in Mono and make an implementation of that interface in AngelScript, so it can be further passed to Mono code for processing?

Bartosz:
At the moment, you could try something like:

C# interface:

--- Code: ---interface IFoo {
   void Bar();
}

--- End code ---

Then, in AngelScript (let's say it's module foo):

--- Code: ---class FooImpl { // not that it doesn't say anywhere we implement that interface
    void Bar() { ... }
}
FooImpl GetImplementation() { return FooImpl(); }

--- End code ---

Back in C#:

--- Code: ---class FooImplWrapper : IFoo {
    ScriptObject foo;
    public Wrapper(ScriptObject impl) {
        foo = impl;
    }
    public void Bar() {
        foo.Bar(); // dynamic call
    }
}

dynamic module = AngelScript.GetModule("foo");
var foo = new FooImplWrapper(module.GetImplementation());
foo.Bar();

--- End code ---

But it's rather ugly, and it's exploiting AS dynamic wrappers which are rather experimental (and do not work with overloaded functions).

I never planned such tight binding (implementing interfaces across different script runtime boundaries), as it bounds to be pretty complicated, so question is, what kind of design decisions led you to such requirement?

wladimiiir:

--- Quote from: scypior on June 10, 2013, 09:49:18 am ---I never planned such tight binding (implementing interfaces across different script runtime boundaries), as it bounds to be pretty complicated, so question is, what kind of design decisions led you to such requirement?

--- End quote ---
It is again those Critter Action Behaviour Trees I am working on. I already have system that manages these actions (let's call it Manager) and set of actions in AngelScripts.
What I am thinking is reimplementing Manager in Mono, but to be able to reuse those existing actions by introducing interface in Mono, which existing actions would implement, so I could reuse those actions in Manager in Mono.
The second reason is not to be bound to Mono code, as maybe someone does not want to use it in their project and he can implement actions in AngelScript.
And the third reason is the ability to easily switch between the AngelScript Manager and Mono Manager to e.g. see the difference in performance or just to have fallback Manager in case that your Mono project won't be maintained anymore (not compatible with the newest revision of SDK as it happened after UTF change or you will discontinue the project).

I was trying something like that in C++, so I introduced interface which is then implemented in AngelScript (already existing actions), and create C++ Manager for the actions, but I am struggling with it a bit as I am not advanced user of C++ (as being Java focused), but that's another story :)

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version