{"id":343770,"date":"2023-01-10T21:00:38","date_gmt":"2023-01-10T21:00:38","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=343770"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=343770","title":{"rendered":"<span>\u0414\u0435\u043b\u044c\u0442\u0430 \u043a\u043e\u043c\u043f\u0440\u0435\u0441\u0441\u0438\u044f \u0438 \u043a\u0432\u0430\u043d\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0432 C#<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/c1a\/309\/54b\/c1a30954bbd65009e456805b1a73f1d8.png\" width=\"1380\" height=\"708\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c1a\/309\/54b\/c1a30954bbd65009e456805b1a73f1d8.png\"\/><figcaption><\/figcaption><\/figure>\n<p>C\u0442\u0430\u0442\u044c\u044f \u0437\u0430\u0442\u0440\u0430\u0433\u0438\u0432\u0430\u0435\u0442 \u0442\u0435\u043c\u0443 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u043f\u043e unreliable \u043a\u0430\u043d\u0430\u043b\u0430\u043c.<\/p>\n<p>\u0412 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u044d\u0442\u043e \u043a\u0430\u0441\u0430\u0435\u0442\u0441\u044f \u0440\u0435\u0430\u043b\u0442\u0430\u0439\u043c \u0438\u0433\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043a\u0440\u0438\u0442\u0438\u0447\u043d\u044b \u043a \u0441\u0435\u0442\u0435\u0432\u044b\u043c \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0430\u043c, \u0438\u043c\u0435\u044e\u0442 \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0435 \u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, 10 &#8212; 60 \u0440\u0430\u0437 \u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0443 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 UDP \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b. <\/p>\n<p>\u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u0432\u044b \u0443\u0437\u043d\u0430\u0435\u0442\u0435, \u043a\u0430\u043a \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0434\u0435\u043b\u044c\u0442\u0430 \u043a\u043e\u043c\u043f\u0440\u0435\u0441\u0441\u0438\u0438 \u0438 \u043a\u0432\u0430\u043d\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0440 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0438, \u0442\u0435\u043c \u0441\u0430\u043c\u044b\u043c, \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0440 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445. \u041f\u043e\u043f\u0443\u0442\u043d\u043e \u043c\u044b \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u043c\u0441\u044f \u0441 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 \u0434\u043b\u044f \u0431\u0438\u0442\u043e\u0432\u043e\u0439 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 <a href=\"https:\/\/github.com\/Levchenkov\/NetCode\" rel=\"noopener noreferrer nofollow\">NetCode<\/a>.<\/p>\n<p>\u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c\u044e \u0440\u0435\u0430\u043b\u0442\u0430\u0439\u043c \u0438\u0433\u0440 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u043e, \u0447\u0442\u043e \u043e\u043d\u0438 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b \u043a\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u044e\u0442 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043c\u0438\u0440\u0430 \u043e\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u0430. \u041c\u0430\u043b\u043e \u043a\u043e\u043c\u0443 \u043c\u043e\u0433\u0443\u0442 \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0438 \u043d\u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0438\u0433\u0440\u044b. \u0422\u0443\u0442 \u043e\u0447\u0435\u043d\u044c \u0432\u0430\u0436\u043d\u0443\u044e \u0440\u043e\u043b\u044c \u0438\u0433\u0440\u0430\u044e\u0442: \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f, \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u043c \u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u043d\u0435\u043c\u0430\u043b\u043e\u0432\u0430\u0436\u043d\u0443\u044e \u0440\u043e\u043b\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0438 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445, \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0445 \u043f\u043e \u0441\u0435\u0442\u0438. \u0412\u0435\u0434\u044c \u0438\u043c\u0435\u043d\u043d\u043e \u0441\u043f\u043e\u0441\u043e\u0431 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0440\u0430\u0437\u043c\u0435\u0440 \u0441\u0435\u0442\u0435\u0432\u044b\u0445 \u043f\u0430\u043a\u0435\u0442\u043e\u0432.  \u0412 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0440\u0430\u0437\u043c\u0435\u0440 \u043f\u0430\u043a\u0435\u0442\u043e\u0432, \u0432\u0430\u0436\u0435\u043d \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e \u043f\u0440\u0438\u0447\u0438\u043d\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442-\u043a\u0430\u043d\u0430\u043b\u0430, \u043d\u043e \u0438 \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u043f\u0430\u043a\u0435\u0442\u044b \u043f\u043e\u0434\u0432\u0435\u0440\u0433\u0430\u044e\u0442\u0441\u044f \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438, \u0430 \u043f\u043e\u0442\u0435\u0440\u044f \u043e\u0434\u043d\u043e\u0433\u043e \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u043f\u043e\u0442\u0435\u0440\u0435 \u0432\u0441\u0435\u0433\u043e \u043f\u0430\u043a\u0435\u0442\u0430.<\/p>\n<h3>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430<\/h3>\n<p>\u0412 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u0443 \u0432\u0430\u0441 \u043d\u0430\u0432\u0435\u0440\u043d\u044f\u043a\u0430 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u043b\u0438 \u0432\u043e\u043f\u0440\u043e\u0441\u044b:<\/p>\n<ul>\n<li>\n<p>\u043a\u0430\u043a \u0441\u0436\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435,<\/p>\n<\/li>\n<li>\n<p>\u043a\u0430\u043a \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0440 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u0442\u0430\u043a\u0438\u043c, \u0447\u0442\u043e\u0431\u044b \u043e\u043d\u0438 \u043d\u0435 \u043f\u043e\u0434\u0432\u0435\u0440\u0433\u0430\u043b\u0438\u0441\u044c \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438,<\/p>\n<\/li>\n<li>\n<p>\u043a\u0430\u043a \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u044c \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u0439 \u0442\u0440\u0430\u0444\u0438\u043a?<\/p>\n<\/li>\n<\/ul>\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u043e\u0433\u0440\u0443\u0437\u0438\u0442\u044c\u0441\u044f \u0432 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u0442\u0438\u043a\u0443 \u0440\u0435\u0430\u043b\u0442\u0430\u0439\u043c \u0438\u0433\u0440 \u0438, \u0432 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0441 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439 \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u043f\u0430\u043a\u0435\u0442\u043e\u0432, \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441\u043e \u0441\u0442\u0430\u0442\u044c\u0435\u0439 <a href=\"https:\/\/gafferongames.com\/post\/snapshot_compression\/\" rel=\"noopener noreferrer nofollow\"><u>Snapshot Compression<\/u><\/a> \u0438\u0437 \u0446\u0438\u043a\u043b\u0430 \u0441\u0442\u0430\u0442\u0435\u0439 Gaffer On Games.  \u041d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0438 \u043f\u043e\u0434\u0445\u043e\u0434\u043e\u0432 \u0438\u0437 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0430\u0434 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u043f\u0430\u043a\u0435\u0442\u043e\u0432.<\/p>\n<p>\u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u044c\u0442\u0435 \u0441\u0435\u0431\u0435 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044e: \u0441\u0435\u0440\u0432\u0435\u0440 \u0442\u0438\u043a\u0430\u0435\u0442 \u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u043e\u0442\u043e\u0439 \u0438 \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u0442\u0438\u043a\u0435 \u0440\u0430\u0441\u0441\u044b\u043b\u0430\u0435\u0442 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043c\u0438\u0440\u0430 \u0432\u0441\u0435\u043c \u0438\u0433\u0440\u043e\u043a\u0430\u043c. \u0414\u043b\u044f \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u044f, \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0440\u0430\u0441\u0441\u044b\u043b\u043a\u0443 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u043e \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0438\u0433\u0440\u043e\u043a\u043e\u0432 \u0432 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435.<\/p>\n<p>\u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443:<\/p>\n<pre><code class=\"cs\">public struct TransformComponent {     public Vector3 Position;          public float Yaw;          public float Pitch; }<\/code><\/pre>\n<p>\u0420\u0430\u0437\u043c\u0435\u0440 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b &#8212; 20 \u0431\u0430\u0439\u0442. Position \u0438\u043c\u0435\u0435\u0442 \u0442\u0438\u043f Vector3, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 3 float \u043f\u043e\u043b\u044f \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u043e\u0441\u0438 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 (X, Y \u0438 Z), Yaw \u0438 Pitch \u0442\u043e\u0436\u0435 \u0438\u043c\u0435\u044e\u0442 \u0442\u0438\u043f float. \u0427\u0442\u043e \u0432 \u0438\u0442\u043e\u0433\u0435 \u0434\u0430\u0435\u0442 5 float \u043f\u043e\u043b\u0435\u0439, \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c \u0432 4 \u0431\u0430\u0439\u0442\u0430, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0441\u0443\u043c\u043c\u0430\u0440\u043d\u044b\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 \u0440\u0430\u0432\u0435\u043d 20 \u0431\u0430\u0439\u0442 (5 \u043f\u043e\u043b\u0435\u0439 * 4 \u0431\u0430\u0439\u0442\u0430). <\/p>\n<p>\u0423\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0440\u0430\u0437\u043c\u0435\u0440 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a\u043e\u0439 \u043c\u043e\u0436\u043d\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 SizeOf:  <\/p>\n<pre><code class=\"cs\">Console.WriteLine(Unsafe.SizeOf&lt;TransformComponent>()); \/\/ 20<\/code><\/pre>\n<p>\u0422\u043e\u0433\u0434\u0430, \u0435\u0441\u043b\u0438 \u0443 \u043d\u0430\u0441 \u0448\u0443\u0442\u0435\u0440 5 \u043d\u0430 5, \u0442\u043e \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f 200 \u0431\u0430\u0439\u0442 \u043d\u0430 \u043f\u0430\u043a\u0435\u0442 (20 \u0431\u0430\u0439\u0442 * 10 \u0438\u0433\u0440\u043e\u043a\u043e\u0432).<\/p>\n<p>\u0412\u0440\u043e\u0434\u0435 \u043d\u0435 \u0441\u0442\u0440\u0430\u0448\u043d\u043e \u0438 \u043d\u0435 \u043a\u0440\u0438\u0442\u0438\u0447\u043d\u043e, \u043d\u043e \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442. \u0410 \u0432 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0438\u0433\u0440\u044b, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u044b \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u043e \u0441\u0435\u0442\u0438, \u0432\u0445\u043e\u0434\u044f\u0442 \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b: \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c, \u0437\u0434\u043e\u0440\u043e\u0432\u044c\u0435, \u0430\u043c\u0443\u043d\u0438\u0446\u0438\u044f \u0438 \u0442.\u0434. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0443\u043b\u043e\u0436\u0438\u0442\u044c\u0441\u044f \u0432 1500 \u0431\u0430\u0439\u0442 \u0434\u043b\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c\u043e\u0433\u043e \u043f\u0430\u043a\u0435\u0442\u0430 \u043f\u043e UDP \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e <a href=\"https:\/\/ru.wikipedia.org\/wiki\/Maximum_transmission_unit\" rel=\"noopener noreferrer nofollow\">MTU<\/a>, \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438. <\/p>\n<p>\u0410 \u0435\u0441\u043b\u0438 \u0443 \u043d\u0430\u0441 \u0448\u0443\u0442\u0435\u0440 \u0441 \u0440\u0435\u0436\u0438\u043c\u043e\u043c \u043a\u043e\u0440\u043e\u043b\u0435\u0432\u0441\u043a\u0430\u044f \u0431\u0438\u0442\u0432\u0430 \u043d\u0430 100 \u0447\u0435\u043b\u043e\u0432\u0435\u043a, \u0442\u043e \u0432 \u0438\u0442\u043e\u0433\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f 2 000 \u0431\u0430\u0439\u0442 (20 \u0431\u0430\u0439\u0442 * 100 \u0438\u0433\u0440\u043e\u043a\u043e\u0432), \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442, \u0447\u0442\u043e \u0434\u0430\u0436\u0435 \u0441 1 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u043c \u043d\u0435 \u0443\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u043c\u0441\u044f \u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b MTU.<\/p>\n<p>\u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0437\u043e\u043d\u044b \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0430, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0445 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439, \u043d\u043e \u0441\u0443\u0442\u0438 \u044d\u0442\u043e \u043d\u0435 \u043c\u0435\u043d\u044f\u0435\u0442.<\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <a href=\"https:\/\/github.com\/RevenantX\/LiteNetLib\" rel=\"noopener noreferrer nofollow\">LiteNetLib<\/a> \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 MTU \u0440\u0430\u0432\u043d\u044b\u0439 1024 \u0431\u0430\u0439\u0442, <a href=\"https:\/\/github.com\/RevenantX\/LiteNetLib\/blob\/4fc5b55aedfa01174b6c423239e90c02165d5594\/LiteNetLib\/NetConstants.cs#L60\" rel=\"noopener noreferrer nofollow\">\u043f\u0440\u0443\u0444<\/a>. \u0418 \u0435\u0441\u043b\u0438 \u0432\u044b \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0435 \u043f\u043e unreliable \u043a\u0430\u043d\u0430\u043b\u0443 \u043f\u0430\u043a\u0435\u0442 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c 1025 \u0431\u0430\u0439\u0442, \u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 <a href=\"https:\/\/github.com\/RevenantX\/LiteNetLib\/blob\/053cddc78b72e889fbcb1cdcfba406381a6a89f9\/LiteNetLib\/NetPeer.cs#L610\" rel=\"noopener noreferrer nofollow\">\u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/a>.<\/p>\n<p>\u041c\u043e\u0436\u043d\u043e \u043b\u0438 \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0440? \u0421\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u0432\u044b\u0448\u0435\u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 <a href=\"https:\/\/gafferongames.com\/post\/snapshot_compression\/\" rel=\"noopener noreferrer nofollow\"><u>Snapshot Compression<\/u><\/a>, \u043c\u043e\u0436\u043d\u043e. \u041f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u0438\u0435\u043c\u043e\u043c \u043a\u0432\u0430\u043d\u0442\u0438\u0437\u0430\u0446\u0438\u0438, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e, \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0442\u044c \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043f\u043e\u043b\u0435\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b.\u00a0<\/p>\n<h3>\u041a\u0432\u0430\u043d\u0442\u0438\u0437\u0430\u0446\u0438\u044f<\/h3>\n<p>\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043a\u0432\u0430\u043d\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0432 <a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%9A%D0%B2%D0%B0%D0%BD%D1%82%D0%BE%D0%B2%D0%B0%D0%BD%D0%B8%D0%B5\" rel=\"noopener noreferrer nofollow\">\u0412\u0438\u043a\u0438\u043f\u0435\u0434\u0438\u0438<\/a>. \u0415\u0441\u043b\u0438 \u0441\u043e\u0432\u0441\u0435\u043c \u043a\u043e\u0440\u043e\u0442\u043a\u043e, \u0442\u043e \u043a\u0432\u0430\u043d\u0442\u0438\u0437\u0430\u0446\u0438\u044f &#8212; \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u0435\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b \u0432 \u0446\u0435\u043b\u044b\u0435.<\/p>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0434\u0430\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441.<\/p>\n<p>\u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043c, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0438\u0433\u0440\u043e\u0432\u043e\u0435 \u043f\u043e\u043b\u0435 100 \u043d\u0430 100 \u0438 \u0435\u0433\u043e \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u043c\u043e\u0433\u0443\u0442 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u0434\u0440\u043e\u0431\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435. \u0422\u0430\u043a\u0436\u0435 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c, \u0447\u0442\u043e \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u0432 0.1 \u0435\u0434\u0438\u043d\u0438\u0446\u044b \u043d\u0430\u043c \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e. \u0421 \u0442\u0430\u043a\u0438\u043c\u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u043d\u0430\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0442\u0438\u043f float, \u0435\u0433\u043e \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043e\u0442 \u00b11.5 x 10<sup>\u221245<\/sup>\u00a0\u0434\u043e \u00b13.4 x 10<sup>38<\/sup>  \u0438 \u0440\u0430\u0437\u043c\u0435\u0440 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 4 \u0431\u0430\u0439\u0442\u0430. \u041d\u043e \u0434\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0432\u0435\u0441\u044c \u0434\u0438\u0430\u043f\u043e\u0437\u043e\u043d \u043d\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u0435\u043d, \u0434\u0430 \u0438 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u0432 7 \u0437\u043d\u0430\u043a\u043e\u0432 \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u044f\u0442\u043e\u0439 \u0434\u043b\u044f \u043d\u0430\u0441 \u044d\u0442\u043e \u043f\u0435\u0440\u0435\u0431\u043e\u0440. <\/p>\n<p>\u041c\u043e\u0436\u043d\u043e \u043b\u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0438 \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0431\u0438\u0442 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f? \u0414\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432\u0441\u0435\u0433\u043e 1000 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u043e\u0441\u0438 (100 * 10), \u0442.\u0435. 10 \u0431\u0438\u0442 \u043d\u0430 \u043e\u0441\u044c \u0438\u043b\u0438 20 \u0431\u0438\u0442 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u043d\u0430 \u043d\u0430\u0448\u0435\u043c \u0438\u0433\u0440\u043e\u0432\u043e\u043c \u043f\u043e\u043b\u0435. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0442\u0438\u043f\u0430 float \u0431\u0435\u0437 \u043a\u0432\u0430\u043d\u0442\u0438\u0437\u0430\u0446\u0438\u0438, \u0443 \u043d\u0430\u0441 \u0431\u044b\u043b\u043e \u0431\u044b 64 \u0431\u0438\u0442\u0430 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 (32 * 2).<\/p>\n<p>\u041a\u0432\u0430\u043d\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0436\u043d\u043e \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0438\u043f\u044b \u0441 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0435\u0439 \u0442\u043e\u0447\u043a\u043e\u0439 float \u0438 double, \u043d\u043e \u0438 \u0446\u0435\u043b\u043e\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0435. <\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u043d\u0430\u0448\u0435\u0439 \u0438\u0433\u0440\u0435 \u043d\u0443\u0436\u043d\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0443\u0433\u043e\u043b \u043f\u043e\u0432\u043e\u0440\u043e\u0442\u0430 \u0432 \u0433\u0440\u0430\u0434\u0443\u0441\u0430\u0445 &#8212; \u043e\u0442 0 \u0438 \u0434\u043e 360. \u0414\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f 9 \u0431\u0438\u0442. \u0417\u043d\u0430\u0447\u0438\u0442 8 \u0431\u0438\u0442\u043e\u0432\u043e\u0433\u043e \u0442\u0438\u043f\u0430 byte \u043d\u0430\u043c \u043d\u0435 \u0445\u0432\u0430\u0442\u0438\u0442, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u0439 \u0442\u0438\u043f \u044d\u0442\u043e ushort 16 \u0431\u0438\u0442, \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e 65535. \u041d\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e 9 \u0431\u0438\u0442. \u041a\u0432\u0430\u043d\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u043a\u0430\u043a \u0440\u0430\u0437 \u043d\u0430\u043c \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e 9 \u0438\u0437 16 \u0431\u0438\u0442.<\/p>\n<p>\u0421\u0430\u043c\u044b\u0439 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0439 \u0442\u0438\u043f \u0432 C# \u044d\u0442\u043e byte, \u043a\u0430\u043a \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0434\u043e\u0433\u0430\u0434\u0430\u0442\u044c\u0441\u044f, \u0435\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440 \u0440\u0430\u0432\u0435\u043d 1 \u0431\u0430\u0439\u0442\u0443. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u0431\u0438\u0442\u0430\u043c\u0438 \u043d\u0430\u0434\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u0438\u0442\u043e\u0432\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438. \u041a \u0441\u0430\u043c\u0438\u043c \u0431\u0438\u0442\u043e\u0432\u044b\u043c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f\u043c \u043f\u0440\u0435\u0442\u0435\u043d\u0437\u0438\u0439 \u043d\u0435\u0442, \u043d\u043e \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u043d\u0435\u043b\u0435\u0433\u043a\u0443\u044e \u0436\u0438\u0437\u043d\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u0438 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442: \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 <a href=\"https:\/\/github.com\/Levchenkov\/NetCode\" rel=\"noopener noreferrer nofollow\">NetCode<\/a>.<\/p>\n<p>\u041d\u0430\u043f\u043e\u043c\u043d\u044e, \u0447\u0442\u043e \u0442\u0438\u043f bool \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 \u0442\u043e\u0436\u0435 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 1 \u0431\u0430\u0439\u0442, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u043e\u0436\u0435\u043c \u0437\u0430\u0431\u044b\u0442\u044c \u043f\u0440\u043e \u043c\u0430\u0441\u0441\u0438\u0432 \u0438\u0437 bool. <\/p>\n<h3>NetCode<\/h3>\n<p><a href=\"https:\/\/github.com\/Levchenkov\/NetCode\" rel=\"noopener noreferrer nofollow\">NetCode<\/a> \u044d\u0442\u043e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0441 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c. \u041e\u043d\u0430 \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0430 \u0434\u043b\u044f \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u044b \u043f\u043e \u0441\u0435\u0442\u0438, \u0438 \u043d\u0430\u0446\u0435\u043b\u0435\u043d\u0430 \u043d\u0430 \u0443\u043c\u0435\u043d\u044c\u0448\u0435\u043d\u0438\u0435 \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0430. \u0412\u044b\u0441\u043e\u043a\u0430\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0438 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u0430\u043b\u043b\u043e\u043a\u0430\u0446\u0438\u0439 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u044d\u0442\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438. \u0412\u0441\u0435 \u0442\u043e, \u0447\u0442\u043e \u043c\u044b \u0442\u0430\u043a \u043b\u044e\u0431\u0438\u043c \u0438 \u0446\u0435\u043d\u0438\u043c \u0432 \u043d\u0430\u0448\u0435\u0439 \u0440\u0430\u0431\u043e\u0442\u0435.<\/p>\n<p>\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043d\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0430\u0431\u043e\u0440 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u0431\u0438\u0442\u0430\u043c\u0438 \u0447\u0438\u0441\u043b\u0430 \u0438 \u043d\u0435 \u0443\u043c\u0435\u0435\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u0431\u0438\u0442\u043e\u0432, \u0437\u0430\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0432 \u043c\u0430\u0441\u0441\u0438\u0432 \u0431\u0430\u0439\u0442\u043e\u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0431\u0438\u0442 \u0438\u0437 \u0431\u0438\u0442\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0447\u0438\u0441\u043b\u0430:<\/p>\n<pre><code class=\"cs\">var bitWriter = new BitWriter();  bitWriter.WriteBits(bitCount: 3, value: 0b_101010); \/\/ 0b_010        bitWriter.WriteBits(bitCount: 3, value: 0b_1111); \/\/ 0b_111  Console.WriteLine(bitWriter.BitsCount); \/\/ 6  bitWriter.Flush();  Console.WriteLine(bitWriter.BitsCount); \/\/ 8  byte[] data = bitWriter.Array; \/\/ data[0] == 0b_111010 Console.WriteLine(Convert.ToString(value: data[0], toBase: 2)); \/\/ 111010<\/code><\/pre>\n<p>\u0412 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u043c \u0432\u044b\u0448\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043c\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043b\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435: <\/p>\n<ul>\n<li>\n<p>2 \u0440\u0430\u0437\u0430 \u0437\u0430\u043f\u0438\u0441\u0430\u043b\u0438 \u043f\u043e 3 \u0431\u0438\u0442\u0430 (010 \u0438 111), \u0445\u043e\u0442\u044f \u0441\u0430\u043c\u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u0447\u0438\u0441\u043b\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043b\u0438 \u0431\u043e\u043b\u044c\u0448\u0435 \u0437\u043d\u0430\u0447\u0438\u043c\u044b\u0445 \u0431\u0438\u0442\u043e\u0432 (101010 \u0438 1111 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e),<\/p>\n<\/li>\n<li>\n<p>\u0432\u044b\u0432\u0435\u043b\u0438 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435 \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u0431\u0438\u0442\u043e\u0432,<\/p>\n<\/li>\n<li>\n<p>\u0437\u0430\u043f\u0438\u0441\u0430\u043b\u0438 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439 \u0431\u0443\u0444\u0435\u0440 \u0432 \u0438\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432,<\/p>\n<\/li>\n<li>\n<p>\u043e\u043f\u044f\u0442\u044c \u0432\u044b\u0432\u0435\u043b\u0438 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435 \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u0431\u0438\u0442\u043e\u0432,<\/p>\n<\/li>\n<li>\n<p>\u0438 \u0432\u044b\u0432\u0435\u043b\u0438 \u043d\u0430 \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0438\u0442\u043e\u0433\u043e\u0432\u043e\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0430.<\/p>\n<\/li>\n<\/ul>\n<p>\u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435, \u043f\u043e\u043b\u0443\u0447\u0435\u043d \u043c\u0430\u0441\u0441\u0438\u0432, \u043f\u0435\u0440\u0432\u044b\u0439 \u0431\u0430\u0439\u0442 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043d\u0430\u0448\u0438 \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u0431\u0438\u0442\u044b 010 \u0438 111.<\/p>\n<p>\u041f\u043e\u0431\u0438\u0442\u043e\u0432\u0430\u044f \u0437\u0430\u043f\u0438\u0441\u044c \u0447\u0438\u0441\u043b\u0430, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u0445\u043e\u0440\u043e\u0448\u043e, \u043d\u043e \u043c\u044b \u0441\u044e\u0434\u0430 \u043f\u0440\u0438\u0448\u043b\u0438 \u043d\u0435 \u0437\u0430 \u044d\u0442\u0438\u043c.<\/p>\n<h3>\u041a\u0432\u0430\u043d\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e NetCode<\/h3>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u043e \u043a\u0432\u0430\u043d\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439:<\/p>\n<pre><code class=\"cs\">var bitWriter = new BitWriter();  bitWriter.Write(value: 1f, min: 0f, max: 100f, precision: 0.1f);  Console.WriteLine(bitWriter.BitsCount); \/\/ 10          bitWriter.Flush();  Console.WriteLine(bitWriter.BitsCount); \/\/ 16  var data = bitWriter.Array; var bitReader = new BitReader(data);  var value = bitReader.ReadFloat(min: 0f, max: 100f, precision: 0.1f);  Console.WriteLine(value); \/\/ 1<\/code><\/pre>\n<p>\u0412 \u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043c\u044b \u0434\u0435\u043b\u0430\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<ul>\n<li>\n<p>\u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c float \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0441\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c 1f, \u0441 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \u043e\u0442 0 \u0434\u043e 100 \u0438 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c\u044e \u0432 0.1 ,<\/p>\n<\/li>\n<li>\n<p> \u0432\u044b\u0432\u043e\u0434\u0438\u043c \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435 \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u0431\u0438\u0442\u043e\u0432,<\/p>\n<\/li>\n<li>\n<p>\u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439 \u0431\u0443\u0444\u0435\u0440 \u0432 \u0438\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432,<\/p>\n<\/li>\n<li>\n<p>\u043e\u043f\u044f\u0442\u044c \u0432\u044b\u0432\u043e\u0434\u0438\u043c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435 \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u0431\u0438\u0442\u043e\u0432,<\/p>\n<\/li>\n<li>\n<p>\u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u043a\u043b\u0430\u0441\u0441\u0430 BitReader,<\/p>\n<\/li>\n<li>\n<p>\u0447\u0438\u0442\u0430\u0435\u043c float \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0441 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \u043e\u0442 0 \u0434\u043e 100 \u0438 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c\u044e \u0432 0.1,<\/p>\n<\/li>\n<li>\n<p>\u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435.<\/p>\n<\/li>\n<\/ul>\n<p>\u041a\u0430\u043a \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442, \u043c\u044b \u0437\u0430\u043f\u0438\u0441\u0430\u043b\u0438 \u0434\u0440\u043e\u0431\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e 10 \u0431\u0438\u0442\u043e\u0432 \u0438 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u043b\u0438 \u044d\u0442\u043e \u0447\u0438\u0441\u043b\u043e \u043d\u0430\u0437\u0430\u0434.<\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c, \u0447\u0442\u043e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0432\u0441\u0435\u0433\u043e \u043e\u0434\u043d\u0443 \u0441\u0442\u0440\u043e\u043a\u0443 \u043a\u043e\u0434\u0430 \u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 \u043c\u0430\u0441\u0441\u0438\u0432:<\/p>\n<pre><code class=\"cs\">bitWriter.Write(value: 1f, min: 0f, max: 100f, precision: 0.1f);<\/code><\/pre>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0432\u0435\u0440\u043d\u0435\u043c\u0441\u044f \u043a \u043d\u0430\u0448\u0435\u043c\u0443 \u043f\u0440\u0438\u043c\u0435\u0440\u0443 \u0441 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0439, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0438\u0433\u0440\u043e\u043a\u043e\u0432 \u0432 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435, \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 NetCode \u0441\u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u043c \u043f\u043e\u043c\u043e\u0447\u044c.<\/p>\n<p>\u041d\u0430\u043f\u043e\u043c\u043d\u044e, \u0447\u0442\u043e \u043d\u0430\u0448\u0430 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u0438\u043c\u0435\u0435\u0442 \u0432\u0438\u0434:<\/p>\n<pre><code class=\"cs\">public struct TransformComponent {     public Vector3 Position;          public float Yaw;          public float Pitch; }<\/code><\/pre>\n<p>\u0438 \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u0447\u0442\u043e \u043d\u0430\u0448\u0435 \u0438\u0433\u0440\u043e\u0432\u043e\u0435 \u043f\u043e\u043b\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043e:<\/p>\n<ul>\n<li>\n<p>-100 &lt; X &lt; 100,<\/p>\n<\/li>\n<li>\n<p>-10 &lt; Y &lt; 10,<\/p>\n<\/li>\n<li>\n<p>-100 &lt; Z &lt; 100,<\/p>\n<\/li>\n<\/ul>\n<p>\u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043f\u0443\u0441\u0442\u044c \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 0.1 \u0435\u0434\u0438\u043d\u0438\u0446\u044b (\u043f\u043e\u043f\u0443\u0433\u0430\u0435\u0432, \u043c\u0435\u0442\u0440\u043e\u0432 \u0438\u043b\u0438 \u0444\u0443\u0442\u043e\u0432). <\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u043d\u0430\u043b\u043e\u0436\u0438\u043c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u043d\u0430 \u0443\u0433\u043b\u044b \u043f\u043e\u0432\u043e\u0440\u043e\u0442\u0430:<\/p>\n<ul>\n<li>\n<p>0 &lt; Yaw, Pitch  &lt; 360,<\/p>\n<\/li>\n<\/ul>\n<p>\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u0443\u0433\u043b\u0430 \u043f\u043e\u0432\u043e\u0440\u043e\u0442\u0430 \u043f\u0443\u0441\u0442\u044c \u0431\u0443\u0434\u0435\u0442 0.1 \u0433\u0440\u0430\u0434\u0443\u0441.<\/p>\n<p>\u0422\u043e\u0433\u0434\u0430 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0440\u0438\u043c\u0435\u0442 \u0432\u0438\u0434:<\/p>\n<pre><code class=\"cs\">var bitWriter = new BitWriter();  var positionXZLimit = new FloatLimit(min: -100f, max: 100f, precision: 0.1f); var positionYLimit = new FloatLimit(min: -10f, max: 10f, precision: 0.1f); var rotationLimit = new FloatLimit(min: 0f, max: 360f, precision: 0.1f);  var transformComponent = new TransformComponent { Position = new Vector3(10f, 5f, 10f), Pitch = 30f, Yaw = 60f };  bitWriter.Write(value: transformComponent.Position.X, limit: positionXZLimit); bitWriter.Write(value: transformComponent.Position.Y, limit: positionYLimit); bitWriter.Write(value: transformComponent.Position.Z, limit: positionXZLimit);  bitWriter.Write(value: transformComponent.Yaw, limit: rotationLimit); bitWriter.Write(value: transformComponent.Pitch, limit: rotationLimit);  bitWriter.Flush();  Console.WriteLine(bitWriter.BytesCount); \/\/ 7<\/code><\/pre>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043c\u044b:<\/p>\n<ul>\n<li>\n<p>\u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043b\u0430\u0441\u0441\u0430 FloatLimit,<\/p>\n<\/li>\n<li>\n<p>\u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043e\u0431\u044a\u0435\u043a\u0442 \u043d\u0430\u0448\u0435\u0439 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0443\u0435\u043c\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b,<\/p>\n<\/li>\n<li>\n<p>\u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0438 \u043f\u043e\u0432\u043e\u0440\u043e\u0442\u044b,<\/p>\n<\/li>\n<li>\n<p>\u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439 \u0431\u0443\u0444\u0435\u0440 \u0432 \u0438\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432,<\/p>\n<\/li>\n<li>\n<p>\u0432\u044b\u0432\u043e\u0434\u0438\u043c \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0431\u0430\u0439\u0442 \u0438\u0442\u043e\u0433\u043e\u0432\u043e\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0430.<\/p>\n<\/li>\n<\/ul>\n<p>\u0420\u0430\u0437\u043c\u0435\u0440 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 7 \u0431\u0430\u0439\u0442. \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043d\u0435\u043f\u043b\u043e\u0445\u043e\u0439. \u041d\u043e \u043c\u043e\u0436\u043d\u043e \u0435\u0449\u0435 \u043b\u0443\u0447\u0448\u0435!<\/p>\n<h3>\u0414\u0435\u043b\u044c\u0442\u0430<\/h3>\n<p>\u0414\u0435\u043b\u044c\u0442\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439, \u043e\u043d\u0430 \u0436\u0435 \u0434\u0438\u0444\u0444 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439, \u043e\u043d\u0430 \u0436\u0435 \u0440\u0430\u0437\u043d\u043e\u0441\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439.<\/p>\n<p>\u041c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u0439\u0442\u0438 \u0434\u0430\u043b\u044c\u0448\u0435 \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0438\u0441\u044c. \u042d\u0442\u043e \u0438 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0434\u0435\u043b\u044c\u0442\u0430 \u043a\u043e\u043c\u043f\u0440\u0435\u0441\u0441\u0438\u044f.\u00a0<\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0443 \u0438\u0433\u0440\u043e\u043a\u0430 \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0438\u0441\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b, \u0430 \u043d\u0430\u043a\u043b\u043e\u043d \u0438 \u043f\u043e\u0432\u043e\u0440\u043e\u0442 \u043e\u0441\u0442\u0430\u043b\u0438\u0441\u044c \u043f\u0440\u0435\u0436\u043d\u0438\u043c\u0438:<\/p>\n<pre><code class=\"cs\">var before = new TransformComponent {     Position = new Vector3(10f, 5f, 10f),     Pitch = 30f,     Yaw = 60f };  var after = new TransformComponent {     Position = new Vector3(10.5f, 5.5f, 10.5f),     Pitch = 30f,     Yaw = 60f };  var bitWriter = new BitWriter(); var positionXZLimit = new FloatLimit(min: -100f, max: 100f, precision: 0.1f); var positionYLimit = new FloatLimit(min: -10f, max: 10f, precision: 0.1f); var rotationLimit = new FloatLimit(min: 0f, max: 360f, precision: 0.1f);  bitWriter.WriteValueIfChanged(     baseline: before.Position.X,     updated: after.Position.X,     limit: positionXZLimit);  bitWriter.WriteValueIfChanged(     baseline: before.Position.Y,     updated: after.Position.Y,     limit: positionYLimit);  bitWriter.WriteValueIfChanged(     baseline: before.Position.Z,     updated: after.Position.Z,     limit: positionXZLimit);  bitWriter.WriteValueIfChanged(     baseline: before.Yaw,     updated: after.Yaw,     limit: rotationLimit);  bitWriter.WriteValueIfChanged(     baseline: before.Pitch,     updated: after.Pitch,     limit: rotationLimit);  bitWriter.Flush();  Console.WriteLine(bitWriter.BytesCount); \/\/ 5<\/code><\/pre>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043c\u044b \u0434\u0435\u043b\u0430\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<ul>\n<li>\n<p>\u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e before, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0434\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439,<\/p>\n<\/li>\n<li>\n<p>\u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e after, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043f\u043e\u0441\u043b\u0435 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439,<\/p>\n<\/li>\n<li>\n<p>\u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043b\u0430\u0441\u0441\u0430 FloatLimit,<\/p>\n<\/li>\n<li>\n<p>\u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0438 \u043f\u043e\u0432\u043e\u0440\u043e\u0442\u044b,<\/p>\n<\/li>\n<li>\n<p>\u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439 \u0431\u0443\u0444\u0435\u0440 \u0432 \u0438\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432,<\/p>\n<\/li>\n<li>\n<p>\u0432\u044b\u0432\u043e\u0434\u0438\u043c \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0431\u0430\u0439\u0442 \u0438\u0442\u043e\u0433\u043e\u0432\u043e\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0430.<\/p>\n<\/li>\n<\/ul>\n<p>\u0418\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u0432\u0438\u0441\u0435\u0442\u044c \u043e\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u043d\u044b\u0445 \u043f\u043e\u043b\u0435\u0439. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0430\u0441\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0437\u0438\u0446\u0438\u044f \u0438 \u0440\u0430\u0437\u043c\u0435\u0440 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 5 \u0431\u0430\u0439\u0442. <\/p>\n<p>\u0415\u0441\u043b\u0438 \u043f\u043e\u043b\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b, \u0442.\u0435. \u043d\u0435 \u0431\u044b\u043b\u043e \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0432 \u0434\u0430\u043d\u043d\u044b\u0445, \u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0441\u0442\u043e\u043b\u044c\u043a\u043e <u>\u0431\u0438\u0442<\/u>, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u043b\u0435\u0439. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e 5 \u0431\u0438\u0442.<\/p>\n<p>\u0418 \u044d\u0442\u043e \u0435\u0449\u0435 \u043d\u0435 \u0432\u0441\u0435. \u041c\u043e\u0436\u043d\u043e \u0432\u0432\u0435\u0441\u0442\u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u043d\u0430 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439, \u0442.\u0435. \u043c\u043e\u0436\u043d\u043e \u043a\u0432\u0430\u043d\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0435\u043b\u044c\u0442\u0443.<\/p>\n<h3>\u041a\u0432\u0430\u043d\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u0434\u0435\u043b\u044c\u0442\u044b<\/h3>\n<p>\u041f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c, \u0447\u0442\u043e \u0438\u0433\u0440\u043e\u043a 90% \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0430\u0435\u0442\u0441\u044f \u043f\u0435\u0448\u043a\u043e\u043c \u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 \u043d\u0435 \u043f\u0440\u0435\u0432\u044b\u0448\u0430\u0435\u0442 1 (\u043e\u0434\u043d\u043e\u0433\u043e) \u044e\u043d\u0438\u0442\u0430 \u0437\u0430 1 \u0442\u0438\u043a:<\/p>\n<ul>\n<li>\n<p>-1 &lt; deltaX, deltaY, deltaZ &lt; 1,<\/p>\n<\/li>\n<\/ul>\n<p>\u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u044f, \u043a\u0430\u043a \u0438 \u0440\u0430\u043d\u044c\u0448\u0435, \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c 0.1 \u0435\u0434\u0438\u043d\u0438\u0446\u044b.<\/p>\n<p>\u0422\u043e\u0433\u0434\u0430 \u043d\u0430\u0448\u0430 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0440\u0438\u043c\u0435\u0442 \u0432\u0438\u0434:<\/p>\n<pre><code class=\"cs\">var before = new TransformComponent {     Position = new Vector3(10f, 5f, 10f),     Pitch = 30f,     Yaw = 60f };  var after = new TransformComponent {     Position = new Vector3(10.5f, 5.5f, 10.5f),     Pitch = 30f,     Yaw = 60f };  var bitWriter = new BitWriter(); var positionXZLimit = new FloatLimit(min: -100f, max: 100f, precision: 0.1f); var positionYLimit = new FloatLimit(min: -10f, max: 10f, precision: 0.1f); var rotationLimit = new FloatLimit(min: 0f, max: 360f, precision: 0.1f); var diffPositionLimit = new FloatLimit(min: -1f, max: 1f, precision: 0.1f);  bitWriter.WriteDiffIfChanged(     baseline: before.Position.X,     updated: after.Position.X,     limit: positionXZLimit,     diffLimit: diffPositionLimit);  bitWriter.WriteDiffIfChanged(     baseline: before.Position.Y,     updated: after.Position.Y,     limit: positionYLimit,     diffLimit: diffPositionLimit);  bitWriter.WriteDiffIfChanged(     baseline: before.Position.Z,     updated: after.Position.Z,     limit: positionXZLimit,     diffLimit: diffPositionLimit);  bitWriter.WriteValueIfChanged(     baseline: before.Yaw,     updated: after.Yaw,     limit: rotationLimit);  bitWriter.WriteValueIfChanged(     baseline: before.Pitch,     updated: after.Pitch,     limit: rotationLimit);  bitWriter.Flush();  Console.WriteLine(bitWriter.BytesCount); \/\/ 3<\/code><\/pre>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043c\u044b \u0434\u0435\u043b\u0430\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<ul>\n<li>\n<p>\u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e before, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0434\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439,<\/p>\n<\/li>\n<li>\n<p>\u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e after, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043f\u043e\u0441\u043b\u0435 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439,<\/p>\n<\/li>\n<li>\n<p>\u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043b\u0430\u0441\u0441\u0430 FloatLimit,<\/p>\n<\/li>\n<li>\n<p>\u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0438 \u043f\u043e\u0432\u043e\u0440\u043e\u0442\u044b,<\/p>\n<\/li>\n<li>\n<p>\u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439 \u0431\u0443\u0444\u0435\u0440 \u0432 \u0438\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432,<\/p>\n<\/li>\n<li>\n<p>\u0432\u044b\u0432\u043e\u0434\u0438\u043c \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0431\u0430\u0439\u0442 \u0438\u0442\u043e\u0433\u043e\u0432\u043e\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0430.<\/p>\n<\/li>\n<\/ul>\n<p>\u0418\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u0432\u0438\u0441\u0435\u0442\u044c \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u043d\u044b\u0445 \u043f\u043e\u043b\u0435\u0439, \u043d\u043e \u0438 \u043e\u0442 \u0442\u043e\u0433\u043e, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0438\u043b\u044c\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0438\u0441\u044c \u043f\u043e\u043b\u044f. \u0415\u0441\u043b\u0438 \u043d\u0430\u0448\u0435 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0438\u0433\u0440\u043e\u043a\u0430 \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0438\u0441\u044c \u0432 \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043a\u0435 [-1, 1], \u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0432\u0435\u0440\u043d\u044b\u043c, \u0442\u043e \u0440\u0430\u0437\u043c\u0435\u0440 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441\u043e\u0441\u0442\u0430\u0432\u0438\u0442 3 \u0431\u0430\u0439\u0442\u0430. \u0415\u0441\u043b\u0438 \u043c\u044b \u0434\u043e\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043e\u0448\u0438\u0431\u043a\u0443 \u0432 \u043e\u0446\u0435\u043d\u043a\u0435, \u0442.\u0435. \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0438\u0433\u0440\u043e\u043a\u0430 \u043f\u043e \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043f\u0440\u0438\u0447\u0438\u043d\u0435 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043e\u043d \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0442\u0435\u043b\u0435\u043f\u043e\u0440\u0442) \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0438\u0441\u044c \u0441\u0438\u043b\u044c\u043d\u0435\u0435, \u0442\u043e \u0440\u0430\u0437\u043c\u0435\u0440 \u0441\u043e\u0441\u0442\u0430\u0432\u0438\u0442 5 \u0431\u0430\u0439\u0442, \u043a\u0430\u043a \u0438 \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435.<\/p>\n<details class=\"spoiler\">\n<summary>\u041f\u043e\u043b\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 \u0438 \u0434\u0435\u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cs\">var serializer = new TransformComponentSerializer(); var deserializer = new TransformComponentDeserializer();  var before = new TransformComponent { Position = new Vector3(10f, 5f, 10f), Pitch = 30f, Yaw = 60f }; var after = new TransformComponent { Position = new Vector3(10.5f, 5.5f, 10.5f), Pitch = 30f, Yaw = 60f };  var serializedComponent = serializer.Serialize(before, after); Console.WriteLine(serializedComponent.Length); \/\/ 3  var updated = deserializer.Deserialize(before, serializedComponent.Array);  serializedComponent.Dispose();  Console.WriteLine(updated); \/\/ Position: &lt;10.5, 5.5, 10.5>, Yaw: 60, Pitch: 30  public record struct TransformComponent (Vector3 Position, float Yaw, float Pitch );  public struct SerializedComponent {     private readonly ArrayPool&lt;byte> _arrayPool;          public byte[] Array { get; }          public int Length { get; }      public SerializedComponent(ArrayPool&lt;byte> arrayPool, byte[] array, int length)     {         _arrayPool = arrayPool;         Array = array;         Length = length;     }      public void Dispose()     {         _arrayPool.Return(Array);     } }  public static class Limits {     public static readonly FloatLimit Rotation = new FloatLimit(0, 360, 0.1f);              public static readonly Vector3Limit AbsolutePosition = new Vector3Limit(new FloatLimit(-100f, 100f, 0.1f), new FloatLimit(-10f, 10f, 0.1f), new FloatLimit(-100f, 100f, 0.1f));              public static readonly Vector3Limit DiffPosition = new Vector3Limit(new FloatLimit(-1f, 1f, 0.1f), new FloatLimit(-1f, 1f, 0.1f), new FloatLimit(-1f, 1f, 0.1f)); }  public class TransformComponentSerializer {     private const int MTU = 1500;          private readonly BitWriter _bitWriter = new BitWriter();     private readonly ArrayPool&lt;byte> _arrayPool = ArrayPool&lt;byte>.Shared;      public SerializedComponent Serialize(TransformComponent baseline, TransformComponent updated)     {         var array = _arrayPool.Rent(MTU);         _bitWriter.SetArray(array);                  _bitWriter.WriteDiffIfChanged(baseline.Position.X, updated.Position.X, Limits.AbsolutePosition.X, Limits.DiffPosition.X);         _bitWriter.WriteDiffIfChanged(baseline.Position.Y, updated.Position.Y, Limits.AbsolutePosition.Y, Limits.DiffPosition.Y);         _bitWriter.WriteDiffIfChanged(baseline.Position.Z, updated.Position.Z, Limits.AbsolutePosition.Z, Limits.DiffPosition.Z);                  _bitWriter.WriteValueIfChanged(baseline.Yaw, updated.Yaw, Limits.Rotation);         _bitWriter.WriteValueIfChanged(baseline.Pitch, updated.Pitch, Limits.Rotation);                  _bitWriter.Flush();          return new SerializedComponent(_arrayPool, _bitWriter.Array, _bitWriter.BytesCount);     } }  public class TransformComponentDeserializer {     private readonly BitReader _bitReader = new BitReader();      public TransformComponent Deserialize(TransformComponent before, byte[] array)     {         _bitReader.SetArray(array);          TransformComponent result = default;          result.Position = new Vector3(             _bitReader.ReadFloat(before.Position.X, Limits.AbsolutePosition.X, Limits.DiffPosition.X),             _bitReader.ReadFloat(before.Position.Y, Limits.AbsolutePosition.Y, Limits.DiffPosition.Y),             _bitReader.ReadFloat(before.Position.Z, Limits.AbsolutePosition.Z, Limits.DiffPosition.Z));                  result.Yaw = _bitReader.ReadFloat(before.Yaw, Limits.Rotation);         result.Pitch = _bitReader.ReadFloat(before.Pitch, Limits.Rotation);          return result;     } } <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>\u0417\u0430 3 \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0448\u0430\u0433\u0430 (\u043a\u0432\u0430\u043d\u0442\u0438\u0437\u0430\u0446\u0438\u044f, \u0434\u0435\u043b\u044c\u0442\u0430 \u043a\u043e\u043c\u043f\u0440\u0435\u0441\u0441\u0438\u044f \u0438 \u043a\u0432\u0430\u043d\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u0434\u0435\u043b\u044c\u0442\u044b) \u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 <a href=\"https:\/\/github.com\/Levchenkov\/NetCode\" rel=\"noopener noreferrer nofollow\">NetCode<\/a>, \u043d\u0430\u043c \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0441\u0436\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0441 20 \u0431\u0430\u0439\u0442 \u0434\u043e 3 \u0431\u0430\u0439\u0442.<\/p>\n<h2>\u041c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u044b<\/h2>\n<p><a href=\"https:\/\/gafferongames.com\/post\/snapshot_compression\/\" rel=\"noopener noreferrer nofollow\">https:\/\/gafferongames.com\/post\/snapshot_compression\/<\/a><\/p>\n<p><a href=\"https:\/\/ru.wikipedia.org\/wiki\/Maximum_transmission_unit\" rel=\"noopener noreferrer nofollow\">https:\/\/ru.wikipedia.org\/wiki\/Maximum_transmission_unit<\/a><\/p>\n<p><a href=\"https:\/\/github.com\/Levchenkov\/NetCode\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/Levchenkov\/NetCode<\/a><\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p> <!----> <!----><\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/709954\/\"> https:\/\/habr.com\/ru\/post\/709954\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>C\u0442\u0430\u0442\u044c\u044f \u0437\u0430\u0442\u0440\u0430\u0433\u0438\u0432\u0430\u0435\u0442 \u0442\u0435\u043c\u0443 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u043f\u043e unreliable \u043a\u0430\u043d\u0430\u043b\u0430\u043c.<\/p>\n<p>\u0412 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u044d\u0442\u043e \u043a\u0430\u0441\u0430\u0435\u0442\u0441\u044f \u0440\u0435\u0430\u043b\u0442\u0430\u0439\u043c \u0438\u0433\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043a\u0440\u0438\u0442\u0438\u0447\u043d\u044b \u043a \u0441\u0435\u0442\u0435\u0432\u044b\u043c \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0430\u043c, \u0438\u043c\u0435\u044e\u0442 \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0435 \u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, 10 &#8212; 60 \u0440\u0430\u0437 \u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0443 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 UDP \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b. <\/p>\n<p>\u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u0432\u044b \u0443\u0437\u043d\u0430\u0435\u0442\u0435, \u043a\u0430\u043a \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0434\u0435\u043b\u044c\u0442\u0430 \u043a\u043e\u043c\u043f\u0440\u0435\u0441\u0441\u0438\u0438 \u0438 \u043a\u0432\u0430\u043d\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0440 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0438, \u0442\u0435\u043c \u0441\u0430\u043c\u044b\u043c, \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0440 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445. \u041f\u043e\u043f\u0443\u0442\u043d\u043e \u043c\u044b \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u043c\u0441\u044f \u0441 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 \u0434\u043b\u044f \u0431\u0438\u0442\u043e\u0432\u043e\u0439 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 <a href=\"https:\/\/github.com\/Levchenkov\/NetCode\" rel=\"noopener noreferrer nofollow\">NetCode<\/a>.<\/p>\n<p>\u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c\u044e \u0440\u0435\u0430\u043b\u0442\u0430\u0439\u043c \u0438\u0433\u0440 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u043e, \u0447\u0442\u043e \u043e\u043d\u0438 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b \u043a\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u044e\u0442 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043c\u0438\u0440\u0430 \u043e\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u0430. \u041c\u0430\u043b\u043e \u043a\u043e\u043c\u0443 \u043c\u043e\u0433\u0443\u0442 \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0438 \u043d\u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0438\u0433\u0440\u044b. \u0422\u0443\u0442 \u043e\u0447\u0435\u043d\u044c \u0432\u0430\u0436\u043d\u0443\u044e \u0440\u043e\u043b\u044c \u0438\u0433\u0440\u0430\u044e\u0442: \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f, \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u043c \u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u043d\u0435\u043c\u0430\u043b\u043e\u0432\u0430\u0436\u043d\u0443\u044e \u0440\u043e\u043b\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0438 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445, \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0445 \u043f\u043e \u0441\u0435\u0442\u0438. \u0412\u0435\u0434\u044c \u0438\u043c\u0435\u043d\u043d\u043e \u0441\u043f\u043e\u0441\u043e\u0431 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0440\u0430\u0437\u043c\u0435\u0440 \u0441\u0435\u0442\u0435\u0432\u044b\u0445 \u043f\u0430\u043a\u0435\u0442\u043e\u0432.  \u0412 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0440\u0430\u0437\u043c\u0435\u0440 \u043f\u0430\u043a\u0435\u0442\u043e\u0432, \u0432\u0430\u0436\u0435\u043d \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e \u043f\u0440\u0438\u0447\u0438\u043d\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442-\u043a\u0430\u043d\u0430\u043b\u0430, \u043d\u043e \u0438 \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u043f\u0430\u043a\u0435\u0442\u044b \u043f\u043e\u0434\u0432\u0435\u0440\u0433\u0430\u044e\u0442\u0441\u044f \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438, \u0430 \u043f\u043e\u0442\u0435\u0440\u044f \u043e\u0434\u043d\u043e\u0433\u043e \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u043f\u043e\u0442\u0435\u0440\u0435 \u0432\u0441\u0435\u0433\u043e \u043f\u0430\u043a\u0435\u0442\u0430.<\/p>\n<h3>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430<\/h3>\n<p>\u0412 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u0443 \u0432\u0430\u0441 \u043d\u0430\u0432\u0435\u0440\u043d\u044f\u043a\u0430 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u043b\u0438 \u0432\u043e\u043f\u0440\u043e\u0441\u044b:<\/p>\n<ul>\n<li>\n<p>\u043a\u0430\u043a \u0441\u0436\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435,<\/p>\n<\/li>\n<li>\n<p>\u043a\u0430\u043a \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0440 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u0442\u0430\u043a\u0438\u043c, \u0447\u0442\u043e\u0431\u044b \u043e\u043d\u0438 \u043d\u0435 \u043f\u043e\u0434\u0432\u0435\u0440\u0433\u0430\u043b\u0438\u0441\u044c \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438,<\/p>\n<\/li>\n<li>\n<p>\u043a\u0430\u043a \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u044c \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u0439 \u0442\u0440\u0430\u0444\u0438\u043a?<\/p>\n<\/li>\n<\/ul>\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u043e\u0433\u0440\u0443\u0437\u0438\u0442\u044c\u0441\u044f \u0432 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u0442\u0438\u043a\u0443 \u0440\u0435\u0430\u043b\u0442\u0430\u0439\u043c \u0438\u0433\u0440 \u0438, \u0432 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0441 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439 \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u043f\u0430\u043a\u0435\u0442\u043e\u0432, \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441\u043e \u0441\u0442\u0430\u0442\u044c\u0435\u0439 <a href=\"https:\/\/gafferongames.com\/post\/snapshot_compression\/\" rel=\"noopener noreferrer nofollow\"><u>Snapshot Compression<\/u><\/a> \u0438\u0437 \u0446\u0438\u043a\u043b\u0430 \u0441\u0442\u0430\u0442\u0435\u0439 Gaffer On Games.  \u041d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0438 \u043f\u043e\u0434\u0445\u043e\u0434\u043e\u0432 \u0438\u0437 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0430\u0434 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u043f\u0430\u043a\u0435\u0442\u043e\u0432.<\/p>\n<p>\u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u044c\u0442\u0435 \u0441\u0435\u0431\u0435 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044e: \u0441\u0435\u0440\u0432\u0435\u0440 \u0442\u0438\u043a\u0430\u0435\u0442 \u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u043e\u0442\u043e\u0439 \u0438 \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u0442\u0438\u043a\u0435 \u0440\u0430\u0441\u0441\u044b\u043b\u0430\u0435\u0442 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043c\u0438\u0440\u0430 \u0432\u0441\u0435\u043c \u0438\u0433\u0440\u043e\u043a\u0430\u043c. \u0414\u043b\u044f \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u044f, \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0440\u0430\u0441\u0441\u044b\u043b\u043a\u0443 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u043e \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0438\u0433\u0440\u043e\u043a\u043e\u0432 \u0432 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435.<\/p>\n<p>\u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443:<\/p>\n<pre><code class=\"cs\">public struct TransformComponent {     public Vector3 Position;          public float Yaw;          public float Pitch; }<\/code><\/pre>\n<p>\u0420\u0430\u0437\u043c\u0435\u0440 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b &#8212; 20 \u0431\u0430\u0439\u0442. Position \u0438\u043c\u0435\u0435\u0442 \u0442\u0438\u043f Vector3, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 3 float \u043f\u043e\u043b\u044f \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u043e\u0441\u0438 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 (X, Y \u0438 Z), Yaw \u0438 Pitch \u0442\u043e\u0436\u0435 \u0438\u043c\u0435\u044e\u0442 \u0442\u0438\u043f float. \u0427\u0442\u043e \u0432 \u0438\u0442\u043e\u0433\u0435 \u0434\u0430\u0435\u0442 5 float \u043f\u043e\u043b\u0435\u0439, \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c \u0432 4 \u0431\u0430\u0439\u0442\u0430, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0441\u0443\u043c\u043c\u0430\u0440\u043d\u044b\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 \u0440\u0430\u0432\u0435\u043d 20 \u0431\u0430\u0439\u0442 (5 \u043f\u043e\u043b\u0435\u0439 * 4 \u0431\u0430\u0439\u0442\u0430). <\/p>\n<p>\u0423\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0440\u0430\u0437\u043c\u0435\u0440 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a\u043e\u0439 \u043c\u043e\u0436\u043d\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 SizeOf:  <\/p>\n<pre><code class=\"cs\">Console.WriteLine(Unsafe.SizeOf&lt;TransformComponent>()); \/\/ 20<\/code><\/pre>\n<p>\u0422\u043e\u0433\u0434\u0430, \u0435\u0441\u043b\u0438 \u0443 \u043d\u0430\u0441 \u0448\u0443\u0442\u0435\u0440 5 \u043d\u0430 5, \u0442\u043e \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f 200 \u0431\u0430\u0439\u0442 \u043d\u0430 \u043f\u0430\u043a\u0435\u0442 (20 \u0431\u0430\u0439\u0442 * 10 \u0438\u0433\u0440\u043e\u043a\u043e\u0432).<\/p>\n<p>\u0412\u0440\u043e\u0434\u0435 \u043d\u0435 \u0441\u0442\u0440\u0430\u0448\u043d\u043e \u0438 \u043d\u0435 \u043a\u0440\u0438\u0442\u0438\u0447\u043d\u043e, \u043d\u043e \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442. \u0410 \u0432 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0438\u0433\u0440\u044b, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u044b \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u043e \u0441\u0435\u0442\u0438, \u0432\u0445\u043e\u0434\u044f\u0442 \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b: \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c, \u0437\u0434\u043e\u0440\u043e\u0432\u044c\u0435, \u0430\u043c\u0443\u043d\u0438\u0446\u0438\u044f \u0438 \u0442.\u0434. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0443\u043b\u043e\u0436\u0438\u0442\u044c\u0441\u044f \u0432 1500 \u0431\u0430\u0439\u0442 \u0434\u043b\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c\u043e\u0433\u043e \u043f\u0430\u043a\u0435\u0442\u0430 \u043f\u043e UDP \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e <a href=\"https:\/\/ru.wikipedia.org\/wiki\/Maximum_transmission_unit\" rel=\"noopener noreferrer nofollow\">MTU<\/a>, \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438. <\/p>\n<p>\u0410 \u0435\u0441\u043b\u0438 \u0443 \u043d\u0430\u0441 \u0448\u0443\u0442\u0435\u0440 \u0441 \u0440\u0435\u0436\u0438\u043c\u043e\u043c \u043a\u043e\u0440\u043e\u043b\u0435\u0432\u0441\u043a\u0430\u044f \u0431\u0438\u0442\u0432\u0430 \u043d\u0430 100 \u0447\u0435\u043b\u043e\u0432\u0435\u043a, \u0442\u043e \u0432 \u0438\u0442\u043e\u0433\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f 2 000 \u0431\u0430\u0439\u0442 (20 \u0431\u0430\u0439\u0442 * 100 \u0438\u0433\u0440\u043e\u043a\u043e\u0432), \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442, \u0447\u0442\u043e \u0434\u0430\u0436\u0435 \u0441 1 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u043c \u043d\u0435 \u0443\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u043c\u0441\u044f \u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b MTU.<\/p>\n<p>\u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0437\u043e\u043d\u044b \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0430, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0445 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439, \u043d\u043e \u0441\u0443\u0442\u0438 \u044d\u0442\u043e \u043d\u0435 \u043c\u0435\u043d\u044f\u0435\u0442.<\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <a href=\"https:\/\/github.com\/RevenantX\/LiteNetLib\" rel=\"noopener noreferrer nofollow\">LiteNetLib<\/a> \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 MTU \u0440\u0430\u0432\u043d\u044b\u0439 1024 \u0431\u0430\u0439\u0442, <a href=\"https:\/\/github.com\/RevenantX\/LiteNetLib\/blob\/4fc5b55aedfa01174b6c423239e90c02165d5594\/LiteNetLib\/NetConstants.cs#L60\" rel=\"noopener noreferrer nofollow\">\u043f\u0440\u0443\u0444<\/a>. \u0418 \u0435\u0441\u043b\u0438 \u0432\u044b \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0435 \u043f\u043e unreliable \u043a\u0430\u043d\u0430\u043b\u0443 \u043f\u0430\u043a\u0435\u0442 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c 1025 \u0431\u0430\u0439\u0442, \u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 <a href=\"https:\/\/github.com\/RevenantX\/LiteNetLib\/blob\/053cddc78b72e889fbcb1cdcfba406381a6a89f9\/LiteNetLib\/NetPeer.cs#L610\" rel=\"noopener noreferrer nofollow\">\u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/a>.<\/p>\n<p>\u041c\u043e\u0436\u043d\u043e \u043b\u0438 \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0440? \u0421\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u0432\u044b\u0448\u0435\u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 <a href=\"https:\/\/gafferongames.com\/post\/snapshot_compression\/\" rel=\"noopener noreferrer nofollow\"><u>Snapshot Compression<\/u><\/a>, \u043c\u043e\u0436\u043d\u043e. \u041f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u0438\u0435\u043c\u043e\u043c \u043a\u0432\u0430\u043d\u0442\u0438\u0437\u0430\u0446\u0438\u0438, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e, \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0442\u044c \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043f\u043e\u043b\u0435\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b.\u00a0<\/p>\n<h3>\u041a\u0432\u0430\u043d\u0442\u0438\u0437\u0430\u0446\u0438\u044f<\/h3>\n<p>\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043a\u0432\u0430\u043d\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0432 <a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%9A%D0%B2%D0%B0%D0%BD%D1%82%D0%BE%D0%B2%D0%B0%D0%BD%D0%B8%D0%B5\" rel=\"noopener noreferrer nofollow\">\u0412\u0438\u043a\u0438\u043f\u0435\u0434\u0438\u0438<\/a>. \u0415\u0441\u043b\u0438 \u0441\u043e\u0432\u0441\u0435\u043c \u043a\u043e\u0440\u043e\u0442\u043a\u043e, \u0442\u043e \u043a\u0432\u0430\u043d\u0442\u0438\u0437\u0430\u0446\u0438\u044f &#8212; \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u0435\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b \u0432 \u0446\u0435\u043b\u044b\u0435.<\/p>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0434\u0430\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441.<\/p>\n<p>\u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043c, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0438\u0433\u0440\u043e\u0432\u043e\u0435 \u043f\u043e\u043b\u0435 100 \u043d\u0430 100 \u0438 \u0435\u0433\u043e \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u043c\u043e\u0433\u0443\u0442 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u0434\u0440\u043e\u0431\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435. \u0422\u0430\u043a\u0436\u0435 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c, \u0447\u0442\u043e \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u0432 0.1 \u0435\u0434\u0438\u043d\u0438\u0446\u044b \u043d\u0430\u043c \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e. \u0421 \u0442\u0430\u043a\u0438\u043c\u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u043d\u0430\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0442\u0438\u043f float, \u0435\u0433\u043e \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043e\u0442 \u00b11.5 x 10<sup>\u221245<\/sup>\u00a0\u0434\u043e \u00b13.4 x 10<sup>38<\/sup>  \u0438 \u0440\u0430\u0437\u043c\u0435\u0440 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 4 \u0431\u0430\u0439\u0442\u0430. \u041d\u043e \u0434\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0432\u0435\u0441\u044c \u0434\u0438\u0430\u043f\u043e\u0437\u043e\u043d \u043d\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u0435\u043d, \u0434\u0430 \u0438 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u0432 7 \u0437\u043d\u0430\u043a\u043e\u0432 \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u044f\u0442\u043e\u0439 \u0434\u043b\u044f \u043d\u0430\u0441 \u044d\u0442\u043e \u043f\u0435\u0440\u0435\u0431\u043e\u0440. <\/p>\n<p>\u041c\u043e\u0436\u043d\u043e \u043b\u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0438 \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0431\u0438\u0442 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f? \u0414\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432\u0441\u0435\u0433\u043e 1000 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u043e\u0441\u0438 (100 * 10), \u0442.\u0435. 10 \u0431\u0438\u0442 \u043d\u0430 \u043e\u0441\u044c \u0438\u043b\u0438 20 \u0431\u0438\u0442 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u043d\u0430 \u043d\u0430\u0448\u0435\u043c \u0438\u0433\u0440\u043e\u0432\u043e\u043c \u043f\u043e\u043b\u0435. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0442\u0438\u043f\u0430 float \u0431\u0435\u0437 \u043a\u0432\u0430\u043d\u0442\u0438\u0437\u0430\u0446\u0438\u0438, \u0443 \u043d\u0430\u0441 \u0431\u044b\u043b\u043e \u0431\u044b 64 \u0431\u0438\u0442\u0430 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 (32 * 2).<\/p>\n<p>\u041a\u0432\u0430\u043d\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0436\u043d\u043e \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0438\u043f\u044b \u0441 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0435\u0439 \u0442\u043e\u0447\u043a\u043e\u0439 float \u0438 double, \u043d\u043e \u0438 \u0446\u0435\u043b\u043e\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0435. <\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u043d\u0430\u0448\u0435\u0439 \u0438\u0433\u0440\u0435 \u043d\u0443\u0436\u043d\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0443\u0433\u043e\u043b \u043f\u043e\u0432\u043e\u0440\u043e\u0442\u0430 \u0432 \u0433\u0440\u0430\u0434\u0443\u0441\u0430\u0445 &#8212; \u043e\u0442 0 \u0438 \u0434\u043e 360. \u0414\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f 9 \u0431\u0438\u0442. \u0417\u043d\u0430\u0447\u0438\u0442 8 \u0431\u0438\u0442\u043e\u0432\u043e\u0433\u043e \u0442\u0438\u043f\u0430 byte \u043d\u0430\u043c \u043d\u0435 \u0445\u0432\u0430\u0442\u0438\u0442, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u0439 \u0442\u0438\u043f \u044d\u0442\u043e ushort 16 \u0431\u0438\u0442, \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e 65535. \u041d\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e 9 \u0431\u0438\u0442. \u041a\u0432\u0430\u043d\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u043a\u0430\u043a \u0440\u0430\u0437 \u043d\u0430\u043c \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e 9 \u0438\u0437 16 \u0431\u0438\u0442.<\/p>\n<p>\u0421\u0430\u043c\u044b\u0439 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0439 \u0442\u0438\u043f \u0432 C# \u044d\u0442\u043e byte, \u043a\u0430\u043a \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0434\u043e\u0433\u0430\u0434\u0430\u0442\u044c\u0441\u044f, \u0435\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440 \u0440\u0430\u0432\u0435\u043d 1 \u0431\u0430\u0439\u0442\u0443. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u0431\u0438\u0442\u0430\u043c\u0438 \u043d\u0430\u0434\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u0438\u0442\u043e\u0432\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438. \u041a \u0441\u0430\u043c\u0438\u043c \u0431\u0438\u0442\u043e\u0432\u044b\u043c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f\u043c \u043f\u0440\u0435\u0442\u0435\u043d\u0437\u0438\u0439 \u043d\u0435\u0442, \u043d\u043e \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u043d\u0435\u043b\u0435\u0433\u043a\u0443\u044e \u0436\u0438\u0437\u043d\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u0438 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442: \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 <a href=\"https:\/\/github.com\/Levchenkov\/NetCode\" rel=\"noopener noreferrer nofollow\">NetCode<\/a>.<\/p>\n<p>\u041d\u0430\u043f\u043e\u043c\u043d\u044e, \u0447\u0442\u043e \u0442\u0438\u043f bool \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 \u0442\u043e\u0436\u0435 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 1 \u0431\u0430\u0439\u0442, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u043e\u0436\u0435\u043c \u0437\u0430\u0431\u044b\u0442\u044c \u043f\u0440\u043e \u043c\u0430\u0441\u0441\u0438\u0432 \u0438\u0437 bool. <\/p>\n<h3>NetCode<\/h3>\n<p><a href=\"https:\/\/github.com\/Levchenkov\/NetCode\" rel=\"noopener noreferrer nofollow\">NetCode<\/a> \u044d\u0442\u043e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0441 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c. \u041e\u043d\u0430 \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0430 \u0434\u043b\u044f \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u044b \u043f\u043e \u0441\u0435\u0442\u0438, \u0438 \u043d\u0430\u0446\u0435\u043b\u0435\u043d\u0430 \u043d\u0430 \u0443\u043c\u0435\u043d\u044c\u0448\u0435\u043d\u0438\u0435 \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0430. \u0412\u044b\u0441\u043e\u043a\u0430\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0438 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u0430\u043b\u043b\u043e\u043a\u0430\u0446\u0438\u0439 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u044d\u0442\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438. \u0412\u0441\u0435 \u0442\u043e, \u0447\u0442\u043e \u043c\u044b \u0442\u0430\u043a \u043b\u044e\u0431\u0438\u043c \u0438 \u0446\u0435\u043d\u0438\u043c \u0432 \u043d\u0430\u0448\u0435\u0439 \u0440\u0430\u0431\u043e\u0442\u0435.<\/p>\n<p>\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043d\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0430\u0431\u043e\u0440 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u0431\u0438\u0442\u0430\u043c\u0438 \u0447\u0438\u0441\u043b\u0430 \u0438 \u043d\u0435 \u0443\u043c\u0435\u0435\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u0431\u0438\u0442\u043e\u0432, \u0437\u0430\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0432 \u043c\u0430\u0441\u0441\u0438\u0432 \u0431\u0430\u0439\u0442\u043e\u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0431\u0438\u0442 \u0438\u0437 \u0431\u0438\u0442\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0447\u0438\u0441\u043b\u0430:<\/p>\n<pre><code class=\"cs\">var bitWriter = new BitWriter();  bitWriter.WriteBits(bitCount: 3, value: 0b_101010); \/\/ 0b_010        bitWriter.WriteBits(bitCount: 3, value: 0b_1111); \/\/ 0b_111  Console.WriteLine(bitWriter.BitsCount); \/\/ 6  bitWriter.Flush();  Console.WriteLine(bitWriter.BitsCount); \/\/ 8  byte[] data = bitWriter.Array; \/\/ data[0] == 0b_111010 Console.WriteLine(Convert.ToString(value: data[0], toBase: 2)); \/\/ 111010<\/code><\/pre>\n<p>\u0412 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u043c \u0432\u044b\u0448\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043c\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043b\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435: <\/p>\n<ul>\n<li>\n<p>2 \u0440\u0430\u0437\u0430 \u0437\u0430\u043f\u0438\u0441\u0430\u043b\u0438 \u043f\u043e 3 \u0431\u0438\u0442\u0430 (010 \u0438 111), \u0445\u043e\u0442\u044f \u0441\u0430\u043c\u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u0447\u0438\u0441\u043b\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043b\u0438 \u0431\u043e\u043b\u044c\u0448\u0435 \u0437\u043d\u0430\u0447\u0438\u043c\u044b\u0445 \u0431\u0438\u0442\u043e\u0432 (101010 \u0438 1111 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e),<\/p>\n<\/li>\n<li>\n<p>\u0432\u044b\u0432\u0435\u043b\u0438 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435 \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u0431\u0438\u0442\u043e\u0432,<\/p>\n<\/li>\n<li>\n<p>\u0437\u0430\u043f\u0438\u0441\u0430\u043b\u0438 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439 \u0431\u0443\u0444\u0435\u0440 \u0432 \u0438\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432,<\/p>\n<\/li>\n<li>\n<p>\u043e\u043f\u044f\u0442\u044c \u0432\u044b\u0432\u0435\u043b\u0438 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435 \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u0431\u0438\u0442\u043e\u0432,<\/p>\n<\/li>\n<li>\n<p>\u0438 \u0432\u044b\u0432\u0435\u043b\u0438 \u043d\u0430 \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0438\u0442\u043e\u0433\u043e\u0432\u043e\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0430.<\/p>\n<\/li>\n<\/ul>\n<p>\u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435, \u043f\u043e\u043b\u0443\u0447\u0435\u043d \u043c\u0430\u0441\u0441\u0438\u0432, \u043f\u0435\u0440\u0432\u044b\u0439 \u0431\u0430\u0439\u0442 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043d\u0430\u0448\u0438 \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u0431\u0438\u0442\u044b 010 \u0438 111.<\/p>\n<p>\u041f\u043e\u0431\u0438\u0442\u043e\u0432\u0430\u044f \u0437\u0430\u043f\u0438\u0441\u044c \u0447\u0438\u0441\u043b\u0430, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u0445\u043e\u0440\u043e\u0448\u043e, \u043d\u043e \u043c\u044b \u0441\u044e\u0434\u0430 \u043f\u0440\u0438\u0448\u043b\u0438 \u043d\u0435 \u0437\u0430 \u044d\u0442\u0438\u043c.<\/p>\n<h3>\u041a\u0432\u0430\u043d\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e NetCode<\/h3>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u043e \u043a\u0432\u0430\u043d\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439:<\/p>\n<pre><code class=\"cs\">var bitWriter = new BitWriter();  bitWriter.Write(value: 1f, min: 0f, max: 100f, precision: 0.1f);  Console.WriteLine(bitWriter.BitsCount); \/\/ 10          bitWriter.Flush();  Console.WriteLine(bitWriter.BitsCount); \/\/ 16  var data = bitWriter.Array; var bitReader = new BitReader(data);  var value = bitReader.ReadFloat(min: 0f, max: 100f, precision: 0.1f);  Console.WriteLine(value); \/\/ 1<\/code><\/pre>\n<p>\u0412 \u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043c\u044b \u0434\u0435\u043b\u0430\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<ul>\n<li>\n<p>\u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c float \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0441\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c 1f, \u0441 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \u043e\u0442 0 \u0434\u043e 100 \u0438 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c\u044e \u0432 0.1 ,<\/p>\n<\/li>\n<li>\n<p> \u0432\u044b\u0432\u043e\u0434\u0438\u043c \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435 \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u0431\u0438\u0442\u043e\u0432,<\/p>\n<\/li>\n<li>\n<p>\u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439 \u0431\u0443\u0444\u0435\u0440 \u0432 \u0438\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432,<\/p>\n<\/li>\n<li>\n<p>\u043e\u043f\u044f\u0442\u044c \u0432\u044b\u0432\u043e\u0434\u0438\u043c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435 \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u0431\u0438\u0442\u043e\u0432,<\/p>\n<\/li>\n<li>\n<p>\u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u043a\u043b\u0430\u0441\u0441\u0430 BitReader,<\/p>\n<\/li>\n<li>\n<p>\u0447\u0438\u0442\u0430\u0435\u043c float \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0441 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \u043e\u0442 0 \u0434\u043e 100 \u0438 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c\u044e \u0432 0.1,<\/p>\n<\/li>\n<li>\n<p>\u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435.<\/p>\n<\/li>\n<\/ul>\n<p>\u041a\u0430\u043a \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442, \u043c\u044b \u0437\u0430\u043f\u0438\u0441\u0430\u043b\u0438 \u0434\u0440\u043e\u0431\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e 10 \u0431\u0438\u0442\u043e\u0432 \u0438 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u043b\u0438 \u044d\u0442\u043e \u0447\u0438\u0441\u043b\u043e \u043d\u0430\u0437\u0430\u0434.<\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c, \u0447\u0442\u043e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0432\u0441\u0435\u0433\u043e \u043e\u0434\u043d\u0443 \u0441\u0442\u0440\u043e\u043a\u0443 \u043a\u043e\u0434\u0430 \u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 \u043c\u0430\u0441\u0441\u0438\u0432:<\/p>\n<pre><code class=\"cs\">bitWriter.Write(value: 1f, min: 0f, max: 100f, precision: 0.1f);<\/code><\/pre>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0432\u0435\u0440\u043d\u0435\u043c\u0441\u044f \u043a \u043d\u0430\u0448\u0435\u043c\u0443 \u043f\u0440\u0438\u043c\u0435\u0440\u0443 \u0441 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0439, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0438\u0433\u0440\u043e\u043a\u043e\u0432 \u0432 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435, \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 NetCode \u0441\u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u043c \u043f\u043e\u043c\u043e\u0447\u044c.<\/p>\n<p>\u041d\u0430\u043f\u043e\u043c\u043d\u044e, \u0447\u0442\u043e \u043d\u0430\u0448\u0430 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u0438\u043c\u0435\u0435\u0442 \u0432\u0438\u0434:<\/p>\n<pre><code class=\"cs\">public struct TransformComponent {     public Vector3 Position;          public float Yaw;          public float Pitch; }<\/code><\/pre>\n<p>\u0438 \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u0447\u0442\u043e \u043d\u0430\u0448\u0435 \u0438\u0433\u0440\u043e\u0432\u043e\u0435 \u043f\u043e\u043b\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043e:<\/p>\n<ul>\n<li>\n<p>-100 &lt; X &lt; 100,<\/p>\n<\/li>\n<li>\n<p>-10 &lt; Y &lt; 10,<\/p>\n<\/li>\n<li>\n<p>-100 &lt; Z &lt; 100,<\/p>\n<\/li>\n<\/ul>\n<p>\u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043f\u0443\u0441\u0442\u044c \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 0.1 \u0435\u0434\u0438\u043d\u0438\u0446\u044b (\u043f\u043e\u043f\u0443\u0433\u0430\u0435\u0432, \u043c\u0435\u0442\u0440\u043e\u0432 \u0438\u043b\u0438 \u0444\u0443\u0442\u043e\u0432). <\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u043d\u0430\u043b\u043e\u0436\u0438\u043c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u043d\u0430 \u0443\u0433\u043b\u044b \u043f\u043e\u0432\u043e\u0440\u043e\u0442\u0430:<\/p>\n<ul>\n<li>\n<p>0 &lt; Yaw, Pitch  &lt; 360,<\/p>\n<\/li>\n<\/ul>\n<p>\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u0443\u0433\u043b\u0430 \u043f\u043e\u0432\u043e\u0440\u043e\u0442\u0430 \u043f\u0443\u0441\u0442\u044c \u0431\u0443\u0434\u0435\u0442 0.1 \u0433\u0440\u0430\u0434\u0443\u0441.<\/p>\n<p>\u0422\u043e\u0433\u0434\u0430 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0440\u0438\u043c\u0435\u0442 \u0432\u0438\u0434:<\/p>\n<pre><code class=\"cs\">var bitWriter = new BitWriter();  var positionXZLimit = new FloatLimit(min: -100f, max: 100f, precision: 0.1f); var positionYLimit = new FloatLimit(min: -10f, max: 10f, precision: 0.1f); var rotationLimit = new FloatLimit(min: 0f, max: 360f, precision: 0.1f);  var transformComponent = new TransformComponent { Position = new Vector3(10f, 5f, 10f), Pitch = 30f, Yaw = 60f };  bitWriter.Write(value: transformComponent.Position.X, limit: positionXZLimit); bitWriter.Write(value: transformComponent.Position.Y, limit: positionYLimit); bitWriter.Write(value: transformComponent.Position.Z, limit: positionXZLimit);  bitWriter.Write(value: transformComponent.Yaw, limit: rotationLimit); bitWriter.Write(value: transformComponent.Pitch, limit: rotationLimit);  bitWriter.Flush();  Console.WriteLine(bitWriter.BytesCount); \/\/ 7<\/code><\/pre>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043c\u044b:<\/p>\n<ul>\n<li>\n<p>\u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043b\u0430\u0441\u0441\u0430 FloatLimit,<\/p>\n<\/li>\n<li>\n<p>\u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043e\u0431\u044a\u0435\u043a\u0442 \u043d\u0430\u0448\u0435\u0439 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0443\u0435\u043c\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b,<\/p>\n<\/li>\n<li>\n<p>\u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0438 \u043f\u043e\u0432\u043e\u0440\u043e\u0442\u044b,<\/p>\n<\/li>\n<li>\n<p>\u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439 \u0431\u0443\u0444\u0435\u0440 \u0432 \u0438\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432,<\/p>\n<\/li>\n<li>\n<p>\u0432\u044b\u0432\u043e\u0434\u0438\u043c \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0431\u0430\u0439\u0442 \u0438\u0442\u043e\u0433\u043e\u0432\u043e\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0430.<\/p>\n<\/li>\n<\/ul>\n<p>\u0420\u0430\u0437\u043c\u0435\u0440 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 7 \u0431\u0430\u0439\u0442. \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043d\u0435\u043f\u043b\u043e\u0445\u043e\u0439. \u041d\u043e \u043c\u043e\u0436\u043d\u043e \u0435\u0449\u0435 \u043b\u0443\u0447\u0448\u0435!<\/p>\n<h3>\u0414\u0435\u043b\u044c\u0442\u0430<\/h3>\n<p>\u0414\u0435\u043b\u044c\u0442\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439, \u043e\u043d\u0430 \u0436\u0435 \u0434\u0438\u0444\u0444 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439, \u043e\u043d\u0430 \u0436\u0435 \u0440\u0430\u0437\u043d\u043e\u0441\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439.<\/p>\n<p>\u041c\u044b \u043c\u043e\u0436\u0435\u043c<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-343770","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/343770","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=343770"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/343770\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=343770"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=343770"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=343770"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}