<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[HTML5 perfomance issues]]></title><description><![CDATA[<p>Hello, I'm trying to make a game with syncronous multiplayer with Colyseus and Defold and I have perfomance issues.<br />
At first I was using state sync and messages from server to sync clients. State sync was working on 30 FPS and whole game has around 10 FPS on HTML5, Android, Windows and Mac versions because of</p>
<pre><code class="language-lua">local new_state = msgpack.unpack( utils.byte_array_to_string(self._previousState) )
</code></pre>
<p>in room.lua Room:patch.</p>
<p>Then I turned off room patch by copying library to my project and commenting room.lua:87</p>
<pre><code class="language-lua">self:patch(message[2])
</code></pre>
<p>and sending state info by message from server to clients  every frame at 30 FPS. One message contains array of 6-10 elements like this</p>
<pre><code class="language-lua">2 = {
    segmentRadius = 32,
    skin = cat,
    id = 2,
    segments = {
      1 = {
        y = -316,
        x = -85,
      }
      2 = {
        y = -308,
        x = -93,
      }
      3 = {
        y = -303,
        x = -82,
      }
      4 = {
        y = -295,
        x = -90,
      }
      5 = {
        y = -290,
        x = -79,
      }
      6 = {
        y = -285,
        x = -68,
      }
      7 = {
        y = -277,
        x = -76,
      }
      8 = {
        y = -272,
        x = -65,
      }
      9 = {
        y = -264,
        x = -73,
      }
      10 = {
        y = -259,
        x = -62,
      }
    }
    name = Jessica Jones,
    isolationTimer = 23,
  }
</code></pre>
<p>On Windows, Mac and Android it works perfect, but on HTML5 game works at stable 30 FPS around 3-4 seconds and after that Colyseus client freezes and receives no messages from server or client have no resources to decode them: print in room.lua:38 in</p>
<pre><code class="language-lua"> self.connection:on(&quot;message&quot;, function(message)
</code></pre>
<p>works  only 3-4 seconds.</p>
<p>Where can I tweak or optimize my system to solve this perfomance issue?</p>
]]></description><link>http://discuss.colyseus.io/topic/161/html5-perfomance-issues</link><generator>RSS for Node</generator><lastBuildDate>Wed, 09 Sep 2026 12:53:35 GMT</lastBuildDate><atom:link href="http://discuss.colyseus.io/topic/161.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 19 Oct 2018 06:44:57 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to HTML5 perfomance issues on Invalid Date]]></title><description><![CDATA[<p>Hello, I'm trying to make a game with syncronous multiplayer with Colyseus and Defold and I have perfomance issues.<br />
At first I was using state sync and messages from server to sync clients. State sync was working on 30 FPS and whole game has around 10 FPS on HTML5, Android, Windows and Mac versions because of</p>
<pre><code class="language-lua">local new_state = msgpack.unpack( utils.byte_array_to_string(self._previousState) )
</code></pre>
<p>in room.lua Room:patch.</p>
<p>Then I turned off room patch by copying library to my project and commenting room.lua:87</p>
<pre><code class="language-lua">self:patch(message[2])
</code></pre>
<p>and sending state info by message from server to clients  every frame at 30 FPS. One message contains array of 6-10 elements like this</p>
<pre><code class="language-lua">2 = {
    segmentRadius = 32,
    skin = cat,
    id = 2,
    segments = {
      1 = {
        y = -316,
        x = -85,
      }
      2 = {
        y = -308,
        x = -93,
      }
      3 = {
        y = -303,
        x = -82,
      }
      4 = {
        y = -295,
        x = -90,
      }
      5 = {
        y = -290,
        x = -79,
      }
      6 = {
        y = -285,
        x = -68,
      }
      7 = {
        y = -277,
        x = -76,
      }
      8 = {
        y = -272,
        x = -65,
      }
      9 = {
        y = -264,
        x = -73,
      }
      10 = {
        y = -259,
        x = -62,
      }
    }
    name = Jessica Jones,
    isolationTimer = 23,
  }
</code></pre>
<p>On Windows, Mac and Android it works perfect, but on HTML5 game works at stable 30 FPS around 3-4 seconds and after that Colyseus client freezes and receives no messages from server or client have no resources to decode them: print in room.lua:38 in</p>
<pre><code class="language-lua"> self.connection:on(&quot;message&quot;, function(message)
</code></pre>
<p>works  only 3-4 seconds.</p>
<p>Where can I tweak or optimize my system to solve this perfomance issue?</p>
]]></description><link>http://discuss.colyseus.io/post/541</link><guid isPermaLink="true">http://discuss.colyseus.io/post/541</guid><dc:creator><![CDATA[dreml]]></dc:creator><pubDate>Invalid Date</pubDate></item></channel></rss>