Page 1 of 1
Do all the scripts run only on host machine in mp games?
Posted: 28 Nov 2012, 06:48
by aubergine
In an MP game, with multiple human players, do all the scripts (rules.js, scavfact.js, AIs, etc) only run on the host machine or do some of them also run on client machines as well?
Re: Do all the scripts run only on host machine in mp games?
Posted: 28 Nov 2012, 07:05
by Shadow Wolf TJC
I think that rules.js is supposed to run on both the host and client machines. Otherwise, there would be desyncs.
Re: Do all the scripts run only on host machine in mp games?
Posted: 28 Nov 2012, 07:21
by aubergine
That's what I thought, but I'm not 100% sure if that is the case. Specifically, I was wondering if the hackNetOn() and hackNetOff() have something to do with sending out player set-up data (limits, techs, etc) in some sort of special "game initialisation" packet to all players?
Re: Do all the scripts run only on host machine in mp games?
Posted: 28 Nov 2012, 10:02
by Per
Shadow Wolf is right. rules.js runs on all peers, while AIs only run on host. hackNetOn/Off() stops the underlying code from sending out net messages, which would duplicate/undo changes done by rules.js on each peer. As the name indicates, this is a stopgap solution, until a better design solution is found.
Re: Do all the scripts run only on host machine in mp games?
Posted: 28 Nov 2012, 12:03
by Shadow Wolf TJC
And I presume that scavfact.js is run on the host player as well, since it's basically an AI script for Scavengers?
Re: Do all the scripts run only on host machine in mp games?
Posted: 28 Nov 2012, 14:04
by Per
Shadow Wolf TJC wrote:And I presume that scavfact.js is run on the host player as well, since it's basically an AI script for Scavengers?
Correct.