[ Thread Index |
Date Index
| More lists.tuxfamily.org/gluon Archives
]
- To: gluon <gluon@xxxxxxxxxxxxxxxxxxx>
- Subject: [gluon] gluon network
- From: idk <istdasklar@xxxxxxxxx>
- Date: Sun, 13 Jun 2010 02:46:47 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=eKTXeSrXlR4EHyZxJYhjL3vLOLjQ/SnliyyYnPaPGh4=; b=e2vPFzQcDy2nw2gdrLZ2le87pB3xuYLHUS8lTG70j7ZJgC2azA9xvnaj2y3imvpmMc Jcm18pp1An/YtMzID3w5ncyRN9zXnn861czAHZ7pHum7fsnlQazaPXVSGrSoduHN5HMh gMS86XHEXuug1S7BxsoySItbONXn+jrK6ep08=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=HJhJ06fn29Wi+qgcRMGMq98zcjQf4eK7a9kHOX7rw9246noGmAznJjYI06MOkZLw3Q RVaLj3j2BPgxJTpzYcGIZdAU2RKblVGpSJHCDejcOWwPVyqDu0tCuGugPdnmHVkX05rP GhC8L3PVNUEARwD5934D45wn45/+ZZZ+ZWqI4=
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!
