Author Topic: FOnlineServer with Mono  (Read 21646 times)

Re: FOnlineServer with Mono
« Reply #15 on: February 10, 2013, 06:43:57 pm »
you mean that one from "\fonline_sdk\Server\mono" ?
I'm using exacly that one.


edit:
I didnt saw that im using 385 rev.
like you said .I downloaded earlier version of that file and it is working now , big thanks to You :)
« Last Edit: February 10, 2013, 07:01:19 pm by OmegaPL »

Offline wladimiiir

  • Rotator
  • Independent FOnline developer
Re: FOnlineServer with Mono
« Reply #16 on: May 14, 2013, 08:28:06 am »
Are there any performance drawbacks when using C# for development?

Offline Bartosz

  • Rotator
  • There'd better be a killer reason...
Re: FOnlineServer with Mono
« Reply #17 on: May 14, 2013, 09:14:48 am »
Unless there are some unintended memory leaks, then performance should be even better, as AngelScript (as it stands now) is not yet JITted, and the bytecode is interpreted as it goes.

Offline wladimiiir

  • Rotator
  • Independent FOnline developer
Re: FOnlineServer with Mono
« Reply #18 on: May 14, 2013, 09:32:50 am »
That's nice to hear, thanks. :)

Offline wladimiiir

  • Rotator
  • Independent FOnline developer
Re: FOnlineServer with Mono
« Reply #19 on: May 14, 2013, 02:18:04 pm »
Do you plan to update FOnlineServer.exe to be compatible with the latest revision? Current version of mono server is 0504-EB, but the newest revision server has version 0518-F7.

EDIT:
Actually, currently I cannot even start the server as it crashes right after Start (and I also tried 383 revision of mono-2.0.dll).
My bad, I forgot to build the project. I "only" have compilation errors because of incompatibility.

And some additional questions:
1. Is it possible to create linux runnable of mono FOnlineServer and use it?
2. Would it be possible to implement also PlaneBegin, PlaneRun and PlaneEnd CRITTER_EVENTS? I understand that it is needed to do some work on engine to call them otherwise I would implement them by myself.
« Last Edit: May 15, 2013, 01:27:37 pm by Mike Wall »

Offline Bartosz

  • Rotator
  • There'd better be a killer reason...
Re: FOnlineServer with Mono
« Reply #20 on: May 17, 2013, 03:37:44 pm »
Do you plan to update FOnlineServer.exe to be compatible with the latest revision? Current version of mono server is 0504-EB, but the newest revision server has version 0518-F7.

Probably not that fast, so I can't promise anything. Ideally, the source would be open for you to modify, but it's not the case:)

Quote
EDIT:
Actually, currently I cannot even start the server as it crashes right after Start (and I also tried 383 revision of mono-2.0.dll).
My bad, I forgot to build the project. I "only" have compilation errors because of incompatibility.

And some additional questions:
1. Is it possible to create linux runnable of mono FOnlineServer and use it?
Should be possible.

Quote
2. Would it be possible to implement also PlaneBegin, PlaneRun and PlaneEnd CRITTER_EVENTS? I understand that it is needed to do some work on engine to call them otherwise I would implement them by myself.
You are right, and unfortunately I can't promise it's gonna be implemented in near future:(

Offline wladimiiir

  • Rotator
  • Independent FOnline developer
Re: FOnlineServer with Mono
« Reply #21 on: June 06, 2013, 10:01:27 am »
Do you plan to update FOnlineServer.exe to be compatible with the latest revision? Current version of mono server is 0504-EB, but the newest revision server has version 0518-F7.
Probably not that fast, so I can't promise anything.
Thanks for the change in the newest revision. :)


Offline Bartosz

  • Rotator
  • There'd better be a killer reason...
Re: FOnlineServer with Mono
« Reply #22 on: June 06, 2013, 11:08:37 am »
Probably not that fast, so I can't promise anything.

Thanks for the change in the newest revision. :)

No problem, hopefuly I will be able to react faster in the future.

Anyway, can I ask what are you using it for, how it goes etc etc?

Offline wladimiiir

  • Rotator
  • Independent FOnline developer
