{"id":104,"date":"2012-11-28T11:36:54","date_gmt":"2012-11-28T04:36:54","guid":{"rendered":"http:\/\/lhkbob.com\/blog\/?p=104"},"modified":"2012-11-28T11:36:54","modified_gmt":"2012-11-28T04:36:54","slug":"entreri-1-6-released","status":"publish","type":"post","link":"https:\/\/lhkbob.com\/blog\/entreri-1-6-released\/","title":{"rendered":"Entreri 1.6 Released"},"content":{"rendered":"<p>My flurry of activity on Entreri has a reached its culmination and 1.6 has been released. \u00a0It should be synced to the Maven Central Repository within the next couple of hours. \u00a0The release notes have been summarized on the project&#8217;s main page on <a title=\"Bitbucket\" href=\"https:\/\/bitbucket.org\/mludwig\/entreri\">Bitbucket<\/a>\u00a0but I&#8217;ll talk a little bit about the major changes here:<\/p>\n<p>The biggest is that the entire Controller and ControllerManager API has been removed. \u00a0I was never happy with this view of the world, it was too easy when designing your entity setup to just lump everything into a single controller or far too many controllers. \u00a0And to be honest, the name bothered me some too. \u00a0Now, there are Tasks that process the EntitySystem&#8211;or a subset thereof&#8211;to produce results. \u00a0These results are either mutations to the system, computations passed onto future tasks, or output such as rendering to a window. \u00a0Tasks are grouped into jobs that can be scheduled and threaded independently, but to achieve good performance it is critical that Tasks implement <a title=\"ParallelAware\" href=\"http:\/\/entreri.lhkbob.com\/javadoc\/1.6.0\/com\/lhkbob\/entreri\/task\/ParallelAware.html\">ParallelAware<\/a>. \u00a0Jobs can be scheduled repeatedly at a fixed rate, as fast as possible, or invoked under more customized control.<\/p>\n<p>The next change added is the concept of ownership. \u00a0As an example to motivate this, consider a 3D renderer that has particle systems and renderable shapes. \u00a0For maximum reuse, it&#8217;d be nice if the particle system can just update its geometry component automatically, and then depend on the rendering engine to render all shapes. \u00a0However, it is annoying for the programmer to know that the particle system requires a geometry component and add or remove it as necessary. \u00a0In comes ownership to clean this mess up. \u00a0Components and entities can be the owners of other components and entities. \u00a0When a component or entity is removed, all objects owned by it are also removed from the system.<\/p>\n<p>With ownership, the particle system task can add the geometry if necessary and mark the particle system as the owner. Then when the particle system is removed, the geometry is removed. \u00a0This can be used when one entity produces multiple intermediate entities, such as an avatar with a detachable weapon or helmet, or a unit of troops.<\/p>\n<p>The last large change is relatively straight-forward. \u00a0Properly implemented ComponentData definitions can report data changes by incrementing a version flag that is per-Component. \u00a0Tasks can take advantage of this by remembering the last processed version per-entity and comparing the two before doing any heavy computation. \u00a0In some cases it is more cost effective to just perform the computation than store and compare versions. \u00a0Using decorated properties is a convenient way for a task to store the last version.<\/p>\n<p>Oh and that reminds me, the other significant change is that there is no more &#8216;undecorate&#8217; required when you decorate a component data type. \u00a0Instead, the system only stores a weak reference to the new property, so when the decorating task no longer keeps a reference to it, Java will garbage collect it and its cleanup is handled gracefully by the entity system.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>My flurry of activity on Entreri has a reached its culmination and 1.6 has been released. \u00a0It should be synced to the Maven Central Repository&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0},"categories":[5],"tags":[10],"_links":{"self":[{"href":"https:\/\/lhkbob.com\/blog\/wp-json\/wp\/v2\/posts\/104"}],"collection":[{"href":"https:\/\/lhkbob.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lhkbob.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lhkbob.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lhkbob.com\/blog\/wp-json\/wp\/v2\/comments?post=104"}],"version-history":[{"count":1,"href":"https:\/\/lhkbob.com\/blog\/wp-json\/wp\/v2\/posts\/104\/revisions"}],"predecessor-version":[{"id":105,"href":"https:\/\/lhkbob.com\/blog\/wp-json\/wp\/v2\/posts\/104\/revisions\/105"}],"wp:attachment":[{"href":"https:\/\/lhkbob.com\/blog\/wp-json\/wp\/v2\/media?parent=104"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lhkbob.com\/blog\/wp-json\/wp\/v2\/categories?post=104"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lhkbob.com\/blog\/wp-json\/wp\/v2\/tags?post=104"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}