I ran a few tests for UDP sync packets. For now they are very simple, but it works . Those packets use UDP, so we shouldn't rely on them. For now there is no packet to synchronize events such as unit creation/destruction or weapon data.
Currently there is no full game synchronization but I am glad to see two human controlled commanders from 2 different player walking in the same game . Movements aren't synchronized so it's a bit ugly ... even if it starts the walking animation (but I don't know why ...)
Game synchronization ...
- zuzuf
- Administrateur - Site Admin
- Posts: 3281
- Joined: Mon Oct 30, 2006 8:49 pm
- Location: Toulouse, France
- Contact:
Game synchronization ...
=>;-D Penguin Powered
- zuzuf
- Administrateur - Site Admin
- Posts: 3281
- Joined: Mon Oct 30, 2006 8:49 pm
- Location: Toulouse, France
- Contact:
Here is what is currently synchronized:
Orders aren't synchronized at all !!! which means all remote units have a very basic mission : wait and do nothing !! It prevents the engine from doing useless calculation.
Also speed can be set very easily since the game will run at the speed of the slowest client ... so if server sets speed to 3x and client to 2x it'll run at 2x but if server sets speed to 1x it'll run at 1x. And if someone set pause ... it pauses for everyone
I have run no test about required bandwidth, but it may be high (might be difficult using a DSL connection) because nothing is compressed or optimized ... for example unit types are identified using their names, not their ID since their ID can change on a client which loaded some extra units ... And packet sizes are fixed ... so sometimes it sends useless data. It uses UDP to sync positon, speed, angles, HP, ... and TCP to send events (unit creation, death, ...)[/list]
- * unit creation & death
* unit scripts calls (so unit animation is synchronized )
* unit position, speed, health, build_percent_left, and angle_y (other angles should be computed by the engine)
Orders aren't synchronized at all !!! which means all remote units have a very basic mission : wait and do nothing !! It prevents the engine from doing useless calculation.
Also speed can be set very easily since the game will run at the speed of the slowest client ... so if server sets speed to 3x and client to 2x it'll run at 2x but if server sets speed to 1x it'll run at 1x. And if someone set pause ... it pauses for everyone
I have run no test about required bandwidth, but it may be high (might be difficult using a DSL connection) because nothing is compressed or optimized ... for example unit types are identified using their names, not their ID since their ID can change on a client which loaded some extra units ... And packet sizes are fixed ... so sometimes it sends useless data. It uses UDP to sync positon, speed, angles, HP, ... and TCP to send events (unit creation, death, ...)[/list]
=>;-D Penguin Powered
- zuzuf
- Administrateur - Site Admin
- Posts: 3281
- Joined: Mon Oct 30, 2006 8:49 pm
- Location: Toulouse, France
- Contact:
I don't know exactly, I have to debug statistics first
Currently all units are synced even if it"s not needed, so I'll implement 2 lacking mechanisms:
_only send sync events when required (dirty flag)
_a critical sync system that is used when UDP packets loss is too high and some unit needs to be synced
Also packets need to be endianness independent and we can only send what is really required. Then we'll talk about compression
But first let's sync map features, for now you end with the same game on several computers but not with the same wreckages
Currently all units are synced even if it"s not needed, so I'll implement 2 lacking mechanisms:
_only send sync events when required (dirty flag)
_a critical sync system that is used when UDP packets loss is too high and some unit needs to be synced
Also packets need to be endianness independent and we can only send what is really required. Then we'll talk about compression
But first let's sync map features, for now you end with the same game on several computers but not with the same wreckages
=>;-D Penguin Powered
Who is online
Users browsing this forum: No registered users and 10 guests