{"id":859,"date":"2020-02-13T20:15:12","date_gmt":"2020-02-13T20:15:12","guid":{"rendered":"https:\/\/www.world-machine.com\/blog\/?p=859"},"modified":"2020-02-13T20:15:12","modified_gmt":"2020-02-13T20:15:12","slug":"lte-feature-3","status":"publish","type":"post","link":"https:\/\/www.world-machine.com\/blog\/2020\/02\/lte-feature-3\/","title":{"rendered":"LTE Feature #3"},"content":{"rendered":"\n<p style=\"background-color:#2e2c2c\" class=\"has-text-color has-background has-normal-font-size has-background-color\">A series of posts describing the changes afoot for the <a href=\"https:\/\/www.world-machine.com\/blog\/?cat=18\">Long Term Evolution<\/a> of World Machine. <\/p>\n\n\n\n<p>Welcome back! I hope everyone had a great holiday season.. the winter here in Seattle has been gloomy and rainy, but inside work has proceeded on LTE at a blistering pace.<\/p>\n\n\n\n<p>Next up, let&#8217;s take a look at a feature we hinted at last time.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Full Edit History<\/h2>\n\n\n\n<p>Undo\/Redo was not built into World Machine originally. Consequently, it has been the source of many bugs and issues over the years. For LTE, I wanted to not just make undo\/redo rock-solid and dependable, but also turn a historical weakness into a strength.<\/p>\n\n\n\n<p>This has been achieved. World Machine now keeps your full edit history intact:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"553\" src=\"https:\/\/www.world-machine.com\/blog\/wp-content\/uploads\/2020\/02\/WMLTE_EditHistory-1024x553.jpg\" alt=\"\" class=\"wp-image-871\" srcset=\"https:\/\/www.world-machine.com\/blog\/wp-content\/uploads\/2020\/02\/WMLTE_EditHistory-1024x553.jpg 1024w, https:\/\/www.world-machine.com\/blog\/wp-content\/uploads\/2020\/02\/WMLTE_EditHistory-300x162.jpg 300w, https:\/\/www.world-machine.com\/blog\/wp-content\/uploads\/2020\/02\/WMLTE_EditHistory-768x415.jpg 768w, https:\/\/www.world-machine.com\/blog\/wp-content\/uploads\/2020\/02\/WMLTE_EditHistory-1200x649.jpg 1200w, https:\/\/www.world-machine.com\/blog\/wp-content\/uploads\/2020\/02\/WMLTE_EditHistory.jpg 1534w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Every action that modifies your world appears in the edit history. The history is quite granular; for example, changes to each device parameter are stored individually. Repeated edits are automatically grouped to keep your history neat, and eventually certain edits will automatically collapse to a single changeset (such as moving wires and devices around). You can also remove\/ collapse old history if you don&#8217;t need it.<\/p>\n\n\n\n<p>Edits can load\/save with your project file, so for important worlds you can keep the full evolution and return to any revision you might want to see.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Full Build Results<\/h3>\n\n\n\n<p> You can quickly hop back and forth between edits and compare how they look <strong>at their full build resolution<\/strong>. Here&#8217;s a quick video showing the history feature in action:<\/p>\n\n\n\n<figure class=\"wp-block-embed-youtube wp-block-embed is-type-video is-provider-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"LTE Preview #3 : Full Edit History\" width=\"580\" height=\"326\" src=\"https:\/\/www.youtube.com\/embed\/LvbWFAXbtGA?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<p>I hope the above video makes you excited! Being able to step up and down the history list and see the full-res results change is a real game changing workflow feature.<\/p>\n\n\n\n<p>Another thing: the build engine is history-aware, and each edit knows what changes and device invalidations occurred. As a result, you can initiate a build on an old version of your world, and all edits above that in the history list will inherit the build results if applicable.<\/p>\n\n\n\n<p>And although not implemented currently, there&#8217;s no real reason why you couldn&#8217;t take historical results as the &#8220;before&#8221; in the 3D View&#8217;s A:B comparison. This would let you interactively explore how your world is evolving.. but that&#8217;s for later.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Snapshots<\/h3>\n\n\n\n<p>You can also take a snapshot to keep a named copy of your world at a point in time. This is really useful for making sure you can always re-build a certain version of an asset using the same settings, while letting you continue changing your world file. There will probably be a setting to auto-snapshot whenever you perform a final export.<\/p>\n\n\n\n<p>Finally, all of this gives session files a new purpose: They can function as the disk store for all of the build results, etc resulting from all of this. Thus when you save and then reload a session, it should be just as if you never left the program; all of your build results, history, etc will remain just as you left it.<\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">A Technical Aside<\/h4>\n\n\n\n<p>All of this is enabled by a fundamental change in the way data is handled in WM. The core of WM is now built around what&#8217;s called <strong>immutable data<\/strong>. When you perform a <em>mutating action<\/em>, you&#8217;re actually creating a new draft version of your world containing your changes. When the draft is committed to the history, it can no longer be changed.<\/p>\n\n\n\n<p>This is a very powerful concept! The overhead of a copy is negligible in this case, and we immediately gain edit history almost for free. It also achieves my other main goal : The very stable and fast asynchronous build engine within WM LTE. Multi-threaded code is traditionally a huge source of bugs, and synchronization is slow. By having a guarantee that a particular copy of the world won&#8217;t change underneath us, we remove almost all traditional synchronization issues, improving both stability and performance.<\/p>\n\n\n\n<p>This feature was one of the most technologically interesting ones to tackle in the LTE conversion, and was informed by Sean Parent&#8217;s talk &#8216;<a href=\"https:\/\/channel9.msdn.com\/Events\/GoingNative\/2013\/Inheritance-Is-The-Base-Class-of-Evil\">Inheritance is the Base Class of Evil<\/a>&#8216;. For fellow dev-nerds: the fundamental realization is that although mutable shared_ptrs can be very dangerous, a shared_ptr&lt;const T> in fact has value semantics.<\/p>\n\n\n\n<p>&#8230;Don&#8217;t worry if that last sentence is gibberish \ud83d\ude42<\/p>\n\n\n\n<p>For folks writing plugins, this has implications &#8211; in particular, the WM core now uses C++ const-ness to enforce this immutability.<\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>That&#8217;s enough for now. Next time we&#8217;ll look at the improvements to viewports and the workview. See you then!<\/p>\n\n\n\n<p>Stephen<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Welcome back! I hope everyone had a great holiday season.. the winter here in Seattle has been gloomy and rainy, but inside work has proceeded on LTE at a blistering pace. Next up, let&#8217;s take a look at a feature we hinted at last time. Full Edit History Undo\/Redo was not built into World Machine [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"publish_to_discourse":"","publish_post_category":"20","wpdc_auto_publish_overridden":"","wpdc_topic_tags":"","wpdc_pin_topic":"","wpdc_pin_until":"","discourse_post_id":"30162","discourse_permalink":"https:\/\/forum.world-machine.com\/t\/lte-feature-3\/5145","wpdc_publishing_response":"success","wpdc_publishing_error":"","footnotes":""},"categories":[18,2],"tags":[],"class_list":["post-859","post","type-post","status-publish","format-standard","hentry","category-lte","category-world-machine-development-news"],"_links":{"self":[{"href":"https:\/\/www.world-machine.com\/blog\/wp-json\/wp\/v2\/posts\/859","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.world-machine.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.world-machine.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.world-machine.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.world-machine.com\/blog\/wp-json\/wp\/v2\/comments?post=859"}],"version-history":[{"count":10,"href":"https:\/\/www.world-machine.com\/blog\/wp-json\/wp\/v2\/posts\/859\/revisions"}],"predecessor-version":[{"id":874,"href":"https:\/\/www.world-machine.com\/blog\/wp-json\/wp\/v2\/posts\/859\/revisions\/874"}],"wp:attachment":[{"href":"https:\/\/www.world-machine.com\/blog\/wp-json\/wp\/v2\/media?parent=859"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.world-machine.com\/blog\/wp-json\/wp\/v2\/categories?post=859"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.world-machine.com\/blog\/wp-json\/wp\/v2\/tags?post=859"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}