{"id":1911,"date":"2023-05-18T23:43:04","date_gmt":"2023-05-18T21:43:04","guid":{"rendered":"https:\/\/konekan.fr\/?p=1911"},"modified":"2025-05-22T23:04:37","modified_gmt":"2025-05-22T21:04:37","slug":"network-protocol-and-rust-broker-for-video-games-en","status":"publish","type":"post","link":"https:\/\/konekan.fr\/index.php\/en\/2023\/05\/18\/network-protocol-and-rust-broker-for-video-games-en\/","title":{"rendered":"Network Protocol and Rust Broker for Video Games"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"1911\" class=\"elementor elementor-1911\" data-elementor-post-type=\"post\">\n\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-45ebf1ad elementor-section-full_width elementor-section-height-default elementor-section-height-default\" data-id=\"45ebf1ad\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-wider\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-1c7ed7ab\" data-id=\"1c7ed7ab\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-6bce50cb elementor-widget elementor-widget-heading\" data-id=\"6bce50cb\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h1 class=\"elementor-heading-title elementor-size-default\">Network Protocol and Rust Broker for Video Games<\/h1>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<section class=\"elementor-section elementor-inner-section elementor-element elementor-element-8787267 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"8787267\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-inner-column elementor-element elementor-element-674051fd\" data-id=\"674051fd\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-2958fd86 elementor-align-center elementor-widget elementor-widget-post-info\" data-id=\"2958fd86\" data-element_type=\"widget\" data-widget_type=\"post-info.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<ul class=\"elementor-inline-items elementor-icon-list-items elementor-post-info\">\n\t\t\t\t\t\t\t\t<li class=\"elementor-icon-list-item elementor-repeater-item-49a232a elementor-inline-item\" itemprop=\"author\">\n\t\t\t\t\t\t<a href=\"https:\/\/konekan.fr\/index.php\/author\/lucasguichard127\/\">\n\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-icon-list-icon\">\n\t\t\t\t\t\t\t\t<i aria-hidden=\"true\" class=\"far fa-user-circle\"><\/i>\t\t\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t<span class=\"elementor-icon-list-text elementor-post-info__item elementor-post-info__item--type-author\">\n\t\t\t\t\t\t\t\t\t\tlucasguichard127\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t<\/a>\n\t\t\t\t<\/li>\n\t\t\t\t<li class=\"elementor-icon-list-item elementor-repeater-item-05df5ef elementor-inline-item\" itemprop=\"datePublished\">\n\t\t\t\t\t\t<a href=\"https:\/\/konekan.fr\/index.php\/2023\/05\/18\/\">\n\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-icon-list-icon\">\n\t\t\t\t\t\t\t\t<i aria-hidden=\"true\" class=\"fas fa-calendar\"><\/i>\t\t\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t<span class=\"elementor-icon-list-text elementor-post-info__item elementor-post-info__item--type-date\">\n\t\t\t\t\t\t\t\t\t\t<time>mai 18, 2023<\/time>\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t<\/a>\n\t\t\t\t<\/li>\n\t\t\t\t<li class=\"elementor-icon-list-item elementor-repeater-item-697cf04 elementor-inline-item\">\n\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-icon-list-icon\">\n\t\t\t\t\t\t\t\t<i aria-hidden=\"true\" class=\"far fa-clock\"><\/i>\t\t\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t<span class=\"elementor-icon-list-text elementor-post-info__item elementor-post-info__item--type-time\">\n\t\t\t\t\t\t\t\t\t\t<time>11:43 pm<\/time>\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t<\/li>\n\t\t\t\t<li class=\"elementor-icon-list-item elementor-repeater-item-bf070ba elementor-inline-item\" itemprop=\"commentCount\">\n\t\t\t\t\t\t<a href=\"https:\/\/konekan.fr\/index.php\/en\/2023\/05\/18\/network-protocol-and-rust-broker-for-video-games-en\/#respond\">\n\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-icon-list-icon\">\n\t\t\t\t\t\t\t\t<i aria-hidden=\"true\" class=\"far fa-comment-dots\"><\/i>\t\t\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t<span class=\"elementor-icon-list-text elementor-post-info__item elementor-post-info__item--type-comments\">\n\t\t\t\t\t\t\t\t\t\tAucun commentaire\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t<\/a>\n\t\t\t\t<\/li>\n\t\t\t\t<li class=\"elementor-icon-list-item elementor-repeater-item-dcee5c4 elementor-inline-item\" itemprop=\"about\">\n\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-icon-list-icon\">\n\t\t\t\t\t\t\t\t<i aria-hidden=\"true\" class=\"fas fa-tags\"><\/i>\t\t\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t<span class=\"elementor-icon-list-text elementor-post-info__item elementor-post-info__item--type-terms\">\n\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-post-info__terms-list\">\n\t\t\t\t<a href=\"https:\/\/konekan.fr\/index.php\/en\/tag\/async-en\/\" class=\"elementor-post-info__terms-list-item\">async<\/a>, <a href=\"https:\/\/konekan.fr\/index.php\/en\/tag\/network-en\/\" class=\"elementor-post-info__terms-list-item\">network<\/a>, <a href=\"https:\/\/konekan.fr\/index.php\/en\/tag\/team-project-en\/\" class=\"elementor-post-info__terms-list-item\">Projet d&#039;\u00e9quipe<\/a>, <a href=\"https:\/\/konekan.fr\/index.php\/en\/tag\/rust-en\/\" class=\"elementor-post-info__terms-list-item\">Rust<\/a>, <a href=\"https:\/\/konekan.fr\/index.php\/en\/tag\/tokio-en\/\" class=\"elementor-post-info__terms-list-item\">tokio<\/a>, <a href=\"https:\/\/konekan.fr\/index.php\/en\/tag\/unreal-engine-en\/\" class=\"elementor-post-info__terms-list-item\">Unreal Engine<\/a>\t\t\t\t<\/span>\n\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t<\/li>\n\t\t\t\t<\/ul>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-inner-section elementor-element elementor-element-2a3c173f elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"2a3c173f\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-inner-column elementor-element elementor-element-114bcf9e\" data-id=\"114bcf9e\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-1d5c3837 elementor-position-left elementor-widget__width-auto elementor-vertical-align-middle elementor-view-default elementor-mobile-position-top elementor-widget elementor-widget-icon-box\" data-id=\"1d5c3837\" data-element_type=\"widget\" data-widget_type=\"icon-box.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"elementor-icon-box-wrapper\">\n\n\t\t\t\t\t\t<div class=\"elementor-icon-box-icon\">\n\t\t\t\t<a href=\"https:\/\/github.com\/GuicLuca\/RekT_Protocol\" target=\"_blank\" class=\"elementor-icon\" tabindex=\"-1\">\n\t\t\t\t<i aria-hidden=\"true\" class=\"fab fa-github-alt\"><\/i>\t\t\t\t<\/a>\n\t\t\t<\/div>\n\t\t\t\n\t\t\t\t\t\t<div class=\"elementor-icon-box-content\">\n\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t<p class=\"elementor-icon-box-description\">\n\t\t\t\t\t\tGitHub repository\n\t\t\t\t\t<\/p>\n\t\t\t\t\n\t\t\t<\/div>\n\t\t\t\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-12cad12e elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"12cad12e\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-wider\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-415ba934\" data-id=\"415ba934\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-2a0465f1 elementor-widget elementor-widget-heading\" data-id=\"2a0465f1\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">Context<\/h3>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-76f2afc0 elementor-widget elementor-widget-text-editor\" data-id=\"76f2afc0\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p style=\"text-align: justify;\">\u00a0 \u00a0 \u00a0 \u00a0The RekT protocol (Rapid Encrypted Knot Transfer) was developed as part of the project course during the Winter 2023 semester at UQAC (University of Quebec at Chicoutimi), taught by Val\u00e8re Plantevin. The project involved simulating several hundred players on a single game map using Unreal Engine. The course was attended by a group of eight students aiming to deepen their knowledge of online multiplayer video game development. The course followed a \u00ab\u00a0research\u00a0\u00bb format, meaning we were left to our own devices to tackle challenges and independently learn about new technologies and concepts. Nevertheless, we provided weekly progress reports to ensure the project was on track.<\/p><p style=\"text-align: justify;\">\u00a0 \u00a0 \u00a0 \u00a0The group was divided into two teams. The \u00ab\u00a0game engine\u00a0\u00bb team (five members) was responsible for understanding how the Flecs ECS (Entity Component System) worked to manage all player actions on the client side. They also had to replace Unreal Engine 5&rsquo;s replication system to support the protocol developed by the second team. The \u00ab\u00a0network\u00a0\u00bb team, consisting of three members, was tasked with writing a pub\/sub protocol and coding a broker (server) capable of handling as many connections as possible with minimal resource consumption.<\/p><p style=\"text-align: justify;\">\u00a0 \u00a0 \u00a0 \u00a0For this project, I was part of the second team, and the following sections of this article will detail the networking aspects of the project.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-96c7a42 elementor-widget-divider--view-line_icon elementor-view-default elementor-widget-divider--element-align-center elementor-widget elementor-widget-divider\" data-id=\"96c7a42\" data-element_type=\"widget\" data-widget_type=\"divider.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"elementor-divider\">\n\t\t\t<span class=\"elementor-divider-separator\">\n\t\t\t\t\t\t\t<div class=\"elementor-icon elementor-divider__element\">\n\t\t\t\t\t<i aria-hidden=\"true\" class=\"fas fa-network-wired\"><\/i><\/div>\n\t\t\t\t\t\t<\/span>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-71bbb2ef elementor-widget elementor-widget-heading\" data-id=\"71bbb2ef\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h5 class=\"elementor-heading-title elementor-size-default\">A Two-Phase Approach<\/h5>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-6fc87336 elementor-widget elementor-widget-text-editor\" data-id=\"6fc87336\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p style=\"text-align: justify;\">\u00a0 \u00a0 \u00a0 \u00a0For our team, the work was divided into two phases. The first phase was focused on research and design, during which we learned about how pub\/sub protocols function and compiled a list of requirements for a network protocol in video games. This allowed us to draft our own protocol, the RFC for which can be found <a href=\"https:\/\/docs.google.com\/document\/d\/14CvwkXtRae_5xV28Figp6gdxwyYd5Fqvls8pvmseKAI\/edit?usp=sharing\">here<\/a>. The second phase involved coding a broker that uses our protocol to enable the \u201cgame engine\u201d team to simulate connections with up to 300 players or more!<\/p><p style=\"text-align: justify;\">\u00a0 \u00a0 \u00a0 \u00a0In short, our goal was always to push for greater performance and optimization!<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-ebcd963 elementor-widget elementor-widget-heading\" data-id=\"ebcd963\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h5 class=\"elementor-heading-title elementor-size-default\">The RekT protocol<\/h5>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-17dd928 elementor-widget elementor-widget-text-editor\" data-id=\"17dd928\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p style=\"text-align: justify;\">\u00a0 \u00a0 \u00a0 \u00a0The RekT protocol (Rapid Encrypted Knot Transfer) is a UDP-based network protocol designed to meet the speed and optimization demands of multiplayer video games with a large number of players. Inspired by the Tachyon protocol, RekT primarily focuses on fast data transmission. Aware of the specific requirements of multiplayer games with a high player count (300+), RekT aims to minimize latency and optimize network performance.<\/p><p style=\"text-align: justify;\">\u00a0 \u00a0 \u00a0 \u00a0During the initial connection, RekT employs a handshake system to verify client authenticity and register them as valid connections on the server. Once the connection is established, the protocol operates on a pub\/sub (publish\/subscribe) model using topics and objects (groups of topics). This allows clients to subscribe to relevant topics to receive only the data they are interested in.<\/p><p style=\"text-align: justify;\">\u00a0 \u00a0 \u00a0 \u00a0To simplify implementation, RekT does not currently support authority systems or encryption. However, we are aware that data security must be considered and could be added in future versions of the protocol.<\/p><p style=\"text-align: justify;\">\u00a0 \u00a0 \u00a0 \u00a0To maintain an active connection with the server, clients must periodically send requests or \u00ab\u00a0heartbeats\u00a0\u00bb to signal activity when no other requests are necessary. If a client fails to maintain this connection, the server will disconnect them.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<section class=\"elementor-section elementor-inner-section elementor-element elementor-element-7c8f36ab elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"7c8f36ab\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-50 elementor-inner-column elementor-element elementor-element-379ffa14\" data-id=\"379ffa14\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-1d689bab elementor-icon-list--layout-traditional elementor-list-item-link-full_width elementor-widget elementor-widget-icon-list\" data-id=\"1d689bab\" data-element_type=\"widget\" data-widget_type=\"icon-list.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<ul class=\"elementor-icon-list-items\">\n\t\t\t\t\t\t\t<li class=\"elementor-icon-list-item\">\n\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-icon-list-icon\">\n\t\t\t\t\t\t\t<i aria-hidden=\"true\" class=\"fas fa-network-wired\"><\/i>\t\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-icon-list-text\">Protocol : UDP <\/span>\n\t\t\t\t\t\t\t\t\t<\/li>\n\t\t\t\t\t\t\t\t<li class=\"elementor-icon-list-item\">\n\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-icon-list-icon\">\n\t\t\t\t\t\t\t<i aria-hidden=\"true\" class=\"fas fa-cogs\"><\/i>\t\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-icon-list-text\">Architecture: Pub\/Sub<\/span>\n\t\t\t\t\t\t\t\t\t<\/li>\n\t\t\t\t\t\t<\/ul>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t<div class=\"elementor-column elementor-col-50 elementor-inner-column elementor-element elementor-element-37ec5688\" data-id=\"37ec5688\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-1d50fcff elementor-icon-list--layout-traditional elementor-list-item-link-full_width elementor-widget elementor-widget-icon-list\" data-id=\"1d50fcff\" data-element_type=\"widget\" data-widget_type=\"icon-list.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<ul class=\"elementor-icon-list-items\">\n\t\t\t\t\t\t\t<li class=\"elementor-icon-list-item\">\n\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-icon-list-icon\">\n\t\t\t\t\t\t\t<i aria-hidden=\"true\" class=\"fas fa-search-minus\"><\/i>\t\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-icon-list-text\">Inspiration: Tachyon Protocol<\/span>\n\t\t\t\t\t\t\t\t\t<\/li>\n\t\t\t\t\t\t\t\t<li class=\"elementor-icon-list-item\">\n\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-icon-list-icon\">\n\t\t\t\t\t\t\t<i aria-hidden=\"true\" class=\"far fa-clock\"><\/i>\t\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-icon-list-text\">Duration : 3 weeks<\/span>\n\t\t\t\t\t\t\t\t\t<\/li>\n\t\t\t\t\t\t<\/ul>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-inner-section elementor-element elementor-element-3861c34a elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"3861c34a\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-inner-column elementor-element elementor-element-61516edd\" data-id=\"61516edd\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-647ab02d elementor-widget elementor-widget-testimonial\" data-id=\"647ab02d\" data-element_type=\"widget\" data-widget_type=\"testimonial.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"elementor-testimonial-wrapper\">\n\t\t\t\t\t\t\t<div class=\"elementor-testimonial-content\">For the second phase of the project, all three of us had to discover and learn the Rust programming language to code the broker. This additional challenge was optional but strongly recommended due to Rust's performance capabilities and its strengths in memory optimization and asynchronous processing. This explains why the server underwent multiple versions \ud83d\ude09<\/div>\n\t\t\t\n\t\t\t\t\t\t<div class=\"elementor-testimonial-meta elementor-has-image elementor-testimonial-image-position-aside\">\n\t\t\t\t<div class=\"elementor-testimonial-meta-inner\">\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"elementor-testimonial-image\">\n\t\t\t\t\t\t\t<img decoding=\"async\" width=\"150\" height=\"150\" src=\"https:\/\/konekan.fr\/wp-content\/uploads\/2023\/02\/portraitDeMoi-scaled-e1676157618267-150x150.jpg\" class=\"attachment-thumbnail size-thumbnail wp-image-592\" alt=\"C&#039;est ma petite t\u00eate sur cette photo\" \/>\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t<div class=\"elementor-testimonial-details\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"elementor-testimonial-job\">- Lucas <\/div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<div class=\"elementor-element elementor-element-ca1f763 elementor-widget elementor-widget-heading\" data-id=\"ca1f763\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h5 class=\"elementor-heading-title elementor-size-default\">The broker<\/h5>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-039eabd elementor-widget elementor-widget-text-editor\" data-id=\"039eabd\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p style=\"text-align: justify;\">\u00a0 \u00a0 \u00a0 \u00a0The development of the RekT server&rsquo;s coding phase progressed gradually, overcoming the challenge of mastering the Rust programming language, which was entirely new to us. Our work took the form of a project with three major versions, which I will briefly summarize below. You can check out the GitHub repository to view the code.<\/p><p style=\"text-align: justify;\"><strong><span style=\"text-decoration: underline;\">Version 1 \u2014 Learning the Language:<\/span><\/strong> In the \u201cGYM\u201d folder of the project, we focused on learning the Rust language. This step was crucial for acquiring basic knowledge, understanding the syntax, and absorbing Rust&rsquo;s programming best practices. In this version, we succeeded in enabling two clients to communicate with each other without implementing the heartbeat system (connection maintenance verification) or ping calculation. Since the broker was synchronous, we were unable to handle multiple tasks simultaneously. This limitation led us to move to the next stage with version 2.<\/p><p style=\"text-align: justify;\"><strong><span style=\"text-decoration: underline;\">Version 2 \u2014 First Asynchronous Broker with Tokio:<\/span><\/strong> The \u201cAsync_broker\u201d folder was dedicated to creating the first functional version of the broker using the Tokio library for asynchronous programming. Although all features were present, this version failed to meet the performance and speed expectations required by the RekT protocol. Our approach to using Tokio&rsquo;s asynchronous tasks struggled with resource sharing, leading to significant memory duplication and excessive simultaneous asynchronous task creation. This resulted in exponential RAM consumption and disproportionate CPU usage.<\/p><p style=\"text-align: justify;\"><strong><span style=\"text-decoration: underline;\">Version 3 \u2014 Optimization and Message Design Pattern:<\/span><\/strong> The \u201cAsync_broker_message\u201d sub-folder focused on further optimizing the broker and correcting improper usage of the language. We adopted the message design pattern to improve the management of concurrent asynchronous tasks, drastically reducing the number of simultaneous tasks and better managing variable propagation between tasks. Additionally, we revisited the shared data structures used across tasks to minimize cloning and rely as much as possible on references. This optimization phase was critical in enhancing the broker&rsquo;s processing capacity and achieving the performance requirements of the RekT protocol and the overall project.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<section class=\"elementor-section elementor-inner-section elementor-element elementor-element-3b37ccc elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"3b37ccc\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-50 elementor-inner-column elementor-element elementor-element-7fa492b\" data-id=\"7fa492b\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-de5da5d elementor-icon-list--layout-traditional elementor-list-item-link-full_width elementor-widget elementor-widget-icon-list\" data-id=\"de5da5d\" data-element_type=\"widget\" data-widget_type=\"icon-list.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<ul class=\"elementor-icon-list-items\">\n\t\t\t\t\t\t\t<li class=\"elementor-icon-list-item\">\n\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-icon-list-icon\">\n\t\t\t\t\t\t\t<i aria-hidden=\"true\" class=\"fas fa-code\"><\/i>\t\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-icon-list-text\">Language : Rust<\/span>\n\t\t\t\t\t\t\t\t\t<\/li>\n\t\t\t\t\t\t\t\t<li class=\"elementor-icon-list-item\">\n\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-icon-list-icon\">\n\t\t\t\t\t\t\t<i aria-hidden=\"true\" class=\"fas fa-cubes\"><\/i>\t\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-icon-list-text\">Main Crate : Tokio<\/span>\n\t\t\t\t\t\t\t\t\t<\/li>\n\t\t\t\t\t\t<\/ul>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t<div class=\"elementor-column elementor-col-50 elementor-inner-column elementor-element elementor-element-3e209f3\" data-id=\"3e209f3\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-7a2ab53 elementor-icon-list--layout-traditional elementor-list-item-link-full_width elementor-widget elementor-widget-icon-list\" data-id=\"7a2ab53\" data-element_type=\"widget\" data-widget_type=\"icon-list.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<ul class=\"elementor-icon-list-items\">\n\t\t\t\t\t\t\t<li class=\"elementor-icon-list-item\">\n\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-icon-list-icon\">\n\t\t\t\t\t\t\t<i aria-hidden=\"true\" class=\"fas fa-weight-hanging\"><\/i>\t\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-icon-list-text\">Project size : 4,500 code lines<\/span>\n\t\t\t\t\t\t\t\t\t<\/li>\n\t\t\t\t\t\t\t\t<li class=\"elementor-icon-list-item\">\n\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-icon-list-icon\">\n\t\t\t\t\t\t\t<i aria-hidden=\"true\" class=\"fas fa-check-circle\"><\/i>\t\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-icon-list-text\">Duration: 2,5 months<\/span>\n\t\t\t\t\t\t\t\t\t<\/li>\n\t\t\t\t\t\t<\/ul>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<div class=\"elementor-element elementor-element-9c0e8ca elementor-widget-divider--view-line_icon elementor-view-default elementor-widget-divider--element-align-center elementor-widget elementor-widget-divider\" data-id=\"9c0e8ca\" data-element_type=\"widget\" data-widget_type=\"divider.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"elementor-divider\">\n\t\t\t<span class=\"elementor-divider-separator\">\n\t\t\t\t\t\t\t<div class=\"elementor-icon elementor-divider__element\">\n\t\t\t\t\t<i aria-hidden=\"true\" class=\"fas fa-network-wired\"><\/i><\/div>\n\t\t\t\t\t\t<\/span>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-44cb8b3 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"44cb8b3\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-8f099b8\" data-id=\"8f099b8\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-cba42b2 elementor-widget elementor-widget-heading\" data-id=\"cba42b2\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h5 class=\"elementor-heading-title elementor-size-default\">Project Results<\/h5>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<section class=\"elementor-section elementor-inner-section elementor-element elementor-element-b1325f5 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"b1325f5\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-inner-column elementor-element elementor-element-4d15603\" data-id=\"4d15603\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-e320d68 elementor-widget elementor-widget-text-editor\" data-id=\"e320d68\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p style=\"text-align: justify;\">To test the work of both teams, the \u00ab\u00a0game engine\u00a0\u00bb team created a very simple game playable by an AI. The game consists of a basic maze with colored doors. To pass through these doors, players must match their color to the door\u2019s by pressing a key to switch between colors.<\/p> <p style=\"text-align: justify;\">This project was a success for us because we managed to implement all the necessary steps to independently learn the skills required to meet the project&rsquo;s needs. Our professor acknowledged the effort we put in and praised the final result, which was highly satisfying!<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-inner-section elementor-element elementor-element-bde9d52 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"bde9d52\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-66 elementor-inner-column elementor-element elementor-element-be7591f\" data-id=\"be7591f\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-4d91648c elementor-widget elementor-widget-image\" data-id=\"4d91648c\" data-element_type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img fetchpriority=\"high\" decoding=\"async\" width=\"522\" height=\"338\" src=\"https:\/\/konekan.fr\/wp-content\/uploads\/2023\/05\/maze.gif\" class=\"elementor-animation-grow attachment-full size-full wp-image-1241\" alt=\"\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-3a4c3920 elementor-widget elementor-widget-text-editor\" data-id=\"3a4c3920\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p style=\"text-align: left;\">In the gif above, you can see 300 replicated AIs playing the game while being synchronized over the network. The movements remain smooth and consistent despite latency and potential network lag.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t<div class=\"elementor-column elementor-col-33 elementor-inner-column elementor-element elementor-element-ed1dfcd\" data-id=\"ed1dfcd\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-16a916d8 elementor-widget elementor-widget-text-editor\" data-id=\"16a916d8\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p style=\"text-align: right;\">In the gif below, we take a closer look at the behavior of the AIs near a red door.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-5e24ebe0 elementor-widget elementor-widget-image\" data-id=\"5e24ebe0\" data-element_type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img decoding=\"async\" width=\"600\" height=\"338\" src=\"https:\/\/konekan.fr\/wp-content\/uploads\/2023\/05\/maze_door.webp\" class=\"elementor-animation-grow attachment-full size-full wp-image-1240\" alt=\"\" srcset=\"https:\/\/konekan.fr\/wp-content\/uploads\/2023\/05\/maze_door.webp 600w, https:\/\/konekan.fr\/wp-content\/uploads\/2023\/05\/maze_door-300x169.webp 300w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<div class=\"elementor-element elementor-element-b2aa0b5 elementor-widget-divider--view-line_text elementor-widget-divider--element-align-center elementor-widget elementor-widget-divider\" data-id=\"b2aa0b5\" data-element_type=\"widget\" data-widget_type=\"divider.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"elementor-divider\">\n\t\t\t<span class=\"elementor-divider-separator\">\n\t\t\t\t\t\t\t<span class=\"elementor-divider__text elementor-divider__element\">\n\t\t\t\tThanks for reading\t\t\t\t<\/span>\n\t\t\t\t\t\t<\/span>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-4ee6182c elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"4ee6182c\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-wider\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-346b4735\" data-id=\"346b4735\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>GitHub repository Context \u00a0 \u00a0 \u00a0 \u00a0The RekT protocol (Rapid Encrypted Knot Transfer) was developed as part of the project course during the Winter 2023 semester at UQAC (University of Quebec at Chicoutimi), taught by Val\u00e8re Plantevin. The project involved simulating several hundred players on a single game map using Unreal Engine. The course was [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1200,"comment_status":"open","ping_status":"open","sticky":false,"template":"elementor_header_footer","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[100,90],"tags":[131,133,108,135,137,110],"class_list":["post-1911","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-network_en","category-other_en","tag-async-en","tag-network-en","tag-team-project-en","tag-rust-en","tag-tokio-en","tag-unreal-engine-en"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/konekan.fr\/index.php\/wp-json\/wp\/v2\/posts\/1911","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/konekan.fr\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/konekan.fr\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/konekan.fr\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/konekan.fr\/index.php\/wp-json\/wp\/v2\/comments?post=1911"}],"version-history":[{"count":4,"href":"https:\/\/konekan.fr\/index.php\/wp-json\/wp\/v2\/posts\/1911\/revisions"}],"predecessor-version":[{"id":1915,"href":"https:\/\/konekan.fr\/index.php\/wp-json\/wp\/v2\/posts\/1911\/revisions\/1915"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/konekan.fr\/index.php\/wp-json\/wp\/v2\/media\/1200"}],"wp:attachment":[{"href":"https:\/\/konekan.fr\/index.php\/wp-json\/wp\/v2\/media?parent=1911"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/konekan.fr\/index.php\/wp-json\/wp\/v2\/categories?post=1911"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/konekan.fr\/index.php\/wp-json\/wp\/v2\/tags?post=1911"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}