[gluon] gluon network

[ Thread Index | Date Index | More lists.tuxfamily.org/gluon Archives ]


Hello,

Here is my plan about my vision of Gluon network. I started yet to mind a framework, and I wanted to share with you.

What's gluonNetwork ?�
It's not a standard network library. QNetwork has already all features about that. Gluon is a layer �above that one which make easily game network developpement.

How is it working ?
GluonServer and GluonClient can share data with 2 kind of packet.�
- GluonPacket �
- 2 mode : synchronious and asynchronious

Asynchronious Mode
Gluon packet allows you to send data without synchronisation. It can be use to send data which doesn't need to interact in the same time to the other client. For example a message, chat, send money in a games etc....�
It would be use in Non-real time game, Turn per Turn games ..etc...

API example :�
//client side
GluonClient client;
client.setAdress("192.168.0.1");
client.setPort("21);
client.setMode(GluonClient::AsynchroniousMode);
client.setPlayer(GluonPlayer("nickname".......));

GluonPacket status;
status.addVariant("name", "idk");
status.addVariant("position", QVector2D(3,2));
status.addVariant("angle", 43);

client.connection();
client.send(status);

//server side

class Server �: public GluonServer�
{

void receive(GluonPacket packet)
{
//do action...
}

}

Synchronious Mode

This mode allows the user to get Data from server and the time elapsed between sending and receiving. It is usefull for real time games.�
For example ; when a client A say :" I move" .. This message takes a long time before arrive in client 2... The server need to compute the current position of the client

void GluonServer::receive( GluonPacket , int timeElapsed)
{
the client position is now = � oldPosition �+ direction * (speed + �timeElapsed...)
}


How ??

1- Send Delta compression of Status games

We send only the difference between game status.�
For example :
send ( Game position 2 - GamePosition1) � �// If it' s 0, do not send anything...
Compress data by using qCompress or another algorythm...

2 - Send package with the time !

client : send (Value , currentTimeOfClient)
server : receive ( value, timeElapsed = current Time - currentTimeOfClient )

3 - using a background synchronisator which compute the ping and test variable...



GluonNetwork in GluonCreator ??

Why not, but I don't know how yet!












Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/