Jump to content
Sign in to follow this  
Tankbuster

Multiplayer Framework. Insight, documentation, discussion. :)

Recommended Posts

http://community.bistudio.com/wiki/Multiplayer_framework

This is one of the hidden gems of this game. It's potentially very powerful allowing mission designers to cross that tricky locality boundary.

Xeno employed some jolly cunning stuff in Domination to do this in the past and I understood much of what he did, but the MPF stuff is not documented very well.

If I'm honest, I'm after some help with some specific parts of the MPF, but think that we should have a more central place to discuss and develop how we use this.

So, everyone. Carry on. :)

Perhaps I can kick this off with the very first question...

When testing and using the examples given on the MPF biki pages, do I HAVE to be running in a dedicated server/client environment?

Share this post


Link to post
Share on other sites

I do not believe Xeno deploys the BI MultiPlayer framework, as it is generally not preferred, unoptimized, etc.

AFAIK Xeno deploys CBA on Domination, just like we do in ACE mod.

CBA's powerful remote and local eventhandler system is recommended.

https://dev-heaven.net/projects/cca/wiki/Custom_Events_System

https://dev-heaven.net/docs/cba/files/events/fnc_addEventHandler-sqf.html

https://dev-heaven.net/docs/cba/files/events/fnc_globalEvent-sqf.html

etc

Share this post


Link to post
Share on other sites

Xeno doesn't use CBA in Domination, at least it's not required. He made his own remote stuff which was excellent, but I did want to rather want to focus on the multiplayer framework here as it's an addon free deployment.

Share this post


Link to post
Share on other sites
I do not believe Xeno deploys the BI MultiPlayer framework, as it is generally not preferred, unoptimized, etc.

AFAIK Xeno deploys CBA on Domination, just like we do in ACE mod.

It's basically the same system as the CBA event system but a little bit enhanced. You can select where events are beeing registered by adding an additional parameter (0 = on all machines, 1 = server only, 2 = client only and so on). And the CBA where local part is missing.

I've never used and will never use the BI MP framework. One reason is that the last thing I would do is sending huge code snippets over the network just to execute something somewhere (a good or rather bad example for that is the Insurgency mission, huge code parts are beeing sent by the mission over the net, totally unneeded, wasted bandwith).

Sending just parameters (if needed) is enough. The (script) overhead that the BI MP framework has is simply too much.

Xeno

Edited by Xeno

Share this post


Link to post
Share on other sites

I'm a big fan of what you did in Domi for remote code execution, Xeno. Just for the record, I didn't say you did use MP framework.. I think SB misunderstood me. :)

But is it really that bad? I must admit I did wonder why there wasn't much chat about the thing. It hadn't crossed my mind that the reason there's not much said about it is that it's not very good! :)

Share this post


Link to post
Share on other sites

Also the MPF framework allows you to use the "per" in parameters which means the it will be executed for JIPs. That all sounds nice, but what happens when you have done that a 100 times? Will it then be executed a 100 times for each JIP. If if will then it has a lot of information to send to the JIP upon joining.