Re: FOnlineServer with Mono
« Reply #23 on: June 06, 2013, 12:45:23 pm »
No problem, hopefuly I will be able to react faster in the future.

Anyway, can I ask what are you using it for, how it goes etc etc?
I was trying to remake Critter Action DSL (see the example below), which I have done in AngelScript and I wanted to rework it in C# as it is easier to debug and develop with (and also maybe have some performance improvement). But currently I am stuck, because I need also PlaneBegin, PlaneRun and PlaneEnd CRITTER_EVENTS to be implemented in Mono, so currently I am trying to remake it in pure C++. ;D
But nevertheless I plan to develop new features in C# (for the productivity), but I am not very productive on the project, so not having much progress ATM. :)


Critter Action DSL: (I know it is not really a DSL, but just to explain what I mean)
This is meant to be used as a simple language to make it easy to setup roles (actions) for NPCs. See the following example and keep in mind, that it is planed to make it public, when it is in the state of publishing. ;D

Examples: :)
Johny, the hungry kid will try to find a (closest) player and asks him for food. Then he searches if any food is on the ground and picks it up:
Code: [Select]
void _HungryKidInit(Critter& npc, bool firstTime)
{
#define TO_DISTANCE (3)

Action@ action = LoopAction()
.AddSubAction(FindCritters(ClosestPlayer)
.If(IsSeen())
.AddSubAction(LoopAction(2)
.AddSubAction(Follow(TO_DISTANCE))
.AddSubAction(LookAt())
               .AddSubAction(Say(TEXTMSG_TEXT, 70113))
.AddSubAction(Wait(REAL_SECOND(5)))))
.AddSubAction(FindItems(FOOD_ITEMS)
       .AddSubAction(PickUp())
       .AddSubAction(DeleteItems()))
.AddSubAction(Patrol(DEFAULT_PATROL_ENTIRE, true))
.AddSubAction(Wait(REAL_SECOND(3)))
           ;

actionManager.Start(npc, action);
}

Brahmin wondering around:
Code: [Select]
void _InitBrahmin(Critter& npc, bool firstTime)
{
      Action@ action = LoopAction(true)
           .AddSubAction(AttackAttacker())
           .AddSubAction(ChangeDirection(RANDOM_DIRECTION, true))
           .AddSubAction(Wait(REAL_SECOND(5), REAL_SECOND(30)))
      ;
     
      actionManager.Start(npc, action);
}
« Last Edit: June 06, 2013, 12:51:27 pm by Mike Wall »

Offline Bartosz

  • Rotator
  • There'd better be a killer reason...
Re: FOnlineServer with Mono
« Reply #24 on: June 06, 2013, 08:15:20 pm »
Nice, it reminds me of behavior trees

Offline wladimiiir

  • Rotator
  • Independent FOnline developer
Re: FOnlineServer with Mono
« Reply #25 on: June 07, 2013, 08:38:52 am »
Nice, it reminds me of behavior trees
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. ;)

Offline Bartosz

  • Rotator
  • There'd better be a killer reason...
Re: FOnlineServer with Mono
« Reply #26 on: June 07, 2013, 09:10:25 am »
There used to be tons of info about in on AiGameDev.net

Offline wladimiiir

  • Rotator
  • Independent FOnline developer
Re: FOnlineServer with Mono
« Reply #27 on: June 10, 2013, 08:15:55 am »
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?

Offline Bartosz

  • Rotator
  • There'd better be a killer reason...
Re: FOnlineServer with Mono
« Reply #28 on: June 10, 2013, 09:49:18 am »
At the moment, you could try something like:

C# interface:
Code: [Select]
interface IFoo {
   void Bar();
}

Then, in AngelScript (let's say it's module foo):
Code: [Select]
class FooImpl { // not that it doesn't say anywhere we implement that interface
    void Bar() { ... }
}
FooImpl GetImplementation() { return FooImpl(); }

Back in C#:
Code: [Select]
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();

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?

Offline wladimiiir

  • Rotator
  • Independent FOnline developer
Re: FOnlineServer with Mono
« Reply #29 on: June 10, 2013, 10:12:47 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?
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 :)