-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|514|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
SoCoder -> Link Home -> Help/Tutorials


 
HoboBen
Created : 04 June 2010
 

Network programming in Age of Empires [PDF]



https://zoo.cs.yale.edu/classes/cs538/readings/papers/terrano_1500arch.pdf
Network programming in Age of Empires [PDF]

 

Comments


Friday, 04 June 2010, 14:55
Jayenkai
Blimey, that's a lot to read through! Maybe later...

On a related note, if I'd have written that, it'd have been as two short comments inside the highly mangled code!
Saturday, 05 June 2010, 08:44
Mog
Just poured through this and wow! You can really learn a lot from people who made such great games as this. Think i'm going to take their advice about metering and work that into my network code.
Saturday, 05 June 2010, 20:44
Erebel55
Wow awesome linky Thanks.
Saturday, 05 June 2010, 21:46
Tikihead
Can anyone tell me if there's a way to connect with another computer without them having to open ports on their firewall? For example, A_I_M or p_e_e_r_-_t_o_-_p_e_e_r programs?
Saturday, 05 June 2010, 23:17
JL235
The need to open ports is down to the statefull packet filter in your router. All incomming packets are blocked, even those on port 80 (for HTTP). But when you send a message out on a port (like on port 80 for requesting a website) the port is temporarily unblocked for your PC. This allows responses to come back from the webserver.

When hosting a game you aren't initially sending packets out, instead you sit there waiting for players outside of your network to contact you. So the port needs to be open because people outside are initiating the communication.

To summarise, to get around this the PC on the inside of the network must always initiate communication.
Saturday, 05 June 2010, 23:39
Tikihead
Thanks jl, that filled in the gaps in my understanding of ports.
Sunday, 06 June 2010, 16:54
JL235
Note that this behaviour is down to your router and not the behaviour of ports in general. It's there for security to prevent outsiders sending messages to your PC without you warrenting it.
Thursday, 10 June 2010, 07:07
Afr0
Tiki:

I haven't programmed for quite a long time... so my memory might be failing me, but I believe you don't have to open any ports when 'connecting' with UDP. Simply because it's a connectionless protocol.
Thursday, 10 June 2010, 08:23
Tikihead
This is going to sound very ignorant, but don't you have to establish a stream with the other computer? It's my understanding that the first person has to set up a port forward on their router, gives their router's ip to a database, and the second person retrieves this ip from the database and connects to it.
Thursday, 10 June 2010, 10:36
JL235
@Tiki, no you don't setup a stream with UDP. Afr0 is right that it's connection-less.

However I'm pretty certain the same still applies in regards to your routers firewall. It will not allow TCP or UDP packets to come in to the network unless you have first sent corresponding TCP or UDP packets out on that port.

The point of a stateful packet filter is that it can act based on past behaviour (it stores 'state' about what is occuring). Hence why although the UDP packets are each indevidual, the firewall can work out if future UDP packets were related to previous ones and so open ports accordingly.
Thursday, 10 June 2010, 11:52
Tikihead
Oh, gotcha - looking back at the BlitzDocs and reading more carefully, I see that it isn't a stream between the two computers. Thanks again Afr0 and jl.