Home   Help Search Login Register  

Author Topic: Multiplayer missions  (Read 2623 times)

0 Members and 1 Guest are viewing this topic.

Offline OFP_f3d3

  • Former Staff
  • ****
  • Fraud is the ready minister of injustice.
Multiplayer missions
« on: 27 Jan 2011, 16:23:48 »
Nothing in the world is as certain as death.

Offline Aldo15

  • OFP-addict
  • Former Staff
  • ****
    • My OFP missions
Re: Multiplayer missions
« Reply #1 on: 27 Jan 2011, 18:23:18 »
Hi OFP_f3d3

I always i've wanted to make a mission type "Halo" with teleport and weapons in ground ,

-Team battles
-Capture the Flag
-slayer
My OFP stuff
FMF Project by Aldo15. Coming soon.
If in the high school or university, Teachers add a new subject about how to make scripts, missions, for ofp. I'd be number one of my classroom

Offline savedbygrace

  • Intel Depot
  • Administrator
  • *****
  • Be swift to hear...slow to speak...slow to wrath.
Re: Multiplayer missions
« Reply #2 on: 27 Jan 2011, 20:36:14 »
The thing about MP missions is that we have no way of testing them here at OFPEC. We have no server. The most important thing about MP missions is making sure certains scripts only run on the server. My advice...if you have no way of testing the mission, don't make it.

Offline OFP_f3d3

  • Former Staff
  • ****
  • Fraud is the ready minister of injustice.
Re: Multiplayer missions
« Reply #3 on: 27 Jan 2011, 20:39:29 »
I have a way of creating a server to play it with a friend and test everything
Nothing in the world is as certain as death.

Offline savedbygrace

  • Intel Depot
  • Administrator
  • *****
  • Be swift to hear...slow to speak...slow to wrath.
Re: Multiplayer missions
« Reply #4 on: 28 Jan 2011, 10:13:16 »
By all means create mp missions. BUT know that when you test a mission with fewer player numbers, it does not respond the same as when you play it with higher player numbers.

Offline j0e

  • Members
  • *
    • j0e's home
Re: Multiplayer missions
« Reply #5 on: 07 Apr 2011, 11:39:24 »
[1] Dedicated Server;
[2] People acting like real soldiers (team-speak and so on);
[3] I was inspirated and created a revive script that should keep a mininum
cooperation requirement and remove the frustration of being excluded
from the mission progress when killed;
[4] I'm testing my own full replacement of "PublicVariable", it's a really
light version of CoC_NS (thanks guys!) and at now it 100% worked;

Offline haroon1992

  • Members
  • *
  • My life is hopeless...
Re: Multiplayer missions
« Reply #6 on: 07 Apr 2011, 13:30:13 »
I am always interested in making COOP missions which are great fun!

Imagine sneaking up a base and blowing stuffs up. (well, I'm referring to my operation spark mission. :D )

@SavedByGrace

Is there no way of testing MP without a server? (I mean dedi-server)
Why can't you just host the game and let the other join it?

And I test MP missions with a single computer, where two ofps are running.
It is always best to test something in a simple,testing environment, then porting it to the actual mission for final verification.
But complex things or mission specific things are a different story. You'll screw things up if you test them in another mission.
( I used my desert island test.intro mission to test most of the simple things.)

Additionally, as this topic is concerned with mp missions, I have some questions to ask :

QUESTIONS :

- what type of variable can PublicVariable transmit?
(So far I know it can transmit : boolean, and numbers, NOT strings)

- And how can i transmit strings from the server to clients?
I mean like this :

init.sqs
Code: [Select]
global_Var = ""Server_Script.sqs ( only run on server)
Code: [Select]
global_Var = " hint "" I am da server, I'm da boss!"" "
publicvariable "global_Var"
exit

Client_Poll.sqs (running on all client)
Code: [Select]
global_Var = ""
#Poll
@ global_Var != ""
call global_Var
global_Var = ""
goto "Poll"
This will NOT work in OFP since it cannot transmit "Strings" with publicVariable command.

- How do I make Intro/Outro appear in MP missions ?

Regards,
Haroon1992

Very busy with life, business, and other stuff. Away from OFP for months. Not sure if I could get back onto it. :(

Offline j0e

  • Members
  • *
    • j0e's home
Re: Multiplayer missions
« Reply #7 on: 07 Apr 2011, 17:20:04 »
@haroon1992

Quote
>Is there no way of testing MP without a server?

I do the following:

1) Host the mission and verify with 1 or more clients how the AI behaves,
if a trigger fires and so on;

This step is necessary for me to catch syntax errors in scripts, since
if you host in dedicated-server mode, the server doesn't show them at all.
It might do so, if you use such a kind of debug-addon but, honestly,
I don't need it for now.

2) Host the mission in dedicated-server mode;

