CSCE 552 Spring 2012 AI (III) & Multiplayer By Jijun Tang.

Slides:



Advertisements
Similar presentations
Part 1: Multiplayer Games Multiplayer Modes. Multiplayer Modes Event Timing Turn-Based Easy to implement Any connection type Real-Time Difficult to implement.
Advertisements

AI Pathfinding Representing the Search Space
Cs/ee 143 Communication Networks Chapter 6 Internetworking Text: Walrand & Parekh, 2010 Steven Low CMS, EE, Caltech.
CCNA – Network Fundamentals
Chapter 7: Transport Layer
Network Certification Preparation. Module - 1 Communication methods OSI reference model and layered communication TCP/IP model TCP and UDP IP addressing.
1 Chapter 3 TCP and IP. Chapter 3 TCP and IP 2 Introduction Transmission Control Protocol (TCP) Transmission Control Protocol (TCP) User Datagram Protocol.
UNIT-IV Computer Network Network Layer. Network Layer Prepared by - ROHIT KOSHTA In the seven-layer OSI model of computer networking, the network layer.
1 Version 3 Module 8 Ethernet Switching. 2 Version 3 Ethernet Switching Ethernet is a shared media –One node can transmit data at a time More nodes increases.
K. Salah 1 Chapter 31 Security in the Internet. K. Salah 2 Figure 31.5 Position of TLS Transport Layer Security (TLS) was designed to provide security.
Department of Computer Engineering University of California at Santa Cruz Networking Systems (1) Hai Tao.
1 Version 3 Module 8 Ethernet Switching. 2 Version 3 Ethernet Switching Ethernet is a shared media –One node can transmit data at a time More nodes increases.
Chapter 15 – Part 2 Networks The Internal Operating System The Architecture of Computer Hardware and Systems Software: An Information Technology Approach.
Chapter 5.6 Network and Multiplayer SUNDEEP MYNENI COMP 7970.
Chapter 10 Introduction to Wide Area Networks Data Communications and Computer Networks: A Business User’s Approach.
Securing TCP/IP Chapter 6. Introduction to Transmission Control Protocol/Internet Protocol (TCP/IP) TCP/IP comprises a suite of four protocols The protocols.
1 Version 3.0 Module 9 TCP/IP Protocol and IP Addressing.
Chapter 5.4 Artificial Intelligence: Pathfinding.
Chapter 5.6 Network and Multiplayer. 2 Multiplayer Modes: Event Timing Turn-Based Easy to implement Any connection type Real-Time Difficult to implement.
Defining Network Protocols Application Protocols –Application Layer –Presentation Layer –Session Layer Transport Protocols –Transport Layer Network Protocols.
IP-UDP-RTP Computer Networking (In Chap 3, 4, 7) 건국대학교 인터넷미디어공학부 임 창 훈.
Gursharan Singh Tatla Transport Layer 16-May
Process-to-Process Delivery:
CN2668 Routers and Switches Kemtis Kunanuraksapong MSIS with Distinction MCTS, MCDST, MCP, A+
OSI Model Routing Connection-oriented/Connectionless Network Services.
LECTURE 9 CT1303 LAN. LAN DEVICES Network: Nodes: Service units: PC Interface processing Modules: it doesn’t generate data, but just it process it and.
Midterm Review - Network Layers. Computer 1Computer 2 2.
Hands-On Microsoft Windows Server 2003 Networking Chapter Three TCP/IP Architecture.
Chapter 5.4 Artificial Intelligence: Pathfinding.
Network Protocols. Why Protocols?  Rules and procedures to govern communication Some for transferring data Some for transferring data Some for route.
What is a Protocol A set of definitions and rules defining the method by which data is transferred between two or more entities or systems. The key elements.
Computer Networks.  The OSI model is a framework containing seven layers that defines the protocols and devices used at each stage of the process when.
Operating Systems Lesson 10. Networking Communications protocol is the set of standard rules for ◦ Data representation ◦ Signaling ◦ Authentication ◦
Chapter 5.6 Network and Multiplayer edited by Jeffery.
Internet Addresses. Universal Identifiers Universal Communication Service - Communication system which allows any host to communicate with any other host.
CSCE 552 Fall 2012 Multiplayer By Jijun Tang. Multiplayer Modes: Event Timing Turn-Based  Easy to implement  Any connection type Real-Time  Difficult.
Introduction to Networks CS587x Lecture 1 Department of Computer Science Iowa State University.
1 Version 3.0 Module 11 TCP Application and Transport.
© 2007 Cisco Systems, Inc. All rights reserved.Cisco Public 1 Version 4.0 OSI Transport Layer Network Fundamentals – Chapter 4.
10/13/2015© 2008 Raymond P. Jefferis IIILect 07 1 Internet Protocol.
CSCE 552 Spring 2009 Network/Multiplayer and Audio By Jijun Tang.
TCP/IP TCP/IP LAYERED PROTOCOL TCP/IP'S APPLICATION LAYER TRANSPORT LAYER NETWORK LAYER NETWORK ACCESS LAYER (DATA LINK LAYER)
Chapter 6-2 the TCP/IP Layers. The four layers of the TCP/IP model are listed in Table 6-2. The layers are The four layers of the TCP/IP model are listed.
UNDERSTANDING THE HOST-TO-HOST COMMUNICATIONS MODEL - OSI LAYER & TCP/IP MODEL 1.
1 Networking Chapter Distributed Capabilities Communications architectures –Software that supports a group of networked computers Network operating.
CCNA 1 v3.0 Module 11 TCP/IP Transport and Application Layers.
Chapter 15 – Part 2 Networks The Internal Operating System The Architecture of Computer Hardware and Systems Software: An Information Technology Approach.
TCP/IP Honolulu Community College Cisco Academy Training Center Semester 2 Version 2.1.
Computer Security Workshops Networking 101. Reasons To Know Networking In Regard to Computer Security To understand the flow of information on the Internet.
Networks and Protocols CE Week 7b. Routing an Overview.
Presented by Rebecca Meinhold But How Does the Internet Work?
Institute of Technology Sligo - Dept of Computing Chapter 12 The Transport Layer.
Individual Project 1 Sarah Pritchard. Fran, a customer of your company, would like to visit your company’s website from her home computer… How does your.
1 Bus topology network. 2 Data is sent to all computers, but only the destination computer accepts 02608c
ISDS 4120 Project 1 DWAYNE CARRAL JR 3/27/15. There are seven layers which make up the OSI (Open Systems Interconnection Model) which is the model for.
Rehab AlFallaj.  Network:  Nodes: Service units: PC Interface processing Modules: it doesn’t generate data, but just it process it and do specific task.
Voice Over Internet Protocol (VoIP) Copyright © 2006 Heathkit Company, Inc. All Rights Reserved Presentation 5 – VoIP and the OSI Model.
CSCE 552 Spring 2010 AI (III) By Jijun Tang. A* Pathfinding Directed search algorithm used for finding an optimal path through the game world Used knowledge.
Data Communication Networks Lec 13 and 14. Network Core- Packet Switching.
TCP/IP1 Address Resolution Protocol Internet uses IP address to recognize a computer. But IP address needs to be translated to physical address (NIC).
CSCE 552 Fall 2012 AI By Jijun Tang. Homework 3 List of AI techniques in games you have played; Select one game and discuss how AI enhances its game play.
Client-server communication Prof. Wenwen Li School of Geographical Sciences and Urban Planning 5644 Coor Hall
Week 3: Protocols Protocols. Protocols Protocol Design Packet Length Conveyance Acknowledgement Methodology Error Checking / Correcting Compression Encryption.
IST 201 Chapter 11 Lecture 2. Ports Used by TCP & UDP Keep track of different types of transmissions crossing the network simultaneously. Combination.
Chapter 5.4 Artificial Intelligence: Pathfinding
Chapter 15 – Part 2 Networks The Internal Operating System
Networking Essentials For Firewall-1 Administrators
CSCE 552 Spring 2009 AI (III) By Jijun Tang.
Unit – III Network Essentials
Presentation transcript:

