Presentation is loading. Please wait.

Presentation is loading. Please wait.

Networked Graphics Building Networked Virtual Environments and Networked Games Chapter 2: One on one (101)

Similar presentations


Presentation on theme: "Networked Graphics Building Networked Virtual Environments and Networked Games Chapter 2: One on one (101)"— Presentation transcript:

1 Networked Graphics Building Networked Virtual Environments and Networked Games Chapter 2: One on one (101)

2 BOIDS

3 Three Forces Acting on a Boid CohesionAlignmentSeparation

4 PiPi ViVi A P’ i V’ i At time t At time t+  t One Time Step of a Boid

5 Data Model Simulation Renderer 1010100 1111001 0010101 0111101 1001...... Software Client

6 DISTRIBUTED BOIDS: CONCEPTS

7 Data-Push Client B Client A

8 Client B Data-Sharing

9 Client B Client A Data-Coupled

10 DISTRIBUTED BOIDS: IMPLEMENTATION

11 Data Model Simulation NetworkRenderer 1010100 1111001 0010101 0111101 1001...... 1010100 1111001 0010101 0111101 1001...... Software Modem Client Router Software Modem Client

12 Boids Implementation Data model Local Flock Remote Flock Screen (Renderer Output) Network Internet Router Simulation

13 Create socket local port X _socket = DatagramSocket(); Read packet _packet = _socket.read() Write packet to remote address and port _socket.write(_packet) Close _socket Write packet to remote address and port _socket.write(_packet) Read packet _packet = _socket.read() Close _socket Create socket local port X _socket = DatagramSocket(); Create Datagram Packet to receive and send _packet = DatagramPacket(); Create Datagram Packet to receive and send _packet = DatagramPacket();

14 Create socket to listen to requests on local port X _listenSocket = ServerSocket(); Wait for incoming connection requests _connectionSocket = _listenSocket.accept(); Read messages on _connectionSocket Write messages on _connectionSocket Close _connectionSocket Connect to remote address and port _clientSocket = _Socket(); Write messages on _clientSocket Read messages on _clientSocket Close _clientSocket Setup streams _connectionSocket Setup streams _connectionSocket

15 REFLECTION

16 X Client A t X Client B t+t Network Boid i wall clock time

17 X Client A t X wall clock time Client B t+t Network Boid i t+t Network t Boid j Boid i

18 t X wall clock time Client A t X wall clock time Client B t Network Boid j Boid i t Network Boid j Boid i

19 a) At time t b) At time t+t Network c) At time t+2.t Network ClientAClientB ClientAClientB ClientAClientB


Download ppt "Networked Graphics Building Networked Virtual Environments and Networked Games Chapter 2: One on one (101)"

Similar presentations


Ads by Google