Book Image

JMonkeyEngine 3.0 Cookbook

By : Rickard Eden
Book Image

JMonkeyEngine 3.0 Cookbook

By: Rickard Eden

Overview of this book

Table of Contents (17 chapters)
jMonkeyEngine 3.0 Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Introduction


Data sent over the network is organized in packets, and protocols handle them differently. Packets can look different depending on protocols, but they contain the data itself along with control information, such as addresses and formatting information.

SpiderMonkey supports both TCP and UDP. In SpiderMonkey, TCP is referred to as reliable. TCP is reliable because it verifies each network packet sent, minimizing problems due to packet loss and other errors. TCP guarantees that everything arrives safely (if at all possible). Why ever use anything else then? For speed. Reliability means that TCP can be slow. In some cases, we're not dependent on every packet reaching the destination. UDP is more suitable for streaming and low-latency applications, but the application will have to be prepared to compensate for the unreliability. This means that when a packet is lost in FPS, the game needs to know what to do. Will it just stop in its tracks, or stutter along? If a character is moving...