You can connect to yourself and play as client on the same machine.
In this situation, you will finally see how AI really behaves in MP,
if the sync with the triggers works and other nice aspect of the game
you maybe ignore when playing the mission as server (HS).

Example: in DS, AI weren't able to do a fast-insertion (land, unload and fly away)
and often killed itself to a tree, instead no problem in HS.
I had to modify the waypoints.

Quote
>Why can't you just host the game and let the other join it?

Not a problem, if you think to never public the mission on a dedicated-server.

Quote
>And I test MP missions with a single computer, where two ofps are running.

Tried and found this way not easy to manage.

Quote
>I used my desert island test.intro mission to test most of the simple things.

I do the same for specific situations, like understanding better a function,
a trigger event and so on.

Quote
>what type of variable can PublicVariable transmit?

My opinion? Poor implementation and reliability.
You can transmit, for sure, numbers but don't expect other.
I modified a CTI mission and followed all recommendations regarding this "function",
but I was never satisfied with it.
So, inspired by the CoC_NS workaround, I created my own script to communicate
all the stuff you like. It's really light and till now I'm happy about that.

If somebody would like to test, use or simply understand it.. I'm here.

Offline haroon1992

  • Members
  • *
  • My life is hopeless...
Re: Multiplayer missions
« Reply #8 on: 08 Apr 2011, 08:02:43 »
Code: [Select]
I created my own script to communicate
Yes please, can you give me that ? ;)



Regards,
Haroon1992
Very busy with life, business, and other stuff. Away from OFP for months. Not sure if I could get back onto it. :(

Offline j0e

  • Members
  • *
    • j0e's home
Re: Multiplayer missions
« Reply #9 on: 08 Apr 2011, 09:21:55 »

Offline haroon1992

  • Members
  • *
  • My life is hopeless...
Re: Multiplayer missions
« Reply #10 on: 09 Apr 2011, 16:51:24 »
Thanks I'll take a look at it in the mission editor when I get home.

I've downloaded it and took at look at it, and found the explanation too sloppy.
You should provide some clear explanation if you intend to let others use your script.
(Sorry if you've kept this only for yourself)

Anyway, I'll try to figure out what the script really does and what all those variables do.

Wow! What's that ?

call _x == player ?
Is this the substitute for :

format ["%1",_x] == format ["%1",player]  which I've been using to compare two strings ?
If you, thanks a million!

I'll try to test it out!


Regards,
Haroon1992
Very busy with life, business, and other stuff. Away from OFP for months. Not sure if I could get back onto it. :(

Offline j0e

  • Members
  • *
    • j0e's home
Re: Multiplayer missions
« Reply #11 on: 11 Apr 2011, 09:39:38 »
Quote
(Sorry if you've kept this only for yourself)

I made it to be used on the missions I'll host
on my server, since I found the CoC_NS.pbo's solution
too complex and out of my control.

But I'm happy to share and just started doing here.

Yes, time to develop but not enough to explain.. uha!

I'll try to change, I promise.

Quote
call _x == player ?
Is this the substitute for:

Yes, it is, but _x must be already a string and
contain the ref to a unit.

Ultimately I'm writing lot of code and cannot stop
tring and optimizing it.. uha again!

Offline j0e

  • Members
  • *
    • j0e's home
Re: Multiplayer missions
« Reply #12 on: 18 Apr 2011, 12:20:04 »
Mini HowTo of j0e_net

Environment
The scripts are designed to work in multiplayer only.
I'm using them in OFP Resistance 1.96.
Tested in both hosted and dedicated way.

What
They completely replace the PublicVariable function.

DependenciesSyntax
[[_to],_ms] Exec "j0e_netsend.sqs"

[_to]  array of strings; each element should match the
     j0e_whoami of other machines;
     if an empty array (=[]), all machines except the
     sender will exec the command;
     if equal to ["<ALLME">], also the sender will
     exec the command;
     if contains the string "<DS>" then the machine
     hosting the mission (=server) will exec the cmd too.

_ms  string; must contain a valid command to be executed
     through the Call _ms.

StepsDeep Inside
When a machine, most of the time the server, execs the
j0e_netsend function, all machines will receive the message
but only those in the [_to] will really consider it.

The message (_ms) must be a valid command you use normally
in the scripts, but simply quoted and managed like a string:

Hint "Hello!" -> _ms={Hint "Hello!"}
var=value     -> _ms="var=value"

j0e_server GlobalChat Format ["%1 has %2 lifes left",Name Call j0e_whoami,lifes] ->
_ms=Format [{j0e_server GlobalChat "%1 has %2 lifes left"},Name Call j0e_whoami,lifes]

These commands have the same effects as if they are written in a script.
So, from above, the contacted machines will show a hint, change the
value of the variable and read a chat with no-speaker (note that j0e_whoami and lifes
are replaced by the sender-values before the messagge is sent).

Examples