<?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[Store data in a Quadtree]]></title><description><![CDATA[<p>Hello! I would like to know if anyone here managed to store Colyseus data into the state via a Quadtree.</p>
<p>Thank you in advance,<br />
virtumonde</p>
]]></description><link>http://discuss.colyseus.io/topic/373/store-data-in-a-quadtree</link><generator>RSS for Node</generator><lastBuildDate>Wed, 12 Aug 2026 12:27:26 GMT</lastBuildDate><atom:link href="http://discuss.colyseus.io/topic/373.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 21 May 2020 22:23:36 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Store data in a Quadtree on Fri, 22 May 2020 19:31:24 GMT]]></title><description><![CDATA[<p>Hello! I would like to know if anyone here managed to store Colyseus data into the state via a Quadtree.</p>
<p>Thank you in advance,<br />
virtumonde</p>
]]></description><link>http://discuss.colyseus.io/post/1222</link><guid isPermaLink="true">http://discuss.colyseus.io/post/1222</guid><dc:creator><![CDATA[virtumonde]]></dc:creator><pubDate>Fri, 22 May 2020 19:31:24 GMT</pubDate></item><item><title><![CDATA[Reply to Store data in a Quadtree on Sat, 23 May 2020 08:06:27 GMT]]></title><description><![CDATA[<p>Hi !</p>
<p>I have done HashMaps but not Quadtree, however I think this is possible as you can nest objects into custom structure, I did not tested but recursivity may not be a problem.</p>
<p>Something like (not tested, just a draft) :</p>
<pre><code>import { Schema, type } from &quot;@colyseus/schema&quot;;

class Node extends Schema {
    @type([Node])
    nodes = new ArraySchema&lt;Node&gt;();
    
    @type([Entity])
    entities = new ArraySchema&lt;Entity&gt;();
}

class MyState extends Schema {
    @type(Node)
    node: Node = new Node();
}
</code></pre>
<p>On each <code>Node</code> you may have 4 child <code>Nodes</code>, each nodes can have 0 to many <code>Entity</code>. It may be a good idea to write a NodeManager attached to the <code>State</code> for building and update the tree !</p>
]]></description><link>http://discuss.colyseus.io/post/1225</link><guid isPermaLink="true">http://discuss.colyseus.io/post/1225</guid><dc:creator><![CDATA[SauceCodeFr]]></dc:creator><pubDate>Sat, 23 May 2020 08:06:27 GMT</pubDate></item></channel></rss>