CSCE 552 Spring 2012 AI (III) & Multiplayer By Jijun Tang

Searching for a Path A path is a list of cells, points, or nodes that an agent must traverse A pathfinding algorithm finds a path  From a start position to a goal position The following pathfinding algorithms can be used on  Grids  Waypoint graphs  Navigation meshes

Criteria for Evaluating Pathfinding Algorithms Quality of final path Resource consumption during search  CPU and memory Whether it is a complete algorithm  A complete algorithm guarantees to find a path if one exists

PathPlannerApp Demo

Characteristics of Grids Fast look-up Easy access to neighboring cells Complete representation of the level

Waypoint Graph A waypoint graph specifies lines/routes that are “ safe ” for traversing Each line (or link) connects exactly two waypoints

Navigation Meshes (continued)

Example—No Rotation

Resulted Path

Example 2—With Rotation

Random Trace Simple algorithm  Agent moves towards goal  If goal reached, then done  If obstacle Trace around the obstacle clockwise or counter-clockwise (pick randomly) until free path towards goal  Repeat procedure until goal reached

Random Trace (continued) How will Random Trace do on the following maps?

Random Trace Characteristics Not a complete algorithm Found paths are unlikely to be optimal Consumes very little memory

A* Pathfinding Directed search algorithm used for finding an optimal path through the game world Used knowledge about the destination to direct the search A* is regarded as the best  Guaranteed to find a path if one exists  Will find the optimal path  Very efficient and fast

