<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="299601" data-post-id="299601">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="iacobson" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/iacobson/120/2974_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  iacobson
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>New release <a href="https://github.com/iacobson/ecspanse/releases/tag/v0.3.1" rel="noopener nofollow ugc">v0.3.1</a></p>
<h3><a name="p-299601-fixes-1" class="anchor" href="#p-299601-fixes-1" aria-label="Heading link" rel="nofollow"></a>Fixes</h3>
<ul>
<li>fixes a bug where events could be scheduled after they were batched for the current frame, and before the current events are cleared, causing some events to be lost. Thanks to <a href="https://github.com/andzdroid" rel="noopener nofollow ugc">@andzdroid</a> for identifying and documenting the issue.</li>
<li>fixes a bug where temporary timers would crash. Thanks to <a href="https://github.com/holykol" rel="noopener nofollow ugc">@holykol</a> for finding and fixing the issue.</li>
</ul>
<h3><a name="p-299601-features-2" class="anchor" href="#p-299601-features-2" aria-label="Heading link" rel="nofollow"></a>Features</h3>
<ul>
<li>imports <code>Ecspanse.Query</code> and <code>Ecspanse.Command</code> in all systems, so all the queries and commands are available without needing the respective module prefix.</li>
<li>imports <code>Ecspanse</code> in the setup module that <code>use Ecspanse</code> so the system scheduling functions are available without needing the module prefix.</li>
</ul>
<p>If you are using the library, please update it to 0.3.1 to get rid of the 2 bugs.</p>
<p>I updated also the 2 demo projects to use the latest version.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="299601" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/ecspanse-an-entity-component-system-framework-for-elixir/57650/22">Post #21</a>
	                </div>
	            </div>
              <div id="likers-container-299601" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="299601"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #21"></div>
  </section>
</div>
    <div class="postbit" id="300907" data-post-id="300907">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="andzdroid" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/andzdroid/120/31831_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  andzdroid
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I tried to create 1000 entities, but the fps drops to 1 per second.</p>
<p>I also tried creating 10000 entities, this never got past initialization (or took more time than I was willing to wait).</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="300907" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/ecspanse-an-entity-component-system-framework-for-elixir/57650/23">Post #22</a>
	                </div>
	            </div>
              <div id="likers-container-300907" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="300907"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #22"></div>
  </section>
</div>
    <div class="postbit" id="300985" data-post-id="300985">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="iacobson" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/iacobson/120/2974_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  iacobson
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Thank you for doing the test.</p>
<p>What was your use case? Did you try it with the <a href="https://github.com/iacobson/iveseenthings" rel="noopener nofollow ugc"><strong>I’ve seen things</strong> demo project</a> and switch the player count to 1000?</p>
<p>Or did you build your own custom example?</p>
<ol>
<li>
<p>If you tried with the demo project, please remember that this is not optimized. As said, it was just a side project to build while developing the library. I think many things can be done differently there.<br>
Also, if you spawn 1000 players, that means probably around 5-6000 entities.</p>
</li>
<li>
<p>If on the other hand, you built your custom project, could you share it?</p>
</li>
</ol>
<p>That being said, I am fully aware that speed is not the greatest attribute of Ecspanse. I needed a library with extended ECS capabilities to build the Orbituary project with Elixir and Phoenix, and my plan is to improve the speed (where possible) as I develop that game.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="300985" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/ecspanse-an-entity-component-system-framework-for-elixir/57650/24">Post #23</a>
	                </div>
	            </div>
              <div id="likers-container-300985" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="300985"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #23"></div>
  </section>
</div>
    <div class="postbit" id="301009" data-post-id="301009">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="andzdroid" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/andzdroid/120/31831_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  andzdroid
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>No use case, only wanted to see how it runs with more entities.</p>
<p>I was on the ecspanse_demo project, I added this in the SpawnMarket system:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">    Enum.each(0..999, fn _x -&gt;
      %Ecspanse.Entity{} = Ecspanse.Command.spawn_entity!(Demo.Entities.Inventory.new_map())
    end)
</code></pre>
<p>Actually I just found out if I comment out the MaybeFindResources system it runs at a normal framerate.</p>
<p>Edit:<br>
I also have another project with my own entities. It looks like if any system locks any of the components on the 1000 entities that are spawned, the framerate drops to 1. <em>Even if the system runs on events that haven’t triggered.</em></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="301009" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/ecspanse-an-entity-component-system-framework-for-elixir/57650/25">Post #24</a>
	                </div>
	            </div>
              <div id="likers-container-301009" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="301009"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #24"></div>
  </section>
</div>
    <div class="postbit" id="301015" data-post-id="301015">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="iacobson" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/iacobson/120/2974_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  iacobson
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Very interesting. I will try to reproduce as soon as I find some time, and get back.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="301015" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/ecspanse-an-entity-component-system-framework-for-elixir/57650/26">Post #25</a>
	                </div>
	            </div>
              <div id="likers-container-301015" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="301015"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #25"></div>
  </section>
