Do all the scripts run only on host machine in mp games?

For AI and campaign script related discussions and questions
Post Reply
User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Do all the scripts run only on host machine in mp games?

Post 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?
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
User avatar
Shadow Wolf TJC
Regular
Regular
Posts: 1047
Joined: 16 Apr 2011, 05:12
Location: Raleigh, NC

Re: Do all the scripts run only on host machine in mp games?

Post 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.
Creator of Warzone 2100: Contingency!
Founder of Wikizone 2100: http://wikizone2100.wikia.com/wiki/Wikizone_2100
User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Re: Do all the scripts run only on host machine in mp games?

Post 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?
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: Do all the scripts run only on host machine in mp games?

Post 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.
User avatar
Shadow Wolf TJC
Regular
Regular
Posts: 1047
Joined: 16 Apr 2011, 05:12
Location: Raleigh, NC

Re: Do all the scripts run only on host machine in mp games?

Post 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?
Creator of Warzone 2100: Contingency!
Founder of Wikizone 2100: http://wikizone2100.wikia.com/wiki/Wikizone_2100
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: Do all the scripts run only on host machine in mp games?

Post 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.
Post Reply