Book Image

Mastering CryENGINE

By : Michelle Martin
Book Image

Mastering CryENGINE

By: Michelle Martin

Overview of this book

Table of Contents (17 chapters)
Mastering CryENGINE
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Making an entity multiplayer-ready


In order to make our entity work properly in a multiplayer environment, certain changes need to be made to our script.

Right now, we are not taking into account whether our entity is operating on a client or a server. Let's go ahead and get our entity network ready. For this, we need to make sure the server serializes the script entities properly.

Understanding the dataflow of Lua entities in a multiplayer environment

When using your own Lua entities in a multiplayer environment, you need to make sure everything your entity does on one of the clients is also triggered on all other clients. Let's take a light switch as an example. If one of the players turned on the light switch, the switch should also be flipped on all other clients.

Each client connected to the game has an instance of that light switch in their level. The CryENGINE network implementation already handles all the work involved in linking these individual instances together using network entity...