{"id":52,"date":"2013-07-28T17:09:58","date_gmt":"2013-07-28T17:09:58","guid":{"rendered":"https:\/\/blogs.scummvm.org\/t0by\/?p=52"},"modified":"2022-05-24T17:14:17","modified_gmt":"2022-05-24T17:14:17","slug":"mid-term-roundup","status":"publish","type":"post","link":"https:\/\/blogs.scummvm.org\/t0by\/2013\/07\/28\/mid-term-roundup\/","title":{"rendered":"Mid term roundup"},"content":{"rendered":"<p>So, midterm is upon us.<br \/>\nIt\u2019s been a few really challenging, but also fun weeks where only a couple of times I found myself really stuck.<br \/>\nI am surprisingly more-or-less on schedule, which means that two new, cool features are on their way to players and developers.<\/p>\n<p>Let\u2019s talk about them.<\/p>\n<p>The first one, as we mentioned before, is rotozoom.<br \/>\nThe branch is basically ready (I still may have to fix just a couple of non-important few lines, but it\u2019s there) , which means that WME games get sprite rotation+scaling suypport on ScummVM:<br \/>\n<a href=\"https:\/\/github.com\/tobiatesan\/scummvm\/tree\/wintermute_rotozoom_3\" rel=\"nofollow\">https:\/\/github.com\/tobiatesan\/scummvm\/tree\/wintermute_rotozoom_3<\/a><\/p>\n<p>Which in turn means that at least a puzzle in one game, J.u.l.i.a, is now playable.<br \/>\nThe J.u.l.i.a greenlight demo, available here, is playable to completion thanks to the patch: <a href=\"http:\/\/steamcommunity.com\/sharedfiles\/filedetails\/?id=122116943\" rel=\"nofollow\">http:\/\/steamcommunity.com\/sharedfiles\/filedetails\/?id=122116943<\/a><br \/>\nI\u2019m not sure which ones, but I guess there are or will be other games that use rotation around.<br \/>\nThey are now playable on ScummVM, bar other issues.<\/p>\n<p><a href=\"https:\/\/blogs.scummvm.org\/t0by\/wp-content\/uploads\/sites\/43\/2013\/07\/no_spoiler_2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-54\" src=\"https:\/\/blogs.scummvm.org\/t0by\/wp-content\/uploads\/sites\/43\/2013\/07\/no_spoiler_2.png\" alt=\"\" width=\"1040\" height=\"781\" srcset=\"https:\/\/blogs.scummvm.org\/t0by\/wp-content\/uploads\/sites\/43\/2013\/07\/no_spoiler_2.png 1040w, https:\/\/blogs.scummvm.org\/t0by\/wp-content\/uploads\/sites\/43\/2013\/07\/no_spoiler_2-300x225.png 300w, https:\/\/blogs.scummvm.org\/t0by\/wp-content\/uploads\/sites\/43\/2013\/07\/no_spoiler_2-1024x769.png 1024w, https:\/\/blogs.scummvm.org\/t0by\/wp-content\/uploads\/sites\/43\/2013\/07\/no_spoiler_2-768x577.png 768w\" sizes=\"auto, (max-width: 1040px) 100vw, 1040px\" \/><\/a>The second one is the debugger.<\/p>\n<p>It\u2019s not quite as production ready as the rotozoom feature, but the bulk is most definitely there, so it\u2019s a matter of polishing it: <a href=\"https:\/\/github.com\/tobiatesan\/scummvm\/tree\/38db3907a7a0e31a6ff71e2e2c89b0d91a476589\" rel=\"nofollow\">https:\/\/github.com\/tobiatesan\/scummvm\/tree\/38db3907a7a0e31a6ff71e2e2c89b0d91a476589<\/a><\/p>\n<p>You can set breakpoints, watch variables, step-execute (both step over and step into), import source code if available (if not, you\u2019ll have a hard time using the debugger anyway) and dump variables and engine resources.<\/p>\n<p><a href=\"https:\/\/blogs.scummvm.org\/t0by\/wp-content\/uploads\/sites\/43\/2013\/07\/debugger.gif\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-55\" src=\"https:\/\/blogs.scummvm.org\/t0by\/wp-content\/uploads\/sites\/43\/2013\/07\/debugger.gif\" alt=\"\" width=\"816\" height=\"638\" \/><\/a>All you need to debug your games on ScummVM+WME and, more importantly, very useful in debugging the engine itself.<br \/>\nWill turn out rather handy post-midterm, where the real fun (for arbitrary values of \u201cfun\u201d) is.<\/p>\n<p>Post-midterm, I plan on putting the finishing touches on the debugger, obviously, but also doing some bug hunting (for example, by playing popular WME games) and some doing refactoring and profiling+optimizing.<\/p>\n<p>Now, there are quite a few areas of interest there.<\/p>\n<p>Let\u2019s see them.<\/p>\n<p>I have learned by now that the biggest culprit for performance issues (and a few bugs) is the rect-system + the ticket system.<br \/>\nThe latter, especially, is a rather complex business that is not present in the original engine, which uses a SDL backend, that does a *lot* of comparisons.<\/p>\n<p>For starters, there is a known , aka \u201cthe Rosemary bug\u201d (as it is evident in Rosemary when the main character walks right-to-left) that seems to be triggered by mirrored sprites.<br \/>\nFor some reason, the sprite gets \u201cjigsawed\u201d WHEN dirty rects are enabled.<br \/>\nThis may mean a bug in the dirty rect system.<\/p>\n<p>The rect system also allows for optimization in the form of support for multiple rects.<br \/>\nWhich means that, basically, at the moment, if two single pixels are updated, the whole rectangular area encompassing them is redrawn (bad for performance).<br \/>\nWe would hope to just work with two 1px-wide rectangles.<\/p>\n<p>The ticket comparison (which is carried out by the ticket system to recognized duplicate rendering tickets) might also be optimized further, but that\u2019s something that will be considered after profiling.<\/p>\n<p>Something that may yield better results is avoiding *abusing* the ticket system by prerendering stuff that would result in *huge* amounts of requests \u2013 namely, UITiledImage, which results in a request for every single tile.<br \/>\nMost evident in the system menu.<\/p>\n<p>TransparentSurface my benefit from optimizing too; my bilinear-filtered copy function certainly does not help, as it is far from optimized.<br \/>\nTo have good performance with that either the rect system must be made a lot better, or that must be optimized.<\/p>\n<p>There is also some refactoring to be done in there.<br \/>\nFor starters, there are cases where handy things provided by scummvm are not used, e.g. obvious things like const char*\u2019s everywhere instead of Common::String.<br \/>\nThen there is some leftover code here and there, and a few paths *seem* to be modelled around implementation specific things of the original WME (the whole graphic stack *may* be it), so maybe one could try to see if there is a simpler way of handling it.<\/p>\n<p>I hope the next half will be as fun and as fulfilling as the first half.<\/p>\n<p>See you!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>So, midterm is upon us. It\u2019s been a few really challenging, but also fun weeks where only a couple of times I found myself really stuck. I am surprisingly more-or-less on schedule, which means that two new, cool features are on their way to players and developers. Let\u2019s talk about them. The first one, as [&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-52","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blogs.scummvm.org\/t0by\/wp-json\/wp\/v2\/posts\/52","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=52"}],"version-history":[{"count":2,"href":"https:\/\/blogs.scummvm.org\/t0by\/wp-json\/wp\/v2\/posts\/52\/revisions"}],"predecessor-version":[{"id":56,"href":"https:\/\/blogs.scummvm.org\/t0by\/wp-json\/wp\/v2\/posts\/52\/revisions\/56"}],"wp:attachment":[{"href":"https:\/\/blogs.scummvm.org\/t0by\/wp-json\/wp\/v2\/media?parent=52"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.scummvm.org\/t0by\/wp-json\/wp\/v2\/categories?post=52"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.scummvm.org\/t0by\/wp-json\/wp\/v2\/tags?post=52"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}