MafiaHub / Framework

Advanced modding framework for multiplayer modifications
https://mafiahub.dev
Other
37 stars 7 forks source link

Server->Client resource streaming #89

Open zpl-zak opened 6 months ago

zpl-zak commented 6 months ago

Description

The issue at hand is optimizing the transmission of game server resources to clients, while considering security and efficiency. The server must efficiently manage and distribute client-side logic and other resources to the clients without overwhelming them or compromising on the loading speed of the game.

Tasks

Discussion

A discussion is needed to determine the most efficient and secure approach for transmitting data from the server to the client. This includes exploring lazy loading versus startup loading, hashing techniques, bytecode versus source code transmission for scripting, and the practicality of encryption in an open-source environment.

Scope

The scope encompasses server-client netcode, client and game mechanics..

(generated from voice note, yes)

zpl-zak commented 6 months ago

gamemode directory would contain 3 folders: server, client and assets

Web assets for UI are a separate concern we already handle via mongoose's ability to serve static assets from custom folder.

Deewarz commented 6 months ago

Actually, we don't care about gamemode directory organization.

We need a entry_point_server and entry_point_client in package.json

About assets, probably also an Array in package.json with the path of the asset

Segfaultd commented 6 months ago

We do care about organization, for the specific reason that client & server scripts won't get executed under the same scripting layer (node + v8 vs raw v8) and thus, have to be routed properly to destination, compiled to bytecode and binded to the correct SDK.

Splitting avoids to over complexify logics.

As of reference, that's how Alt:V team does https://docs.altv.mp/js/articles/create-your-first-resource.html

zpl-zak commented 6 months ago

RakNet has the following class DirectoryDeltaTransfer, it states: Simple class to send changes between directories. In essence, a simple autopatcher that can be used for transmitting levels, skins, etc.