I am creating a game where the engine and graphics are running on Java, and one of the players which is AI controlled, in Python. I need to setup some communication method between these two, with the following conditions:
multi-platform compatible: i am developing on a windows machine, but later i want to run both on Raspibian (RaspberryPi)
low delay (milisecond level): the game is based on Pong, so the AI reaction to the ball position must be as fast as possible
low throughtput: the throughput can be low, since only some numerical values will be passed, such as field dimentions, ball position and players positions (all serializable objects)
full python compatibility: the Python AI program might need to communicate with an AI USB Accelerator like the NVidia Jetson or Google Coral. I haven't worked with these boards yet or their libraries, but i want to be sure that whatever communication solution i choose, also supports the necessary libraries for these boards.
Client-Python/Server-Java synchronization: the game (Java) will run on 30 to 60 FPS, while the AI (Python) speed will heavily depend on the implementation, but its likely to be slower then the game.
Directionality: the game provides the data, and the AI choses the action, therefore communication must be both ways
Easeness of use: the focus of this project is not the communication between languages, therefore i want to make it as transparent and easy to implement as possible.
Given these requirements i found these libraries
Inter Process Communication (IPC) / Pipes:
Socket Communication:
Re-implementation of the language:
I tried to group the libraries according to their working principle. From your experience, and my requirements, what would you say is the library that fits the best?