Paradigm Shift, part 2

The server-client infrastructure in Ophelia now looks like this: The server, an express application, manages connections from different client. Each client can choose to host a game on the server or join an already hosted game. Once a game is in progress, it’s logic will be executed on the server. Whenever something happens that needs to be displayed on the client, such as an object being created, the server sends a message to the clients who update their state to match. The only thing sent to the server by the clients is user input.

The game logic on the server is written in the form of triggers; callbacks to events. All user scripts will start their execution on an event. See the previous post on Events for more information about this.

User’s create their own application by creating JavaScript file and starting the Ophelia server from it. After that, any game code can be defined. No custom code is required for the clients to run the game.

Be Sociable, Share!

Published by

Albert Öhrling

Studies computer science in Skellefteå, at Lulea University of Technology.

Leave a Reply

Your email address will not be published. Required fields are marked *