</div>
    <div class="postbit" id="301067" data-post-id="301067">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="iacobson" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/iacobson/120/2974_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  iacobson
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I tried your example, but until now, I could not reproduce exactly the case yet.</p>
<p>I used this</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">    Enum.each(0..3000, fn _x -&gt;
      %Ecspanse.Entity{} = Ecspanse.Command.spawn_entity!(Demo.Entities.Inventory.new_map())
    end)
</code></pre>
<p>So, I ran your example with 3000 entities, not 1000, and still got 100+ frames.</p>
<p>Indeed the startup is extremely slow. But give it enough time and the frame rate changes from 1 to 100+.</p>
<p>I also updated the demo project to display the FPS in the LiveView. You can pull the main branch and use it.</p>
<p></p><div class="lightbox-wrapper"><a class="lightbox" href="https://forum.elixirforum.com/uploads/default/original/3X/0/4/049110484b4c971be66ecd37741fb0d8d38e8b4d.png" data-download-href="https://forum.elixirforum.com/uploads/default/049110484b4c971be66ecd37741fb0d8d38e8b4d" title="Screenshot 2023-09-13 at 21.02.45" rel="nofollow"><img src="https://forum.elixirforum.com/uploads/default/optimized/3X/0/4/049110484b4c971be66ecd37741fb0d8d38e8b4d_2_690x238.png" alt="Screenshot 2023-09-13 at 21.02.45" data-base62-sha1="EoHQxShIuPdXva4QIYSghYVJMx" width="690" height="238" srcset="https://forum.elixirforum.com/uploads/default/optimized/3X/0/4/049110484b4c971be66ecd37741fb0d8d38e8b4d_2_690x238.png, https://forum.elixirforum.com/uploads/default/optimized/3X/0/4/049110484b4c971be66ecd37741fb0d8d38e8b4d_2_1035x357.png 1.5x, https://forum.elixirforum.com/uploads/default/optimized/3X/0/4/049110484b4c971be66ecd37741fb0d8d38e8b4d_2_1380x476.png 2x" data-dominant-color="8B8D92"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">Screenshot 2023-09-13 at 21.02.45</span><span class="informations">2060×712 53.7 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div><p></p>
<p>I identified some potential small improvements for the next version, but nothing major.</p>
<p>Also as a heads-up, I’m thinking of removing the automatically generated events like <code>Ecspanse.Event.ComponentUpdated</code>. Their functionality can be easily replaced with triggering custom events, and they pollute the events queue, every frame.</p>
<h3><a name="p-301067-later-edit-1" class="anchor" href="#p-301067-later-edit-1" aria-label="Heading link" rel="nofollow"></a>Later Edit</h3>
<p>After some optimizations for the tagging system, got the same 3000 entities running at ~500FPS.<br>
This will require a lot more work on my side, but I hope to push a new version somewhere next week.</p>
<p></p><div class="lightbox-wrapper"><a class="lightbox" href="https://forum.elixirforum.com/uploads/default/original/3X/4/c/4c5ad04c19466aa69429072ce7a974c63be48a11.png" data-download-href="https://forum.elixirforum.com/uploads/default/4c5ad04c19466aa69429072ce7a974c63be48a11" title="Screenshot 2023-09-14 at 09.51.31" rel="nofollow"><img src="https://forum.elixirforum.com/uploads/default/optimized/3X/4/c/4c5ad04c19466aa69429072ce7a974c63be48a11_2_690x239.png" alt="Screenshot 2023-09-14 at 09.51.31" data-base62-sha1="aTsR16r19viyrbcZjtKs7Y3beIp" width="690" height="239" srcset="https://forum.elixirforum.com/uploads/default/optimized/3X/4/c/4c5ad04c19466aa69429072ce7a974c63be48a11_2_690x239.png, https://forum.elixirforum.com/uploads/default/optimized/3X/4/c/4c5ad04c19466aa69429072ce7a974c63be48a11_2_1035x358.png 1.5x, https://forum.elixirforum.com/uploads/default/optimized/3X/4/c/4c5ad04c19466aa69429072ce7a974c63be48a11_2_1380x478.png 2x" data-dominant-color="94969A"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">Screenshot 2023-09-14 at 09.51.31</span><span class="informations">2154×748 54.7 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div><p></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="301067" data-batch-url="/posts/batch_likers">
                        3
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/ecspanse-an-entity-component-system-framework-for-elixir/57650/27">Post #26</a>
	                </div>
	            </div>
              <div id="likers-container-301067" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="301067"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #26"></div>
  </section>
