{"id":94,"date":"2013-09-22T17:29:12","date_gmt":"2013-09-22T17:29:12","guid":{"rendered":"https:\/\/blogs.scummvm.org\/t0by\/?p=94"},"modified":"2022-05-24T17:30:24","modified_gmt":"2022-05-24T17:30:24","slug":"wme-todo-notes-for-posterity-including-future-me","status":"publish","type":"post","link":"https:\/\/blogs.scummvm.org\/t0by\/2013\/09\/22\/wme-todo-notes-for-posterity-including-future-me\/","title":{"rendered":"WME TODO: Notes for posterity (including future me)"},"content":{"rendered":"<p>Here is a list of todos and ideas for further improvement of the WME engine:<\/p>\n<h5>1. The new patches contributed by yours truly could probably benefit from some optimization, performance-wise.<\/h5>\n<p>In particular,<\/p>\n<ul>\n<li>bilinear blitting is very naive, plus it\u2019s all float, so it has large margins for optimization simply by replacing it with a well-known optimized algorithm.<\/li>\n<\/ul>\n<ul>\n<li>Multirect could probably benefit from some fine tuning;<\/li>\n<li>It\u2019s a matter of finding the best balance between the additional cost of multirect and the cost of going through tickets and blitting.<\/li>\n<\/ul>\n<p>On the other hand<\/p>\n<ul>\n<li>ui_tiled shouldn\u2019t really require any further efforts unless some weird bug pops up.<\/li>\n<li>blending could have some margin for improvement, but it\u2019s basically pretty much fixed as it is.<\/li>\n<\/ul>\n<h5>2. The debugger is a bit of a hack as it is.<\/h5>\n<p>It is by far my least-favorite piece of code in there.<\/p>\n<p>The thing is, we don\u2019t really have a compiler giving us debug symbols; instead what the compiler does (and always does, even in released games) is adding a special II_DBG_LINE instruction that keeps a special register up-to-date with the last line traversed.<\/p>\n<p>What we do is watch for those instructions and infer everything from there, including keeping a history of the watched variables and inspecting them to see if they\u2019ve changed.<\/p>\n<p>Among other things, the original debugger does not have a watch feature, as it\u2019s very awkward to do.<\/p>\n<p>What one should do then is <strong>hack the compiler in order to have symbols and easily improve on the debugger.<\/strong><\/p>\n<p>Another interesting side effect of hacking the compiler would be the ability to<strong> inject code.<\/strong><\/p>\n<p>If nothing else, it would help to have the compiler bundle the source file with the code and\/or adding a checksum, to avoid copying source files by hand (please note that ATM we have NO way of knowing if the source file matches bytecode or if it\u2019s something completely different, at least some support for generating checksums should be useful and easily added. I\u2019ve found myself wondering what the hell was going on more than once, only to find that my sources were outdated)<\/p>\n<p>Apart from that, I guess there is room for some further polishing\/refactoring anyway (it\u2019s become slightly uglier than I\u2019d like over time).<\/p>\n<p>In particular, it would help to improve the command line and let it accept e.g. hex values.<\/p>\n<h5>3. Fonts. We tend to have ugly fallback fonts. Find why and fix it. Would we perhaps be interested in selectively applying bilinear on bitmapped fonts only?<\/h5>\n<ol start=\"4\">\n<li>Also, results from profiling show three areas of interest performance wise:<\/li>\n<\/ol>\n<ul>\n<li>FMVs are sometimes slower and uglier than they should be.<br \/>\nSoftware scaling ain\u2019t terribly efficient.<\/li>\n<li>The particle engine can benefit from some optimization, perhaps akin to what\u2019s been done with ui_tiled image to lessen the load on the ticket system.<br \/>\nIt is heavy and it plays an integral role in the speed of J.u.l.i.a.<\/li>\n<li>Fonts, again, are sometimes at least as heavy as their ui_tiled backgrounds.<br \/>\nPerhaps caching text as well, as has been done for the backgrounds, to reduce load?<\/li>\n<\/ul>\n<p>Apart from this, there are a few TODO\u2019s lingering all over the code which can be taken care of with a quick fix, most of them pre-existing, some of them new, just grep it.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here is a list of todos and ideas for further improvement of the WME engine: 1. The new patches contributed by yours truly could probably benefit from some optimization, performance-wise. In particular, bilinear blitting is very naive, plus it\u2019s all float, so it has large margins for optimization simply by replacing it with a well-known [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-94","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blogs.scummvm.org\/t0by\/wp-json\/wp\/v2\/posts\/94","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.scummvm.org\/t0by\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.scummvm.org\/t0by\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.scummvm.org\/t0by\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.scummvm.org\/t0by\/wp-json\/wp\/v2\/comments?post=94"}],"version-history":[{"count":2,"href":"https:\/\/blogs.scummvm.org\/t0by\/wp-json\/wp\/v2\/posts\/94\/revisions"}],"predecessor-version":[{"id":96,"href":"https:\/\/blogs.scummvm.org\/t0by\/wp-json\/wp\/v2\/posts\/94\/revisions\/96"}],"wp:attachment":[{"href":"https:\/\/blogs.scummvm.org\/t0by\/wp-json\/wp\/v2\/media?parent=94"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.scummvm.org\/t0by\/wp-json\/wp\/v2\/categories?post=94"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.scummvm.org\/t0by\/wp-json\/wp\/v2\/tags?post=94"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}