Loading...
  OR  Zero-K Name:    Password:   

Post edit history

Help Wanted: Zero K Offline LAN Server

To display differences between versions, select one or more edits in the list using checkboxes and click "diff selected"
Post edit history
Date Editor Before After
11/25/2022 3:45:30 AMUSrankuser101 before revert after revert
11/25/2022 1:50:05 AMUSrankuser101 before revert after revert
11/25/2022 1:28:34 AMUSrankuser101 before revert after revert
Before After
1 Thanks to GoogleFrog for the advice about using a script. Following that lead I was able to host a few offline LAN games using a single Ethernet cable directly connecting two PCs. These games ran perfectly fine. All UI appeared and worked properly and there was no desync. The downside is that this approach is time consuming and easily botched. The Client only needs to use a simple script. txt ( a slightly modified copy of the Hosts) , but the Host needs to configure everything inside the script ( AllyTeams, Teams, Players, ModOptions, AI, Chicken, IP of Interface, Port, etc. ) . 1 Thanks for the replies!
2 \n
3 Thanks to GoogleFrog for the advice about using a script. Following that lead I was able to host a few offline LAN games using a single Ethernet cable directly connecting two PCs. These games ran perfectly fine. All UI appeared and worked properly and there was no desync. The Client only needs to use a simple script.txt (a slightly modified copy of the Hosts), but the Host needs to configure everything inside the script (AllyTeams, Teams, Players, ModOptions, AI, Chicken, IP of Interface, Port, etc.).
2 \n 4 \n
3 \n 5 \n
4 Here is how my LAN experience can be reproduced: 6 Here is how my LAN experience can be reproduced:
5 \n 7 \n
6 Considerations:
7 - My firewall is turned off, but if yours is turned on you might need to allow inbound connections on the Port selected for the battle Server.
8 \n
9 Requirements: 8 Requirements:
10 - A functional LAN. In my case PC1 as 10.30.0.1 and PC2 as 10.30.0.2 with an ethernet cable connecting them. 9 - A functional LAN. In my case PC1 as 10.30.0.1 and PC2 as 10.30.0.2 with an ethernet cable connecting them.
11 - A copy of Zero-K Portable .zip (to avoid damaging your Steam installation) 10 - A copy of Zero-K Portable .zip (to avoid damaging your Steam installation)
11 - My firewall is turned off, but if yours is turned on you might need to allow inbound connections on the Port selected for the battle Server.
12 \n 12 \n
13 Steps: 13 Steps:
14 - Download Zero-K portable from itch.io (https://zerok.itch.io/zero-k). 14 - Download Zero-K portable from itch.io (https://zerok.itch.io/zero-k).
15 - Unzip into a folder. 15 - Unzip into a folder.
16 - In zero-k-portable\engine\win64 will be several Spring engine versions. Open the newest one, copy all files, paste into Zero-K portable folder. When prompted, do NOT replace any files already in the Zero-K folder. 16 - In zero-k-portable\engine\win64 will be several Spring engine versions. Open the newest one, copy all files, paste into Zero-K portable folder. When prompted, do NOT replace any files already in the Zero-K folder.
17 - Open "springsettings.cfg" in Notepad. Find the line "Fullscreen=0" and replace the 0 with a 1 or else the window will not be aligned properly. 17 - Open "springsettings.cfg" in Notepad. Find the line "Fullscreen=0" and replace the 0 with a 1 or else the window will not be aligned properly.
18 - Create a new blank file called "script.txt" in the Zero-K folder. 18 - Create a new blank file called "script.txt" in the Zero-K folder.
19 - Client and Host place different contents in "script.txt" 19 - Client and Host place different contents in "script.txt"
20 \n 20 \n
21 \n 21 \n
22 The Hosts IP Address should be the IP Address of the interface which will be used for the connection. 22 The Hosts IP Address should be the IP Address of the interface which will be used for the connection.
23 The Port can be anything in the range 1024-49000 ( to avoid errors) and must be the same for both users. 23 The Port should be anything in the range 1024-49000 ( to avoid errors) and must be the same for both users.
24 \n 24 \n
25 Hosts "script.txt" file: 25 Hosts "script.txt" file:
26 [game] 26 [game]
27 { 27 {
28 [allyteam1] 28 [allyteam1]
29 { 29 {
30 numallies=0; 30 numallies=0;
31 } 31 }
32 [team1] 32 [team1]
33 { 33 {
34 teamleader=0; 34 teamleader=0;
35 rgbcolor=0.99609375 0.546875 0; 35 rgbcolor=0.99609375 0.546875 0;
36 allyteam=1; 36 allyteam=1;
37 } 37 }
38 [modoptions] 38 [modoptions]
39 { 39 {
40 } 40 }
41 [allyteam0] 41 [allyteam0]
42 { 42 {
43 numallies=0; 43 numallies=0;
44 } 44 }
45 [team0] 45 [team0]
46 { 46 {
47 teamleader=0; 47 teamleader=0;
48 rgbcolor=0.99609375 0.546875 0; 48 rgbcolor=0.99609375 0.546875 0;
49 allyteam=0; 49 allyteam=0;
50 } 50 }
51 [player0] 51 [player0]
52 { 52 {
53 name=Bob; 53 name=Bob;
54 rank=0; 54 rank=0;
55 isfromdemo=0; 55 isfromdemo=0;
56 team=0; 56 team=0;
57 } 57 }
58 [player2] 58 [player2]
59 { 59 {
60 name=Alice; 60 name=Alice;
61 rank=0; 61 rank=0;
62 isfromdemo=0; 62 isfromdemo=0;
63 team=1; 63 team=1;
64 } 64 }
65 numplayers=1; 65 numplayers=1;
66 gamestartdelay=0; 66 gamestartdelay=0;
67 myplayername=Bob; 67 myplayername=Bob;
68 gametype=zk; 68 gametype=zk;
69 ishost=1; 69 ishost=1;
70 hostip=10.30.0.1; 70 hostip=10.30.0.1;
71 mapname=TitanDuel 2.2; 71 mapname=TitanDuel 2.2;
72 startpostype=2; 72 startpostype=2;
73 hostport=8000; 73 hostport=8000;
74 numusers=2; 74 numusers=2;
75 nohelperais=0; 75 nohelperais=0;
76 } 76 }
77 \n 77 \n
78 \n 78 \n
79 \n 79 \n
80 The clients file should all be the same except for changing "isHost=1" to "isHost=0", and changing the "myplayername" to whatever name the Host already wrote for you, in this case "Alice". 80 The clients file should all be the same except for changing "isHost=1" to "isHost=0", and changing the "myplayername" to whatever name the Host already wrote for you, in this case "Alice".
81 \n 81 \n
82 Clients "scripts.txt" file: 82 Clients "scripts.txt" file:
83 [game] 83 [game]
84 { 84 {
85 [allyteam1] 85 [allyteam1]
86 { 86 {
87 numallies=0; 87 numallies=0;
88 } 88 }
89 [team1] 89 [team1]
90 { 90 {
91 teamleader=0; 91 teamleader=0;
92 rgbcolor=0.99609375 0.546875 0; 92 rgbcolor=0.99609375 0.546875 0;
93 allyteam=1; 93 allyteam=1;
94 } 94 }
95 [modoptions] 95 [modoptions]
96 { 96 {
97 } 97 }
98 [allyteam0] 98 [allyteam0]
99 { 99 {
100 numallies=0; 100 numallies=0;
101 } 101 }
102 [team0] 102 [team0]
103 { 103 {
104 teamleader=0; 104 teamleader=0;
105 rgbcolor=0.99609375 0.546875 0; 105 rgbcolor=0.99609375 0.546875 0;
106 allyteam=0; 106 allyteam=0;
107 } 107 }
108 [player0] 108 [player0]
109 { 109 {
110 name=Bob; 110 name=Bob;
111 rank=0; 111 rank=0;
112 isfromdemo=0; 112 isfromdemo=0;
113 team=0; 113 team=0;
114 } 114 }
115 [player2] 115 [player2]
116 { 116 {
117 name=Alice; 117 name=Alice;
118 rank=0; 118 rank=0;
119 isfromdemo=0; 119 isfromdemo=0;
120 team=1; 120 team=1;
121 } 121 }
122 numplayers=1; 122 numplayers=1;
123 gamestartdelay=0; 123 gamestartdelay=0;
124 myplayername=Alice; 124 myplayername=Alice;
125 gametype=zk; 125 gametype=zk;
126 ishost=0; 126 ishost=0;
127 hostip=10.30.0.1; 127 hostip=10.30.0.1;
128 mapname=TitanDuel 2.2; 128 mapname=TitanDuel 2.2;
129 startpostype=2; 129 startpostype=2;
130 hostport=8000; 130 hostport=8000;
131 numusers=2; 131 numusers=2;
132 nohelperais=0; 132 nohelperais=0;
133 } 133 }
134 \n 134 \n
135 \n 135 \n
136 Once both users have the same Zero-K game folder ( with the only differences being in the script. txt files) , both players click and drag "script. txt" onto "spring. exe" ( which are now in the same folder) at around the same time, it doesnt need to be exact. 136 Once both users have the same Zero-K game folder ( with the only differences being in the script. txt files) , both players click and drag "script. txt" onto "spring. exe" ( which are now in the same folder) . The Host should do this right before the Clients, who will otherwise timeout in 10 seconds.
137 \n 137 \n
138 Zero-K should now open with both players connected to the same battle. 138 Zero-K should now open with both players connected to the same battle.
139 \n 139 \n
140 Problems: 140 Only problem I noticed was that all units in-game have "Player: Bob" in their description for some reason, but both users still play on entirely separate teams ( if configured to by the Host) so its not a big deal.
141 - All units in-game have "Player: Bob" in their description for some reason, but both users still play on entirely separate teams (if configured to by the Host) so its not a big deal.
142 - This setup is the opposite of user friendly.
143 \n 141 \n
144 You might be right that the simplest solution would be to create some kind of Java application ( . jar) for Hosting games and configuring battles, which then generates a valid script. txt for spring. exe to host the Zero-K battle. Then also a Java application for Clients could be made, which would need only a username, IP, and port. 142 You might be right that the best solution to make this more user friendly would be to create some kind of application ( maybe a . jar) for Hosting games and configuring battles, which then generates a valid script. txt for spring. exe to host the Zero-K battle. Then the Clients would need only a username, IP, and port.
145 \n 143 \n
146 I might try my hand at making these applications ( or combine into a single application) . 144 I might try my hand at making such an applications in time.
147 \n
148 Or maybe i can implement the same idea inside Chobby by editing its source code.
149 \n 145 \n
150 My ideal solution would involve the continued use of Chobby, since its serves as an excellent user interface for configuring multiplayer battles. In Chobby selecting maps, teams, spectators, AIs, and Chickens is really easy. Opening spring. exe with a script similar to "_script. txt" works but its excessively difficult and error prone. 146 My ideal solution would be to run a local instance of whatever lobby server software is being used for Zero-K's public lobbies, and redirect Chobby to that. In that case selecting maps, teams, spectators, AIs, and Chickens would be really easy, but maybe that will remain a fantasy.
151 \n
152 If possible id love to run a local instance of whatever lobby server software is being used for Zero-K's public lobbies, and redirect Chobby to that.
153 \n 147 \n
154 I'll keep messing around with the Zero-K Infrastructure to see what I can do with it. I'll post again if I figure out more. 148 I'll keep messing around with the Zero-K Infrastructure to see what I can do with it. I'll post again if I figure out more.