Hi,
I am working on a game as part my studies and have to link to scientific libraries which are written in python. See message http://forum.unity3d.com/viewtopic.php?t=33837.
I like to know how can I connect my game (unity front end) to a back end which is in python.
Somebody suggested UDP, but not clear how I can create UDP packets (TCP is even better) in the client and send it across.
Has anybody done this?
Does anybody know how this is supported in unity and where I can find some docs?
Do you know python?
Are you running the simulation on Windows or the Mac?
Yes, I know python.
My client is running in a browser, but my server is windows, although I like to run it on a linux server like ubuntu.
Google up iron python, as far as I know, the version of mono that unity is using works with iron python, so you should be able to use it, built in tcp/ip networking commands with unity and be able to use the script. Without knowing or getting ahold of the python files and documentation, can’t do to much more to help.
Unity has no DLR integrated, as such you can’t use IronPython / IronRuby
But you also don’t need it as server and client are distinct.
On the Unity end you would use the System.Net namespace and the corresponding socket for the networking protocol of your choice.
On the other end, python would handle it all for the server.
Thanks guys. I am now working on a simple udp client using the System.Net library. As UDP by its nature is unreliable, I am also looking to find out how to make it reliable.
tomcat
Check out Enet / lidgren
both come with sources and show you ways to recreate reliability with UDP.
Generally the idea is just using the same ack - nack messaging as TCP does internally on its own.
Thanks. Thats where I am looking now.
tomcat