Understanding A* To understand A*  First understand Breadth-First, Best-First, and Dijkstra algorithms These algorithms use nodes to represent candidate paths

Class Definition class PlannerNode { public: PlannerNode *m_pParent; int m_cellX, m_cellY;... }; The m_pParent member is used to chain nodes sequentially together to represent a path

Data Structures All of the following algorithms use two lists  The open list  The closed list Open list keeps track of promising nodes When a node is examined from open list  Taken off open list and checked to see whether it has reached the goal If it has not reached the goal  Used to create additional nodes  Then placed on the closed list

Overall Structure of the Algorithms 1. Create start point node – push onto open list 2. While open list is not empty A. Pop node from open list (call it currentNode) B. If currentNode corresponds to goal, break from step 2 C. Create new nodes (successors nodes) for cells around currentNode and push them onto open list D. Put currentNode onto closed list

Breadth-First Finds a path from the start to the goal by examining the search space ply-by-ply

Breadth-First Characteristics Exhaustive search  Systematic, but not clever Consumes substantial amount of CPU and memory Guarantees to find paths that have fewest number of nodes in them  Not necessarily the shortest distance! Complete algorithm

Best-First Uses problem specific knowledge to speed up the search process Head straight for the goal Computes the distance of every node to the goal  Uses the distance (or heuristic cost) as a priority value to determine the next node that should be brought out of the open list

Best-First (continued)

Situation where Best-First finds a suboptimal path

Best-First Characteristics Heuristic search Uses fewer resources than Breadth- First Tends to find good paths  No guarantee to find most optimal path Complete algorithm

Dijkstra Disregards distance to goal  Keeps track of the cost of every path  No guessing Computes accumulated cost paid to reach a node from the start  Uses the cost (called the given cost) as a priority value to determine the next node that should be brought out of the open list

Dijkstra Characteristics Exhaustive search At least as resource intensive as Breadth-First Always finds the most optimal path Complete algorithm

Example

A* Uses both heuristic cost and given cost to order the open list Final Cost = Given Cost + (Heuristic Cost * Heuristic Weight)

A* Characteristics Heuristic search On average, uses fewer resources than Dijkstra and Breadth-First Admissible heuristic guarantees it will find the most optimal path Complete algorithm

Example

Start Node and Costs F=G+H

First Move

Second Move

Cost Map

Path

Pathfinding with Constraints

More Example

Multiplayer Modes: Event Timing Turn-Based  Easy to implement  Any connection type Real-Time  Difficult to implement  Latency sensitive

Multiplayer Modes: Shared I/O Input Devices  Shared keyboard layout  Multiple device mapping Display  Full Screen and Screen Swap  Split Screen

Split Screen

Multiplayer Modes: Connectivity Non Real-Time  Floppy disk net   Database Direct Link  Serial, USB, IrD, … (no hops) Circuit Switched (phones)  Dedicated line with consistent latency Packet Switched  Internet  Shared pipe

Protocols: Protocol Design Packet Length Conveyance Acknowledgement Methodology Error Checking / Correcting Compression Encryption Packet Control

Protocols: Packets Packets  Header = Protocol Manifest  Payload Gottchas  Pointers  Large/Variable Size Arrays  ADTs  Integer Alignment  Endian Order  Processor dependant Intrinsic Types (int and long)  Unicode vs. ASCII Strings

Protocols: Request for Comments RFC web site  Protocol Specifications  Definitive Resource  Public Criticism  Future Protocols

Example Packets IP Packet TCP Packet

Protocol Stack: Open System Interconnect

Another View

Protocol Stack: Physical Layer Bandwidth  Width of data pipe  Measured in bps = bits per second Latency  Travel time from point A to B  Measured in Milliseconds  You cannot beat the physics The Medium  Fiber, FireWire, IrD, CDMA & other cell Serial USB 1&2 ISDNDSLCable LAN 10/100/1G BaseT Wireless a/b/g Power Line T1 Speed (bps) 20K 12M 480M 128k 1.5M down 896K up 3M down 256K up 10M 100M 1G b=11M a,g=54M 14M1.5M Table: Max Bandwidth Specifications

Protocol Stack: Data Link Layer Serializes data to/from physical layer Network Interface Card (NIC)  Ethernet  MAC Address

