Home   Help Search Login Register  

Author Topic: Dedicated and Hosted server, PLEASE RESPOND EVEN IF YOU DON'T KNOW  (Read 3085 times)

0 Members and 1 Guest are viewing this topic.

Offline laggy

  • Members
  • *
  • "Behold a pale horse"
Hello all again,

I have a serious question that I have touched on several times in other posts.
The problem is that I have NEVER got an answer, from anyone knowledgable.

When it comes to multiplayer scripting and even just editing (i.e editor waypoints) I have found that certain things simply work differently on a hosted server compared to a dedicated server EVEN WHEN THEY SHOULD NOT.

My question is if there is an explanation for this, or if this is an issue that non of you scripting masters know, simply because it is hidden in the game engine and might even be concidered a BUG.

To best illustrate my question I have this helicopter script as an example:

Insertion.sqs

Code: [Select]
_helo = _this select 0;
_targetpos = _this select 1
_homepos = _this select 2
_group = group _helo

_wp = _group addWaypoint [_targetpos, 0];
[_group, 1] setWaypointStatements ["true", "(vehicle this) flyinHeight 0;(vehicle this) land ""LAND"""];
[_group, 1] setWaypointTimeout [0, 0, 0];
[_group, 1] showWaypoint "NEVER";
[_group, 1] setWaypointSpeed "NORMAL";
[_group, 1] setWaypointType "MOVE";

_wp = _group addWaypoint [_targetpos, 0];
[_group, 2] setWaypointStatements ["count crew (vehicle this) == 1", "driver (vehicle this) say ""hell""; (vehicle this) flyinHeight 100"];
[_group, 2] setWaypointTimeout [0, 0, 0];
[_group, 2] showWaypoint "NEVER";
[_group, 2] setWaypointSpeed "NORMAL";
[_group, 2] setWaypointType "MOVE";

_wp = _group addWaypoint [_homepos, 0];
[_group, 3] setWaypointStatements ["true", "deleteVehicle driver (vehicle this); deleteVehicle (vehicle this)"];
[_group, 3] setWaypointTimeout [0, 0, 0];
[_group, 3] showWaypoint "NEVER";
[_group, 3] setWaypointSpeed "FULL";
[_group, 3] setWaypointType "MOVE";

exit


The script is run on ALL computers AND the "_helo" is not local to any player, since it is a PURE AI group that the players group get a ride from. When the ride is over, the waypoint checks for CREW == 1 and should then leave.

This script works as intended on a dedi, but when on a hosted server the chopper won't  move to "_homepos" as indicated in the last waypoint, it just stays on the ground at "_targetpos". This happens at least when the leader of players group is NOT server.

Locality (which is a common MP issue) shouldn't be the problem, since it works on a dedi.

Does anyone on OFPEC have an idea of what's causing this problem, or is it an issue that only BIS could answer?

Sincerely

Laggy
« Last Edit: 08 Apr 2009, 22:05:24 by laggy »
And I looked and beheld a pale horse and his name that sat on him was Death and Hell followed with him.

Offline JamesF1

  • Editors Depot Staff
  • *****
    • JamesBurgess.co.uk
I'll take a look at this (if I remember) when I'm not about to fall asleep... but I've experienced similar problems time and time again with differences between dedicated and 'player-hosted' servers.

In fact, I made a topic about a problem here - though I never did investigate as to why there was different behaviour... Mando's answer seemed reasonable enough!

Offline Worldeater

  • Former Staff
  • ****
  • Suum cuique
The script is run on ALL computers AND the "_helo" is not local to any player...
...
This script works as intended on a dedi, but when on a hosted server...

Not quite right. AFAIK "_helo" is local to the player who hosts the game.


<nitpicking>
_wp = _group addWaypoint...
[_group, 1] setWaypointStatements...
[_group, 1] setWaypointTimeout...
[_group, 1] showWaypoint...
[_group, 1] setWaypointSpeed...
[_group, 1] setWaypointType...

Bad! addWaypoint doesn't return the waypoint array just for fun. Better:

Code: [Select]
_wp = _group addWaypoint...
_wp setWaypointTimeout...
_wp showWaypoint...
_wp setWaypointSpeed...
_wp setWaypointType...
</nitpicking>
try { return true; } finally { return false; }

Offline laggy

  • Members
  • *
  • "Behold a pale horse"
@ JamesF1

I see, but in my case that problem shouldn't be present, since my script runs at least one minute into the mission gameplay itself.

Quote
Not quite right. AFAIK "_helo" is local to the player who hosts the game.

Yes of course, but what I was trying to say is that the "lack" of locality should not matter in this case, since it works on dedi  :whistle: AND the script is run on ALL computers.

Maybe the question is if a group leader player (only client) in the chopper might interfere with the locality somehow even just as cargo, meaning a BUG :scratch:

I'll try and see if running the script only on the server will make a difference.
Keep it coming please.

Laggy
« Last Edit: 09 Apr 2009, 21:23:30 by laggy »
And I looked and beheld a pale horse and his name that sat on him was Death and Hell followed with him.

Offline Worldeater

  • Former Staff
  • ****
  • Suum cuique
Uhm, wait a minute... you are running this script on all computers? You know that the effect of addWaypoint is global?
try { return true; } finally { return false; }

Offline laggy

  • Members
  • *
  • "Behold a pale horse"
I wasn't sure, so therefore I executed on all computers.

Are you saying that I'm in this case creating a new set of waypoints for every player and those multiples are probably creating the problem?

Thanks again,

Laggy
And I looked and beheld a pale horse and his name that sat on him was Death and Hell followed with him.

Offline Worldeater

  • Former Staff
  • ****
  • Suum cuique
Uhm, no. I indicate that you create more waypoints for "_helo" than you thought you would.

This (in combination with magic numbers, see <nitpicking>) could be the cause of the problem.
try { return true; } finally { return false; }

Offline laggy

  • Members
  • *
  • "Behold a pale horse"
Much obliged again Worldeater,

Not that it really matters, but just out of curiosity.

The "count crew (vehicle this) == 1" condition would then in my case be in several waypoints (number equal to (players + server) number) placed on the same spot "_targetpos" and ALL of those "paralell" waypoints would have to have their conditions met before the chopper would continue to "_homepos"?

Or am I jumping into conclusions?

 :dunno:

And I looked and beheld a pale horse and his name that sat on him was Death and Hell followed with him.

Offline Worldeater

  • Former Staff
  • ****
  • Suum cuique
Uhm, no. :)

Since you have hardcoded the indices only the first three waypoints have "conditions". The rest is just "empty".
try { return true; } finally { return false; }

Offline Rommel92

  • Members
  • *
I have no idea as to why that may be happening. Checkout what Worldeater was saying, that sounds like a decent problem there; maybe on the Dedicated it wasn't running on all PC's ...  :dunno:

Offline laggy

  • Members
  • *
  • "Behold a pale horse"
Following Worldeaters advice seems to do the trick.
I guess the problem didn't occur on the dedi because I was only one player testing the mission.
That way not many "additional" waypoints were created, by mistake.
If more players would have joined my dedi the problem would most likely have happened there as well.

So for anyone reading this and wondering... addWaypoint IS global according to WIKI and only needs to be executed on one computer.

Thanks all.

Laggy
And I looked and beheld a pale horse and his name that sat on him was Death and Hell followed with him.