</div>
    <div class="postbit" id="301439" data-post-id="301439">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="iacobson" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/iacobson/120/2974_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  iacobson
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>New release <a href="https://github.com/iacobson/ecspanse/releases/tag/v0.4.0" rel="noopener nofollow ugc">v0.4.0</a></p>
<ul>
<li>
<p>breaking: removes the automatically generated events on every component create, update and destroy. While this was useful, it was also very noisy, generating many events every frame. The functionality can be easily replaced by emitting a manual event wherever needed, or by creating a short-lived component for the specific entity.</p>
</li>
<li>
<p>improvement: change the way tagged components are handled. This improved the frame rate for cases when many tagged components had to be queried.</p>
</li>
</ul>
<p>Thanks again to <a class="mention" href="/u/andzdroid" rel="nofollow">@andzdroid</a> for testing the library and reporting the performance issues.<br>
While <code>Ecspanse</code> was not created with a focus on performance, but mostly on functionality, it is still good to improve also the performance whenever possible.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="301439" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/ecspanse-an-entity-component-system-framework-for-elixir/57650/28">Post #27</a>
	                </div>
	            </div>
              <div id="likers-container-301439" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="301439"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #27"></div>
  </section>
</div>
    <div class="postbit" id="301440" data-post-id="301440">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="iacobson" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/iacobson/120/2974_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  iacobson
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p><a class="mention" href="/u/andzdroid" rel="nofollow">@andzdroid</a>, version v0.4.0 has now been released, so you can perform your tests with the new version if you want. I have also updated the ecspanse_demo project to use the latest version.</p>
<p>That being said, for your specific case where you want to spawn a significant amount of entities on startup, the     <a href="https://hexdocs.pm/ecspanse/Ecspanse.Command.html#spawn_entities!/1" rel="noopener nofollow ugc"><code>Ecspanse.Command.spawn_entities!/1</code></a> is a much more efficient way to do this.</p>
<p>Per your example, it would be something like:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">    specs =
      Enum.map(0..3000, fn _x -&gt;
        Demo.Entities.Inventory.new_map()
      end)

    Ecspanse.Command.spawn_entities!(specs)

    IO.inspect("READY!!!")
</code></pre> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="301440" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/ecspanse-an-entity-component-system-framework-for-elixir/57650/29">Post #28</a>
	                </div>
	            </div>
              <div id="likers-container-301440" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="301440"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #28"></div>
  </section>
</div>
    <div class="postbit" id="302473" data-post-id="302473">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="iacobson" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/iacobson/120/2974_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  iacobson
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>New release <a href="https://github.com/iacobson/ecspanse/releases/tag/v0.5.0" rel="noopener nofollow ugc">v0.5.0</a></p>
<p>Introduces <strong>ancestors</strong> related queries to look for parents of an entity, the parents of their parents, and so on:</p>
<ul>
<li>added a new option to <code>Ecspanse.Query.select/2</code>: <code>:for_ancestors_of</code></li>
<li><code>Ecspanse.Query.list_ancestors/1</code></li>
<li><code>Ecspanse.Query.list_tagged_components_for_ancestors/2</code></li>
</ul>
<p>So now it is possible to look for top-level parents of deeply nested entities.</p>
<p>For example, let’s consider a <strong>hero entity</strong>, child of a <strong>clan entity</strong>, child of a <strong>mission entity</strong>, child of a <strong>dungeon entity</strong>. Now you can query the dungeon directly with the hero entity.</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">  Ecspanse.Query.select(
    {Ecspanse.Entity, Components.Dungeon}, 
     for_ancestors_of: [hero_entity]
  ) |&gt; Ecspanse.Query.one()
</code></pre> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="302473" data-batch-url="/posts/batch_likers">
                        3
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/ecspanse-an-entity-component-system-framework-for-elixir/57650/30">Post #29</a>
	                </div>
	            </div>
              <div id="likers-container-302473" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="302473"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #29"></div>
  </section>
</div>
    <div class="postbit" id="302814" data-post-id="302814">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="iacobson" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/iacobson/120/2974_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  iacobson
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>New release <a href="https://github.com/iacobson/ecspanse/releases/tag/v0.6.0" rel="noopener nofollow ugc">v0.6.0</a></p>
<p>Introduces <a href="https://hexdocs.pm/ecspanse/Ecspanse.Projection.html" rel="noopener nofollow ugc"><strong>projections</strong></a>, a way to build state models across entities and components.</p>
<p>This is meant as a tool for external libraries (UI), and especially for Phoenix Liveview.<br>
The Livewiew can create a Projection with the needed state, then the projection server can push the projection struct to the Liveview every time it changes.</p>
<p>I intend to use it as the main way to provide data to the Liveview for the Orbituary game.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="302814" data-batch-url="/posts/batch_likers">
                        2
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/ecspanse-an-entity-component-system-framework-for-elixir/57650/31">Post #30</a>
	                </div>
	            </div>
              <div id="likers-container-302814" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="302814"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #30"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <a class="load-more-button" data-turbo-stream="true" href="/topics/57650/load_more?page=4">Load more posts (22 remaining)</a>
</div></template></turbo-stream>