- Home /
Send Data from one Unity Build, to another Unity Build
Hello,
I need to basically send some data from one Unity build (or editor) to another Unity build (or editor) on a completely different machine (all connected via LAN though).
The most obvious way would be to use Unity's network API and have a Server to Client communication going on. However, the data I'm sending is around 0.4Mb (434,176 Bytes), which is fine, although this needs to be sent every Update (Frame)!
Is there a better way to achieve this? Or is there something external from Unity that will do a better job?
If I do go down the road of using Unity's Network API, then would it just be a case of using RPC? Like this , for example:
ushort[] _DataStream;
//On client
void Update(){
//Send to Server
this.RPC("NetworkUpdate", RPCMode.Server, _DataStream);
}
//On Server
[RPC]
void NetworkUpdate(ushort[] _ExternalDataStream) {
//do something with the stream
}
I just want to confirm before I start diving into the development process of it. Any advise would be appreciated.
Or is 0.4Mb per Frame just unrealistic? With an average FPS of ~300, thats 120Mbs per second!!
Thanks.
That's an insane amount of data to send per frame. Is this a game, or are you trying to do some sort of scientific simulation?
I suppose one can call it a scientific simulation, yeah. I know, hence my question :/
Very unrealistic Bandwidth requirement there.
You would most certainly have to send only updates ins$$anonymous$$d of the whole data table.
If you really do want to attempt this you may have more luck (in my opinion) implementing a high priority custom $$anonymous$$essage
http://docs.unity3d.com/$$anonymous$$anual/UNet$$anonymous$$essages.html
NASA send a big lorry full of Paper printouts for their data because it a lot faster than trying to send many TBs of data across the net. Not that Im suggesting you switch to Pen and Paper as a platform ;)
Okay, I just did a file transfer speed from one computer to another over LAN, and the transfer speed was ~35 $$anonymous$$B/s.
So given that information, that 120$$anonymous$$B/s I need seems unrealistic indeed. So, if I cap the FPS at 60, that gives me 0.4$$anonymous$$b * 60 = 25$$anonymous$$B/s transfer rate needed, which now seems possible, right?
Thanks.
Your answer
Follow this Question
Related Questions
How to receive streaming data over a UDP connection? 1 Answer
How to pass data threw server ? 1 Answer
Read and write data to a webserver or...? 0 Answers
Create Data Connection From External Program? 0 Answers
Sending bulk data via rpc 1 Answer