Networking Questions
by Matt Kelly · in Torque Game Builder · 03/01/2006 (7:21 pm) · 5 replies
I'm hazy in a few areas concerning networking in T2D.
Can anyone clear these up?
1) Does the Checkers Demo use TCP or UDP?
2) Is UDP implemented into T2D yet?
3) What's the difference of "turn-based" networking compared to "real time"? Based on this, could a game such as multiplayer asteroids or tetris be built on turn-based networking?
Thanks!
Matt
Can anyone clear these up?
1) Does the Checkers Demo use TCP or UDP?
2) Is UDP implemented into T2D yet?
3) What's the difference of "turn-based" networking compared to "real time"? Based on this, could a game such as multiplayer asteroids or tetris be built on turn-based networking?
Thanks!
Matt
#2
Kevin
03/02/2006 (2:24 pm)
Is it possible to have real time networking with T2D, now or in the future?Kevin
#4
03/03/2006 (5:18 am)
Whats the difference between commandToServer and TCPObject.send() ?
#5
Whilst you can use TCPObject for in game networking, you would have to rewrite everything that Torque already gives you. If you're going to do that, you may as well just get proper TGE style networking back in and use that instead. And if you can't do that, then you don't have the experience to do it from scratch with TCPObject anyway.
If you want more clarification/information, read any TCP/IP sockets primer/how to. There should be thousands of them easily found by way of google. All TCPObject gives you is a wrapper around the standard socket functions connect(), listen(), send() and recv() (and the associated code to make them work, of course).
To understand the TGE networking, you can read about it on TDN. Most of the meaty info is probably only available to TGE owners, however you can go to www.opentnl.org and read the docs for TNL. Although most of the TNL code is pretty different from TGE now, the core concepts are still the same.
03/03/2006 (8:04 am)
CommandToClient/commandToServer runs on top of TGE's existing (and efficient) netcode to allow easy scriptable RPC. TCPObject is just a cross platform wrapper around standard TCP/IP sockets. Whilst you can use TCPObject for in game networking, you would have to rewrite everything that Torque already gives you. If you're going to do that, you may as well just get proper TGE style networking back in and use that instead. And if you can't do that, then you don't have the experience to do it from scratch with TCPObject anyway.
If you want more clarification/information, read any TCP/IP sockets primer/how to. There should be thousands of them easily found by way of google. All TCPObject gives you is a wrapper around the standard socket functions connect(), listen(), send() and recv() (and the associated code to make them work, of course).
To understand the TGE networking, you can read about it on TDN. Most of the meaty info is probably only available to TGE owners, however you can go to www.opentnl.org and read the docs for TNL. Although most of the TNL code is pretty different from TGE now, the core concepts are still the same.
Torque 3D Owner Tom Bampton
2) Yes, all standard Torque networking uses UDP. The only exception is TCPObject and HTTPObject ... these are not used to implement any in-game networking.
3) Roughly, and not exactly: "Turn based" generally refers to the fact that you dont need to send a lot of data over the network and if its a bit delayed, it doesnt matter since nothing is critical. "Real time" generally means that all objects need real time position updates, and everything is time critical. e.g. when you move an object on the server, it has to move on all the clients too, at the same time, without any lag.
As far as T2D is concerned, "turn based" means "you can use RPC by way of commandToClient/commandToServer" and "real time" means full blown TGE style networking.
If you're sneaky, you could probably do tetris with RPC. Asteroids will more then likely be more trouble then it's worth and you'll end up reimplementing a lot of what you'd have with TGE style networking.
T.