CBA (and Xeno's method) doesn't to any JIP handling at all which forces you to deal with that in a proper manner. Also implementing network functionality like CBA does it actually much simpler than how the MPF is implemented. You can implement this in 100 lines if not 50 lines of sqf. It bascially just a publicVariable with some functions to ensure proper bahaviour (eg. must raise event too on local machine since pubVar doens't raise any handlers there).

Share this post


Link to post
Share on other sites

Ah OK. I don't want to diss Xeno's domi method or CBA, I'm a big fan of both, but I do want to fully explore what MPF might bring to the party. Let's continue with that.

Share this post


Link to post
Share on other sites

I'm disappointed there's been no further contributions.

I've spent 3 days staring at that biki page and putting random combinations of the example scripts into my mission with varying levels of success. Frankly, it's been a waste of time.

Clearly it's too much to ask for BI to document their products properly.

Share this post


Link to post
Share on other sites

Maybe not many people use it. Because of the fact that I enjoy scripting... I just build my own functions for everything.

There are no BIS Function modules on my maps! Ever!

I suspect it's the same for a lot of coders here that have a good understanding of scripting in Arma 2.

Share this post


Link to post
Share on other sites

You should add what you've found to the Biki. As with any wiki, it's up to the users to make it better and fill in the blanks so if you've discovered something or have an example that works you should absolutely add it to the documentation.

Maybe not many people use it. Because of the fact that I enjoy scripting... I just build my own functions for everything.

There are no BIS Function modules on my maps! Ever!

Reinventing the wheel every mission? Seems pretty crazy. :) For some larger scale things like ALICE and other mods that don't work quite right I can see doing that, but the Functions module is pretty much awesome, can't see why you'd spend time recreating all the tools that are in that.

Share this post


Link to post
Share on other sites
Reinventing the wheel every mission? Seems pretty crazy. :) For some larger scale things like ALICE and other mods that don't work quite right I can see doing that, but the Functions module is pretty much awesome, can't see why you'd spend time recreating all the tools that are in that.

A lot of my functions were built before I even knew there was a functions module!.. and they are specific to my needs. No re-inventing the wheel there at all!

EDIT: Apologies Tankbuster!

Edited by twirly

Share this post


Link to post
Share on other sites

WTF happened with my double post? Grrrr.

Share this post


Link to post
Share on other sites

Tankbuster

I have been watching this thread hoping some more info would come out about Multiplayer Framework. It seems like a nice tool for those of us who are not scripting wizards. I have been messing around with MF but it is more trial and error than anything else.

Nomadd

Share this post


Link to post
Share on other sites

I find the MPF not easy to understand, not well documented and not designed well.

Best to use simple PV + PVEH design and setVar public.

Or make use of CBA events system if you are doing addons.

Share this post


Link to post
Share on other sites
WTF happened with my double post? Grrrr.

I've ran into this before. I had a double post, edited my second one to say it was a double, and then the first disappeared, leaving only the second one.

On topic:

I use the MPF frequently, but only for simple things like sidechat, Hint, and spawn.

I might look into it more sometime.

Share this post


Link to post
Share on other sites
I've ran into this before. I had a double post, edited my second one to say it was a double, and then the first disappeared, leaving only the second one.

That's exactly what happened here too. I'll report it to Dwarden.

---------- Post added at 11:24 ---------- Previous post was at 11:21 ----------

I use the MPF frequently, but only for simple things like sidechat, Hint, and spawn.

I might look into it more sometime.

(Another quote from the same post. Let's see how this ends up if I leave it alone)

That's really all I want to do, sidechat, but it's so hard to reliably get working. What I've found so far is that "loc" breaks the thing. I've not even tried the JIP "per" stuff yet.

---------- Post added at 11:25 ---------- Previous post was at 11:24 ----------

Tankbuster

I have been watching this thread hoping some more info would come out about Multiplayer Framework. It seems like a nice tool for those of us who are not scripting wizards. I have been messing around with MF but it is more trial and error than anything else.

Nomadd

That's what is such a shame. The MF looks like it could give the mid level scripters an way into remote stuff, but it's poorly documented and/or broken.

Share this post


Link to post
Share on other sites

fuck it

Edited by Shuko

Share this post


Link to post
Share on other sites
If sidechat etc is all you want, then it's pretty simple to do with PV+PVEH

Sorry for being so horrible, and comment a second time, this time on your changed example ;P (i'll not bump the old thread for now :P)

But using radio messages in PV/PVEH, seems at least bad practice - unless you add the strings on all machines, and only send the Stringtable (or other) references :)

At least it seems very inefficient to send

"Large string example. Large string example. Large string example. Large string example. Large string example. Large string example. Large string example. Large string example. Large string example. Large string example. Large string example. Large string example."

Every time again in full, instead of sending "STR_MyLargeString", which will be looked up in the Stringtable, or elsewhere ;-P

I know you could see this as nit-picking, especially considering you are simply trying to make an example of PVEH, but on the other hand, this is exactly where issues start.

Issues caused by these things probably don't show their ugly head too soon, but they will appear sooner or later, e.g when you are playing the mission with 40 players or more, and so on ;)

Especially considering these things can pile up rather quickly.

Good practice is half the work, not only today but also in the future ;-) (But, I too suffer from not always following them :P)

