The last changes and additions have been made to the engine. Let’s take a look at what has happened lately.
To start with, the server no longer transmits all attribute changes to the clients. The reason for this is, of course, that the clients do not need to know of every change. To achieve this, an object’s attribute are split into distributed and regular attributes. Only distributed attributes are synchronized with the client. In order to not inconvenience the developer, only regular attributes have to be created for custom games, as game logic runs on the server. The client mostly deals with objects transformations and graphics, these things are distributed by the engine.
Another big improvement is adding more messages sent by the server to the client. These messages tell the client to do things that it can do on it’s own, while guaranteeing a synchronized result with the server. For example, one such message tells the client to clear all game objects. Previously, this would be done on the server and the server would then send a ‘removeObject’ message to the clients for each removed object. Being able to send just one ‘clearObjects’ message is much better for our network performance.
Client-exclusive objects is another big addition. Such an object will only have a copy on one client, allowing the game to show different information to different players. This is perfect to, for example, create a HUD element.
The engine now also has support for a camera. The camera is client-side, which means that different player can have different views of the game. The camera can be instructed to follow an object.
Image object have been very simple in the past, but now a lot more of Pixi.js power has been unlocked, with new Image object attributes that map directly to Pixi.js sprite attributes. Have fun transforming your images!
Finally, a different form of visual representation has been added, the Text object. This object also uses Pixi and can support the same transforms.
Check back next time and we take a look at a demo game made with Ophelia!