You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -189,11 +215,70 @@ As seen in the figure, the proxy handles connecting to the server, receiving sen
189
215
190
216
## Other Solutions To Run The Base Code
191
217
192
-
TODO
218
+
### Running the base code with different rpc port
219
+
220
+
In soccer simulation 2D games (official competitions), each agents (players and coach) should be run in a separate process. So, you need to connect each agent to a rpc server (each agent has a separate rpc server). In this case, you need to run the rpc server for each agent separately. You can use the following commands to run the rpc server for each agent for debugging purposes.
221
+
222
+
| Note: For official competitions, tournament script will run each player/coach with separate command, so it will be like the next section, but the result will be the same as this section because the rpc server will be run for each agent separately.
223
+
224
+
```Bash
225
+
python3 start.py --use-different-rpc-port
226
+
// or
227
+
./start.sh --use-different-rpc-port
228
+
```
229
+
230
+
### Running each agent and server separately
231
+
232
+
In soccer simulation 2D games (official competitions), each agents (players and coach) should be run in a separate process. So, you need to connect each agent to a rpc server (each agent has a separate rpc server). You can use the following commands to run each agent and rpc server separately.
233
+
234
+
```Bash
235
+
python3 start.py --goalie
236
+
python3 start.py --player (you need to run this command 11 times)
237
+
python3 start.py --coach
238
+
// or
239
+
./start.sh --goalie
240
+
./start.sh --player (you need to run this command 11 times)
241
+
./start.sh --coach
242
+
```
243
+
244
+
### Running the rpc server and proxy separately
245
+
246
+
To run the rpc server and proxy separately, you can use the following commands.
247
+
248
+
```Bash
249
+
python3 server.py
250
+
cd scripts/proxy
251
+
./start.sh --rpc-type=grpc
252
+
```
193
253
194
254
## Create Binary
195
255
196
-
TODO
256
+
As you know python is an interpreted language and it is slow in comparison to C++. In official tournaments, an agent should send actions to the server in less than 100ms. Also, python may not be installed on the tournament server. So, you need to create a binary from your python code. You can use the following commands to create a binary from your python code.
257
+
258
+
```Bash
259
+
cd scripts
260
+
./create_binary.sh
261
+
```
262
+
263
+
After creating the binary, you can find it in the `scripts/binary` directory. In this directory, you can find the following files and directories:
264
+
265
+
-`start.bin`: The binary file that behaves like the `start.py` script. So, by running this file, you can run one rpc server and 12 proxy agents (11 players and 1 coach).
266
+
-`start`: The tournament script will run this file to run your team in the tournament. This file will run one agent and one rpc server on random port.
267
+
-`startAll`: This script is available for testing purposes. By running this file, it will call the `start` file 12 times to run 12 agents and 12 rpc servers.
268
+
-`scripts`: This directory contains the necessary files to run the proxy.
269
+
-`src`: This directory contains the formations of your team.
270
+
271
+
## How to debug your team
272
+
273
+
There are three different solution for debugging your team:
274
+
275
+
### Logging
276
+
277
+
You can use the logging module to log the information in rpc server code. By default, the logs are stored in the `logs` directory. For example, `agentX_Y.log` is the log file for the agent with unum `X` and `Y` is the unique id of the agent in rpc server (This one is not important for you). `proxy.log` is the log file for the proxy for all agents. `start-team.log` is the log file for the `start.py` script.
278
+
279
+
### Debug Mode
280
+
281
+
If you enable the debug mode, the proxy agents will be run in debug mode, so you can check graphical logs in `soccerwindow2` application. You can use `message Log` or `message DebugClient` to send the debug information to the proxy and then proxy will save them in file or send them directly to the `soccerwindow2` application to show them in the graphical interface. For more information, you can check the [IDL section in the documentation](https://clsframework.github.io/docs/idl/protobuf).
0 commit comments