TCP not working
Posted: Sat Jan 30, 2021 4:27 pm
I am trying to create a TCP client/server setup with pybullet.
I have tried:
server side --
physicsClientId = p.connect(p.DIRECT) # I have also tried p.SHARED_MEMORY_SERVER
client side (testing on the same machine) --
physicsClientId = p.connect(p.TCP, hostName='localhost', port=6667)
but I get the error message:
b3ConnectPhysicsTCP connection failed.
I have scoured the internet, but I haven't found any examples of a working TCP client/server setup in pybullet. Does anyone know how to fix this?
The purpose for this is to create a multiplayer game. I want the main physics client on the server to perform all of the calculations, while the TCP connections are used to send control inputs and receive state updates. Then, each of the clients can render an image using their local client.
If I can't get TCP to work, then I would like to find an alternative. I have looked into saving/loading the system state so I could manually send the updated state to the clients, load the state, and render an image. Unfortunately, it looks like you can only write to a file (which is quite slow) or to some hidden memory which pybullet doesn't provide access to. Of course, one solution would be to render all of the clients images on the server, but ideally I would like to avoid that because it isn't scalable and sending images over the internet is slow. Does anyone have a solution?
I have tried:
server side --
physicsClientId = p.connect(p.DIRECT) # I have also tried p.SHARED_MEMORY_SERVER
client side (testing on the same machine) --
physicsClientId = p.connect(p.TCP, hostName='localhost', port=6667)
but I get the error message:
b3ConnectPhysicsTCP connection failed.
I have scoured the internet, but I haven't found any examples of a working TCP client/server setup in pybullet. Does anyone know how to fix this?
The purpose for this is to create a multiplayer game. I want the main physics client on the server to perform all of the calculations, while the TCP connections are used to send control inputs and receive state updates. Then, each of the clients can render an image using their local client.
If I can't get TCP to work, then I would like to find an alternative. I have looked into saving/loading the system state so I could manually send the updated state to the clients, load the state, and render an image. Unfortunately, it looks like you can only write to a file (which is quite slow) or to some hidden memory which pybullet doesn't provide access to. Of course, one solution would be to render all of the clients images on the server, but ideally I would like to avoid that because it isn't scalable and sending images over the internet is slow. Does anyone have a solution?