---------- Post added at 15:29 ---------- Previous post was at 15:22 ----------

And sorry TankBuster, I would gladly provide examples/support on how to handle it with PV/PVEH or with CBA's event system. I do not support things I do not believe in, like the MP Framework :)

Edited by Sickboy

Share this post


Link to post
Share on other sites

the forums are auto-merging last posts from same person so your double post most likely was just one post at moment you did the edit/wipe

Share this post


Link to post
Share on other sites
It's basically the same system as the CBA event system but a little bit enhanced. You can select where events are beeing registered by adding an additional parameter (0 = on all machines, 1 = server only, 2 = client only and so on). And the CBA where local part is missing.

I've never used and will never use the BI MP framework. One reason is that the last thing I would do is sending huge code snippets over the network just to execute something somewhere (a good or rather bad example for that is the Insurgency mission, huge code parts are beeing sent by the mission over the net, totally unneeded, wasted bandwith).

Sending just parameters (if needed) is enough. The (script) overhead that the BI MP framework has is simply too much.

Xeno

You can do some more work so you can overcome that same problem.

So, if you create functions, and simply use call or spawn when broadcasting code using R commands.

For example:

TAG_myFunction = compile preprocessfilelinenumbers "blabla.sqf";

//Then, when you need to spawn some code remotely you can simply do
[nil, _unit, "loc", rSPAWN, _parameters, { _this call TAG_myFunction }] call RE;

This way, the code being sent over the network is minimal, since all it actually broadcast is that call command.

_neo_

Share this post


Link to post
Share on other sites

So the options for this are:

Use MPF (very carefully)

Use CBA (if SB falls under a bus tomorrow can he name a successor in a will?)

Make your own system (if you have the skills, I don't)

Before I choose one, does anyone know if this rather awkward MP situation will change with Arma3?

Share this post


Link to post
Share on other sites

ArmA3 has been pushed back till Q4 2012 and will probably use Java as it's scripting language, so no sense in not doing something now because it'll all be radically different for A3.

Share this post


Link to post
Share on other sites

This way, the code being sent over the network is minimal, since all it actually broadcast is that call command.

Good point. And while the design of said framework still might be rather ugly, it makes me wonder if it isn't all _that_ wrong afterall. The question is how it is (or was - at some point) _supposed_ to be used. But then again, we're back to point one: it's ugly, because a well design would make "good" useage more or less mandatory.

Share this post


Link to post
Share on other sites
You can do some more work so you can overcome that same problem.

So, if you create functions, and simply use call or spawn when broadcasting code using R commands.

For example:

TAG_myFunction = compile preprocessfilelinenumbers "blabla.sqf";

//Then, when you need to spawn some code remotely you can simply do
[nil, _unit, "loc", rSPAWN, _parameters, { _this call TAG_myFunction }] call RE;

This way, the code being sent over the network is minimal, since all it actually broadcast is that call command.

_neo_

Wrong, doesn't change the original point; You're still sending the string path to rSpawn function, and code (regardless how small) that is unneeded to be sent, basically it doesn't scale very well.

Then the call to RE is way too verbose. And by default you cannot expect RE to be ready, but have to wait for it to become ready, with e.g a waitUntil and so forth.

---------- Post added at 16:21 ---------- Previous post was at 16:15 ----------

Use CBA (if SB falls under a bus tomorrow can he name a successor in a will?)
Ha! Nerds like me don't see that much daylight, let alone public transportation :P

But point taken :) No worries though, from the top of my head, CBA teammembers, contributors, and same for ACE and ACRE, are pretty CBA-tastic :)

Next to having technical documentation available, while CBA itself as well as ACE are examples on their own, but I admit, that is probably not as helpful as true demo/examples ;)

Edited by Sickboy

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×