Protocol Stack: Network Layer Packet Routing  Hops  Routers, Hubs, Switches Internet Protocol (IP)  Contains Source & Destination IP Address  IPv4 Widespread Infrastructure  IPv6 Larger IP address

Protocol Stack: Network Layer: IP Address Unicast  Static  DHCP Multicast  Requires multicast capable router Broadcast  Local  Directed Loop Back  Send to self

Protocol Stack: Network Layer: DNS Domain Name Service  Converts text name to IP address  Must contact one or more DNS servers to resolve  Local cache resolution possible Game Tips  Store local game cache to use when DNS out of order.  DNS resolution often slow, use cache for same day resolution.

DNS

Protocol Stack: Transport Layer Manage data deliver between endpoints  Error recovery  Data flow TCP and UDP used with IP  Contains Source and Destination Port  TCP is connection-oriented, UDP is connectionless Port + IP = Net Address  Port Range = 0-64k  Well known Ports 0-1k

Protocol Stack: Transport Layer: TCP Guaranteed Correct In Order Delivery  Acknowledgement system: Ack, Nack, Resend  Checksum  Out of Band Connection Required  Packet Window  Packet Coalescence (united)  Keep Alive Streamed Data  User must serialize data

Protocol Stack: Transport Layer: UDP Non Guaranteed Delivery  No Acknowledgement system  May arrive out of order  Checksum Not Connected  Source not verified  Hop Count Limit = TTL (time to live)  Required for Broadcasting Datagram  Sent in packets exactly as user sends them

TCP/UDP Comparison

Protocol Stack: Session Layer Manages Connections between Apps  Connect  Terminate  Data Exchange Socket API live at this layer  Cross platform  Cross language

Protocol Stack: Session Layer: Sockets Based on File I/O  File Descriptors  Open/Close  Read/Write Winsock  Provides standard specification implementation plus more  Extension to spec prefixed with “ WSA ”  Requires call to WSAStartup() before use  Cleanup with WSAShutdown()

Protocol Stack: Session Layer: Socket Design Modes  Blocking  Non-Blocking Standard Models  Standard  Select Extended Models  Windows WSAEventSelect I/O Completion Ports  Unix Poll Kernel Queues

Socket Programming

Socket Programming-2

Socket Programming -3

Socket Programming -4

Protocol Stack: Presentation Layer Prepares App Data for Transmission  Compression Pascal Strings String Tables Float to Fixed Matrix to Quaternion  Encryption  Endian Order When used cross platform or cross language  Serialize Pointers Variable Length Arrays

Endian Order

Protocol Stack: Presentation Layer: Buffering Packet Coalescence Induced Latency Dead Data Large Packets

Protocol Stack: Application Layer Handles Game Logic Update Models  Input Reflection  State Reflection Synchronization  Dead Reckoning  AI Assist  Arbitration

Real-Time Communications: Connection Models Broadcast  Good for player discovery on LANs Peer to Peer  Good for 2 player games Client / Server  Good for 2+ player games  Dedicated lobby server great for player discovery

Real-Time Communications: Peer to Peer vs. Client/Server BroadcastPeer/PeerClient/Server Connections0 Client = 1 Server = N N = Number of players BroadcastPeer/PeerClient/Server Send1N-1 Client = 1 Server = N ReceiveN-1 Client = 1 Server = N

Security: Encryption Goals Authentication Privacy Integrity

Security: Encryption Methods Keyed  Public Key  Private Key  Ciphers Message Digest Certificates IPSec (Internet Protocol Security)

IPSec

Security: Copy Protection Disk Copy Protection  Costly Mastering, delay copies to ensure first several months ’ sale  Invalid/Special Sector Read Code Sheets  Ask code from a line in a large manual Watermarking

Security: Execution Cryptography Code Obfuscation  Strip Symbols: int numOfPlayer;  int a1; Heap Hopper  Move sensitive data around in the heap to avoid snapshots Stack Overrun Execution  Check for buffer overflow Timer Hacking  Do not allow time to change backward DLL Shims

Privacy Critical data should be kept secret and strong encrypted:  Real name  Password  Address/phone/  Billing  Age (especially for minors) Using public key for transforming user name and password

Security: Firewalls Packet Filter  Allow a packet based on its headers Proxies  Check contents Circuit Gateways  Setup secure sessions

Security: Firewalls: Network Address Translation

Security: Firewalls: NAT Traversal Port Forwarding Port Triggering DMZ Determining WAN IP

Summary: Further Study Socket Programming Serial Communication Server Design Network Gear & Infrastructure VOIP Tools of the Trade Unit & Public Beta Testing Middleware Databases Web Development Asynchronous Programming