{"video_id":"VC9E2hyyEIw","comment_count":400,"fetched_at":"2026-10-23T18:11:15+00:00","source":"innertube_next","comments":[{"id":"Ugx1LPcNq5mx09cnP-l4AaABAg","text":"Heads up! The point of this video was not to criticize game code, it's to give some insight on how these games were made. I see quite a few comments taking this the wrong way. Rest assured, I am not trying to discredit the quality or gameplay merit of these titles. Perhaps I didn't make that clear enough - that's my bad, I'll be more careful next time.\n\nFrequently Asked Questions:\n\nQ: How are you sure that this is the real code? Isn't decompilation a lossy process?\nA: Flash's ActionScript often decompiles relatively cleanly, maintaining the original control flow almost completely unmodified. Symbols aren't stripped by default, and functions don't seem to be inlined. The usual suspects of decompilation noise are minimal at worst. Even if things were moved around, inlined or restructured by the decompiler, that wouldn't explain the quirks I highlight here. For example, \"Portal: The Flash Version\" must be using duplicated code for its portals, as a modular solution would never decompile to hard angles. \"Sugar, sugar\" also undoubtedly contains duplicated code - the sugar logic is copied once for the menu, and once for gameplay, with nearly inconsequential changes in-between.\n\nQ: How can you know that the code was written in one huge file?\nA: I can't, but it's likely. ActionScript 3 structures its code into classes, and it'd be a bit unusual for a class to span multiple files. Since the logic of \"Sugar, sugar\" is almost entirely contained within a single class, I'm pretty confident that the code was also written as one big blob. For ActionScript 2, I'm less confident, as that stuff is tied to frames on a timeline. In the video, I do mention that I'm not sure whether the \"9200 lines\" metric is accurate. But... from vibes alone, the code of Interactive Buddy does feel like it was written in one file.\n\nQ: Aren't you being a bit harsh?\nA: Possibly, but I think this criticism still qualifies as constructive. I admit that these games have huge merit past their source code, and the creativity that went into them is what got me to talk about them in the first place, but that won't bias my honest review of the code. I do highlight the cool stuff, and I do highlight the mess.\n\nQ: Okay, but who cares about the code? The games are fun as-is.\nA: I agree, code quality should not be the top priority for an indie Flash game. However, by following best practices, developers can preemptively avoid bugs and inconsistencies. Consider the example at 5:28 - the typo is surrounded by checks for specific angles and code that's nearly identical in each condition. That's textbook code duplication, which ended up causing some behavior to be inconsistent depending on which wall holds your portal. If the portals were instead implemented modularly, this issue would've been way easier to spot and avoid. Again, I agree that it ultimately doesn't matter - the game is polished enough, it's fun to play, that's the important part. But cleaner code is undeniably linked to less bugs.","author":"@PortalRunner","author_id":"UCx-PpwbajI5ToAY0WwJO2Kg","like_count":1,"published_time":"10 months ago (edited)"},{"id":"UgxkEw88lbZ266B63WB4AaABAg","text":"\"Don't bother cleaning the code nobody will look into it anyway\" ...","author":"@lllloyd","author_id":"UCvW0S4Ut4CamvLwOspb5ixw","like_count":4,"published_time":"10 months ago"},{"id":"UgwfCZwyhSzsw_mvu1B4AaABAg","text":"Good explanations!\n\nHere's some more facts about Run. I think you've earned them.\n\nFirst, a correction. Run 1 and 2 were made in Flash Pro, not Haxe. The reason they're obfuscated is simple: I used an obfuscator to make decompilation harder.\n\nThe 3D effect is exactly as you described. A software renderer calculates where the four corners appear onscreen, then draws a quadrilateral using Flash's 2D Graphics API.\n\nSince I made the projection code from scratch, it has several quirks. Obviously, faraway shapes get distorted (at the time I thought they looked squished without that effect). Less obviously, the camera is hard-coded to look down the Z axis, and can't rotate to look in another direction. Technically, it can't even rotate around Z; I just drew the image unrotated and then told Flash to rotate the 2D display object. Actually, the two display objects: one for tiles that should appear in front of the Runner, and one for the tiles that appear behind.\n\nThe physics have similar quirks. The tiles must be grid-aligned, for starters. In the original release, it only knew how to hit-test against the floor, so when you got close enough to a wall, I made it rotate (turning the wall into floor) before actually hit testing. Later, I back-ported Run 2's physics engine, which means the tiles are secretly handled as cubes. The only reason you don't collide with invisible blocks is, it moves the collision up by one full space when it detects you're falling outside.\n\nI'll leave it at that, but trust me, there was a lot more ridiculousness.","author":"@player03","author_id":"UCM-zYOyBX3nSve9-vOjOwPQ","like_count":2,"published_time":"10 months ago (edited)"},{"id":"UgxdtqEqkNf3qvjbHOV4AaABAg","text":"PortalRunner covered code of games called \"Portal\" and \"Run\"","author":"@SMVery","author_id":"UC5GnE1S33hEsqDp2Z5AH8Gg","like_count":2,"published_time":"10 months ago"},{"id":"UgwgdksKtgVVC-_xbW54AaABAg","text":"At this point the main reason anyone cleans up their code is in case someone decompiles it in 20 years","author":"@hbomberguy","author_id":"UClt01z1wHHT7c5lKcU8pxRQ","like_count":661,"published_time":"10 months ago"},{"id":"UgxfMvQ973I6fBssenJ4AaABAg","text":"If the code sucks, but it works, it doesn't suck\n\n\n...until you want to expand on it","author":"@nodrance","author_id":"UC1eSvpuz-hLv2WfUi2GkHNw","like_count":1,"published_time":"10 months ago"},{"id":"Ugy7i5IpNp0JqeT-H6d4AaABAg","text":"So effectively Run 1 just has a custom software graphics renderer that uses quads instead of tris.","author":"@plantelo","author_id":"UCNql47OTgdswD1aJedtpM2g","like_count":451,"published_time":"10 months ago"},{"id":"UgzUEdJlWqi0-UgwDeZ4AaABAg","text":"I knew the developers of Portal: The Flash Version in real life back when it was developed. It had to be rushed A LOT in order to release ahead of Portal. Also, it was made by just two people, one of which was still in highschool.\n\nNo promises, but if you want I can try to connect you with them for an interview!","author":"@NeatNit","author_id":"UCjM2OgFmEWzL_6Yvef7I4fA","like_count":694,"published_time":"10 months ago"},{"id":"UgyJESWL8haDa5e70Bt4AaABAg","text":"Fun fact: all of Portal TFV was written by a 14-year-old. Another fun little tidbit about it's development is that The Living Tombstone also worked on it before he started making music under that name.","author":"@glassys42","author_id":"UCppbviYF9Fpv6gvqMlHLHLA","like_count":541,"published_time":"10 months ago"},{"id":"UgzWg3IEGibEv5WMWWx4AaABAg","text":"ok but what if you made a flash emulator in portal","author":"@deepsky-r9v","author_id":"UC0rPicsNlPppYqGd7M0qs1w","like_count":365,"published_time":"10 months ago"},{"id":"UgxlaIBHtwwjpLK-kmd4AaABAg","text":"Sugar, Sugar, Raze, Bloxorz, The Impossible Game... We didn't know how good we had it","author":"@nathanpotter1334","author_id":"UC256yixp9EzQF5OG_IOgSYw","like_count":299,"published_time":"10 months ago"},{"id":"UgzT1aQPQ6PN-LvHGNd4AaABAg","text":"I am the Cave Story finder.\nAt 9:58, the Cave Story song \"White\" plays in the background.\nUntil next time...","author":"@hatenathing","author_id":"UC82X4h0it6cTx3xK9U-WedQ","like_count":225,"published_time":"10 months ago"},{"id":"UgwqyhTj15dHv4NRCfx4AaABAg","text":"My instincts said that iterating over 3000 objects is definitely reasonable, considering that those objects appear to be operating at the pixel scale, meaning there is only a few operations for each object, and I'm already used to having to iterate over millions of pixels to render to 4K screen in real time (on the CPU obviously)","author":"@jhgvvetyjj6589","author_id":"UC5-Cz_78xMqsEGtEjinhQsg","like_count":158,"published_time":"10 months ago"},{"id":"UgyJz7v2Ubre9oghlsJ4AaABAg","text":"how did the customers in the papa’s pizzeria games rate your food? that seems like it would be semi complicated","author":"@ThatAnimatronicPerson","author_id":"UCsAGxefpeU-iun4fK1N77mw","like_count":161,"published_time":"10 months ago (edited)"},{"id":"UgwI1J3GbWXXWgpdm494AaABAg","text":"great to see the former home sheep home record holder going back to their roots","author":"@dustyhob0","author_id":"UCLyl6fxntedTEYTxno2S9Tw","like_count":443,"published_time":"10 months ago"},{"id":"UgzqLasZlw2_Oxcm6hF4AaABAg","text":"0:11  Bart bonte is my fav game dev","author":"@OctopusWhoSeesAll","author_id":"UCvvomgOsZ-T4ywMfbw8mecg","like_count":13,"published_time":"9 months ago"},{"id":"UgzcfE-dao1tb8zWRSN4AaABAg","text":"9:39 YEAH THAT'S HOW CODE LOOKS TO ME","author":"@DamageMaximo","author_id":"UC0-4u92PEzjk9AH6X7sJ2vA","like_count":62,"published_time":"10 months ago"},{"id":"UgxUrK8x-FcBrfnMrV54AaABAg","text":"the corru.observer sound at 2:49 caught my attention immediately lol","author":"@sstarlit5631","author_id":"UCyBQZsLQmpilEyi39g2A-CQ","like_count":20,"published_time":"10 months ago (edited)"},{"id":"Ugw7cF02PA-CrMDyUE54AaABAg","text":"Run 3 modder here! It’s actually super cool to see you talk about this. Run 3 in specific has some really weirdly interesting code related to data collection and music. For data collection, only one in I believe 200 infinite mode runs are specifically sent to player for the data to be collected. For music, there’s literally a line of code that makes it so every level that uses “map of the stars” uses traveling the galaxy instead. For a lot of sin related functions, instead of using some pi function and dividing it by 2, player inputs pi/2 accurate to like 15 digits individually each time.","author":"@t8thegr8st","author_id":"UCwTlAx33LuskcVKe8VP042A","like_count":15,"published_time":"10 months ago"},{"id":"UgwN3ATu4oWZzezXpy14AaABAg","text":"12:23 the rendering code IS NOT faking the 3rd dimension. This is actually how GPUs work, projecting the 3D world onto a 2D plane of the camera","author":"@BenMorse0","author_id":"UCtUdfgusz7tx12PSoSEcSKQ","like_count":14,"published_time":"10 months ago"},{"id":"Ugx1LPcNq5mx09cnP-l4AaABAg","text":"Heads up! The point of this video was not to criticize game code, it's to give some insight on how these games were made. I see quite a few comments taking this the wrong way. Rest assured, I am not trying to discredit the quality or gameplay merit of these titles. Perhaps I didn't make that clear enough - that's my bad, I'll be more careful next time.\n\nFrequently Asked Questions:\n\nQ: How are you sure that this is the real code? Isn't decompilation a lossy process?\nA: Flash's ActionScript often decompiles relatively cleanly, maintaining the original control flow almost completely unmodified. Symbols aren't stripped by default, and functions don't seem to be inlined. The usual suspects of decompilation noise are minimal at worst. Even if things were moved around, inlined or restructured by the decompiler, that wouldn't explain the quirks I highlight here. For example, \"Portal: The Flash Version\" must be using duplicated code for its portals, as a modular solution would never decompile to hard angles. \"Sugar, sugar\" also undoubtedly contains duplicated code - the sugar logic is copied once for the menu, and once for gameplay, with nearly inconsequential changes in-between.\n\nQ: How can you know that the code was written in one huge file?\nA: I can't, but it's likely. ActionScript 3 structures its code into classes, and it'd be a bit unusual for a class to span multiple files. Since the logic of \"Sugar, sugar\" is almost entirely contained within a single class, I'm pretty confident that the code was also written as one big blob. For ActionScript 2, I'm less confident, as that stuff is tied to frames on a timeline. In the video, I do mention that I'm not sure whether the \"9200 lines\" metric is accurate. But... from vibes alone, the code of Interactive Buddy does feel like it was written in one file.\n\nQ: Aren't you being a bit harsh?\nA: Possibly, but I think this criticism still qualifies as constructive. I admit that these games have huge merit past their source code, and the creativity that went into them is what got me to talk about them in the first place, but that won't bias my honest review of the code. I do highlight the cool stuff, and I do highlight the mess.\n\nQ: Okay, but who cares about the code? The games are fun as-is.\nA: I agree, code quality should not be the top priority for an indie Flash game. However, by following best practices, developers can preemptively avoid bugs and inconsistencies. Consider the example at 5:28 - the typo is surrounded by checks for specific angles and code that's nearly identical in each condition. That's textbook code duplication, which ended up causing some behavior to be inconsistent depending on which wall holds your portal. If the portals were instead implemented modularly, this issue would've been way easier to spot and avoid. Again, I agree that it ultimately doesn't matter - the game is polished enough, it's fun to play, that's the important part. But cleaner code is undeniably linked to less bugs.","author":"@PortalRunner","author_id":"UCx-PpwbajI5ToAY0WwJO2Kg","like_count":1,"published_time":"10 months ago (edited)"},{"id":"UgxkEw88lbZ266B63WB4AaABAg","text":"\"Don't bother cleaning the code nobody will look into it anyway\" ...","author":"@lllloyd","author_id":"UCvW0S4Ut4CamvLwOspb5ixw","like_count":4,"published_time":"10 months ago"},{"id":"UgxfMvQ973I6fBssenJ4AaABAg","text":"If the code sucks, but it works, it doesn't suck\n\n\n...until you want to expand on it","author":"@nodrance","author_id":"UC1eSvpuz-hLv2WfUi2GkHNw","like_count":1,"published_time":"10 months ago"},{"id":"UgxdtqEqkNf3qvjbHOV4AaABAg","text":"PortalRunner covered code of games called \"Portal\" and \"Run\"","author":"@SMVery","author_id":"UC5GnE1S33hEsqDp2Z5AH8Gg","like_count":2,"published_time":"10 months ago"},{"id":"UgwgdksKtgVVC-_xbW54AaABAg","text":"At this point the main reason anyone cleans up their code is in case someone decompiles it in 20 years","author":"@hbomberguy","author_id":"UClt01z1wHHT7c5lKcU8pxRQ","like_count":661,"published_time":"10 months ago"},{"id":"UgzUEdJlWqi0-UgwDeZ4AaABAg","text":"I knew the developers of Portal: The Flash Version in real life back when it was developed. It had to be rushed A LOT in order to release ahead of Portal. Also, it was made by just two people, one of which was still in highschool.\n\nNo promises, but if you want I can try to connect you with them for an interview!","author":"@NeatNit","author_id":"UCjM2OgFmEWzL_6Yvef7I4fA","like_count":694,"published_time":"10 months ago"},{"id":"UgyJESWL8haDa5e70Bt4AaABAg","text":"Fun fact: all of Portal TFV was written by a 14-year-old. Another fun little tidbit about it's development is that The Living Tombstone also worked on it before he started making music under that name.","author":"@glassys42","author_id":"UCppbviYF9Fpv6gvqMlHLHLA","like_count":541,"published_time":"10 months ago"},{"id":"UgwfCZwyhSzsw_mvu1B4AaABAg","text":"Good explanations!\n\nHere's some more facts about Run. I think you've earned them.\n\nFirst, a correction. Run 1 and 2 were made in Flash Pro, not Haxe. The reason they're obfuscated is simple: I used an obfuscator to make decompilation harder.\n\nThe 3D effect is exactly as you described. A software renderer calculates where the four corners appear onscreen, then draws a quadrilateral using Flash's 2D Graphics API.\n\nSince I made the projection code from scratch, it has several quirks. Obviously, faraway shapes get distorted (at the time I thought they looked squished without that effect). Less obviously, the camera is hard-coded to look down the Z axis, and can't rotate to look in another direction. Technically, it can't even rotate around Z; I just drew the image unrotated and then told Flash to rotate the 2D display object. Actually, the two display objects: one for tiles that should appear in front of the Runner, and one for the tiles that appear behind.\n\nThe physics have similar quirks. The tiles must be grid-aligned, for starters. In the original release, it only knew how to hit-test against the floor, so when you got close enough to a wall, I made it rotate (turning the wall into floor) before actually hit testing. Later, I back-ported Run 2's physics engine, which means the tiles are secretly handled as cubes. The only reason you don't collide with invisible blocks is, it moves the collision up by one full space when it detects you're falling outside.\n\nI'll leave it at that, but trust me, there was a lot more ridiculousness.","author":"@player03","author_id":"UCM-zYOyBX3nSve9-vOjOwPQ","like_count":2,"published_time":"10 months ago (edited)"},{"id":"UgwI1J3GbWXXWgpdm494AaABAg","text":"great to see the former home sheep home record holder going back to their roots","author":"@dustyhob0","author_id":"UCLyl6fxntedTEYTxno2S9Tw","like_count":443,"published_time":"10 months ago"},{"id":"Ugy7i5IpNp0JqeT-H6d4AaABAg","text":"So effectively Run 1 just has a custom software graphics renderer that uses quads instead of tris.","author":"@plantelo","author_id":"UCNql47OTgdswD1aJedtpM2g","like_count":451,"published_time":"10 months ago"},{"id":"UgxlaIBHtwwjpLK-kmd4AaABAg","text":"Sugar, Sugar, Raze, Bloxorz, The Impossible Game... We didn't know how good we had it","author":"@nathanpotter1334","author_id":"UC256yixp9EzQF5OG_IOgSYw","like_count":299,"published_time":"10 months ago"},{"id":"UgzWg3IEGibEv5WMWWx4AaABAg","text":"ok but what if you made a flash emulator in portal","author":"@deepsky-r9v","author_id":"UC0rPicsNlPppYqGd7M0qs1w","like_count":365,"published_time":"10 months ago"},{"id":"UgzT1aQPQ6PN-LvHGNd4AaABAg","text":"I am the Cave Story finder.\nAt 9:58, the Cave Story song \"White\" plays in the background.\nUntil next time...","author":"@hatenathing","author_id":"UC82X4h0it6cTx3xK9U-WedQ","like_count":225,"published_time":"10 months ago"},{"id":"UgwqyhTj15dHv4NRCfx4AaABAg","text":"My instincts said that iterating over 3000 objects is definitely reasonable, considering that those objects appear to be operating at the pixel scale, meaning there is only a few operations for each object, and I'm already used to having to iterate over millions of pixels to render to 4K screen in real time (on the CPU obviously)","author":"@jhgvvetyjj6589","author_id":"UC5-Cz_78xMqsEGtEjinhQsg","like_count":158,"published_time":"10 months ago"},{"id":"UgyJz7v2Ubre9oghlsJ4AaABAg","text":"how did the customers in the papa’s pizzeria games rate your food? that seems like it would be semi complicated","author":"@ThatAnimatronicPerson","author_id":"UCsAGxefpeU-iun4fK1N77mw","like_count":161,"published_time":"10 months ago (edited)"},{"id":"UgwN3ATu4oWZzezXpy14AaABAg","text":"12:23 the rendering code IS NOT faking the 3rd dimension. This is actually how GPUs work, projecting the 3D world onto a 2D plane of the camera","author":"@BenMorse0","author_id":"UCtUdfgusz7tx12PSoSEcSKQ","like_count":14,"published_time":"10 months ago"},{"id":"UgwPlIYdf_4Yvy3HuNx4AaABAg","text":"If you ever made another one of these, I'd love to see Fancy Pants Adventure dissected specifically to see how its physics work. It's one of the most unique and fun feeling platformers I've ever played and I'm intrigued what's happening under the hood","author":"@hyperventalated","author_id":"UCj0vLXXpR2_WgRoSwy7Vjww","like_count":19,"published_time":"10 months ago"},{"id":"Ugz89MACUJr9zGbsZ3t4AaABAg","text":"If there's any decrease in quality today, it's less to do with artistry and 100% to do with time and budget constraints. As in, artists just aren't given the time to animate those sequences as they used to, so corners get cut and \"good enough\" has to make do to get things released on time. \n\nIt's almost never the artists at fault and almost always the budgetary big wigs who haven't drawn a picture since primary school.","author":"@Respectable_Username","author_id":"UCO5Wbxfw1zmzdcrd5vxzmxw","like_count":10,"published_time":"10 months ago"},{"id":"Ugx6uhvozvee7-mwBdJ4AaABAg","text":"12:54 kick the buddy before he became a celebrity","author":"@HANAKINskywoker","author_id":"UC8bqqhyVqsvYEZU1lJahnPg","like_count":22,"published_time":"10 months ago"},{"id":"Ugz4tyg8IfPX030_Jwp4AaABAg","text":"2:56 HOLY SH$T IT'S ME\ni feel like hunter s. thompson seeing hunter s. thompson","author":"@hhhsp951","author_id":"UCtFdXg48m9LaaIoopN2wUHg","like_count":48,"published_time":"10 months ago (edited)"},{"id":"Ugx1LPcNq5mx09cnP-l4AaABAg","text":"Heads up! The point of this video was not to criticize game code, it's to give some insight on how these games were made. I see quite a few comments taking this the wrong way. Rest assured, I am not trying to discredit the quality or gameplay merit of these titles. Perhaps I didn't make that clear enough - that's my bad, I'll be more careful next time.\n\nFrequently Asked Questions:\n\nQ: How are you sure that this is the real code? Isn't decompilation a lossy process?\nA: Flash's ActionScript often decompiles relatively cleanly, maintaining the original control flow almost completely unmodified. Symbols aren't stripped by default, and functions don't seem to be inlined. The usual suspects of decompilation noise are minimal at worst. Even if things were moved around, inlined or restructured by the decompiler, that wouldn't explain the quirks I highlight here. For example, \"Portal: The Flash Version\" must be using duplicated code for its portals, as a modular solution would never decompile to hard angles. \"Sugar, sugar\" also undoubtedly contains duplicated code - the sugar logic is copied once for the menu, and once for gameplay, with nearly inconsequential changes in-between.\n\nQ: How can you know that the code was written in one huge file?\nA: I can't, but it's likely. ActionScript 3 structures its code into classes, and it'd be a bit unusual for a class to span multiple files. Since the logic of \"Sugar, sugar\" is almost entirely contained within a single class, I'm pretty confident that the code was also written as one big blob. For ActionScript 2, I'm less confident, as that stuff is tied to frames on a timeline. In the video, I do mention that I'm not sure whether the \"9200 lines\" metric is accurate. But... from vibes alone, the code of Interactive Buddy does feel like it was written in one file.\n\nQ: Aren't you being a bit harsh?\nA: Possibly, but I think this criticism still qualifies as constructive. I admit that these games have huge merit past their source code, and the creativity that went into them is what got me to talk about them in the first place, but that won't bias my honest review of the code. I do highlight the cool stuff, and I do highlight the mess.\n\nQ: Okay, but who cares about the code? The games are fun as-is.\nA: I agree, code quality should not be the top priority for an indie Flash game. However, by following best practices, developers can preemptively avoid bugs and inconsistencies. Consider the example at 5:28 - the typo is surrounded by checks for specific angles and code that's nearly identical in each condition. That's textbook code duplication, which ended up causing some behavior to be inconsistent depending on which wall holds your portal. If the portals were instead implemented modularly, this issue would've been way easier to spot and avoid. Again, I agree that it ultimately doesn't matter - the game is polished enough, it's fun to play, that's the important part. But cleaner code is undeniably linked to less bugs.","author":"@PortalRunner","author_id":"UCx-PpwbajI5ToAY0WwJO2Kg","like_count":1,"published_time":"10 months ago (edited)"},{"id":"UgxkEw88lbZ266B63WB4AaABAg","text":"\"Don't bother cleaning the code nobody will look into it anyway\" ...","author":"@lllloyd","author_id":"UCvW0S4Ut4CamvLwOspb5ixw","like_count":4,"published_time":"10 months ago"},{"id":"UgxfMvQ973I6fBssenJ4AaABAg","text":"If the code sucks, but it works, it doesn't suck\n\n\n...until you want to expand on it","author":"@nodrance","author_id":"UC1eSvpuz-hLv2WfUi2GkHNw","like_count":1,"published_time":"10 months ago"},{"id":"UgxdtqEqkNf3qvjbHOV4AaABAg","text":"PortalRunner covered code of games called \"Portal\" and \"Run\"","author":"@SMVery","author_id":"UC5GnE1S33hEsqDp2Z5AH8Gg","like_count":2,"published_time":"10 months ago"},{"id":"UgwgdksKtgVVC-_xbW54AaABAg","text":"At this point the main reason anyone cleans up their code is in case someone decompiles it in 20 years","author":"@hbomberguy","author_id":"UClt01z1wHHT7c5lKcU8pxRQ","like_count":661,"published_time":"10 months ago"},{"id":"UgzUEdJlWqi0-UgwDeZ4AaABAg","text":"I knew the developers of Portal: The Flash Version in real life back when it was developed. It had to be rushed A LOT in order to release ahead of Portal. Also, it was made by just two people, one of which was still in highschool.\n\nNo promises, but if you want I can try to connect you with them for an interview!","author":"@NeatNit","author_id":"UCjM2OgFmEWzL_6Yvef7I4fA","like_count":694,"published_time":"10 months ago"},{"id":"UgyJESWL8haDa5e70Bt4AaABAg","text":"Fun fact: all of Portal TFV was written by a 14-year-old. Another fun little tidbit about it's development is that The Living Tombstone also worked on it before he started making music under that name.","author":"@glassys42","author_id":"UCppbviYF9Fpv6gvqMlHLHLA","like_count":541,"published_time":"10 months ago"},{"id":"UgwfCZwyhSzsw_mvu1B4AaABAg","text":"Good explanations!\n\nHere's some more facts about Run. I think you've earned them.\n\nFirst, a correction. Run 1 and 2 were made in Flash Pro, not Haxe. The reason they're obfuscated is simple: I used an obfuscator to make decompilation harder.\n\nThe 3D effect is exactly as you described. A software renderer calculates where the four corners appear onscreen, then draws a quadrilateral using Flash's 2D Graphics API.\n\nSince I made the projection code from scratch, it has several quirks. Obviously, faraway shapes get distorted (at the time I thought they looked squished without that effect). Less obviously, the camera is hard-coded to look down the Z axis, and can't rotate to look in another direction. Technically, it can't even rotate around Z; I just drew the image unrotated and then told Flash to rotate the 2D display object. Actually, the two display objects: one for tiles that should appear in front of the Runner, and one for the tiles that appear behind.\n\nThe physics have similar quirks. The tiles must be grid-aligned, for starters. In the original release, it only knew how to hit-test against the floor, so when you got close enough to a wall, I made it rotate (turning the wall into floor) before actually hit testing. Later, I back-ported Run 2's physics engine, which means the tiles are secretly handled as cubes. The only reason you don't collide with invisible blocks is, it moves the collision up by one full space when it detects you're falling outside.\n\nI'll leave it at that, but trust me, there was a lot more ridiculousness.","author":"@player03","author_id":"UCM-zYOyBX3nSve9-vOjOwPQ","like_count":2,"published_time":"10 months ago (edited)"},{"id":"UgwI1J3GbWXXWgpdm494AaABAg","text":"great to see the former home sheep home record holder going back to their roots","author":"@dustyhob0","author_id":"UCLyl6fxntedTEYTxno2S9Tw","like_count":443,"published_time":"10 months ago"},{"id":"Ugy7i5IpNp0JqeT-H6d4AaABAg","text":"So effectively Run 1 just has a custom software graphics renderer that uses quads instead of tris.","author":"@plantelo","author_id":"UCNql47OTgdswD1aJedtpM2g","like_count":451,"published_time":"10 months ago"},{"id":"UgxlaIBHtwwjpLK-kmd4AaABAg","text":"Sugar, Sugar, Raze, Bloxorz, The Impossible Game... We didn't know how good we had it","author":"@nathanpotter1334","author_id":"UC256yixp9EzQF5OG_IOgSYw","like_count":299,"published_time":"10 months ago"},{"id":"UgzWg3IEGibEv5WMWWx4AaABAg","text":"ok but what if you made a flash emulator in portal","author":"@deepsky-r9v","author_id":"UC0rPicsNlPppYqGd7M0qs1w","like_count":365,"published_time":"10 months ago"},{"id":"UgzT1aQPQ6PN-LvHGNd4AaABAg","text":"I am the Cave Story finder.\nAt 9:58, the Cave Story song \"White\" plays in the background.\nUntil next time...","author":"@hatenathing","author_id":"UC82X4h0it6cTx3xK9U-WedQ","like_count":225,"published_time":"10 months ago"},{"id":"UgwqyhTj15dHv4NRCfx4AaABAg","text":"My instincts said that iterating over 3000 objects is definitely reasonable, considering that those objects appear to be operating at the pixel scale, meaning there is only a few operations for each object, and I'm already used to having to iterate over millions of pixels to render to 4K screen in real time (on the CPU obviously)","author":"@jhgvvetyjj6589","author_id":"UC5-Cz_78xMqsEGtEjinhQsg","like_count":158,"published_time":"10 months ago"},{"id":"UgyJz7v2Ubre9oghlsJ4AaABAg","text":"how did the customers in the papa’s pizzeria games rate your food? that seems like it would be semi complicated","author":"@ThatAnimatronicPerson","author_id":"UCsAGxefpeU-iun4fK1N77mw","like_count":161,"published_time":"10 months ago (edited)"},{"id":"UgwN3ATu4oWZzezXpy14AaABAg","text":"12:23 the rendering code IS NOT faking the 3rd dimension. This is actually how GPUs work, projecting the 3D world onto a 2D plane of the camera","author":"@BenMorse0","author_id":"UCtUdfgusz7tx12PSoSEcSKQ","like_count":14,"published_time":"10 months ago"},{"id":"UgwPlIYdf_4Yvy3HuNx4AaABAg","text":"If you ever made another one of these, I'd love to see Fancy Pants Adventure dissected specifically to see how its physics work. It's one of the most unique and fun feeling platformers I've ever played and I'm intrigued what's happening under the hood","author":"@hyperventalated","author_id":"UCj0vLXXpR2_WgRoSwy7Vjww","like_count":19,"published_time":"10 months ago"},{"id":"Ugz89MACUJr9zGbsZ3t4AaABAg","text":"If there's any decrease in quality today, it's less to do with artistry and 100% to do with time and budget constraints. As in, artists just aren't given the time to animate those sequences as they used to, so corners get cut and \"good enough\" has to make do to get things released on time. \n\nIt's almost never the artists at fault and almost always the budgetary big wigs who haven't drawn a picture since primary school.","author":"@Respectable_Username","author_id":"UCO5Wbxfw1zmzdcrd5vxzmxw","like_count":10,"published_time":"10 months ago"},{"id":"Ugx6uhvozvee7-mwBdJ4AaABAg","text":"12:54 kick the buddy before he became a celebrity","author":"@HANAKINskywoker","author_id":"UC8bqqhyVqsvYEZU1lJahnPg","like_count":22,"published_time":"10 months ago"},{"id":"Ugz4tyg8IfPX030_Jwp4AaABAg","text":"2:56 HOLY SH$T IT'S ME\ni feel like hunter s. thompson seeing hunter s. thompson","author":"@hhhsp951","author_id":"UCtFdXg48m9LaaIoopN2wUHg","like_count":48,"published_time":"10 months ago (edited)"},{"id":"Ugx1LPcNq5mx09cnP-l4AaABAg","text":"Heads up! The point of this video was not to criticize game code, it's to give some insight on how these games were made. I see quite a few comments taking this the wrong way. Rest assured, I am not trying to discredit the quality or gameplay merit of these titles. Perhaps I didn't make that clear enough - that's my bad, I'll be more careful next time.\n\nFrequently Asked Questions:\n\nQ: How are you sure that this is the real code? Isn't decompilation a lossy process?\nA: Flash's ActionScript often decompiles relatively cleanly, maintaining the original control flow almost completely unmodified. Symbols aren't stripped by default, and functions don't seem to be inlined. The usual suspects of decompilation noise are minimal at worst. Even if things were moved around, inlined or restructured by the decompiler, that wouldn't explain the quirks I highlight here. For example, \"Portal: The Flash Version\" must be using duplicated code for its portals, as a modular solution would never decompile to hard angles. \"Sugar, sugar\" also undoubtedly contains duplicated code - the sugar logic is copied once for the menu, and once for gameplay, with nearly inconsequential changes in-between.\n\nQ: How can you know that the code was written in one huge file?\nA: I can't, but it's likely. ActionScript 3 structures its code into classes, and it'd be a bit unusual for a class to span multiple files. Since the logic of \"Sugar, sugar\" is almost entirely contained within a single class, I'm pretty confident that the code was also written as one big blob. For ActionScript 2, I'm less confident, as that stuff is tied to frames on a timeline. In the video, I do mention that I'm not sure whether the \"9200 lines\" metric is accurate. But... from vibes alone, the code of Interactive Buddy does feel like it was written in one file.\n\nQ: Aren't you being a bit harsh?\nA: Possibly, but I think this criticism still qualifies as constructive. I admit that these games have huge merit past their source code, and the creativity that went into them is what got me to talk about them in the first place, but that won't bias my honest review of the code. I do highlight the cool stuff, and I do highlight the mess.\n\nQ: Okay, but who cares about the code? The games are fun as-is.\nA: I agree, code quality should not be the top priority for an indie Flash game. However, by following best practices, developers can preemptively avoid bugs and inconsistencies. Consider the example at 5:28 - the typo is surrounded by checks for specific angles and code that's nearly identical in each condition. That's textbook code duplication, which ended up causing some behavior to be inconsistent depending on which wall holds your portal. If the portals were instead implemented modularly, this issue would've been way easier to spot and avoid. Again, I agree that it ultimately doesn't matter - the game is polished enough, it's fun to play, that's the important part. But cleaner code is undeniably linked to less bugs.","author":"@PortalRunner","author_id":"UCx-PpwbajI5ToAY0WwJO2Kg","like_count":1,"published_time":"10 months ago (edited)"},{"id":"UgxkEw88lbZ266B63WB4AaABAg","text":"\"Don't bother cleaning the code nobody will look into it anyway\" ...","author":"@lllloyd","author_id":"UCvW0S4Ut4CamvLwOspb5ixw","like_count":4,"published_time":"10 months ago"},{"id":"UgxfMvQ973I6fBssenJ4AaABAg","text":"If the code sucks, but it works, it doesn't suck\n\n\n...until you want to expand on it","author":"@nodrance","author_id":"UC1eSvpuz-hLv2WfUi2GkHNw","like_count":1,"published_time":"10 months ago"},{"id":"UgxdtqEqkNf3qvjbHOV4AaABAg","text":"PortalRunner covered code of games called \"Portal\" and \"Run\"","author":"@SMVery","author_id":"UC5GnE1S33hEsqDp2Z5AH8Gg","like_count":2,"published_time":"10 months ago"},{"id":"UgwgdksKtgVVC-_xbW54AaABAg","text":"At this point the main reason anyone cleans up their code is in case someone decompiles it in 20 years","author":"@hbomberguy","author_id":"UClt01z1wHHT7c5lKcU8pxRQ","like_count":661,"published_time":"10 months ago"},{"id":"UgzUEdJlWqi0-UgwDeZ4AaABAg","text":"I knew the developers of Portal: The Flash Version in real life back when it was developed. It had to be rushed A LOT in order to release ahead of Portal. Also, it was made by just two people, one of which was still in highschool.\n\nNo promises, but if you want I can try to connect you with them for an interview!","author":"@NeatNit","author_id":"UCjM2OgFmEWzL_6Yvef7I4fA","like_count":694,"published_time":"10 months ago"},{"id":"UgyJESWL8haDa5e70Bt4AaABAg","text":"Fun fact: all of Portal TFV was written by a 14-year-old. Another fun little tidbit about it's development is that The Living Tombstone also worked on it before he started making music under that name.","author":"@glassys42","author_id":"UCppbviYF9Fpv6gvqMlHLHLA","like_count":541,"published_time":"10 months ago"},{"id":"UgwfCZwyhSzsw_mvu1B4AaABAg","text":"Good explanations!\n\nHere's some more facts about Run. I think you've earned them.\n\nFirst, a correction. Run 1 and 2 were made in Flash Pro, not Haxe. The reason they're obfuscated is simple: I used an obfuscator to make decompilation harder.\n\nThe 3D effect is exactly as you described. A software renderer calculates where the four corners appear onscreen, then draws a quadrilateral using Flash's 2D Graphics API.\n\nSince I made the projection code from scratch, it has several quirks. Obviously, faraway shapes get distorted (at the time I thought they looked squished without that effect). Less obviously, the camera is hard-coded to look down the Z axis, and can't rotate to look in another direction. Technically, it can't even rotate around Z; I just drew the image unrotated and then told Flash to rotate the 2D display object. Actually, the two display objects: one for tiles that should appear in front of the Runner, and one for the tiles that appear behind.\n\nThe physics have similar quirks. The tiles must be grid-aligned, for starters. In the original release, it only knew how to hit-test against the floor, so when you got close enough to a wall, I made it rotate (turning the wall into floor) before actually hit testing. Later, I back-ported Run 2's physics engine, which means the tiles are secretly handled as cubes. The only reason you don't collide with invisible blocks is, it moves the collision up by one full space when it detects you're falling outside.\n\nI'll leave it at that, but trust me, there was a lot more ridiculousness.","author":"@player03","author_id":"UCM-zYOyBX3nSve9-vOjOwPQ","like_count":2,"published_time":"10 months ago (edited)"},{"id":"UgwI1J3GbWXXWgpdm494AaABAg","text":"great to see the former home sheep home record holder going back to their roots","author":"@dustyhob0","author_id":"UCLyl6fxntedTEYTxno2S9Tw","like_count":443,"published_time":"10 months ago"},{"id":"Ugy7i5IpNp0JqeT-H6d4AaABAg","text":"So effectively Run 1 just has a custom software graphics renderer that uses quads instead of tris.","author":"@plantelo","author_id":"UCNql47OTgdswD1aJedtpM2g","like_count":451,"published_time":"10 months ago"},{"id":"UgxlaIBHtwwjpLK-kmd4AaABAg","text":"Sugar, Sugar, Raze, Bloxorz, The Impossible Game... We didn't know how good we had it","author":"@nathanpotter1334","author_id":"UC256yixp9EzQF5OG_IOgSYw","like_count":299,"published_time":"10 months ago"},{"id":"UgzWg3IEGibEv5WMWWx4AaABAg","text":"ok but what if you made a flash emulator in portal","author":"@deepsky-r9v","author_id":"UC0rPicsNlPppYqGd7M0qs1w","like_count":365,"published_time":"10 months ago"},{"id":"UgzT1aQPQ6PN-LvHGNd4AaABAg","text":"I am the Cave Story finder.\nAt 9:58, the Cave Story song \"White\" plays in the background.\nUntil next time...","author":"@hatenathing","author_id":"UC82X4h0it6cTx3xK9U-WedQ","like_count":225,"published_time":"10 months ago"},{"id":"UgwqyhTj15dHv4NRCfx4AaABAg","text":"My instincts said that iterating over 3000 objects is definitely reasonable, considering that those objects appear to be operating at the pixel scale, meaning there is only a few operations for each object, and I'm already used to having to iterate over millions of pixels to render to 4K screen in real time (on the CPU obviously)","author":"@jhgvvetyjj6589","author_id":"UC5-Cz_78xMqsEGtEjinhQsg","like_count":158,"published_time":"10 months ago"},{"id":"UgyJz7v2Ubre9oghlsJ4AaABAg","text":"how did the customers in the papa’s pizzeria games rate your food? that seems like it would be semi complicated","author":"@ThatAnimatronicPerson","author_id":"UCsAGxefpeU-iun4fK1N77mw","like_count":161,"published_time":"10 months ago (edited)"},{"id":"UgwN3ATu4oWZzezXpy14AaABAg","text":"12:23 the rendering code IS NOT faking the 3rd dimension. This is actually how GPUs work, projecting the 3D world onto a 2D plane of the camera","author":"@BenMorse0","author_id":"UCtUdfgusz7tx12PSoSEcSKQ","like_count":14,"published_time":"10 months ago"},{"id":"UgwPlIYdf_4Yvy3HuNx4AaABAg","text":"If you ever made another one of these, I'd love to see Fancy Pants Adventure dissected specifically to see how its physics work. It's one of the most unique and fun feeling platformers I've ever played and I'm intrigued what's happening under the hood","author":"@hyperventalated","author_id":"UCj0vLXXpR2_WgRoSwy7Vjww","like_count":19,"published_time":"10 months ago"},{"id":"Ugz89MACUJr9zGbsZ3t4AaABAg","text":"If there's any decrease in quality today, it's less to do with artistry and 100% to do with time and budget constraints. As in, artists just aren't given the time to animate those sequences as they used to, so corners get cut and \"good enough\" has to make do to get things released on time. \n\nIt's almost never the artists at fault and almost always the budgetary big wigs who haven't drawn a picture since primary school.","author":"@Respectable_Username","author_id":"UCO5Wbxfw1zmzdcrd5vxzmxw","like_count":10,"published_time":"10 months ago"},{"id":"Ugx6uhvozvee7-mwBdJ4AaABAg","text":"12:54 kick the buddy before he became a celebrity","author":"@HANAKINskywoker","author_id":"UC8bqqhyVqsvYEZU1lJahnPg","like_count":22,"published_time":"10 months ago"},{"id":"Ugz4tyg8IfPX030_Jwp4AaABAg","text":"2:56 HOLY SH$T IT'S ME\ni feel like hunter s. thompson seeing hunter s. thompson","author":"@hhhsp951","author_id":"UCtFdXg48m9LaaIoopN2wUHg","like_count":48,"published_time":"10 months ago (edited)"},{"id":"Ugx1LPcNq5mx09cnP-l4AaABAg","text":"Heads up! The point of this video was not to criticize game code, it's to give some insight on how these games were made. I see quite a few comments taking this the wrong way. Rest assured, I am not trying to discredit the quality or gameplay merit of these titles. Perhaps I didn't make that clear enough - that's my bad, I'll be more careful next time.\n\nFrequently Asked Questions:\n\nQ: How are you sure that this is the real code? Isn't decompilation a lossy process?\nA: Flash's ActionScript often decompiles relatively cleanly, maintaining the original control flow almost completely unmodified. Symbols aren't stripped by default, and functions don't seem to be inlined. The usual suspects of decompilation noise are minimal at worst. Even if things were moved around, inlined or restructured by the decompiler, that wouldn't explain the quirks I highlight here. For example, \"Portal: The Flash Version\" must be using duplicated code for its portals, as a modular solution would never decompile to hard angles. \"Sugar, sugar\" also undoubtedly contains duplicated code - the sugar logic is copied once for the menu, and once for gameplay, with nearly inconsequential changes in-between.\n\nQ: How can you know that the code was written in one huge file?\nA: I can't, but it's likely. ActionScript 3 structures its code into classes, and it'd be a bit unusual for a class to span multiple files. Since the logic of \"Sugar, sugar\" is almost entirely contained within a single class, I'm pretty confident that the code was also written as one big blob. For ActionScript 2, I'm less confident, as that stuff is tied to frames on a timeline. In the video, I do mention that I'm not sure whether the \"9200 lines\" metric is accurate. But... from vibes alone, the code of Interactive Buddy does feel like it was written in one file.\n\nQ: Aren't you being a bit harsh?\nA: Possibly, but I think this criticism still qualifies as constructive. I admit that these games have huge merit past their source code, and the creativity that went into them is what got me to talk about them in the first place, but that won't bias my honest review of the code. I do highlight the cool stuff, and I do highlight the mess.\n\nQ: Okay, but who cares about the code? The games are fun as-is.\nA: I agree, code quality should not be the top priority for an indie Flash game. However, by following best practices, developers can preemptively avoid bugs and inconsistencies. Consider the example at 5:28 - the typo is surrounded by checks for specific angles and code that's nearly identical in each condition. That's textbook code duplication, which ended up causing some behavior to be inconsistent depending on which wall holds your portal. If the portals were instead implemented modularly, this issue would've been way easier to spot and avoid. Again, I agree that it ultimately doesn't matter - the game is polished enough, it's fun to play, that's the important part. But cleaner code is undeniably linked to less bugs.","author":"@PortalRunner","author_id":"UCx-PpwbajI5ToAY0WwJO2Kg","like_count":1,"published_time":"10 months ago (edited)"},{"id":"UgxkEw88lbZ266B63WB4AaABAg","text":"\"Don't bother cleaning the code nobody will look into it anyway\" ...","author":"@lllloyd","author_id":"UCvW0S4Ut4CamvLwOspb5ixw","like_count":4,"published_time":"10 months ago"},{"id":"UgxfMvQ973I6fBssenJ4AaABAg","text":"If the code sucks, but it works, it doesn't suck\n\n\n...until you want to expand on it","author":"@nodrance","author_id":"UC1eSvpuz-hLv2WfUi2GkHNw","like_count":1,"published_time":"10 months ago"},{"id":"UgxdtqEqkNf3qvjbHOV4AaABAg","text":"PortalRunner covered code of games called \"Portal\" and \"Run\"","author":"@SMVery","author_id":"UC5GnE1S33hEsqDp2Z5AH8Gg","like_count":2,"published_time":"10 months ago"},{"id":"UgzUEdJlWqi0-UgwDeZ4AaABAg","text":"I knew the developers of Portal: The Flash Version in real life back when it was developed. It had to be rushed A LOT in order to release ahead of Portal. Also, it was made by just two people, one of which was still in highschool.\n\nNo promises, but if you want I can try to connect you with them for an interview!","author":"@NeatNit","author_id":"UCjM2OgFmEWzL_6Yvef7I4fA","like_count":694,"published_time":"10 months ago"},{"id":"UgyJESWL8haDa5e70Bt4AaABAg","text":"Fun fact: all of Portal TFV was written by a 14-year-old. Another fun little tidbit about it's development is that The Living Tombstone also worked on it before he started making music under that name.","author":"@glassys42","author_id":"UCppbviYF9Fpv6gvqMlHLHLA","like_count":541,"published_time":"10 months ago"},{"id":"UgwgdksKtgVVC-_xbW54AaABAg","text":"At this point the main reason anyone cleans up their code is in case someone decompiles it in 20 years","author":"@hbomberguy","author_id":"UClt01z1wHHT7c5lKcU8pxRQ","like_count":661,"published_time":"10 months ago"},{"id":"UgwfCZwyhSzsw_mvu1B4AaABAg","text":"Good explanations!\n\nHere's some more facts about Run. I think you've earned them.\n\nFirst, a correction. Run 1 and 2 were made in Flash Pro, not Haxe. The reason they're obfuscated is simple: I used an obfuscator to make decompilation harder.\n\nThe 3D effect is exactly as you described. A software renderer calculates where the four corners appear onscreen, then draws a quadrilateral using Flash's 2D Graphics API.\n\nSince I made the projection code from scratch, it has several quirks. Obviously, faraway shapes get distorted (at the time I thought they looked squished without that effect). Less obviously, the camera is hard-coded to look down the Z axis, and can't rotate to look in another direction. Technically, it can't even rotate around Z; I just drew the image unrotated and then told Flash to rotate the 2D display object. Actually, the two display objects: one for tiles that should appear in front of the Runner, and one for the tiles that appear behind.\n\nThe physics have similar quirks. The tiles must be grid-aligned, for starters. In the original release, it only knew how to hit-test against the floor, so when you got close enough to a wall, I made it rotate (turning the wall into floor) before actually hit testing. Later, I back-ported Run 2's physics engine, which means the tiles are secretly handled as cubes. The only reason you don't collide with invisible blocks is, it moves the collision up by one full space when it detects you're falling outside.\n\nI'll leave it at that, but trust me, there was a lot more ridiculousness.","author":"@player03","author_id":"UCM-zYOyBX3nSve9-vOjOwPQ","like_count":2,"published_time":"10 months ago (edited)"},{"id":"UgwI1J3GbWXXWgpdm494AaABAg","text":"great to see the former home sheep home record holder going back to their roots","author":"@dustyhob0","author_id":"UCLyl6fxntedTEYTxno2S9Tw","like_count":443,"published_time":"10 months ago"},{"id":"Ugy7i5IpNp0JqeT-H6d4AaABAg","text":"So effectively Run 1 just has a custom software graphics renderer that uses quads instead of tris.","author":"@plantelo","author_id":"UCNql47OTgdswD1aJedtpM2g","like_count":451,"published_time":"10 months ago"},{"id":"UgxlaIBHtwwjpLK-kmd4AaABAg","text":"Sugar, Sugar, Raze, Bloxorz, The Impossible Game... We didn't know how good we had it","author":"@nathanpotter1334","author_id":"UC256yixp9EzQF5OG_IOgSYw","like_count":299,"published_time":"10 months ago"},{"id":"UgzT1aQPQ6PN-LvHGNd4AaABAg","text":"I am the Cave Story finder.\nAt 9:58, the Cave Story song \"White\" plays in the background.\nUntil next time...","author":"@hatenathing","author_id":"UC82X4h0it6cTx3xK9U-WedQ","like_count":225,"published_time":"10 months ago"},{"id":"UgzWg3IEGibEv5WMWWx4AaABAg","text":"ok but what if you made a flash emulator in portal","author":"@deepsky-r9v","author_id":"UC0rPicsNlPppYqGd7M0qs1w","like_count":365,"published_time":"10 months ago"},{"id":"UgyJz7v2Ubre9oghlsJ4AaABAg","text":"how did the customers in the papa’s pizzeria games rate your food? that seems like it would be semi complicated","author":"@ThatAnimatronicPerson","author_id":"UCsAGxefpeU-iun4fK1N77mw","like_count":161,"published_time":"10 months ago (edited)"},{"id":"UgwPlIYdf_4Yvy3HuNx4AaABAg","text":"If you ever made another one of these, I'd love to see Fancy Pants Adventure dissected specifically to see how its physics work. It's one of the most unique and fun feeling platformers I've ever played and I'm intrigued what's happening under the hood","author":"@hyperventalated","author_id":"UCj0vLXXpR2_WgRoSwy7Vjww","like_count":19,"published_time":"10 months ago"},{"id":"Ugx6uhvozvee7-mwBdJ4AaABAg","text":"12:54 kick the buddy before he became a celebrity","author":"@HANAKINskywoker","author_id":"UC8bqqhyVqsvYEZU1lJahnPg","like_count":22,"published_time":"10 months ago"},{"id":"Ugz4tyg8IfPX030_Jwp4AaABAg","text":"2:56 HOLY SH$T IT'S ME\ni feel like hunter s. thompson seeing hunter s. thompson","author":"@hhhsp951","author_id":"UCtFdXg48m9LaaIoopN2wUHg","like_count":48,"published_time":"10 months ago (edited)"},{"id":"UgwN3ATu4oWZzezXpy14AaABAg","text":"12:23 the rendering code IS NOT faking the 3rd dimension. This is actually how GPUs work, projecting the 3D world onto a 2D plane of the camera","author":"@BenMorse0","author_id":"UCtUdfgusz7tx12PSoSEcSKQ","like_count":14,"published_time":"10 months ago"},{"id":"UgwqyhTj15dHv4NRCfx4AaABAg","text":"My instincts said that iterating over 3000 objects is definitely reasonable, considering that those objects appear to be operating at the pixel scale, meaning there is only a few operations for each object, and I'm already used to having to iterate over millions of pixels to render to 4K screen in real time (on the CPU obviously)","author":"@jhgvvetyjj6589","author_id":"UC5-Cz_78xMqsEGtEjinhQsg","like_count":158,"published_time":"10 months ago"},{"id":"Ugz89MACUJr9zGbsZ3t4AaABAg","text":"If there's any decrease in quality today, it's less to do with artistry and 100% to do with time and budget constraints. As in, artists just aren't given the time to animate those sequences as they used to, so corners get cut and \"good enough\" has to make do to get things released on time. \n\nIt's almost never the artists at fault and almost always the budgetary big wigs who haven't drawn a picture since primary school.","author":"@Respectable_Username","author_id":"UCO5Wbxfw1zmzdcrd5vxzmxw","like_count":10,"published_time":"10 months ago"},{"id":"Ugx1LPcNq5mx09cnP-l4AaABAg","text":"Heads up! The point of this video was not to criticize game code, it's to give some insight on how these games were made. I see quite a few comments taking this the wrong way. Rest assured, I am not trying to discredit the quality or gameplay merit of these titles. Perhaps I didn't make that clear enough - that's my bad, I'll be more careful next time.\n\nFrequently Asked Questions:\n\nQ: How are you sure that this is the real code? Isn't decompilation a lossy process?\nA: Flash's ActionScript often decompiles relatively cleanly, maintaining the original control flow almost completely unmodified. Symbols aren't stripped by default, and functions don't seem to be inlined. The usual suspects of decompilation noise are minimal at worst. Even if things were moved around, inlined or restructured by the decompiler, that wouldn't explain the quirks I highlight here. For example, \"Portal: The Flash Version\" must be using duplicated code for its portals, as a modular solution would never decompile to hard angles. \"Sugar, sugar\" also undoubtedly contains duplicated code - the sugar logic is copied once for the menu, and once for gameplay, with nearly inconsequential changes in-between.\n\nQ: How can you know that the code was written in one huge file?\nA: I can't, but it's likely. ActionScript 3 structures its code into classes, and it'd be a bit unusual for a class to span multiple files. Since the logic of \"Sugar, sugar\" is almost entirely contained within a single class, I'm pretty confident that the code was also written as one big blob. For ActionScript 2, I'm less confident, as that stuff is tied to frames on a timeline. In the video, I do mention that I'm not sure whether the \"9200 lines\" metric is accurate. But... from vibes alone, the code of Interactive Buddy does feel like it was written in one file.\n\nQ: Aren't you being a bit harsh?\nA: Possibly, but I think this criticism still qualifies as constructive. I admit that these games have huge merit past their source code, and the creativity that went into them is what got me to talk about them in the first place, but that won't bias my honest review of the code. I do highlight the cool stuff, and I do highlight the mess.\n\nQ: Okay, but who cares about the code? The games are fun as-is.\nA: I agree, code quality should not be the top priority for an indie Flash game. However, by following best practices, developers can preemptively avoid bugs and inconsistencies. Consider the example at 5:28 - the typo is surrounded by checks for specific angles and code that's nearly identical in each condition. That's textbook code duplication, which ended up causing some behavior to be inconsistent depending on which wall holds your portal. If the portals were instead implemented modularly, this issue would've been way easier to spot and avoid. Again, I agree that it ultimately doesn't matter - the game is polished enough, it's fun to play, that's the important part. But cleaner code is undeniably linked to less bugs.","author":"@PortalRunner","author_id":"UCx-PpwbajI5ToAY0WwJO2Kg","like_count":1,"published_time":"10 months ago (edited)"},{"id":"UgxkEw88lbZ266B63WB4AaABAg","text":"\"Don't bother cleaning the code nobody will look into it anyway\" ...","author":"@lllloyd","author_id":"UCvW0S4Ut4CamvLwOspb5ixw","like_count":4,"published_time":"10 months ago"},{"id":"UgxdtqEqkNf3qvjbHOV4AaABAg","text":"PortalRunner covered code of games called \"Portal\" and \"Run\"","author":"@SMVery","author_id":"UC5GnE1S33hEsqDp2Z5AH8Gg","like_count":2,"published_time":"10 months ago"},{"id":"UgxfMvQ973I6fBssenJ4AaABAg","text":"If the code sucks, but it works, it doesn't suck\n\n\n...until you want to expand on it","author":"@nodrance","author_id":"UC1eSvpuz-hLv2WfUi2GkHNw","like_count":1,"published_time":"10 months ago"},{"id":"UgwgdksKtgVVC-_xbW54AaABAg","text":"At this point the main reason anyone cleans up their code is in case someone decompiles it in 20 years","author":"@hbomberguy","author_id":"UClt01z1wHHT7c5lKcU8pxRQ","like_count":661,"published_time":"10 months ago"},{"id":"UgzUEdJlWqi0-UgwDeZ4AaABAg","text":"I knew the developers of Portal: The Flash Version in real life back when it was developed. It had to be rushed A LOT in order to release ahead of Portal. Also, it was made by just two people, one of which was still in highschool.\n\nNo promises, but if you want I can try to connect you with them for an interview!","author":"@NeatNit","author_id":"UCjM2OgFmEWzL_6Yvef7I4fA","like_count":694,"published_time":"10 months ago"},{"id":"UgwfCZwyhSzsw_mvu1B4AaABAg","text":"Good explanations!\n\nHere's some more facts about Run. I think you've earned them.\n\nFirst, a correction. Run 1 and 2 were made in Flash Pro, not Haxe. The reason they're obfuscated is simple: I used an obfuscator to make decompilation harder.\n\nThe 3D effect is exactly as you described. A software renderer calculates where the four corners appear onscreen, then draws a quadrilateral using Flash's 2D Graphics API.\n\nSince I made the projection code from scratch, it has several quirks. Obviously, faraway shapes get distorted (at the time I thought they looked squished without that effect). Less obviously, the camera is hard-coded to look down the Z axis, and can't rotate to look in another direction. Technically, it can't even rotate around Z; I just drew the image unrotated and then told Flash to rotate the 2D display object. Actually, the two display objects: one for tiles that should appear in front of the Runner, and one for the tiles that appear behind.\n\nThe physics have similar quirks. The tiles must be grid-aligned, for starters. In the original release, it only knew how to hit-test against the floor, so when you got close enough to a wall, I made it rotate (turning the wall into floor) before actually hit testing. Later, I back-ported Run 2's physics engine, which means the tiles are secretly handled as cubes. The only reason you don't collide with invisible blocks is, it moves the collision up by one full space when it detects you're falling outside.\n\nI'll leave it at that, but trust me, there was a lot more ridiculousness.","author":"@player03","author_id":"UCM-zYOyBX3nSve9-vOjOwPQ","like_count":2,"published_time":"10 months ago (edited)"},{"id":"UgyJESWL8haDa5e70Bt4AaABAg","text":"Fun fact: all of Portal TFV was written by a 14-year-old. Another fun little tidbit about it's development is that The Living Tombstone also worked on it before he started making music under that name.","author":"@glassys42","author_id":"UCppbviYF9Fpv6gvqMlHLHLA","like_count":541,"published_time":"10 months ago"},{"id":"UgwI1J3GbWXXWgpdm494AaABAg","text":"great to see the former home sheep home record holder going back to their roots","author":"@dustyhob0","author_id":"UCLyl6fxntedTEYTxno2S9Tw","like_count":443,"published_time":"10 months ago"},{"id":"Ugy7i5IpNp0JqeT-H6d4AaABAg","text":"So effectively Run 1 just has a custom software graphics renderer that uses quads instead of tris.","author":"@plantelo","author_id":"UCNql47OTgdswD1aJedtpM2g","like_count":451,"published_time":"10 months ago"},{"id":"UgxlaIBHtwwjpLK-kmd4AaABAg","text":"Sugar, Sugar, Raze, Bloxorz, The Impossible Game... We didn't know how good we had it","author":"@nathanpotter1334","author_id":"UC256yixp9EzQF5OG_IOgSYw","like_count":299,"published_time":"10 months ago"},{"id":"UgzT1aQPQ6PN-LvHGNd4AaABAg","text":"I am the Cave Story finder.\nAt 9:58, the Cave Story song \"White\" plays in the background.\nUntil next time...","author":"@hatenathing","author_id":"UC82X4h0it6cTx3xK9U-WedQ","like_count":225,"published_time":"10 months ago"},{"id":"UgzWg3IEGibEv5WMWWx4AaABAg","text":"ok but what if you made a flash emulator in portal","author":"@deepsky-r9v","author_id":"UC0rPicsNlPppYqGd7M0qs1w","like_count":365,"published_time":"10 months ago"},{"id":"UgyJz7v2Ubre9oghlsJ4AaABAg","text":"how did the customers in the papa’s pizzeria games rate your food? that seems like it would be semi complicated","author":"@ThatAnimatronicPerson","author_id":"UCsAGxefpeU-iun4fK1N77mw","like_count":161,"published_time":"10 months ago (edited)"},{"id":"UgwqyhTj15dHv4NRCfx4AaABAg","text":"My instincts said that iterating over 3000 objects is definitely reasonable, considering that those objects appear to be operating at the pixel scale, meaning there is only a few operations for each object, and I'm already used to having to iterate over millions of pixels to render to 4K screen in real time (on the CPU obviously)","author":"@jhgvvetyjj6589","author_id":"UC5-Cz_78xMqsEGtEjinhQsg","like_count":158,"published_time":"10 months ago"},{"id":"UgwPlIYdf_4Yvy3HuNx4AaABAg","text":"If you ever made another one of these, I'd love to see Fancy Pants Adventure dissected specifically to see how its physics work. It's one of the most unique and fun feeling platformers I've ever played and I'm intrigued what's happening under the hood","author":"@hyperventalated","author_id":"UCj0vLXXpR2_WgRoSwy7Vjww","like_count":19,"published_time":"10 months ago"},{"id":"Ugz4tyg8IfPX030_Jwp4AaABAg","text":"2:56 HOLY SH$T IT'S ME\ni feel like hunter s. thompson seeing hunter s. thompson","author":"@hhhsp951","author_id":"UCtFdXg48m9LaaIoopN2wUHg","like_count":48,"published_time":"10 months ago (edited)"},{"id":"Ugx6uhvozvee7-mwBdJ4AaABAg","text":"12:54 kick the buddy before he became a celebrity","author":"@HANAKINskywoker","author_id":"UC8bqqhyVqsvYEZU1lJahnPg","like_count":22,"published_time":"10 months ago"},{"id":"UgwN3ATu4oWZzezXpy14AaABAg","text":"12:23 the rendering code IS NOT faking the 3rd dimension. This is actually how GPUs work, projecting the 3D world onto a 2D plane of the camera","author":"@BenMorse0","author_id":"UCtUdfgusz7tx12PSoSEcSKQ","like_count":14,"published_time":"10 months ago"},{"id":"UgwS549F7nFZhhRby5V4AaABAg","text":"This would be a great series","author":"@WingedHussar__","author_id":"UCT6XaprdTCVlefDn_k2NSig","like_count":40,"published_time":"10 months ago"},{"id":"Ugx1LPcNq5mx09cnP-l4AaABAg","text":"Heads up! The point of this video was not to criticize game code, it's to give some insight on how these games were made. I see quite a few comments taking this the wrong way. Rest assured, I am not trying to discredit the quality or gameplay merit of these titles. Perhaps I didn't make that clear enough - that's my bad, I'll be more careful next time.\n\nFrequently Asked Questions:\n\nQ: How are you sure that this is the real code? Isn't decompilation a lossy process?\nA: Flash's ActionScript often decompiles relatively cleanly, maintaining the original control flow almost completely unmodified. Symbols aren't stripped by default, and functions don't seem to be inlined. The usual suspects of decompilation noise are minimal at worst. Even if things were moved around, inlined or restructured by the decompiler, that wouldn't explain the quirks I highlight here. For example, \"Portal: The Flash Version\" must be using duplicated code for its portals, as a modular solution would never decompile to hard angles. \"Sugar, sugar\" also undoubtedly contains duplicated code - the sugar logic is copied once for the menu, and once for gameplay, with nearly inconsequential changes in-between.\n\nQ: How can you know that the code was written in one huge file?\nA: I can't, but it's likely. ActionScript 3 structures its code into classes, and it'd be a bit unusual for a class to span multiple files. Since the logic of \"Sugar, sugar\" is almost entirely contained within a single class, I'm pretty confident that the code was also written as one big blob. For ActionScript 2, I'm less confident, as that stuff is tied to frames on a timeline. In the video, I do mention that I'm not sure whether the \"9200 lines\" metric is accurate. But... from vibes alone, the code of Interactive Buddy does feel like it was written in one file.\n\nQ: Aren't you being a bit harsh?\nA: Possibly, but I think this criticism still qualifies as constructive. I admit that these games have huge merit past their source code, and the creativity that went into them is what got me to talk about them in the first place, but that won't bias my honest review of the code. I do highlight the cool stuff, and I do highlight the mess.\n\nQ: Okay, but who cares about the code? The games are fun as-is.\nA: I agree, code quality should not be the top priority for an indie Flash game. However, by following best practices, developers can preemptively avoid bugs and inconsistencies. Consider the example at 5:28 - the typo is surrounded by checks for specific angles and code that's nearly identical in each condition. That's textbook code duplication, which ended up causing some behavior to be inconsistent depending on which wall holds your portal. If the portals were instead implemented modularly, this issue would've been way easier to spot and avoid. Again, I agree that it ultimately doesn't matter - the game is polished enough, it's fun to play, that's the important part. But cleaner code is undeniably linked to less bugs.","author":"@PortalRunner","author_id":"UCx-PpwbajI5ToAY0WwJO2Kg","like_count":1,"published_time":"10 months ago (edited)"},{"id":"UgxkEw88lbZ266B63WB4AaABAg","text":"\"Don't bother cleaning the code nobody will look into it anyway\" ...","author":"@lllloyd","author_id":"UCvW0S4Ut4CamvLwOspb5ixw","like_count":4,"published_time":"10 months ago"},{"id":"UgxfMvQ973I6fBssenJ4AaABAg","text":"If the code sucks, but it works, it doesn't suck\n\n\n...until you want to expand on it","author":"@nodrance","author_id":"UC1eSvpuz-hLv2WfUi2GkHNw","like_count":1,"published_time":"10 months ago"},{"id":"UgxdtqEqkNf3qvjbHOV4AaABAg","text":"PortalRunner covered code of games called \"Portal\" and \"Run\"","author":"@SMVery","author_id":"UC5GnE1S33hEsqDp2Z5AH8Gg","like_count":2,"published_time":"10 months ago"},{"id":"UgwgdksKtgVVC-_xbW54AaABAg","text":"At this point the main reason anyone cleans up their code is in case someone decompiles it in 20 years","author":"@hbomberguy","author_id":"UClt01z1wHHT7c5lKcU8pxRQ","like_count":661,"published_time":"10 months ago"},{"id":"UgzUEdJlWqi0-UgwDeZ4AaABAg","text":"I knew the developers of Portal: The Flash Version in real life back when it was developed. It had to be rushed A LOT in order to release ahead of Portal. Also, it was made by just two people, one of which was still in highschool.\n\nNo promises, but if you want I can try to connect you with them for an interview!","author":"@NeatNit","author_id":"UCjM2OgFmEWzL_6Yvef7I4fA","like_count":694,"published_time":"10 months ago"},{"id":"UgyJESWL8haDa5e70Bt4AaABAg","text":"Fun fact: all of Portal TFV was written by a 14-year-old. Another fun little tidbit about it's development is that The Living Tombstone also worked on it before he started making music under that name.","author":"@glassys42","author_id":"UCppbviYF9Fpv6gvqMlHLHLA","like_count":541,"published_time":"10 months ago"},{"id":"UgwfCZwyhSzsw_mvu1B4AaABAg","text":"Good explanations!\n\nHere's some more facts about Run. I think you've earned them.\n\nFirst, a correction. Run 1 and 2 were made in Flash Pro, not Haxe. The reason they're obfuscated is simple: I used an obfuscator to make decompilation harder.\n\nThe 3D effect is exactly as you described. A software renderer calculates where the four corners appear onscreen, then draws a quadrilateral using Flash's 2D Graphics API.\n\nSince I made the projection code from scratch, it has several quirks. Obviously, faraway shapes get distorted (at the time I thought they looked squished without that effect). Less obviously, the camera is hard-coded to look down the Z axis, and can't rotate to look in another direction. Technically, it can't even rotate around Z; I just drew the image unrotated and then told Flash to rotate the 2D display object. Actually, the two display objects: one for tiles that should appear in front of the Runner, and one for the tiles that appear behind.\n\nThe physics have similar quirks. The tiles must be grid-aligned, for starters. In the original release, it only knew how to hit-test against the floor, so when you got close enough to a wall, I made it rotate (turning the wall into floor) before actually hit testing. Later, I back-ported Run 2's physics engine, which means the tiles are secretly handled as cubes. The only reason you don't collide with invisible blocks is, it moves the collision up by one full space when it detects you're falling outside.\n\nI'll leave it at that, but trust me, there was a lot more ridiculousness.","author":"@player03","author_id":"UCM-zYOyBX3nSve9-vOjOwPQ","like_count":2,"published_time":"10 months ago (edited)"},{"id":"UgwI1J3GbWXXWgpdm494AaABAg","text":"great to see the former home sheep home record holder going back to their roots","author":"@dustyhob0","author_id":"UCLyl6fxntedTEYTxno2S9Tw","like_count":443,"published_time":"10 months ago"},{"id":"Ugy7i5IpNp0JqeT-H6d4AaABAg","text":"So effectively Run 1 just has a custom software graphics renderer that uses quads instead of tris.","author":"@plantelo","author_id":"UCNql47OTgdswD1aJedtpM2g","like_count":451,"published_time":"10 months ago"},{"id":"UgxlaIBHtwwjpLK-kmd4AaABAg","text":"Sugar, Sugar, Raze, Bloxorz, The Impossible Game... We didn't know how good we had it","author":"@nathanpotter1334","author_id":"UC256yixp9EzQF5OG_IOgSYw","like_count":299,"published_time":"10 months ago"},{"id":"UgzWg3IEGibEv5WMWWx4AaABAg","text":"ok but what if you made a flash emulator in portal","author":"@deepsky-r9v","author_id":"UC0rPicsNlPppYqGd7M0qs1w","like_count":365,"published_time":"10 months ago"},{"id":"UgzT1aQPQ6PN-LvHGNd4AaABAg","text":"I am the Cave Story finder.\nAt 9:58, the Cave Story song \"White\" plays in the background.\nUntil next time...","author":"@hatenathing","author_id":"UC82X4h0it6cTx3xK9U-WedQ","like_count":225,"published_time":"10 months ago"},{"id":"UgwqyhTj15dHv4NRCfx4AaABAg","text":"My instincts said that iterating over 3000 objects is definitely reasonable, considering that those objects appear to be operating at the pixel scale, meaning there is only a few operations for each object, and I'm already used to having to iterate over millions of pixels to render to 4K screen in real time (on the CPU obviously)","author":"@jhgvvetyjj6589","author_id":"UC5-Cz_78xMqsEGtEjinhQsg","like_count":158,"published_time":"10 months ago"},{"id":"UgyJz7v2Ubre9oghlsJ4AaABAg","text":"how did the customers in the papa’s pizzeria games rate your food? that seems like it would be semi complicated","author":"@ThatAnimatronicPerson","author_id":"UCsAGxefpeU-iun4fK1N77mw","like_count":161,"published_time":"10 months ago (edited)"},{"id":"UgwN3ATu4oWZzezXpy14AaABAg","text":"12:23 the rendering code IS NOT faking the 3rd dimension. This is actually how GPUs work, projecting the 3D world onto a 2D plane of the camera","author":"@BenMorse0","author_id":"UCtUdfgusz7tx12PSoSEcSKQ","like_count":14,"published_time":"10 months ago"},{"id":"UgwPlIYdf_4Yvy3HuNx4AaABAg","text":"If you ever made another one of these, I'd love to see Fancy Pants Adventure dissected specifically to see how its physics work. It's one of the most unique and fun feeling platformers I've ever played and I'm intrigued what's happening under the hood","author":"@hyperventalated","author_id":"UCj0vLXXpR2_WgRoSwy7Vjww","like_count":19,"published_time":"10 months ago"},{"id":"Ugz89MACUJr9zGbsZ3t4AaABAg","text":"If there's any decrease in quality today, it's less to do with artistry and 100% to do with time and budget constraints. As in, artists just aren't given the time to animate those sequences as they used to, so corners get cut and \"good enough\" has to make do to get things released on time. \n\nIt's almost never the artists at fault and almost always the budgetary big wigs who haven't drawn a picture since primary school.","author":"@Respectable_Username","author_id":"UCO5Wbxfw1zmzdcrd5vxzmxw","like_count":10,"published_time":"10 months ago"},{"id":"Ugx6uhvozvee7-mwBdJ4AaABAg","text":"12:54 kick the buddy before he became a celebrity","author":"@HANAKINskywoker","author_id":"UC8bqqhyVqsvYEZU1lJahnPg","like_count":22,"published_time":"10 months ago"},{"id":"Ugz4tyg8IfPX030_Jwp4AaABAg","text":"2:56 HOLY SH$T IT'S ME\ni feel like hunter s. thompson seeing hunter s. thompson","author":"@hhhsp951","author_id":"UCtFdXg48m9LaaIoopN2wUHg","like_count":48,"published_time":"10 months ago (edited)"},{"id":"Ugx1LPcNq5mx09cnP-l4AaABAg","text":"Heads up! The point of this video was not to criticize game code, it's to give some insight on how these games were made. I see quite a few comments taking this the wrong way. Rest assured, I am not trying to discredit the quality or gameplay merit of these titles. Perhaps I didn't make that clear enough - that's my bad, I'll be more careful next time.\n\nFrequently Asked Questions:\n\nQ: How are you sure that this is the real code? Isn't decompilation a lossy process?\nA: Flash's ActionScript often decompiles relatively cleanly, maintaining the original control flow almost completely unmodified. Symbols aren't stripped by default, and functions don't seem to be inlined. The usual suspects of decompilation noise are minimal at worst. Even if things were moved around, inlined or restructured by the decompiler, that wouldn't explain the quirks I highlight here. For example, \"Portal: The Flash Version\" must be using duplicated code for its portals, as a modular solution would never decompile to hard angles. \"Sugar, sugar\" also undoubtedly contains duplicated code - the sugar logic is copied once for the menu, and once for gameplay, with nearly inconsequential changes in-between.\n\nQ: How can you know that the code was written in one huge file?\nA: I can't, but it's likely. ActionScript 3 structures its code into classes, and it'd be a bit unusual for a class to span multiple files. Since the logic of \"Sugar, sugar\" is almost entirely contained within a single class, I'm pretty confident that the code was also written as one big blob. For ActionScript 2, I'm less confident, as that stuff is tied to frames on a timeline. In the video, I do mention that I'm not sure whether the \"9200 lines\" metric is accurate. But... from vibes alone, the code of Interactive Buddy does feel like it was written in one file.\n\nQ: Aren't you being a bit harsh?\nA: Possibly, but I think this criticism still qualifies as constructive. I admit that these games have huge merit past their source code, and the creativity that went into them is what got me to talk about them in the first place, but that won't bias my honest review of the code. I do highlight the cool stuff, and I do highlight the mess.\n\nQ: Okay, but who cares about the code? The games are fun as-is.\nA: I agree, code quality should not be the top priority for an indie Flash game. However, by following best practices, developers can preemptively avoid bugs and inconsistencies. Consider the example at 5:28 - the typo is surrounded by checks for specific angles and code that's nearly identical in each condition. That's textbook code duplication, which ended up causing some behavior to be inconsistent depending on which wall holds your portal. If the portals were instead implemented modularly, this issue would've been way easier to spot and avoid. Again, I agree that it ultimately doesn't matter - the game is polished enough, it's fun to play, that's the important part. But cleaner code is undeniably linked to less bugs.","author":"@PortalRunner","author_id":"UCx-PpwbajI5ToAY0WwJO2Kg","like_count":1,"published_time":"10 months ago (edited)"},{"id":"UgxkEw88lbZ266B63WB4AaABAg","text":"\"Don't bother cleaning the code nobody will look into it anyway\" ...","author":"@lllloyd","author_id":"UCvW0S4Ut4CamvLwOspb5ixw","like_count":4,"published_time":"10 months ago"},{"id":"UgxfMvQ973I6fBssenJ4AaABAg","text":"If the code sucks, but it works, it doesn't suck\n\n\n...until you want to expand on it","author":"@nodrance","author_id":"UC1eSvpuz-hLv2WfUi2GkHNw","like_count":1,"published_time":"10 months ago"},{"id":"UgxdtqEqkNf3qvjbHOV4AaABAg","text":"PortalRunner covered code of games called \"Portal\" and \"Run\"","author":"@SMVery","author_id":"UC5GnE1S33hEsqDp2Z5AH8Gg","like_count":2,"published_time":"10 months ago"},{"id":"UgwgdksKtgVVC-_xbW54AaABAg","text":"At this point the main reason anyone cleans up their code is in case someone decompiles it in 20 years","author":"@hbomberguy","author_id":"UClt01z1wHHT7c5lKcU8pxRQ","like_count":661,"published_time":"10 months ago"},{"id":"UgzUEdJlWqi0-UgwDeZ4AaABAg","text":"I knew the developers of Portal: The Flash Version in real life back when it was developed. It had to be rushed A LOT in order to release ahead of Portal. Also, it was made by just two people, one of which was still in highschool.\n\nNo promises, but if you want I can try to connect you with them for an interview!","author":"@NeatNit","author_id":"UCjM2OgFmEWzL_6Yvef7I4fA","like_count":694,"published_time":"10 months ago"},{"id":"UgyJESWL8haDa5e70Bt4AaABAg","text":"Fun fact: all of Portal TFV was written by a 14-year-old. Another fun little tidbit about it's development is that The Living Tombstone also worked on it before he started making music under that name.","author":"@glassys42","author_id":"UCppbviYF9Fpv6gvqMlHLHLA","like_count":541,"published_time":"10 months ago"},{"id":"UgwfCZwyhSzsw_mvu1B4AaABAg","text":"Good explanations!\n\nHere's some more facts about Run. I think you've earned them.\n\nFirst, a correction. Run 1 and 2 were made in Flash Pro, not Haxe. The reason they're obfuscated is simple: I used an obfuscator to make decompilation harder.\n\nThe 3D effect is exactly as you described. A software renderer calculates where the four corners appear onscreen, then draws a quadrilateral using Flash's 2D Graphics API.\n\nSince I made the projection code from scratch, it has several quirks. Obviously, faraway shapes get distorted (at the time I thought they looked squished without that effect). Less obviously, the camera is hard-coded to look down the Z axis, and can't rotate to look in another direction. Technically, it can't even rotate around Z; I just drew the image unrotated and then told Flash to rotate the 2D display object. Actually, the two display objects: one for tiles that should appear in front of the Runner, and one for the tiles that appear behind.\n\nThe physics have similar quirks. The tiles must be grid-aligned, for starters. In the original release, it only knew how to hit-test against the floor, so when you got close enough to a wall, I made it rotate (turning the wall into floor) before actually hit testing. Later, I back-ported Run 2's physics engine, which means the tiles are secretly handled as cubes. The only reason you don't collide with invisible blocks is, it moves the collision up by one full space when it detects you're falling outside.\n\nI'll leave it at that, but trust me, there was a lot more ridiculousness.","author":"@player03","author_id":"UCM-zYOyBX3nSve9-vOjOwPQ","like_count":2,"published_time":"10 months ago (edited)"},{"id":"UgwI1J3GbWXXWgpdm494AaABAg","text":"great to see the former home sheep home record holder going back to their roots","author":"@dustyhob0","author_id":"UCLyl6fxntedTEYTxno2S9Tw","like_count":443,"published_time":"10 months ago"},{"id":"Ugy7i5IpNp0JqeT-H6d4AaABAg","text":"So effectively Run 1 just has a custom software graphics renderer that uses quads instead of tris.","author":"@plantelo","author_id":"UCNql47OTgdswD1aJedtpM2g","like_count":451,"published_time":"10 months ago"},{"id":"UgxlaIBHtwwjpLK-kmd4AaABAg","text":"Sugar, Sugar, Raze, Bloxorz, The Impossible Game... We didn't know how good we had it","author":"@nathanpotter1334","author_id":"UC256yixp9EzQF5OG_IOgSYw","like_count":299,"published_time":"10 months ago"},{"id":"UgzWg3IEGibEv5WMWWx4AaABAg","text":"ok but what if you made a flash emulator in portal","author":"@deepsky-r9v","author_id":"UC0rPicsNlPppYqGd7M0qs1w","like_count":365,"published_time":"10 months ago"},{"id":"UgzT1aQPQ6PN-LvHGNd4AaABAg","text":"I am the Cave Story finder.\nAt 9:58, the Cave Story song \"White\" plays in the background.\nUntil next time...","author":"@hatenathing","author_id":"UC82X4h0it6cTx3xK9U-WedQ","like_count":225,"published_time":"10 months ago"},{"id":"UgwqyhTj15dHv4NRCfx4AaABAg","text":"My instincts said that iterating over 3000 objects is definitely reasonable, considering that those objects appear to be operating at the pixel scale, meaning there is only a few operations for each object, and I'm already used to having to iterate over millions of pixels to render to 4K screen in real time (on the CPU obviously)","author":"@jhgvvetyjj6589","author_id":"UC5-Cz_78xMqsEGtEjinhQsg","like_count":158,"published_time":"10 months ago"},{"id":"UgyJz7v2Ubre9oghlsJ4AaABAg","text":"how did the customers in the papa’s pizzeria games rate your food? that seems like it would be semi complicated","author":"@ThatAnimatronicPerson","author_id":"UCsAGxefpeU-iun4fK1N77mw","like_count":161,"published_time":"10 months ago (edited)"},{"id":"UgwN3ATu4oWZzezXpy14AaABAg","text":"12:23 the rendering code IS NOT faking the 3rd dimension. This is actually how GPUs work, projecting the 3D world onto a 2D plane of the camera","author":"@BenMorse0","author_id":"UCtUdfgusz7tx12PSoSEcSKQ","like_count":14,"published_time":"10 months ago"},{"id":"UgwPlIYdf_4Yvy3HuNx4AaABAg","text":"If you ever made another one of these, I'd love to see Fancy Pants Adventure dissected specifically to see how its physics work. It's one of the most unique and fun feeling platformers I've ever played and I'm intrigued what's happening under the hood","author":"@hyperventalated","author_id":"UCj0vLXXpR2_WgRoSwy7Vjww","like_count":19,"published_time":"10 months ago"},{"id":"Ugz89MACUJr9zGbsZ3t4AaABAg","text":"If there's any decrease in quality today, it's less to do with artistry and 100% to do with time and budget constraints. As in, artists just aren't given the time to animate those sequences as they used to, so corners get cut and \"good enough\" has to make do to get things released on time. \n\nIt's almost never the artists at fault and almost always the budgetary big wigs who haven't drawn a picture since primary school.","author":"@Respectable_Username","author_id":"UCO5Wbxfw1zmzdcrd5vxzmxw","like_count":10,"published_time":"10 months ago"},{"id":"Ugx6uhvozvee7-mwBdJ4AaABAg","text":"12:54 kick the buddy before he became a celebrity","author":"@HANAKINskywoker","author_id":"UC8bqqhyVqsvYEZU1lJahnPg","like_count":22,"published_time":"10 months ago"},{"id":"Ugz4tyg8IfPX030_Jwp4AaABAg","text":"2:56 HOLY SH$T IT'S ME\ni feel like hunter s. thompson seeing hunter s. thompson","author":"@hhhsp951","author_id":"UCtFdXg48m9LaaIoopN2wUHg","like_count":48,"published_time":"10 months ago (edited)"},{"id":"Ugx1LPcNq5mx09cnP-l4AaABAg","text":"Heads up! The point of this video was not to criticize game code, it's to give some insight on how these games were made. I see quite a few comments taking this the wrong way. Rest assured, I am not trying to discredit the quality or gameplay merit of these titles. Perhaps I didn't make that clear enough - that's my bad, I'll be more careful next time.\n\nFrequently Asked Questions:\n\nQ: How are you sure that this is the real code? Isn't decompilation a lossy process?\nA: Flash's ActionScript often decompiles relatively cleanly, maintaining the original control flow almost completely unmodified. Symbols aren't stripped by default, and functions don't seem to be inlined. The usual suspects of decompilation noise are minimal at worst. Even if things were moved around, inlined or restructured by the decompiler, that wouldn't explain the quirks I highlight here. For example, \"Portal: The Flash Version\" must be using duplicated code for its portals, as a modular solution would never decompile to hard angles. \"Sugar, sugar\" also undoubtedly contains duplicated code - the sugar logic is copied once for the menu, and once for gameplay, with nearly inconsequential changes in-between.\n\nQ: How can you know that the code was written in one huge file?\nA: I can't, but it's likely. ActionScript 3 structures its code into classes, and it'd be a bit unusual for a class to span multiple files. Since the logic of \"Sugar, sugar\" is almost entirely contained within a single class, I'm pretty confident that the code was also written as one big blob. For ActionScript 2, I'm less confident, as that stuff is tied to frames on a timeline. In the video, I do mention that I'm not sure whether the \"9200 lines\" metric is accurate. But... from vibes alone, the code of Interactive Buddy does feel like it was written in one file.\n\nQ: Aren't you being a bit harsh?\nA: Possibly, but I think this criticism still qualifies as constructive. I admit that these games have huge merit past their source code, and the creativity that went into them is what got me to talk about them in the first place, but that won't bias my honest review of the code. I do highlight the cool stuff, and I do highlight the mess.\n\nQ: Okay, but who cares about the code? The games are fun as-is.\nA: I agree, code quality should not be the top priority for an indie Flash game. However, by following best practices, developers can preemptively avoid bugs and inconsistencies. Consider the example at 5:28 - the typo is surrounded by checks for specific angles and code that's nearly identical in each condition. That's textbook code duplication, which ended up causing some behavior to be inconsistent depending on which wall holds your portal. If the portals were instead implemented modularly, this issue would've been way easier to spot and avoid. Again, I agree that it ultimately doesn't matter - the game is polished enough, it's fun to play, that's the important part. But cleaner code is undeniably linked to less bugs.","author":"@PortalRunner","author_id":"UCx-PpwbajI5ToAY0WwJO2Kg","like_count":1,"published_time":"10 months ago (edited)"},{"id":"UgxkEw88lbZ266B63WB4AaABAg","text":"\"Don't bother cleaning the code nobody will look into it anyway\" ...","author":"@lllloyd","author_id":"UCvW0S4Ut4CamvLwOspb5ixw","like_count":4,"published_time":"10 months ago"},{"id":"UgxfMvQ973I6fBssenJ4AaABAg","text":"If the code sucks, but it works, it doesn't suck\n\n\n...until you want to expand on it","author":"@nodrance","author_id":"UC1eSvpuz-hLv2WfUi2GkHNw","like_count":1,"published_time":"10 months ago"},{"id":"UgxdtqEqkNf3qvjbHOV4AaABAg","text":"PortalRunner covered code of games called \"Portal\" and \"Run\"","author":"@SMVery","author_id":"UC5GnE1S33hEsqDp2Z5AH8Gg","like_count":2,"published_time":"10 months ago"},{"id":"UgwgdksKtgVVC-_xbW54AaABAg","text":"At this point the main reason anyone cleans up their code is in case someone decompiles it in 20 years","author":"@hbomberguy","author_id":"UClt01z1wHHT7c5lKcU8pxRQ","like_count":661,"published_time":"10 months ago"},{"id":"UgzUEdJlWqi0-UgwDeZ4AaABAg","text":"I knew the developers of Portal: The Flash Version in real life back when it was developed. It had to be rushed A LOT in order to release ahead of Portal. Also, it was made by just two people, one of which was still in highschool.\n\nNo promises, but if you want I can try to connect you with them for an interview!","author":"@NeatNit","author_id":"UCjM2OgFmEWzL_6Yvef7I4fA","like_count":694,"published_time":"10 months ago"},{"id":"UgyJESWL8haDa5e70Bt4AaABAg","text":"Fun fact: all of Portal TFV was written by a 14-year-old. Another fun little tidbit about it's development is that The Living Tombstone also worked on it before he started making music under that name.","author":"@glassys42","author_id":"UCppbviYF9Fpv6gvqMlHLHLA","like_count":541,"published_time":"10 months ago"},{"id":"UgwfCZwyhSzsw_mvu1B4AaABAg","text":"Good explanations!\n\nHere's some more facts about Run. I think you've earned them.\n\nFirst, a correction. Run 1 and 2 were made in Flash Pro, not Haxe. The reason they're obfuscated is simple: I used an obfuscator to make decompilation harder.\n\nThe 3D effect is exactly as you described. A software renderer calculates where the four corners appear onscreen, then draws a quadrilateral using Flash's 2D Graphics API.\n\nSince I made the projection code from scratch, it has several quirks. Obviously, faraway shapes get distorted (at the time I thought they looked squished without that effect). Less obviously, the camera is hard-coded to look down the Z axis, and can't rotate to look in another direction. Technically, it can't even rotate around Z; I just drew the image unrotated and then told Flash to rotate the 2D display object. Actually, the two display objects: one for tiles that should appear in front of the Runner, and one for the tiles that appear behind.\n\nThe physics have similar quirks. The tiles must be grid-aligned, for starters. In the original release, it only knew how to hit-test against the floor, so when you got close enough to a wall, I made it rotate (turning the wall into floor) before actually hit testing. Later, I back-ported Run 2's physics engine, which means the tiles are secretly handled as cubes. The only reason you don't collide with invisible blocks is, it moves the collision up by one full space when it detects you're falling outside.\n\nI'll leave it at that, but trust me, there was a lot more ridiculousness.","author":"@player03","author_id":"UCM-zYOyBX3nSve9-vOjOwPQ","like_count":2,"published_time":"10 months ago (edited)"},{"id":"UgwI1J3GbWXXWgpdm494AaABAg","text":"great to see the former home sheep home record holder going back to their roots","author":"@dustyhob0","author_id":"UCLyl6fxntedTEYTxno2S9Tw","like_count":443,"published_time":"10 months ago"},{"id":"Ugy7i5IpNp0JqeT-H6d4AaABAg","text":"So effectively Run 1 just has a custom software graphics renderer that uses quads instead of tris.","author":"@plantelo","author_id":"UCNql47OTgdswD1aJedtpM2g","like_count":451,"published_time":"10 months ago"},{"id":"UgxlaIBHtwwjpLK-kmd4AaABAg","text":"Sugar, Sugar, Raze, Bloxorz, The Impossible Game... We didn't know how good we had it","author":"@nathanpotter1334","author_id":"UC256yixp9EzQF5OG_IOgSYw","like_count":299,"published_time":"10 months ago"},{"id":"UgzWg3IEGibEv5WMWWx4AaABAg","text":"ok but what if you made a flash emulator in portal","author":"@deepsky-r9v","author_id":"UC0rPicsNlPppYqGd7M0qs1w","like_count":365,"published_time":"10 months ago"},{"id":"UgzT1aQPQ6PN-LvHGNd4AaABAg","text":"I am the Cave Story finder.\nAt 9:58, the Cave Story song \"White\" plays in the background.\nUntil next time...","author":"@hatenathing","author_id":"UC82X4h0it6cTx3xK9U-WedQ","like_count":225,"published_time":"10 months ago"},{"id":"UgwqyhTj15dHv4NRCfx4AaABAg","text":"My instincts said that iterating over 3000 objects is definitely reasonable, considering that those objects appear to be operating at the pixel scale, meaning there is only a few operations for each object, and I'm already used to having to iterate over millions of pixels to render to 4K screen in real time (on the CPU obviously)","author":"@jhgvvetyjj6589","author_id":"UC5-Cz_78xMqsEGtEjinhQsg","like_count":158,"published_time":"10 months ago"},{"id":"UgyJz7v2Ubre9oghlsJ4AaABAg","text":"how did the customers in the papa’s pizzeria games rate your food? that seems like it would be semi complicated","author":"@ThatAnimatronicPerson","author_id":"UCsAGxefpeU-iun4fK1N77mw","like_count":161,"published_time":"10 months ago (edited)"},{"id":"UgwN3ATu4oWZzezXpy14AaABAg","text":"12:23 the rendering code IS NOT faking the 3rd dimension. This is actually how GPUs work, projecting the 3D world onto a 2D plane of the camera","author":"@BenMorse0","author_id":"UCtUdfgusz7tx12PSoSEcSKQ","like_count":14,"published_time":"10 months ago"},{"id":"UgwPlIYdf_4Yvy3HuNx4AaABAg","text":"If you ever made another one of these, I'd love to see Fancy Pants Adventure dissected specifically to see how its physics work. It's one of the most unique and fun feeling platformers I've ever played and I'm intrigued what's happening under the hood","author":"@hyperventalated","author_id":"UCj0vLXXpR2_WgRoSwy7Vjww","like_count":19,"published_time":"10 months ago"},{"id":"Ugz89MACUJr9zGbsZ3t4AaABAg","text":"If there's any decrease in quality today, it's less to do with artistry and 100% to do with time and budget constraints. As in, artists just aren't given the time to animate those sequences as they used to, so corners get cut and \"good enough\" has to make do to get things released on time. \n\nIt's almost never the artists at fault and almost always the budgetary big wigs who haven't drawn a picture since primary school.","author":"@Respectable_Username","author_id":"UCO5Wbxfw1zmzdcrd5vxzmxw","like_count":10,"published_time":"10 months ago"},{"id":"Ugx6uhvozvee7-mwBdJ4AaABAg","text":"12:54 kick the buddy before he became a celebrity","author":"@HANAKINskywoker","author_id":"UC8bqqhyVqsvYEZU1lJahnPg","like_count":22,"published_time":"10 months ago"},{"id":"Ugz4tyg8IfPX030_Jwp4AaABAg","text":"2:56 HOLY SH$T IT'S ME\ni feel like hunter s. thompson seeing hunter s. thompson","author":"@hhhsp951","author_id":"UCtFdXg48m9LaaIoopN2wUHg","like_count":48,"published_time":"10 months ago (edited)"},{"id":"Ugx1LPcNq5mx09cnP-l4AaABAg","text":"Heads up! The point of this video was not to criticize game code, it's to give some insight on how these games were made. I see quite a few comments taking this the wrong way. Rest assured, I am not trying to discredit the quality or gameplay merit of these titles. Perhaps I didn't make that clear enough - that's my bad, I'll be more careful next time.\n\nFrequently Asked Questions:\n\nQ: How are you sure that this is the real code? Isn't decompilation a lossy process?\nA: Flash's ActionScript often decompiles relatively cleanly, maintaining the original control flow almost completely unmodified. Symbols aren't stripped by default, and functions don't seem to be inlined. The usual suspects of decompilation noise are minimal at worst. Even if things were moved around, inlined or restructured by the decompiler, that wouldn't explain the quirks I highlight here. For example, \"Portal: The Flash Version\" must be using duplicated code for its portals, as a modular solution would never decompile to hard angles. \"Sugar, sugar\" also undoubtedly contains duplicated code - the sugar logic is copied once for the menu, and once for gameplay, with nearly inconsequential changes in-between.\n\nQ: How can you know that the code was written in one huge file?\nA: I can't, but it's likely. ActionScript 3 structures its code into classes, and it'd be a bit unusual for a class to span multiple files. Since the logic of \"Sugar, sugar\" is almost entirely contained within a single class, I'm pretty confident that the code was also written as one big blob. For ActionScript 2, I'm less confident, as that stuff is tied to frames on a timeline. In the video, I do mention that I'm not sure whether the \"9200 lines\" metric is accurate. But... from vibes alone, the code of Interactive Buddy does feel like it was written in one file.\n\nQ: Aren't you being a bit harsh?\nA: Possibly, but I think this criticism still qualifies as constructive. I admit that these games have huge merit past their source code, and the creativity that went into them is what got me to talk about them in the first place, but that won't bias my honest review of the code. I do highlight the cool stuff, and I do highlight the mess.\n\nQ: Okay, but who cares about the code? The games are fun as-is.\nA: I agree, code quality should not be the top priority for an indie Flash game. However, by following best practices, developers can preemptively avoid bugs and inconsistencies. Consider the example at 5:28 - the typo is surrounded by checks for specific angles and code that's nearly identical in each condition. That's textbook code duplication, which ended up causing some behavior to be inconsistent depending on which wall holds your portal. If the portals were instead implemented modularly, this issue would've been way easier to spot and avoid. Again, I agree that it ultimately doesn't matter - the game is polished enough, it's fun to play, that's the important part. But cleaner code is undeniably linked to less bugs.","author":"@PortalRunner","author_id":"UCx-PpwbajI5ToAY0WwJO2Kg","like_count":1,"published_time":"10 months ago (edited)"},{"id":"UgxkEw88lbZ266B63WB4AaABAg","text":"\"Don't bother cleaning the code nobody will look into it anyway\" ...","author":"@lllloyd","author_id":"UCvW0S4Ut4CamvLwOspb5ixw","like_count":4,"published_time":"10 months ago"},{"id":"UgxdtqEqkNf3qvjbHOV4AaABAg","text":"PortalRunner covered code of games called \"Portal\" and \"Run\"","author":"@SMVery","author_id":"UC5GnE1S33hEsqDp2Z5AH8Gg","like_count":2,"published_time":"10 months ago"},{"id":"UgxfMvQ973I6fBssenJ4AaABAg","text":"If the code sucks, but it works, it doesn't suck\n\n\n...until you want to expand on it","author":"@nodrance","author_id":"UC1eSvpuz-hLv2WfUi2GkHNw","like_count":1,"published_time":"10 months ago"},{"id":"UgzUEdJlWqi0-UgwDeZ4AaABAg","text":"I knew the developers of Portal: The Flash Version in real life back when it was developed. It had to be rushed A LOT in order to release ahead of Portal. Also, it was made by just two people, one of which was still in highschool.\n\nNo promises, but if you want I can try to connect you with them for an interview!","author":"@NeatNit","author_id":"UCjM2OgFmEWzL_6Yvef7I4fA","like_count":694,"published_time":"10 months ago"},{"id":"UgwgdksKtgVVC-_xbW54AaABAg","text":"At this point the main reason anyone cleans up their code is in case someone decompiles it in 20 years","author":"@hbomberguy","author_id":"UClt01z1wHHT7c5lKcU8pxRQ","like_count":661,"published_time":"10 months ago"},{"id":"UgwfCZwyhSzsw_mvu1B4AaABAg","text":"Good explanations!\n\nHere's some more facts about Run. I think you've earned them.\n\nFirst, a correction. Run 1 and 2 were made in Flash Pro, not Haxe. The reason they're obfuscated is simple: I used an obfuscator to make decompilation harder.\n\nThe 3D effect is exactly as you described. A software renderer calculates where the four corners appear onscreen, then draws a quadrilateral using Flash's 2D Graphics API.\n\nSince I made the projection code from scratch, it has several quirks. Obviously, faraway shapes get distorted (at the time I thought they looked squished without that effect). Less obviously, the camera is hard-coded to look down the Z axis, and can't rotate to look in another direction. Technically, it can't even rotate around Z; I just drew the image unrotated and then told Flash to rotate the 2D display object. Actually, the two display objects: one for tiles that should appear in front of the Runner, and one for the tiles that appear behind.\n\nThe physics have similar quirks. The tiles must be grid-aligned, for starters. In the original release, it only knew how to hit-test against the floor, so when you got close enough to a wall, I made it rotate (turning the wall into floor) before actually hit testing. Later, I back-ported Run 2's physics engine, which means the tiles are secretly handled as cubes. The only reason you don't collide with invisible blocks is, it moves the collision up by one full space when it detects you're falling outside.\n\nI'll leave it at that, but trust me, there was a lot more ridiculousness.","author":"@player03","author_id":"UCM-zYOyBX3nSve9-vOjOwPQ","like_count":2,"published_time":"10 months ago (edited)"},{"id":"UgyJESWL8haDa5e70Bt4AaABAg","text":"Fun fact: all of Portal TFV was written by a 14-year-old. Another fun little tidbit about it's development is that The Living Tombstone also worked on it before he started making music under that name.","author":"@glassys42","author_id":"UCppbviYF9Fpv6gvqMlHLHLA","like_count":541,"published_time":"10 months ago"},{"id":"UgwI1J3GbWXXWgpdm494AaABAg","text":"great to see the former home sheep home record holder going back to their roots","author":"@dustyhob0","author_id":"UCLyl6fxntedTEYTxno2S9Tw","like_count":443,"published_time":"10 months ago"},{"id":"Ugy7i5IpNp0JqeT-H6d4AaABAg","text":"So effectively Run 1 just has a custom software graphics renderer that uses quads instead of tris.","author":"@plantelo","author_id":"UCNql47OTgdswD1aJedtpM2g","like_count":451,"published_time":"10 months ago"},{"id":"UgxlaIBHtwwjpLK-kmd4AaABAg","text":"Sugar, Sugar, Raze, Bloxorz, The Impossible Game... We didn't know how good we had it","author":"@nathanpotter1334","author_id":"UC256yixp9EzQF5OG_IOgSYw","like_count":299,"published_time":"10 months ago"},{"id":"UgzWg3IEGibEv5WMWWx4AaABAg","text":"ok but what if you made a flash emulator in portal","author":"@deepsky-r9v","author_id":"UC0rPicsNlPppYqGd7M0qs1w","like_count":365,"published_time":"10 months ago"},{"id":"UgyJz7v2Ubre9oghlsJ4AaABAg","text":"how did the customers in the papa’s pizzeria games rate your food? that seems like it would be semi complicated","author":"@ThatAnimatronicPerson","author_id":"UCsAGxefpeU-iun4fK1N77mw","like_count":161,"published_time":"10 months ago (edited)"},{"id":"UgzT1aQPQ6PN-LvHGNd4AaABAg","text":"I am the Cave Story finder.\nAt 9:58, the Cave Story song \"White\" plays in the background.\nUntil next time...","author":"@hatenathing","author_id":"UC82X4h0it6cTx3xK9U-WedQ","like_count":225,"published_time":"10 months ago"},{"id":"UgwqyhTj15dHv4NRCfx4AaABAg","text":"My instincts said that iterating over 3000 objects is definitely reasonable, considering that those objects appear to be operating at the pixel scale, meaning there is only a few operations for each object, and I'm already used to having to iterate over millions of pixels to render to 4K screen in real time (on the CPU obviously)","author":"@jhgvvetyjj6589","author_id":"UC5-Cz_78xMqsEGtEjinhQsg","like_count":158,"published_time":"10 months ago"},{"id":"Ugz4tyg8IfPX030_Jwp4AaABAg","text":"2:56 HOLY SH$T IT'S ME\ni feel like hunter s. thompson seeing hunter s. thompson","author":"@hhhsp951","author_id":"UCtFdXg48m9LaaIoopN2wUHg","like_count":48,"published_time":"10 months ago (edited)"},{"id":"Ugx6uhvozvee7-mwBdJ4AaABAg","text":"12:54 kick the buddy before he became a celebrity","author":"@HANAKINskywoker","author_id":"UC8bqqhyVqsvYEZU1lJahnPg","like_count":22,"published_time":"10 months ago"},{"id":"UgwPlIYdf_4Yvy3HuNx4AaABAg","text":"If you ever made another one of these, I'd love to see Fancy Pants Adventure dissected specifically to see how its physics work. It's one of the most unique and fun feeling platformers I've ever played and I'm intrigued what's happening under the hood","author":"@hyperventalated","author_id":"UCj0vLXXpR2_WgRoSwy7Vjww","like_count":19,"published_time":"10 months ago"},{"id":"UgwN3ATu4oWZzezXpy14AaABAg","text":"12:23 the rendering code IS NOT faking the 3rd dimension. This is actually how GPUs work, projecting the 3D world onto a 2D plane of the camera","author":"@BenMorse0","author_id":"UCtUdfgusz7tx12PSoSEcSKQ","like_count":14,"published_time":"10 months ago"},{"id":"Ugz89MACUJr9zGbsZ3t4AaABAg","text":"If there's any decrease in quality today, it's less to do with artistry and 100% to do with time and budget constraints. As in, artists just aren't given the time to animate those sequences as they used to, so corners get cut and \"good enough\" has to make do to get things released on time. \n\nIt's almost never the artists at fault and almost always the budgetary big wigs who haven't drawn a picture since primary school.","author":"@Respectable_Username","author_id":"UCO5Wbxfw1zmzdcrd5vxzmxw","like_count":10,"published_time":"10 months ago"},{"id":"Ugx1LPcNq5mx09cnP-l4AaABAg","text":"Heads up! The point of this video was not to criticize game code, it's to give some insight on how these games were made. I see quite a few comments taking this the wrong way. Rest assured, I am not trying to discredit the quality or gameplay merit of these titles. Perhaps I didn't make that clear enough - that's my bad, I'll be more careful next time.\n\nFrequently Asked Questions:\n\nQ: How are you sure that this is the real code? Isn't decompilation a lossy process?\nA: Flash's ActionScript often decompiles relatively cleanly, maintaining the original control flow almost completely unmodified. Symbols aren't stripped by default, and functions don't seem to be inlined. The usual suspects of decompilation noise are minimal at worst. Even if things were moved around, inlined or restructured by the decompiler, that wouldn't explain the quirks I highlight here. For example, \"Portal: The Flash Version\" must be using duplicated code for its portals, as a modular solution would never decompile to hard angles. \"Sugar, sugar\" also undoubtedly contains duplicated code - the sugar logic is copied once for the menu, and once for gameplay, with nearly inconsequential changes in-between.\n\nQ: How can you know that the code was written in one huge file?\nA: I can't, but it's likely. ActionScript 3 structures its code into classes, and it'd be a bit unusual for a class to span multiple files. Since the logic of \"Sugar, sugar\" is almost entirely contained within a single class, I'm pretty confident that the code was also written as one big blob. For ActionScript 2, I'm less confident, as that stuff is tied to frames on a timeline. In the video, I do mention that I'm not sure whether the \"9200 lines\" metric is accurate. But... from vibes alone, the code of Interactive Buddy does feel like it was written in one file.\n\nQ: Aren't you being a bit harsh?\nA: Possibly, but I think this criticism still qualifies as constructive. I admit that these games have huge merit past their source code, and the creativity that went into them is what got me to talk about them in the first place, but that won't bias my honest review of the code. I do highlight the cool stuff, and I do highlight the mess.\n\nQ: Okay, but who cares about the code? The games are fun as-is.\nA: I agree, code quality should not be the top priority for an indie Flash game. However, by following best practices, developers can preemptively avoid bugs and inconsistencies. Consider the example at 5:28 - the typo is surrounded by checks for specific angles and code that's nearly identical in each condition. That's textbook code duplication, which ended up causing some behavior to be inconsistent depending on which wall holds your portal. If the portals were instead implemented modularly, this issue would've been way easier to spot and avoid. Again, I agree that it ultimately doesn't matter - the game is polished enough, it's fun to play, that's the important part. But cleaner code is undeniably linked to less bugs.","author":"@PortalRunner","author_id":"UCx-PpwbajI5ToAY0WwJO2Kg","like_count":1,"published_time":"10 months ago (edited)"},{"id":"UgxkEw88lbZ266B63WB4AaABAg","text":"\"Don't bother cleaning the code nobody will look into it anyway\" ...","author":"@lllloyd","author_id":"UCvW0S4Ut4CamvLwOspb5ixw","like_count":4,"published_time":"10 months ago"},{"id":"UgxfMvQ973I6fBssenJ4AaABAg","text":"If the code sucks, but it works, it doesn't suck\n\n\n...until you want to expand on it","author":"@nodrance","author_id":"UC1eSvpuz-hLv2WfUi2GkHNw","like_count":1,"published_time":"10 months ago"},{"id":"UgxdtqEqkNf3qvjbHOV4AaABAg","text":"PortalRunner covered code of games called \"Portal\" and \"Run\"","author":"@SMVery","author_id":"UC5GnE1S33hEsqDp2Z5AH8Gg","like_count":2,"published_time":"10 months ago"},{"id":"UgwgdksKtgVVC-_xbW54AaABAg","text":"At this point the main reason anyone cleans up their code is in case someone decompiles it in 20 years","author":"@hbomberguy","author_id":"UClt01z1wHHT7c5lKcU8pxRQ","like_count":661,"published_time":"10 months ago"},{"id":"UgzUEdJlWqi0-UgwDeZ4AaABAg","text":"I knew the developers of Portal: The Flash Version in real life back when it was developed. It had to be rushed A LOT in order to release ahead of Portal. Also, it was made by just two people, one of which was still in highschool.\n\nNo promises, but if you want I can try to connect you with them for an interview!","author":"@NeatNit","author_id":"UCjM2OgFmEWzL_6Yvef7I4fA","like_count":694,"published_time":"10 months ago"},{"id":"UgyJESWL8haDa5e70Bt4AaABAg","text":"Fun fact: all of Portal TFV was written by a 14-year-old. Another fun little tidbit about it's development is that The Living Tombstone also worked on it before he started making music under that name.","author":"@glassys42","author_id":"UCppbviYF9Fpv6gvqMlHLHLA","like_count":541,"published_time":"10 months ago"},{"id":"UgwfCZwyhSzsw_mvu1B4AaABAg","text":"Good explanations!\n\nHere's some more facts about Run. I think you've earned them.\n\nFirst, a correction. Run 1 and 2 were made in Flash Pro, not Haxe. The reason they're obfuscated is simple: I used an obfuscator to make decompilation harder.\n\nThe 3D effect is exactly as you described. A software renderer calculates where the four corners appear onscreen, then draws a quadrilateral using Flash's 2D Graphics API.\n\nSince I made the projection code from scratch, it has several quirks. Obviously, faraway shapes get distorted (at the time I thought they looked squished without that effect). Less obviously, the camera is hard-coded to look down the Z axis, and can't rotate to look in another direction. Technically, it can't even rotate around Z; I just drew the image unrotated and then told Flash to rotate the 2D display object. Actually, the two display objects: one for tiles that should appear in front of the Runner, and one for the tiles that appear behind.\n\nThe physics have similar quirks. The tiles must be grid-aligned, for starters. In the original release, it only knew how to hit-test against the floor, so when you got close enough to a wall, I made it rotate (turning the wall into floor) before actually hit testing. Later, I back-ported Run 2's physics engine, which means the tiles are secretly handled as cubes. The only reason you don't collide with invisible blocks is, it moves the collision up by one full space when it detects you're falling outside.\n\nI'll leave it at that, but trust me, there was a lot more ridiculousness.","author":"@player03","author_id":"UCM-zYOyBX3nSve9-vOjOwPQ","like_count":2,"published_time":"10 months ago (edited)"},{"id":"UgwI1J3GbWXXWgpdm494AaABAg","text":"great to see the former home sheep home record holder going back to their roots","author":"@dustyhob0","author_id":"UCLyl6fxntedTEYTxno2S9Tw","like_count":443,"published_time":"10 months ago"},{"id":"Ugy7i5IpNp0JqeT-H6d4AaABAg","text":"So effectively Run 1 just has a custom software graphics renderer that uses quads instead of tris.","author":"@plantelo","author_id":"UCNql47OTgdswD1aJedtpM2g","like_count":451,"published_time":"10 months ago"},{"id":"UgxlaIBHtwwjpLK-kmd4AaABAg","text":"Sugar, Sugar, Raze, Bloxorz, The Impossible Game... We didn't know how good we had it","author":"@nathanpotter1334","author_id":"UC256yixp9EzQF5OG_IOgSYw","like_count":299,"published_time":"10 months ago"},{"id":"UgzWg3IEGibEv5WMWWx4AaABAg","text":"ok but what if you made a flash emulator in portal","author":"@deepsky-r9v","author_id":"UC0rPicsNlPppYqGd7M0qs1w","like_count":365,"published_time":"10 months ago"},{"id":"UgzT1aQPQ6PN-LvHGNd4AaABAg","text":"I am the Cave Story finder.\nAt 9:58, the Cave Story song \"White\" plays in the background.\nUntil next time...","author":"@hatenathing","author_id":"UC82X4h0it6cTx3xK9U-WedQ","like_count":225,"published_time":"10 months ago"},{"id":"UgwqyhTj15dHv4NRCfx4AaABAg","text":"My instincts said that iterating over 3000 objects is definitely reasonable, considering that those objects appear to be operating at the pixel scale, meaning there is only a few operations for each object, and I'm already used to having to iterate over millions of pixels to render to 4K screen in real time (on the CPU obviously)","author":"@jhgvvetyjj6589","author_id":"UC5-Cz_78xMqsEGtEjinhQsg","like_count":158,"published_time":"10 months ago"},{"id":"UgyJz7v2Ubre9oghlsJ4AaABAg","text":"how did the customers in the papa’s pizzeria games rate your food? that seems like it would be semi complicated","author":"@ThatAnimatronicPerson","author_id":"UCsAGxefpeU-iun4fK1N77mw","like_count":161,"published_time":"10 months ago (edited)"},{"id":"UgwN3ATu4oWZzezXpy14AaABAg","text":"12:23 the rendering code IS NOT faking the 3rd dimension. This is actually how GPUs work, projecting the 3D world onto a 2D plane of the camera","author":"@BenMorse0","author_id":"UCtUdfgusz7tx12PSoSEcSKQ","like_count":14,"published_time":"10 months ago"},{"id":"UgwPlIYdf_4Yvy3HuNx4AaABAg","text":"If you ever made another one of these, I'd love to see Fancy Pants Adventure dissected specifically to see how its physics work. It's one of the most unique and fun feeling platformers I've ever played and I'm intrigued what's happening under the hood","author":"@hyperventalated","author_id":"UCj0vLXXpR2_WgRoSwy7Vjww","like_count":19,"published_time":"10 months ago"},{"id":"Ugz89MACUJr9zGbsZ3t4AaABAg","text":"If there's any decrease in quality today, it's less to do with artistry and 100% to do with time and budget constraints. As in, artists just aren't given the time to animate those sequences as they used to, so corners get cut and \"good enough\" has to make do to get things released on time. \n\nIt's almost never the artists at fault and almost always the budgetary big wigs who haven't drawn a picture since primary school.","author":"@Respectable_Username","author_id":"UCO5Wbxfw1zmzdcrd5vxzmxw","like_count":10,"published_time":"10 months ago"},{"id":"Ugx6uhvozvee7-mwBdJ4AaABAg","text":"12:54 kick the buddy before he became a celebrity","author":"@HANAKINskywoker","author_id":"UC8bqqhyVqsvYEZU1lJahnPg","like_count":22,"published_time":"10 months ago"},{"id":"Ugz4tyg8IfPX030_Jwp4AaABAg","text":"2:56 HOLY SH$T IT'S ME\ni feel like hunter s. thompson seeing hunter s. thompson","author":"@hhhsp951","author_id":"UCtFdXg48m9LaaIoopN2wUHg","like_count":48,"published_time":"10 months ago (edited)"},{"id":"Ugx1LPcNq5mx09cnP-l4AaABAg","text":"Heads up! The point of this video was not to criticize game code, it's to give some insight on how these games were made. I see quite a few comments taking this the wrong way. Rest assured, I am not trying to discredit the quality or gameplay merit of these titles. Perhaps I didn't make that clear enough - that's my bad, I'll be more careful next time.\n\nFrequently Asked Questions:\n\nQ: How are you sure that this is the real code? Isn't decompilation a lossy process?\nA: Flash's ActionScript often decompiles relatively cleanly, maintaining the original control flow almost completely unmodified. Symbols aren't stripped by default, and functions don't seem to be inlined. The usual suspects of decompilation noise are minimal at worst. Even if things were moved around, inlined or restructured by the decompiler, that wouldn't explain the quirks I highlight here. For example, \"Portal: The Flash Version\" must be using duplicated code for its portals, as a modular solution would never decompile to hard angles. \"Sugar, sugar\" also undoubtedly contains duplicated code - the sugar logic is copied once for the menu, and once for gameplay, with nearly inconsequential changes in-between.\n\nQ: How can you know that the code was written in one huge file?\nA: I can't, but it's likely. ActionScript 3 structures its code into classes, and it'd be a bit unusual for a class to span multiple files. Since the logic of \"Sugar, sugar\" is almost entirely contained within a single class, I'm pretty confident that the code was also written as one big blob. For ActionScript 2, I'm less confident, as that stuff is tied to frames on a timeline. In the video, I do mention that I'm not sure whether the \"9200 lines\" metric is accurate. But... from vibes alone, the code of Interactive Buddy does feel like it was written in one file.\n\nQ: Aren't you being a bit harsh?\nA: Possibly, but I think this criticism still qualifies as constructive. I admit that these games have huge merit past their source code, and the creativity that went into them is what got me to talk about them in the first place, but that won't bias my honest review of the code. I do highlight the cool stuff, and I do highlight the mess.\n\nQ: Okay, but who cares about the code? The games are fun as-is.\nA: I agree, code quality should not be the top priority for an indie Flash game. However, by following best practices, developers can preemptively avoid bugs and inconsistencies. Consider the example at 5:28 - the typo is surrounded by checks for specific angles and code that's nearly identical in each condition. That's textbook code duplication, which ended up causing some behavior to be inconsistent depending on which wall holds your portal. If the portals were instead implemented modularly, this issue would've been way easier to spot and avoid. Again, I agree that it ultimately doesn't matter - the game is polished enough, it's fun to play, that's the important part. But cleaner code is undeniably linked to less bugs.","author":"@PortalRunner","author_id":"UCx-PpwbajI5ToAY0WwJO2Kg","like_count":1,"published_time":"10 months ago (edited)"},{"id":"UgxkEw88lbZ266B63WB4AaABAg","text":"\"Don't bother cleaning the code nobody will look into it anyway\" ...","author":"@lllloyd","author_id":"UCvW0S4Ut4CamvLwOspb5ixw","like_count":4,"published_time":"10 months ago"},{"id":"UgxfMvQ973I6fBssenJ4AaABAg","text":"If the code sucks, but it works, it doesn't suck\n\n\n...until you want to expand on it","author":"@nodrance","author_id":"UC1eSvpuz-hLv2WfUi2GkHNw","like_count":1,"published_time":"10 months ago"},{"id":"UgxdtqEqkNf3qvjbHOV4AaABAg","text":"PortalRunner covered code of games called \"Portal\" and \"Run\"","author":"@SMVery","author_id":"UC5GnE1S33hEsqDp2Z5AH8Gg","like_count":2,"published_time":"10 months ago"},{"id":"UgwgdksKtgVVC-_xbW54AaABAg","text":"At this point the main reason anyone cleans up their code is in case someone decompiles it in 20 years","author":"@hbomberguy","author_id":"UClt01z1wHHT7c5lKcU8pxRQ","like_count":661,"published_time":"10 months ago"},{"id":"UgzUEdJlWqi0-UgwDeZ4AaABAg","text":"I knew the developers of Portal: The Flash Version in real life back when it was developed. It had to be rushed A LOT in order to release ahead of Portal. Also, it was made by just two people, one of which was still in highschool.\n\nNo promises, but if you want I can try to connect you with them for an interview!","author":"@NeatNit","author_id":"UCjM2OgFmEWzL_6Yvef7I4fA","like_count":694,"published_time":"10 months ago"},{"id":"UgyJESWL8haDa5e70Bt4AaABAg","text":"Fun fact: all of Portal TFV was written by a 14-year-old. Another fun little tidbit about it's development is that The Living Tombstone also worked on it before he started making music under that name.","author":"@glassys42","author_id":"UCppbviYF9Fpv6gvqMlHLHLA","like_count":541,"published_time":"10 months ago"},{"id":"UgwfCZwyhSzsw_mvu1B4AaABAg","text":"Good explanations!\n\nHere's some more facts about Run. I think you've earned them.\n\nFirst, a correction. Run 1 and 2 were made in Flash Pro, not Haxe. The reason they're obfuscated is simple: I used an obfuscator to make decompilation harder.\n\nThe 3D effect is exactly as you described. A software renderer calculates where the four corners appear onscreen, then draws a quadrilateral using Flash's 2D Graphics API.\n\nSince I made the projection code from scratch, it has several quirks. Obviously, faraway shapes get distorted (at the time I thought they looked squished without that effect). Less obviously, the camera is hard-coded to look down the Z axis, and can't rotate to look in another direction. Technically, it can't even rotate around Z; I just drew the image unrotated and then told Flash to rotate the 2D display object. Actually, the two display objects: one for tiles that should appear in front of the Runner, and one for the tiles that appear behind.\n\nThe physics have similar quirks. The tiles must be grid-aligned, for starters. In the original release, it only knew how to hit-test against the floor, so when you got close enough to a wall, I made it rotate (turning the wall into floor) before actually hit testing. Later, I back-ported Run 2's physics engine, which means the tiles are secretly handled as cubes. The only reason you don't collide with invisible blocks is, it moves the collision up by one full space when it detects you're falling outside.\n\nI'll leave it at that, but trust me, there was a lot more ridiculousness.","author":"@player03","author_id":"UCM-zYOyBX3nSve9-vOjOwPQ","like_count":2,"published_time":"10 months ago (edited)"},{"id":"UgwI1J3GbWXXWgpdm494AaABAg","text":"great to see the former home sheep home record holder going back to their roots","author":"@dustyhob0","author_id":"UCLyl6fxntedTEYTxno2S9Tw","like_count":443,"published_time":"10 months ago"},{"id":"Ugy7i5IpNp0JqeT-H6d4AaABAg","text":"So effectively Run 1 just has a custom software graphics renderer that uses quads instead of tris.","author":"@plantelo","author_id":"UCNql47OTgdswD1aJedtpM2g","like_count":451,"published_time":"10 months ago"},{"id":"UgxlaIBHtwwjpLK-kmd4AaABAg","text":"Sugar, Sugar, Raze, Bloxorz, The Impossible Game... We didn't know how good we had it","author":"@nathanpotter1334","author_id":"UC256yixp9EzQF5OG_IOgSYw","like_count":299,"published_time":"10 months ago"},{"id":"UgzWg3IEGibEv5WMWWx4AaABAg","text":"ok but what if you made a flash emulator in portal","author":"@deepsky-r9v","author_id":"UC0rPicsNlPppYqGd7M0qs1w","like_count":365,"published_time":"10 months ago"},{"id":"UgzT1aQPQ6PN-LvHGNd4AaABAg","text":"I am the Cave Story finder.\nAt 9:58, the Cave Story song \"White\" plays in the background.\nUntil next time...","author":"@hatenathing","author_id":"UC82X4h0it6cTx3xK9U-WedQ","like_count":225,"published_time":"10 months ago"},{"id":"UgwqyhTj15dHv4NRCfx4AaABAg","text":"My instincts said that iterating over 3000 objects is definitely reasonable, considering that those objects appear to be operating at the pixel scale, meaning there is only a few operations for each object, and I'm already used to having to iterate over millions of pixels to render to 4K screen in real time (on the CPU obviously)","author":"@jhgvvetyjj6589","author_id":"UC5-Cz_78xMqsEGtEjinhQsg","like_count":158,"published_time":"10 months ago"},{"id":"UgyJz7v2Ubre9oghlsJ4AaABAg","text":"how did the customers in the papa’s pizzeria games rate your food? that seems like it would be semi complicated","author":"@ThatAnimatronicPerson","author_id":"UCsAGxefpeU-iun4fK1N77mw","like_count":161,"published_time":"10 months ago (edited)"},{"id":"UgwN3ATu4oWZzezXpy14AaABAg","text":"12:23 the rendering code IS NOT faking the 3rd dimension. This is actually how GPUs work, projecting the 3D world onto a 2D plane of the camera","author":"@BenMorse0","author_id":"UCtUdfgusz7tx12PSoSEcSKQ","like_count":14,"published_time":"10 months ago"},{"id":"UgwPlIYdf_4Yvy3HuNx4AaABAg","text":"If you ever made another one of these, I'd love to see Fancy Pants Adventure dissected specifically to see how its physics work. It's one of the most unique and fun feeling platformers I've ever played and I'm intrigued what's happening under the hood","author":"@hyperventalated","author_id":"UCj0vLXXpR2_WgRoSwy7Vjww","like_count":19,"published_time":"10 months ago"},{"id":"Ugz89MACUJr9zGbsZ3t4AaABAg","text":"If there's any decrease in quality today, it's less to do with artistry and 100% to do with time and budget constraints. As in, artists just aren't given the time to animate those sequences as they used to, so corners get cut and \"good enough\" has to make do to get things released on time. \n\nIt's almost never the artists at fault and almost always the budgetary big wigs who haven't drawn a picture since primary school.","author":"@Respectable_Username","author_id":"UCO5Wbxfw1zmzdcrd5vxzmxw","like_count":10,"published_time":"10 months ago"},{"id":"Ugx6uhvozvee7-mwBdJ4AaABAg","text":"12:54 kick the buddy before he became a celebrity","author":"@HANAKINskywoker","author_id":"UC8bqqhyVqsvYEZU1lJahnPg","like_count":22,"published_time":"10 months ago"},{"id":"Ugz4tyg8IfPX030_Jwp4AaABAg","text":"2:56 HOLY SH$T IT'S ME\ni feel like hunter s. thompson seeing hunter s. thompson","author":"@hhhsp951","author_id":"UCtFdXg48m9LaaIoopN2wUHg","like_count":48,"published_time":"10 months ago (edited)"},{"id":"Ugx1LPcNq5mx09cnP-l4AaABAg","text":"Heads up! The point of this video was not to criticize game code, it's to give some insight on how these games were made. I see quite a few comments taking this the wrong way. Rest assured, I am not trying to discredit the quality or gameplay merit of these titles. Perhaps I didn't make that clear enough - that's my bad, I'll be more careful next time.\n\nFrequently Asked Questions:\n\nQ: How are you sure that this is the real code? Isn't decompilation a lossy process?\nA: Flash's ActionScript often decompiles relatively cleanly, maintaining the original control flow almost completely unmodified. Symbols aren't stripped by default, and functions don't seem to be inlined. The usual suspects of decompilation noise are minimal at worst. Even if things were moved around, inlined or restructured by the decompiler, that wouldn't explain the quirks I highlight here. For example, \"Portal: The Flash Version\" must be using duplicated code for its portals, as a modular solution would never decompile to hard angles. \"Sugar, sugar\" also undoubtedly contains duplicated code - the sugar logic is copied once for the menu, and once for gameplay, with nearly inconsequential changes in-between.\n\nQ: How can you know that the code was written in one huge file?\nA: I can't, but it's likely. ActionScript 3 structures its code into classes, and it'd be a bit unusual for a class to span multiple files. Since the logic of \"Sugar, sugar\" is almost entirely contained within a single class, I'm pretty confident that the code was also written as one big blob. For ActionScript 2, I'm less confident, as that stuff is tied to frames on a timeline. In the video, I do mention that I'm not sure whether the \"9200 lines\" metric is accurate. But... from vibes alone, the code of Interactive Buddy does feel like it was written in one file.\n\nQ: Aren't you being a bit harsh?\nA: Possibly, but I think this criticism still qualifies as constructive. I admit that these games have huge merit past their source code, and the creativity that went into them is what got me to talk about them in the first place, but that won't bias my honest review of the code. I do highlight the cool stuff, and I do highlight the mess.\n\nQ: Okay, but who cares about the code? The games are fun as-is.\nA: I agree, code quality should not be the top priority for an indie Flash game. However, by following best practices, developers can preemptively avoid bugs and inconsistencies. Consider the example at 5:28 - the typo is surrounded by checks for specific angles and code that's nearly identical in each condition. That's textbook code duplication, which ended up causing some behavior to be inconsistent depending on which wall holds your portal. If the portals were instead implemented modularly, this issue would've been way easier to spot and avoid. Again, I agree that it ultimately doesn't matter - the game is polished enough, it's fun to play, that's the important part. But cleaner code is undeniably linked to less bugs.","author":"@PortalRunner","author_id":"UCx-PpwbajI5ToAY0WwJO2Kg","like_count":1,"published_time":"10 months ago (edited)"},{"id":"UgxkEw88lbZ266B63WB4AaABAg","text":"\"Don't bother cleaning the code nobody will look into it anyway\" ...","author":"@lllloyd","author_id":"UCvW0S4Ut4CamvLwOspb5ixw","like_count":4,"published_time":"10 months ago"},{"id":"UgxfMvQ973I6fBssenJ4AaABAg","text":"If the code sucks, but it works, it doesn't suck\n\n\n...until you want to expand on it","author":"@nodrance","author_id":"UC1eSvpuz-hLv2WfUi2GkHNw","like_count":1,"published_time":"10 months ago"},{"id":"UgxdtqEqkNf3qvjbHOV4AaABAg","text":"PortalRunner covered code of games called \"Portal\" and \"Run\"","author":"@SMVery","author_id":"UC5GnE1S33hEsqDp2Z5AH8Gg","like_count":2,"published_time":"10 months ago"},{"id":"UgwgdksKtgVVC-_xbW54AaABAg","text":"At this point the main reason anyone cleans up their code is in case someone decompiles it in 20 years","author":"@hbomberguy","author_id":"UClt01z1wHHT7c5lKcU8pxRQ","like_count":661,"published_time":"10 months ago"},{"id":"UgzUEdJlWqi0-UgwDeZ4AaABAg","text":"I knew the developers of Portal: The Flash Version in real life back when it was developed. It had to be rushed A LOT in order to release ahead of Portal. Also, it was made by just two people, one of which was still in highschool.\n\nNo promises, but if you want I can try to connect you with them for an interview!","author":"@NeatNit","author_id":"UCjM2OgFmEWzL_6Yvef7I4fA","like_count":694,"published_time":"10 months ago"},{"id":"UgyJESWL8haDa5e70Bt4AaABAg","text":"Fun fact: all of Portal TFV was written by a 14-year-old. Another fun little tidbit about it's development is that The Living Tombstone also worked on it before he started making music under that name.","author":"@glassys42","author_id":"UCppbviYF9Fpv6gvqMlHLHLA","like_count":541,"published_time":"10 months ago"},{"id":"UgwfCZwyhSzsw_mvu1B4AaABAg","text":"Good explanations!\n\nHere's some more facts about Run. I think you've earned them.\n\nFirst, a correction. Run 1 and 2 were made in Flash Pro, not Haxe. The reason they're obfuscated is simple: I used an obfuscator to make decompilation harder.\n\nThe 3D effect is exactly as you described. A software renderer calculates where the four corners appear onscreen, then draws a quadrilateral using Flash's 2D Graphics API.\n\nSince I made the projection code from scratch, it has several quirks. Obviously, faraway shapes get distorted (at the time I thought they looked squished without that effect). Less obviously, the camera is hard-coded to look down the Z axis, and can't rotate to look in another direction. Technically, it can't even rotate around Z; I just drew the image unrotated and then told Flash to rotate the 2D display object. Actually, the two display objects: one for tiles that should appear in front of the Runner, and one for the tiles that appear behind.\n\nThe physics have similar quirks. The tiles must be grid-aligned, for starters. In the original release, it only knew how to hit-test against the floor, so when you got close enough to a wall, I made it rotate (turning the wall into floor) before actually hit testing. Later, I back-ported Run 2's physics engine, which means the tiles are secretly handled as cubes. The only reason you don't collide with invisible blocks is, it moves the collision up by one full space when it detects you're falling outside.\n\nI'll leave it at that, but trust me, there was a lot more ridiculousness.","author":"@player03","author_id":"UCM-zYOyBX3nSve9-vOjOwPQ","like_count":2,"published_time":"10 months ago (edited)"},{"id":"UgwI1J3GbWXXWgpdm494AaABAg","text":"great to see the former home sheep home record holder going back to their roots","author":"@dustyhob0","author_id":"UCLyl6fxntedTEYTxno2S9Tw","like_count":443,"published_time":"10 months ago"},{"id":"Ugy7i5IpNp0JqeT-H6d4AaABAg","text":"So effectively Run 1 just has a custom software graphics renderer that uses quads instead of tris.","author":"@plantelo","author_id":"UCNql47OTgdswD1aJedtpM2g","like_count":451,"published_time":"10 months ago"},{"id":"UgxlaIBHtwwjpLK-kmd4AaABAg","text":"Sugar, Sugar, Raze, Bloxorz, The Impossible Game... We didn't know how good we had it","author":"@nathanpotter1334","author_id":"UC256yixp9EzQF5OG_IOgSYw","like_count":299,"published_time":"10 months ago"},{"id":"UgzWg3IEGibEv5WMWWx4AaABAg","text":"ok but what if you made a flash emulator in portal","author":"@deepsky-r9v","author_id":"UC0rPicsNlPppYqGd7M0qs1w","like_count":365,"published_time":"10 months ago"},{"id":"UgzT1aQPQ6PN-LvHGNd4AaABAg","text":"I am the Cave Story finder.\nAt 9:58, the Cave Story song \"White\" plays in the background.\nUntil next time...","author":"@hatenathing","author_id":"UC82X4h0it6cTx3xK9U-WedQ","like_count":225,"published_time":"10 months ago"},{"id":"UgwqyhTj15dHv4NRCfx4AaABAg","text":"My instincts said that iterating over 3000 objects is definitely reasonable, considering that those objects appear to be operating at the pixel scale, meaning there is only a few operations for each object, and I'm already used to having to iterate over millions of pixels to render to 4K screen in real time (on the CPU obviously)","author":"@jhgvvetyjj6589","author_id":"UC5-Cz_78xMqsEGtEjinhQsg","like_count":158,"published_time":"10 months ago"},{"id":"UgyJz7v2Ubre9oghlsJ4AaABAg","text":"how did the customers in the papa’s pizzeria games rate your food? that seems like it would be semi complicated","author":"@ThatAnimatronicPerson","author_id":"UCsAGxefpeU-iun4fK1N77mw","like_count":161,"published_time":"10 months ago (edited)"},{"id":"UgwN3ATu4oWZzezXpy14AaABAg","text":"12:23 the rendering code IS NOT faking the 3rd dimension. This is actually how GPUs work, projecting the 3D world onto a 2D plane of the camera","author":"@BenMorse0","author_id":"UCtUdfgusz7tx12PSoSEcSKQ","like_count":14,"published_time":"10 months ago"},{"id":"UgwPlIYdf_4Yvy3HuNx4AaABAg","text":"If you ever made another one of these, I'd love to see Fancy Pants Adventure dissected specifically to see how its physics work. It's one of the most unique and fun feeling platformers I've ever played and I'm intrigued what's happening under the hood","author":"@hyperventalated","author_id":"UCj0vLXXpR2_WgRoSwy7Vjww","like_count":19,"published_time":"10 months ago"},{"id":"Ugz89MACUJr9zGbsZ3t4AaABAg","text":"If there's any decrease in quality today, it's less to do with artistry and 100% to do with time and budget constraints. As in, artists just aren't given the time to animate those sequences as they used to, so corners get cut and \"good enough\" has to make do to get things released on time. \n\nIt's almost never the artists at fault and almost always the budgetary big wigs who haven't drawn a picture since primary school.","author":"@Respectable_Username","author_id":"UCO5Wbxfw1zmzdcrd5vxzmxw","like_count":10,"published_time":"10 months ago"},{"id":"Ugx6uhvozvee7-mwBdJ4AaABAg","text":"12:54 kick the buddy before he became a celebrity","author":"@HANAKINskywoker","author_id":"UC8bqqhyVqsvYEZU1lJahnPg","like_count":22,"published_time":"10 months ago"},{"id":"Ugz4tyg8IfPX030_Jwp4AaABAg","text":"2:56 HOLY SH$T IT'S ME\ni feel like hunter s. thompson seeing hunter s. thompson","author":"@hhhsp951","author_id":"UCtFdXg48m9LaaIoopN2wUHg","like_count":48,"published_time":"10 months ago (edited)"},{"id":"Ugx1LPcNq5mx09cnP-l4AaABAg","text":"Heads up! The point of this video was not to criticize game code, it's to give some insight on how these games were made. I see quite a few comments taking this the wrong way. Rest assured, I am not trying to discredit the quality or gameplay merit of these titles. Perhaps I didn't make that clear enough - that's my bad, I'll be more careful next time.\n\nFrequently Asked Questions:\n\nQ: How are you sure that this is the real code? Isn't decompilation a lossy process?\nA: Flash's ActionScript often decompiles relatively cleanly, maintaining the original control flow almost completely unmodified. Symbols aren't stripped by default, and functions don't seem to be inlined. The usual suspects of decompilation noise are minimal at worst. Even if things were moved around, inlined or restructured by the decompiler, that wouldn't explain the quirks I highlight here. For example, \"Portal: The Flash Version\" must be using duplicated code for its portals, as a modular solution would never decompile to hard angles. \"Sugar, sugar\" also undoubtedly contains duplicated code - the sugar logic is copied once for the menu, and once for gameplay, with nearly inconsequential changes in-between.\n\nQ: How can you know that the code was written in one huge file?\nA: I can't, but it's likely. ActionScript 3 structures its code into classes, and it'd be a bit unusual for a class to span multiple files. Since the logic of \"Sugar, sugar\" is almost entirely contained within a single class, I'm pretty confident that the code was also written as one big blob. For ActionScript 2, I'm less confident, as that stuff is tied to frames on a timeline. In the video, I do mention that I'm not sure whether the \"9200 lines\" metric is accurate. But... from vibes alone, the code of Interactive Buddy does feel like it was written in one file.\n\nQ: Aren't you being a bit harsh?\nA: Possibly, but I think this criticism still qualifies as constructive. I admit that these games have huge merit past their source code, and the creativity that went into them is what got me to talk about them in the first place, but that won't bias my honest review of the code. I do highlight the cool stuff, and I do highlight the mess.\n\nQ: Okay, but who cares about the code? The games are fun as-is.\nA: I agree, code quality should not be the top priority for an indie Flash game. However, by following best practices, developers can preemptively avoid bugs and inconsistencies. Consider the example at 5:28 - the typo is surrounded by checks for specific angles and code that's nearly identical in each condition. That's textbook code duplication, which ended up causing some behavior to be inconsistent depending on which wall holds your portal. If the portals were instead implemented modularly, this issue would've been way easier to spot and avoid. Again, I agree that it ultimately doesn't matter - the game is polished enough, it's fun to play, that's the important part. But cleaner code is undeniably linked to less bugs.","author":"@PortalRunner","author_id":"UCx-PpwbajI5ToAY0WwJO2Kg","like_count":1,"published_time":"10 months ago (edited)"},{"id":"UgxkEw88lbZ266B63WB4AaABAg","text":"\"Don't bother cleaning the code nobody will look into it anyway\" ...","author":"@lllloyd","author_id":"UCvW0S4Ut4CamvLwOspb5ixw","like_count":4,"published_time":"10 months ago"},{"id":"UgxfMvQ973I6fBssenJ4AaABAg","text":"If the code sucks, but it works, it doesn't suck\n\n\n...until you want to expand on it","author":"@nodrance","author_id":"UC1eSvpuz-hLv2WfUi2GkHNw","like_count":1,"published_time":"10 months ago"},{"id":"UgxdtqEqkNf3qvjbHOV4AaABAg","text":"PortalRunner covered code of games called \"Portal\" and \"Run\"","author":"@SMVery","author_id":"UC5GnE1S33hEsqDp2Z5AH8Gg","like_count":2,"published_time":"10 months ago"},{"id":"UgwgdksKtgVVC-_xbW54AaABAg","text":"At this point the main reason anyone cleans up their code is in case someone decompiles it in 20 years","author":"@hbomberguy","author_id":"UClt01z1wHHT7c5lKcU8pxRQ","like_count":661,"published_time":"10 months ago"},{"id":"UgzUEdJlWqi0-UgwDeZ4AaABAg","text":"I knew the developers of Portal: The Flash Version in real life back when it was developed. It had to be rushed A LOT in order to release ahead of Portal. Also, it was made by just two people, one of which was still in highschool.\n\nNo promises, but if you want I can try to connect you with them for an interview!","author":"@NeatNit","author_id":"UCjM2OgFmEWzL_6Yvef7I4fA","like_count":694,"published_time":"10 months ago"},{"id":"UgyJESWL8haDa5e70Bt4AaABAg","text":"Fun fact: all of Portal TFV was written by a 14-year-old. Another fun little tidbit about it's development is that The Living Tombstone also worked on it before he started making music under that name.","author":"@glassys42","author_id":"UCppbviYF9Fpv6gvqMlHLHLA","like_count":541,"published_time":"10 months ago"},{"id":"UgwfCZwyhSzsw_mvu1B4AaABAg","text":"Good explanations!\n\nHere's some more facts about Run. I think you've earned them.\n\nFirst, a correction. Run 1 and 2 were made in Flash Pro, not Haxe. The reason they're obfuscated is simple: I used an obfuscator to make decompilation harder.\n\nThe 3D effect is exactly as you described. A software renderer calculates where the four corners appear onscreen, then draws a quadrilateral using Flash's 2D Graphics API.\n\nSince I made the projection code from scratch, it has several quirks. Obviously, faraway shapes get distorted (at the time I thought they looked squished without that effect). Less obviously, the camera is hard-coded to look down the Z axis, and can't rotate to look in another direction. Technically, it can't even rotate around Z; I just drew the image unrotated and then told Flash to rotate the 2D display object. Actually, the two display objects: one for tiles that should appear in front of the Runner, and one for the tiles that appear behind.\n\nThe physics have similar quirks. The tiles must be grid-aligned, for starters. In the original release, it only knew how to hit-test against the floor, so when you got close enough to a wall, I made it rotate (turning the wall into floor) before actually hit testing. Later, I back-ported Run 2's physics engine, which means the tiles are secretly handled as cubes. The only reason you don't collide with invisible blocks is, it moves the collision up by one full space when it detects you're falling outside.\n\nI'll leave it at that, but trust me, there was a lot more ridiculousness.","author":"@player03","author_id":"UCM-zYOyBX3nSve9-vOjOwPQ","like_count":2,"published_time":"10 months ago (edited)"},{"id":"UgwI1J3GbWXXWgpdm494AaABAg","text":"great to see the former home sheep home record holder going back to their roots","author":"@dustyhob0","author_id":"UCLyl6fxntedTEYTxno2S9Tw","like_count":443,"published_time":"10 months ago"},{"id":"Ugy7i5IpNp0JqeT-H6d4AaABAg","text":"So effectively Run 1 just has a custom software graphics renderer that uses quads instead of tris.","author":"@plantelo","author_id":"UCNql47OTgdswD1aJedtpM2g","like_count":451,"published_time":"10 months ago"},{"id":"UgxlaIBHtwwjpLK-kmd4AaABAg","text":"Sugar, Sugar, Raze, Bloxorz, The Impossible Game... We didn't know how good we had it","author":"@nathanpotter1334","author_id":"UC256yixp9EzQF5OG_IOgSYw","like_count":299,"published_time":"10 months ago"},{"id":"UgzWg3IEGibEv5WMWWx4AaABAg","text":"ok but what if you made a flash emulator in portal","author":"@deepsky-r9v","author_id":"UC0rPicsNlPppYqGd7M0qs1w","like_count":365,"published_time":"10 months ago"},{"id":"UgzT1aQPQ6PN-LvHGNd4AaABAg","text":"I am the Cave Story finder.\nAt 9:58, the Cave Story song \"White\" plays in the background.\nUntil next time...","author":"@hatenathing","author_id":"UC82X4h0it6cTx3xK9U-WedQ","like_count":225,"published_time":"10 months ago"},{"id":"UgwqyhTj15dHv4NRCfx4AaABAg","text":"My instincts said that iterating over 3000 objects is definitely reasonable, considering that those objects appear to be operating at the pixel scale, meaning there is only a few operations for each object, and I'm already used to having to iterate over millions of pixels to render to 4K screen in real time (on the CPU obviously)","author":"@jhgvvetyjj6589","author_id":"UC5-Cz_78xMqsEGtEjinhQsg","like_count":158,"published_time":"10 months ago"},{"id":"UgyJz7v2Ubre9oghlsJ4AaABAg","text":"how did the customers in the papa’s pizzeria games rate your food? that seems like it would be semi complicated","author":"@ThatAnimatronicPerson","author_id":"UCsAGxefpeU-iun4fK1N77mw","like_count":161,"published_time":"10 months ago (edited)"},{"id":"UgwN3ATu4oWZzezXpy14AaABAg","text":"12:23 the rendering code IS NOT faking the 3rd dimension. This is actually how GPUs work, projecting the 3D world onto a 2D plane of the camera","author":"@BenMorse0","author_id":"UCtUdfgusz7tx12PSoSEcSKQ","like_count":14,"published_time":"10 months ago"},{"id":"UgwPlIYdf_4Yvy3HuNx4AaABAg","text":"If you ever made another one of these, I'd love to see Fancy Pants Adventure dissected specifically to see how its physics work. It's one of the most unique and fun feeling platformers I've ever played and I'm intrigued what's happening under the hood","author":"@hyperventalated","author_id":"UCj0vLXXpR2_WgRoSwy7Vjww","like_count":19,"published_time":"10 months ago"},{"id":"Ugz89MACUJr9zGbsZ3t4AaABAg","text":"If there's any decrease in quality today, it's less to do with artistry and 100% to do with time and budget constraints. As in, artists just aren't given the time to animate those sequences as they used to, so corners get cut and \"good enough\" has to make do to get things released on time. \n\nIt's almost never the artists at fault and almost always the budgetary big wigs who haven't drawn a picture since primary school.","author":"@Respectable_Username","author_id":"UCO5Wbxfw1zmzdcrd5vxzmxw","like_count":10,"published_time":"10 months ago"},{"id":"Ugx6uhvozvee7-mwBdJ4AaABAg","text":"12:54 kick the buddy before he became a celebrity","author":"@HANAKINskywoker","author_id":"UC8bqqhyVqsvYEZU1lJahnPg","like_count":22,"published_time":"10 months ago"},{"id":"Ugz4tyg8IfPX030_Jwp4AaABAg","text":"2:56 HOLY SH$T IT'S ME\ni feel like hunter s. thompson seeing hunter s. thompson","author":"@hhhsp951","author_id":"UCtFdXg48m9LaaIoopN2wUHg","like_count":48,"published_time":"10 months ago (edited)"},{"id":"Ugx1LPcNq5mx09cnP-l4AaABAg","text":"Heads up! The point of this video was not to criticize game code, it's to give some insight on how these games were made. I see quite a few comments taking this the wrong way. Rest assured, I am not trying to discredit the quality or gameplay merit of these titles. Perhaps I didn't make that clear enough - that's my bad, I'll be more careful next time.\n\nFrequently Asked Questions:\n\nQ: How are you sure that this is the real code? Isn't decompilation a lossy process?\nA: Flash's ActionScript often decompiles relatively cleanly, maintaining the original control flow almost completely unmodified. Symbols aren't stripped by default, and functions don't seem to be inlined. The usual suspects of decompilation noise are minimal at worst. Even if things were moved around, inlined or restructured by the decompiler, that wouldn't explain the quirks I highlight here. For example, \"Portal: The Flash Version\" must be using duplicated code for its portals, as a modular solution would never decompile to hard angles. \"Sugar, sugar\" also undoubtedly contains duplicated code - the sugar logic is copied once for the menu, and once for gameplay, with nearly inconsequential changes in-between.\n\nQ: How can you know that the code was written in one huge file?\nA: I can't, but it's likely. ActionScript 3 structures its code into classes, and it'd be a bit unusual for a class to span multiple files. Since the logic of \"Sugar, sugar\" is almost entirely contained within a single class, I'm pretty confident that the code was also written as one big blob. For ActionScript 2, I'm less confident, as that stuff is tied to frames on a timeline. In the video, I do mention that I'm not sure whether the \"9200 lines\" metric is accurate. But... from vibes alone, the code of Interactive Buddy does feel like it was written in one file.\n\nQ: Aren't you being a bit harsh?\nA: Possibly, but I think this criticism still qualifies as constructive. I admit that these games have huge merit past their source code, and the creativity that went into them is what got me to talk about them in the first place, but that won't bias my honest review of the code. I do highlight the cool stuff, and I do highlight the mess.\n\nQ: Okay, but who cares about the code? The games are fun as-is.\nA: I agree, code quality should not be the top priority for an indie Flash game. However, by following best practices, developers can preemptively avoid bugs and inconsistencies. Consider the example at 5:28 - the typo is surrounded by checks for specific angles and code that's nearly identical in each condition. That's textbook code duplication, which ended up causing some behavior to be inconsistent depending on which wall holds your portal. If the portals were instead implemented modularly, this issue would've been way easier to spot and avoid. Again, I agree that it ultimately doesn't matter - the game is polished enough, it's fun to play, that's the important part. But cleaner code is undeniably linked to less bugs.","author":"@PortalRunner","author_id":"UCx-PpwbajI5ToAY0WwJO2Kg","like_count":1,"published_time":"10 months ago (edited)"},{"id":"UgxkEw88lbZ266B63WB4AaABAg","text":"\"Don't bother cleaning the code nobody will look into it anyway\" ...","author":"@lllloyd","author_id":"UCvW0S4Ut4CamvLwOspb5ixw","like_count":4,"published_time":"10 months ago"},{"id":"UgxfMvQ973I6fBssenJ4AaABAg","text":"If the code sucks, but it works, it doesn't suck\n\n\n...until you want to expand on it","author":"@nodrance","author_id":"UC1eSvpuz-hLv2WfUi2GkHNw","like_count":1,"published_time":"10 months ago"},{"id":"UgxdtqEqkNf3qvjbHOV4AaABAg","text":"PortalRunner covered code of games called \"Portal\" and \"Run\"","author":"@SMVery","author_id":"UC5GnE1S33hEsqDp2Z5AH8Gg","like_count":2,"published_time":"10 months ago"},{"id":"UgwgdksKtgVVC-_xbW54AaABAg","text":"At this point the main reason anyone cleans up their code is in case someone decompiles it in 20 years","author":"@hbomberguy","author_id":"UClt01z1wHHT7c5lKcU8pxRQ","like_count":661,"published_time":"10 months ago"},{"id":"UgzUEdJlWqi0-UgwDeZ4AaABAg","text":"I knew the developers of Portal: The Flash Version in real life back when it was developed. It had to be rushed A LOT in order to release ahead of Portal. Also, it was made by just two people, one of which was still in highschool.\n\nNo promises, but if you want I can try to connect you with them for an interview!","author":"@NeatNit","author_id":"UCjM2OgFmEWzL_6Yvef7I4fA","like_count":694,"published_time":"10 months ago"},{"id":"UgyJESWL8haDa5e70Bt4AaABAg","text":"Fun fact: all of Portal TFV was written by a 14-year-old. Another fun little tidbit about it's development is that The Living Tombstone also worked on it before he started making music under that name.","author":"@glassys42","author_id":"UCppbviYF9Fpv6gvqMlHLHLA","like_count":541,"published_time":"10 months ago"},{"id":"UgwfCZwyhSzsw_mvu1B4AaABAg","text":"Good explanations!\n\nHere's some more facts about Run. I think you've earned them.\n\nFirst, a correction. Run 1 and 2 were made in Flash Pro, not Haxe. The reason they're obfuscated is simple: I used an obfuscator to make decompilation harder.\n\nThe 3D effect is exactly as you described. A software renderer calculates where the four corners appear onscreen, then draws a quadrilateral using Flash's 2D Graphics API.\n\nSince I made the projection code from scratch, it has several quirks. Obviously, faraway shapes get distorted (at the time I thought they looked squished without that effect). Less obviously, the camera is hard-coded to look down the Z axis, and can't rotate to look in another direction. Technically, it can't even rotate around Z; I just drew the image unrotated and then told Flash to rotate the 2D display object. Actually, the two display objects: one for tiles that should appear in front of the Runner, and one for the tiles that appear behind.\n\nThe physics have similar quirks. The tiles must be grid-aligned, for starters. In the original release, it only knew how to hit-test against the floor, so when you got close enough to a wall, I made it rotate (turning the wall into floor) before actually hit testing. Later, I back-ported Run 2's physics engine, which means the tiles are secretly handled as cubes. The only reason you don't collide with invisible blocks is, it moves the collision up by one full space when it detects you're falling outside.\n\nI'll leave it at that, but trust me, there was a lot more ridiculousness.","author":"@player03","author_id":"UCM-zYOyBX3nSve9-vOjOwPQ","like_count":2,"published_time":"10 months ago (edited)"},{"id":"UgwI1J3GbWXXWgpdm494AaABAg","text":"great to see the former home sheep home record holder going back to their roots","author":"@dustyhob0","author_id":"UCLyl6fxntedTEYTxno2S9Tw","like_count":443,"published_time":"10 months ago"},{"id":"Ugy7i5IpNp0JqeT-H6d4AaABAg","text":"So effectively Run 1 just has a custom software graphics renderer that uses quads instead of tris.","author":"@plantelo","author_id":"UCNql47OTgdswD1aJedtpM2g","like_count":451,"published_time":"10 months ago"},{"id":"UgxlaIBHtwwjpLK-kmd4AaABAg","text":"Sugar, Sugar, Raze, Bloxorz, The Impossible Game... We didn't know how good we had it","author":"@nathanpotter1334","author_id":"UC256yixp9EzQF5OG_IOgSYw","like_count":299,"published_time":"10 months ago"},{"id":"UgzWg3IEGibEv5WMWWx4AaABAg","text":"ok but what if you made a flash emulator in portal","author":"@deepsky-r9v","author_id":"UC0rPicsNlPppYqGd7M0qs1w","like_count":365,"published_time":"10 months ago"},{"id":"UgzT1aQPQ6PN-LvHGNd4AaABAg","text":"I am the Cave Story finder.\nAt 9:58, the Cave Story song \"White\" plays in the background.\nUntil next time...","author":"@hatenathing","author_id":"UC82X4h0it6cTx3xK9U-WedQ","like_count":225,"published_time":"10 months ago"},{"id":"UgwqyhTj15dHv4NRCfx4AaABAg","text":"My instincts said that iterating over 3000 objects is definitely reasonable, considering that those objects appear to be operating at the pixel scale, meaning there is only a few operations for each object, and I'm already used to having to iterate over millions of pixels to render to 4K screen in real time (on the CPU obviously)","author":"@jhgvvetyjj6589","author_id":"UC5-Cz_78xMqsEGtEjinhQsg","like_count":158,"published_time":"10 months ago"},{"id":"UgyJz7v2Ubre9oghlsJ4AaABAg","text":"how did the customers in the papa’s pizzeria games rate your food? that seems like it would be semi complicated","author":"@ThatAnimatronicPerson","author_id":"UCsAGxefpeU-iun4fK1N77mw","like_count":161,"published_time":"10 months ago (edited)"},{"id":"UgwN3ATu4oWZzezXpy14AaABAg","text":"12:23 the rendering code IS NOT faking the 3rd dimension. This is actually how GPUs work, projecting the 3D world onto a 2D plane of the camera","author":"@BenMorse0","author_id":"UCtUdfgusz7tx12PSoSEcSKQ","like_count":14,"published_time":"10 months ago"},{"id":"UgwPlIYdf_4Yvy3HuNx4AaABAg","text":"If you ever made another one of these, I'd love to see Fancy Pants Adventure dissected specifically to see how its physics work. It's one of the most unique and fun feeling platformers I've ever played and I'm intrigued what's happening under the hood","author":"@hyperventalated","author_id":"UCj0vLXXpR2_WgRoSwy7Vjww","like_count":19,"published_time":"10 months ago"},{"id":"Ugz89MACUJr9zGbsZ3t4AaABAg","text":"If there's any decrease in quality today, it's less to do with artistry and 100% to do with time and budget constraints. As in, artists just aren't given the time to animate those sequences as they used to, so corners get cut and \"good enough\" has to make do to get things released on time. \n\nIt's almost never the artists at fault and almost always the budgetary big wigs who haven't drawn a picture since primary school.","author":"@Respectable_Username","author_id":"UCO5Wbxfw1zmzdcrd5vxzmxw","like_count":10,"published_time":"10 months ago"},{"id":"Ugx6uhvozvee7-mwBdJ4AaABAg","text":"12:54 kick the buddy before he became a celebrity","author":"@HANAKINskywoker","author_id":"UC8bqqhyVqsvYEZU1lJahnPg","like_count":22,"published_time":"10 months ago"},{"id":"Ugz4tyg8IfPX030_Jwp4AaABAg","text":"2:56 HOLY SH$T IT'S ME\ni feel like hunter s. thompson seeing hunter s. thompson","author":"@hhhsp951","author_id":"UCtFdXg48m9LaaIoopN2wUHg","like_count":48,"published_time":"10 months ago (edited)"},{"id":"Ugx1LPcNq5mx09cnP-l4AaABAg","text":"Heads up! The point of this video was not to criticize game code, it's to give some insight on how these games were made. I see quite a few comments taking this the wrong way. Rest assured, I am not trying to discredit the quality or gameplay merit of these titles. Perhaps I didn't make that clear enough - that's my bad, I'll be more careful next time.\n\nFrequently Asked Questions:\n\nQ: How are you sure that this is the real code? Isn't decompilation a lossy process?\nA: Flash's ActionScript often decompiles relatively cleanly, maintaining the original control flow almost completely unmodified. Symbols aren't stripped by default, and functions don't seem to be inlined. The usual suspects of decompilation noise are minimal at worst. Even if things were moved around, inlined or restructured by the decompiler, that wouldn't explain the quirks I highlight here. For example, \"Portal: The Flash Version\" must be using duplicated code for its portals, as a modular solution would never decompile to hard angles. \"Sugar, sugar\" also undoubtedly contains duplicated code - the sugar logic is copied once for the menu, and once for gameplay, with nearly inconsequential changes in-between.\n\nQ: How can you know that the code was written in one huge file?\nA: I can't, but it's likely. ActionScript 3 structures its code into classes, and it'd be a bit unusual for a class to span multiple files. Since the logic of \"Sugar, sugar\" is almost entirely contained within a single class, I'm pretty confident that the code was also written as one big blob. For ActionScript 2, I'm less confident, as that stuff is tied to frames on a timeline. In the video, I do mention that I'm not sure whether the \"9200 lines\" metric is accurate. But... from vibes alone, the code of Interactive Buddy does feel like it was written in one file.\n\nQ: Aren't you being a bit harsh?\nA: Possibly, but I think this criticism still qualifies as constructive. I admit that these games have huge merit past their source code, and the creativity that went into them is what got me to talk about them in the first place, but that won't bias my honest review of the code. I do highlight the cool stuff, and I do highlight the mess.\n\nQ: Okay, but who cares about the code? The games are fun as-is.\nA: I agree, code quality should not be the top priority for an indie Flash game. However, by following best practices, developers can preemptively avoid bugs and inconsistencies. Consider the example at 5:28 - the typo is surrounded by checks for specific angles and code that's nearly identical in each condition. That's textbook code duplication, which ended up causing some behavior to be inconsistent depending on which wall holds your portal. If the portals were instead implemented modularly, this issue would've been way easier to spot and avoid. Again, I agree that it ultimately doesn't matter - the game is polished enough, it's fun to play, that's the important part. But cleaner code is undeniably linked to less bugs.","author":"@PortalRunner","author_id":"UCx-PpwbajI5ToAY0WwJO2Kg","like_count":1,"published_time":"10 months ago (edited)"},{"id":"UgxkEw88lbZ266B63WB4AaABAg","text":"\"Don't bother cleaning the code nobody will look into it anyway\" ...","author":"@lllloyd","author_id":"UCvW0S4Ut4CamvLwOspb5ixw","like_count":4,"published_time":"10 months ago"},{"id":"UgwfCZwyhSzsw_mvu1B4AaABAg","text":"Good explanations!\n\nHere's some more facts about Run. I think you've earned them.\n\nFirst, a correction. Run 1 and 2 were made in Flash Pro, not Haxe. The reason they're obfuscated is simple: I used an obfuscator to make decompilation harder.\n\nThe 3D effect is exactly as you described. A software renderer calculates where the four corners appear onscreen, then draws a quadrilateral using Flash's 2D Graphics API.\n\nSince I made the projection code from scratch, it has several quirks. Obviously, faraway shapes get distorted (at the time I thought they looked squished without that effect). Less obviously, the camera is hard-coded to look down the Z axis, and can't rotate to look in another direction. Technically, it can't even rotate around Z; I just drew the image unrotated and then told Flash to rotate the 2D display object. Actually, the two display objects: one for tiles that should appear in front of the Runner, and one for the tiles that appear behind.\n\nThe physics have similar quirks. The tiles must be grid-aligned, for starters. In the original release, it only knew how to hit-test against the floor, so when you got close enough to a wall, I made it rotate (turning the wall into floor) before actually hit testing. Later, I back-ported Run 2's physics engine, which means the tiles are secretly handled as cubes. The only reason you don't collide with invisible blocks is, it moves the collision up by one full space when it detects you're falling outside.\n\nI'll leave it at that, but trust me, there was a lot more ridiculousness.","author":"@player03","author_id":"UCM-zYOyBX3nSve9-vOjOwPQ","like_count":2,"published_time":"10 months ago (edited)"},{"id":"UgxdtqEqkNf3qvjbHOV4AaABAg","text":"PortalRunner covered code of games called \"Portal\" and \"Run\"","author":"@SMVery","author_id":"UC5GnE1S33hEsqDp2Z5AH8Gg","like_count":2,"published_time":"10 months ago"},{"id":"UgwgdksKtgVVC-_xbW54AaABAg","text":"At this point the main reason anyone cleans up their code is in case someone decompiles it in 20 years","author":"@hbomberguy","author_id":"UClt01z1wHHT7c5lKcU8pxRQ","like_count":661,"published_time":"10 months ago"},{"id":"UgxfMvQ973I6fBssenJ4AaABAg","text":"If the code sucks, but it works, it doesn't suck\n\n\n...until you want to expand on it","author":"@nodrance","author_id":"UC1eSvpuz-hLv2WfUi2GkHNw","like_count":1,"published_time":"10 months ago"},{"id":"Ugy7i5IpNp0JqeT-H6d4AaABAg","text":"So effectively Run 1 just has a custom software graphics renderer that uses quads instead of tris.","author":"@plantelo","author_id":"UCNql47OTgdswD1aJedtpM2g","like_count":451,"published_time":"10 months ago"},{"id":"UgzUEdJlWqi0-UgwDeZ4AaABAg","text":"I knew the developers of Portal: The Flash Version in real life back when it was developed. It had to be rushed A LOT in order to release ahead of Portal. Also, it was made by just two people, one of which was still in highschool.\n\nNo promises, but if you want I can try to connect you with them for an interview!","author":"@NeatNit","author_id":"UCjM2OgFmEWzL_6Yvef7I4fA","like_count":694,"published_time":"10 months ago"},{"id":"UgyJESWL8haDa5e70Bt4AaABAg","text":"Fun fact: all of Portal TFV was written by a 14-year-old. Another fun little tidbit about it's development is that The Living Tombstone also worked on it before he started making music under that name.","author":"@glassys42","author_id":"UCppbviYF9Fpv6gvqMlHLHLA","like_count":541,"published_time":"10 months ago"},{"id":"UgzWg3IEGibEv5WMWWx4AaABAg","text":"ok but what if you made a flash emulator in portal","author":"@deepsky-r9v","author_id":"UC0rPicsNlPppYqGd7M0qs1w","like_count":365,"published_time":"10 months ago"},{"id":"UgxlaIBHtwwjpLK-kmd4AaABAg","text":"Sugar, Sugar, Raze, Bloxorz, The Impossible Game... We didn't know how good we had it","author":"@nathanpotter1334","author_id":"UC256yixp9EzQF5OG_IOgSYw","like_count":299,"published_time":"10 months ago"},{"id":"UgzT1aQPQ6PN-LvHGNd4AaABAg","text":"I am the Cave Story finder.\nAt 9:58, the Cave Story song \"White\" plays in the background.\nUntil next time...","author":"@hatenathing","author_id":"UC82X4h0it6cTx3xK9U-WedQ","like_count":225,"published_time":"10 months ago"},{"id":"UgwqyhTj15dHv4NRCfx4AaABAg","text":"My instincts said that iterating over 3000 objects is definitely reasonable, considering that those objects appear to be operating at the pixel scale, meaning there is only a few operations for each object, and I'm already used to having to iterate over millions of pixels to render to 4K screen in real time (on the CPU obviously)","author":"@jhgvvetyjj6589","author_id":"UC5-Cz_78xMqsEGtEjinhQsg","like_count":158,"published_time":"10 months ago"},{"id":"UgyJz7v2Ubre9oghlsJ4AaABAg","text":"how did the customers in the papa’s pizzeria games rate your food? that seems like it would be semi complicated","author":"@ThatAnimatronicPerson","author_id":"UCsAGxefpeU-iun4fK1N77mw","like_count":161,"published_time":"10 months ago (edited)"},{"id":"UgwI1J3GbWXXWgpdm494AaABAg","text":"great to see the former home sheep home record holder going back to their roots","author":"@dustyhob0","author_id":"UCLyl6fxntedTEYTxno2S9Tw","like_count":443,"published_time":"10 months ago"},{"id":"UgzqLasZlw2_Oxcm6hF4AaABAg","text":"0:11  Bart bonte is my fav game dev","author":"@OctopusWhoSeesAll","author_id":"UCvvomgOsZ-T4ywMfbw8mecg","like_count":13,"published_time":"9 months ago"},{"id":"UgzcfE-dao1tb8zWRSN4AaABAg","text":"9:39 YEAH THAT'S HOW CODE LOOKS TO ME","author":"@DamageMaximo","author_id":"UC0-4u92PEzjk9AH6X7sJ2vA","like_count":62,"published_time":"10 months ago"},{"id":"UgxUrK8x-FcBrfnMrV54AaABAg","text":"the corru.observer sound at 2:49 caught my attention immediately lol","author":"@sstarlit5631","author_id":"UCyBQZsLQmpilEyi39g2A-CQ","like_count":20,"published_time":"10 months ago (edited)"},{"id":"Ugw7cF02PA-CrMDyUE54AaABAg","text":"Run 3 modder here! It’s actually super cool to see you talk about this. Run 3 in specific has some really weirdly interesting code related to data collection and music. For data collection, only one in I believe 200 infinite mode runs are specifically sent to player for the data to be collected. For music, there’s literally a line of code that makes it so every level that uses “map of the stars” uses traveling the galaxy instead. For a lot of sin related functions, instead of using some pi function and dividing it by 2, player inputs pi/2 accurate to like 15 digits individually each time.","author":"@t8thegr8st","author_id":"UCwTlAx33LuskcVKe8VP042A","like_count":15,"published_time":"10 months ago"},{"id":"UgwN3ATu4oWZzezXpy14AaABAg","text":"12:23 the rendering code IS NOT faking the 3rd dimension. This is actually how GPUs work, projecting the 3D world onto a 2D plane of the camera","author":"@BenMorse0","author_id":"UCtUdfgusz7tx12PSoSEcSKQ","like_count":14,"published_time":"10 months ago"},{"id":"Ugx1LPcNq5mx09cnP-l4AaABAg","text":"Heads up! The point of this video was not to criticize game code, it's to give some insight on how these games were made. I see quite a few comments taking this the wrong way. Rest assured, I am not trying to discredit the quality or gameplay merit of these titles. Perhaps I didn't make that clear enough - that's my bad, I'll be more careful next time.\n\nFrequently Asked Questions:\n\nQ: How are you sure that this is the real code? Isn't decompilation a lossy process?\nA: Flash's ActionScript often decompiles relatively cleanly, maintaining the original control flow almost completely unmodified. Symbols aren't stripped by default, and functions don't seem to be inlined. The usual suspects of decompilation noise are minimal at worst. Even if things were moved around, inlined or restructured by the decompiler, that wouldn't explain the quirks I highlight here. For example, \"Portal: The Flash Version\" must be using duplicated code for its portals, as a modular solution would never decompile to hard angles. \"Sugar, sugar\" also undoubtedly contains duplicated code - the sugar logic is copied once for the menu, and once for gameplay, with nearly inconsequential changes in-between.\n\nQ: How can you know that the code was written in one huge file?\nA: I can't, but it's likely. ActionScript 3 structures its code into classes, and it'd be a bit unusual for a class to span multiple files. Since the logic of \"Sugar, sugar\" is almost entirely contained within a single class, I'm pretty confident that the code was also written as one big blob. For ActionScript 2, I'm less confident, as that stuff is tied to frames on a timeline. In the video, I do mention that I'm not sure whether the \"9200 lines\" metric is accurate. But... from vibes alone, the code of Interactive Buddy does feel like it was written in one file.\n\nQ: Aren't you being a bit harsh?\nA: Possibly, but I think this criticism still qualifies as constructive. I admit that these games have huge merit past their source code, and the creativity that went into them is what got me to talk about them in the first place, but that won't bias my honest review of the code. I do highlight the cool stuff, and I do highlight the mess.\n\nQ: Okay, but who cares about the code? The games are fun as-is.\nA: I agree, code quality should not be the top priority for an indie Flash game. However, by following best practices, developers can preemptively avoid bugs and inconsistencies. Consider the example at 5:28 - the typo is surrounded by checks for specific angles and code that's nearly identical in each condition. That's textbook code duplication, which ended up causing some behavior to be inconsistent depending on which wall holds your portal. If the portals were instead implemented modularly, this issue would've been way easier to spot and avoid. Again, I agree that it ultimately doesn't matter - the game is polished enough, it's fun to play, that's the important part. But cleaner code is undeniably linked to less bugs.","author":"@PortalRunner","author_id":"UCx-PpwbajI5ToAY0WwJO2Kg","like_count":1,"published_time":"10 months ago (edited)"},{"id":"UgxkEw88lbZ266B63WB4AaABAg","text":"\"Don't bother cleaning the code nobody will look into it anyway\" ...","author":"@lllloyd","author_id":"UCvW0S4Ut4CamvLwOspb5ixw","like_count":4,"published_time":"10 months ago"},{"id":"UgxfMvQ973I6fBssenJ4AaABAg","text":"If the code sucks, but it works, it doesn't suck\n\n\n...until you want to expand on it","author":"@nodrance","author_id":"UC1eSvpuz-hLv2WfUi2GkHNw","like_count":1,"published_time":"10 months ago"},{"id":"UgxdtqEqkNf3qvjbHOV4AaABAg","text":"PortalRunner covered code of games called \"Portal\" and \"Run\"","author":"@SMVery","author_id":"UC5GnE1S33hEsqDp2Z5AH8Gg","like_count":2,"published_time":"10 months ago"},{"id":"UgwgdksKtgVVC-_xbW54AaABAg","text":"At this point the main reason anyone cleans up their code is in case someone decompiles it in 20 years","author":"@hbomberguy","author_id":"UClt01z1wHHT7c5lKcU8pxRQ","like_count":661,"published_time":"10 months ago"},{"id":"UgzUEdJlWqi0-UgwDeZ4AaABAg","text":"I knew the developers of Portal: The Flash Version in real life back when it was developed. It had to be rushed A LOT in order to release ahead of Portal. Also, it was made by just two people, one of which was still in highschool.\n\nNo promises, but if you want I can try to connect you with them for an interview!","author":"@NeatNit","author_id":"UCjM2OgFmEWzL_6Yvef7I4fA","like_count":694,"published_time":"10 months ago"},{"id":"UgyJESWL8haDa5e70Bt4AaABAg","text":"Fun fact: all of Portal TFV was written by a 14-year-old. Another fun little tidbit about it's development is that The Living Tombstone also worked on it before he started making music under that name.","author":"@glassys42","author_id":"UCppbviYF9Fpv6gvqMlHLHLA","like_count":541,"published_time":"10 months ago"},{"id":"UgwfCZwyhSzsw_mvu1B4AaABAg","text":"Good explanations!\n\nHere's some more facts about Run. I think you've earned them.\n\nFirst, a correction. Run 1 and 2 were made in Flash Pro, not Haxe. The reason they're obfuscated is simple: I used an obfuscator to make decompilation harder.\n\nThe 3D effect is exactly as you described. A software renderer calculates where the four corners appear onscreen, then draws a quadrilateral using Flash's 2D Graphics API.\n\nSince I made the projection code from scratch, it has several quirks. Obviously, faraway shapes get distorted (at the time I thought they looked squished without that effect). Less obviously, the camera is hard-coded to look down the Z axis, and can't rotate to look in another direction. Technically, it can't even rotate around Z; I just drew the image unrotated and then told Flash to rotate the 2D display object. Actually, the two display objects: one for tiles that should appear in front of the Runner, and one for the tiles that appear behind.\n\nThe physics have similar quirks. The tiles must be grid-aligned, for starters. In the original release, it only knew how to hit-test against the floor, so when you got close enough to a wall, I made it rotate (turning the wall into floor) before actually hit testing. Later, I back-ported Run 2's physics engine, which means the tiles are secretly handled as cubes. The only reason you don't collide with invisible blocks is, it moves the collision up by one full space when it detects you're falling outside.\n\nI'll leave it at that, but trust me, there was a lot more ridiculousness.","author":"@player03","author_id":"UCM-zYOyBX3nSve9-vOjOwPQ","like_count":2,"published_time":"10 months ago (edited)"},{"id":"UgwI1J3GbWXXWgpdm494AaABAg","text":"great to see the former home sheep home record holder going back to their roots","author":"@dustyhob0","author_id":"UCLyl6fxntedTEYTxno2S9Tw","like_count":443,"published_time":"10 months ago"},{"id":"Ugy7i5IpNp0JqeT-H6d4AaABAg","text":"So effectively Run 1 just has a custom software graphics renderer that uses quads instead of tris.","author":"@plantelo","author_id":"UCNql47OTgdswD1aJedtpM2g","like_count":451,"published_time":"10 months ago"},{"id":"UgxlaIBHtwwjpLK-kmd4AaABAg","text":"Sugar, Sugar, Raze, Bloxorz, The Impossible Game... We didn't know how good we had it","author":"@nathanpotter1334","author_id":"UC256yixp9EzQF5OG_IOgSYw","like_count":299,"published_time":"10 months ago"},{"id":"UgzWg3IEGibEv5WMWWx4AaABAg","text":"ok but what if you made a flash emulator in portal","author":"@deepsky-r9v","author_id":"UC0rPicsNlPppYqGd7M0qs1w","like_count":365,"published_time":"10 months ago"},{"id":"UgzT1aQPQ6PN-LvHGNd4AaABAg","text":"I am the Cave Story finder.\nAt 9:58, the Cave Story song \"White\" plays in the background.\nUntil next time...","author":"@hatenathing","author_id":"UC82X4h0it6cTx3xK9U-WedQ","like_count":225,"published_time":"10 months ago"},{"id":"UgwqyhTj15dHv4NRCfx4AaABAg","text":"My instincts said that iterating over 3000 objects is definitely reasonable, considering that those objects appear to be operating at the pixel scale, meaning there is only a few operations for each object, and I'm already used to having to iterate over millions of pixels to render to 4K screen in real time (on the CPU obviously)","author":"@jhgvvetyjj6589","author_id":"UC5-Cz_78xMqsEGtEjinhQsg","like_count":158,"published_time":"10 months ago"},{"id":"UgyJz7v2Ubre9oghlsJ4AaABAg","text":"how did the customers in the papa’s pizzeria games rate your food? that seems like it would be semi complicated","author":"@ThatAnimatronicPerson","author_id":"UCsAGxefpeU-iun4fK1N77mw","like_count":161,"published_time":"10 months ago (edited)"},{"id":"UgwN3ATu4oWZzezXpy14AaABAg","text":"12:23 the rendering code IS NOT faking the 3rd dimension. This is actually how GPUs work, projecting the 3D world onto a 2D plane of the camera","author":"@BenMorse0","author_id":"UCtUdfgusz7tx12PSoSEcSKQ","like_count":14,"published_time":"10 months ago"},{"id":"UgwPlIYdf_4Yvy3HuNx4AaABAg","text":"If you ever made another one of these, I'd love to see Fancy Pants Adventure dissected specifically to see how its physics work. It's one of the most unique and fun feeling platformers I've ever played and I'm intrigued what's happening under the hood","author":"@hyperventalated","author_id":"UCj0vLXXpR2_WgRoSwy7Vjww","like_count":19,"published_time":"10 months ago"},{"id":"Ugz89MACUJr9zGbsZ3t4AaABAg","text":"If there's any decrease in quality today, it's less to do with artistry and 100% to do with time and budget constraints. As in, artists just aren't given the time to animate those sequences as they used to, so corners get cut and \"good enough\" has to make do to get things released on time. \n\nIt's almost never the artists at fault and almost always the budgetary big wigs who haven't drawn a picture since primary school.","author":"@Respectable_Username","author_id":"UCO5Wbxfw1zmzdcrd5vxzmxw","like_count":10,"published_time":"10 months ago"},{"id":"Ugx6uhvozvee7-mwBdJ4AaABAg","text":"12:54 kick the buddy before he became a celebrity","author":"@HANAKINskywoker","author_id":"UC8bqqhyVqsvYEZU1lJahnPg","like_count":22,"published_time":"10 months ago"},{"id":"Ugz4tyg8IfPX030_Jwp4AaABAg","text":"2:56 HOLY SH$T IT'S ME\ni feel like hunter s. thompson seeing hunter s. thompson","author":"@hhhsp951","author_id":"UCtFdXg48m9LaaIoopN2wUHg","like_count":48,"published_time":"10 months ago (edited)"},{"id":"Ugx1LPcNq5mx09cnP-l4AaABAg","text":"Heads up! The point of this video was not to criticize game code, it's to give some insight on how these games were made. I see quite a few comments taking this the wrong way. Rest assured, I am not trying to discredit the quality or gameplay merit of these titles. Perhaps I didn't make that clear enough - that's my bad, I'll be more careful next time.\n\nFrequently Asked Questions:\n\nQ: How are you sure that this is the real code? Isn't decompilation a lossy process?\nA: Flash's ActionScript often decompiles relatively cleanly, maintaining the original control flow almost completely unmodified. Symbols aren't stripped by default, and functions don't seem to be inlined. The usual suspects of decompilation noise are minimal at worst. Even if things were moved around, inlined or restructured by the decompiler, that wouldn't explain the quirks I highlight here. For example, \"Portal: The Flash Version\" must be using duplicated code for its portals, as a modular solution would never decompile to hard angles. \"Sugar, sugar\" also undoubtedly contains duplicated code - the sugar logic is copied once for the menu, and once for gameplay, with nearly inconsequential changes in-between.\n\nQ: How can you know that the code was written in one huge file?\nA: I can't, but it's likely. ActionScript 3 structures its code into classes, and it'd be a bit unusual for a class to span multiple files. Since the logic of \"Sugar, sugar\" is almost entirely contained within a single class, I'm pretty confident that the code was also written as one big blob. For ActionScript 2, I'm less confident, as that stuff is tied to frames on a timeline. In the video, I do mention that I'm not sure whether the \"9200 lines\" metric is accurate. But... from vibes alone, the code of Interactive Buddy does feel like it was written in one file.\n\nQ: Aren't you being a bit harsh?\nA: Possibly, but I think this criticism still qualifies as constructive. I admit that these games have huge merit past their source code, and the creativity that went into them is what got me to talk about them in the first place, but that won't bias my honest review of the code. I do highlight the cool stuff, and I do highlight the mess.\n\nQ: Okay, but who cares about the code? The games are fun as-is.\nA: I agree, code quality should not be the top priority for an indie Flash game. However, by following best practices, developers can preemptively avoid bugs and inconsistencies. Consider the example at 5:28 - the typo is surrounded by checks for specific angles and code that's nearly identical in each condition. That's textbook code duplication, which ended up causing some behavior to be inconsistent depending on which wall holds your portal. If the portals were instead implemented modularly, this issue would've been way easier to spot and avoid. Again, I agree that it ultimately doesn't matter - the game is polished enough, it's fun to play, that's the important part. But cleaner code is undeniably linked to less bugs.","author":"@PortalRunner","author_id":"UCx-PpwbajI5ToAY0WwJO2Kg","like_count":1,"published_time":"10 months ago (edited)"},{"id":"UgxkEw88lbZ266B63WB4AaABAg","text":"\"Don't bother cleaning the code nobody will look into it anyway\" ...","author":"@lllloyd","author_id":"UCvW0S4Ut4CamvLwOspb5ixw","like_count":4,"published_time":"10 months ago"},{"id":"UgxfMvQ973I6fBssenJ4AaABAg","text":"If the code sucks, but it works, it doesn't suck\n\n\n...until you want to expand on it","author":"@nodrance","author_id":"UC1eSvpuz-hLv2WfUi2GkHNw","like_count":1,"published_time":"10 months ago"},{"id":"UgxdtqEqkNf3qvjbHOV4AaABAg","text":"PortalRunner covered code of games called \"Portal\" and \"Run\"","author":"@SMVery","author_id":"UC5GnE1S33hEsqDp2Z5AH8Gg","like_count":2,"published_time":"10 months ago"},{"id":"UgwgdksKtgVVC-_xbW54AaABAg","text":"At this point the main reason anyone cleans up their code is in case someone decompiles it in 20 years","author":"@hbomberguy","author_id":"UClt01z1wHHT7c5lKcU8pxRQ","like_count":661,"published_time":"10 months ago"},{"id":"UgzUEdJlWqi0-UgwDeZ4AaABAg","text":"I knew the developers of Portal: The Flash Version in real life back when it was developed. It had to be rushed A LOT in order to release ahead of Portal. Also, it was made by just two people, one of which was still in highschool.\n\nNo promises, but if you want I can try to connect you with them for an interview!","author":"@NeatNit","author_id":"UCjM2OgFmEWzL_6Yvef7I4fA","like_count":694,"published_time":"10 months ago"},{"id":"UgyJESWL8haDa5e70Bt4AaABAg","text":"Fun fact: all of Portal TFV was written by a 14-year-old. Another fun little tidbit about it's development is that The Living Tombstone also worked on it before he started making music under that name.","author":"@glassys42","author_id":"UCppbviYF9Fpv6gvqMlHLHLA","like_count":541,"published_time":"10 months ago"},{"id":"UgwfCZwyhSzsw_mvu1B4AaABAg","text":"Good explanations!\n\nHere's some more facts about Run. I think you've earned them.\n\nFirst, a correction. Run 1 and 2 were made in Flash Pro, not Haxe. The reason they're obfuscated is simple: I used an obfuscator to make decompilation harder.\n\nThe 3D effect is exactly as you described. A software renderer calculates where the four corners appear onscreen, then draws a quadrilateral using Flash's 2D Graphics API.\n\nSince I made the projection code from scratch, it has several quirks. Obviously, faraway shapes get distorted (at the time I thought they looked squished without that effect). Less obviously, the camera is hard-coded to look down the Z axis, and can't rotate to look in another direction. Technically, it can't even rotate around Z; I just drew the image unrotated and then told Flash to rotate the 2D display object. Actually, the two display objects: one for tiles that should appear in front of the Runner, and one for the tiles that appear behind.\n\nThe physics have similar quirks. The tiles must be grid-aligned, for starters. In the original release, it only knew how to hit-test against the floor, so when you got close enough to a wall, I made it rotate (turning the wall into floor) before actually hit testing. Later, I back-ported Run 2's physics engine, which means the tiles are secretly handled as cubes. The only reason you don't collide with invisible blocks is, it moves the collision up by one full space when it detects you're falling outside.\n\nI'll leave it at that, but trust me, there was a lot more ridiculousness.","author":"@player03","author_id":"UCM-zYOyBX3nSve9-vOjOwPQ","like_count":2,"published_time":"10 months ago (edited)"},{"id":"UgwI1J3GbWXXWgpdm494AaABAg","text":"great to see the former home sheep home record holder going back to their roots","author":"@dustyhob0","author_id":"UCLyl6fxntedTEYTxno2S9Tw","like_count":443,"published_time":"10 months ago"},{"id":"Ugy7i5IpNp0JqeT-H6d4AaABAg","text":"So effectively Run 1 just has a custom software graphics renderer that uses quads instead of tris.","author":"@plantelo","author_id":"UCNql47OTgdswD1aJedtpM2g","like_count":451,"published_time":"10 months ago"},{"id":"UgxlaIBHtwwjpLK-kmd4AaABAg","text":"Sugar, Sugar, Raze, Bloxorz, The Impossible Game... We didn't know how good we had it","author":"@nathanpotter1334","author_id":"UC256yixp9EzQF5OG_IOgSYw","like_count":299,"published_time":"10 months ago"},{"id":"UgzWg3IEGibEv5WMWWx4AaABAg","text":"ok but what if you made a flash emulator in portal","author":"@deepsky-r9v","author_id":"UC0rPicsNlPppYqGd7M0qs1w","like_count":365,"published_time":"10 months ago"},{"id":"UgzT1aQPQ6PN-LvHGNd4AaABAg","text":"I am the Cave Story finder.\nAt 9:58, the Cave Story song \"White\" plays in the background.\nUntil next time...","author":"@hatenathing","author_id":"UC82X4h0it6cTx3xK9U-WedQ","like_count":225,"published_time":"10 months ago"},{"id":"UgwqyhTj15dHv4NRCfx4AaABAg","text":"My instincts said that iterating over 3000 objects is definitely reasonable, considering that those objects appear to be operating at the pixel scale, meaning there is only a few operations for each object, and I'm already used to having to iterate over millions of pixels to render to 4K screen in real time (on the CPU obviously)","author":"@jhgvvetyjj6589","author_id":"UC5-Cz_78xMqsEGtEjinhQsg","like_count":158,"published_time":"10 months ago"},{"id":"UgyJz7v2Ubre9oghlsJ4AaABAg","text":"how did the customers in the papa’s pizzeria games rate your food? that seems like it would be semi complicated","author":"@ThatAnimatronicPerson","author_id":"UCsAGxefpeU-iun4fK1N77mw","like_count":161,"published_time":"10 months ago (edited)"},{"id":"UgwN3ATu4oWZzezXpy14AaABAg","text":"12:23 the rendering code IS NOT faking the 3rd dimension. This is actually how GPUs work, projecting the 3D world onto a 2D plane of the camera","author":"@BenMorse0","author_id":"UCtUdfgusz7tx12PSoSEcSKQ","like_count":14,"published_time":"10 months ago"},{"id":"UgwPlIYdf_4Yvy3HuNx4AaABAg","text":"If you ever made another one of these, I'd love to see Fancy Pants Adventure dissected specifically to see how its physics work. It's one of the most unique and fun feeling platformers I've ever played and I'm intrigued what's happening under the hood","author":"@hyperventalated","author_id":"UCj0vLXXpR2_WgRoSwy7Vjww","like_count":19,"published_time":"10 months ago"},{"id":"Ugz89MACUJr9zGbsZ3t4AaABAg","text":"If there's any decrease in quality today, it's less to do with artistry and 100% to do with time and budget constraints. As in, artists just aren't given the time to animate those sequences as they used to, so corners get cut and \"good enough\" has to make do to get things released on time. \n\nIt's almost never the artists at fault and almost always the budgetary big wigs who haven't drawn a picture since primary school.","author":"@Respectable_Username","author_id":"UCO5Wbxfw1zmzdcrd5vxzmxw","like_count":10,"published_time":"10 months ago"},{"id":"Ugx6uhvozvee7-mwBdJ4AaABAg","text":"12:54 kick the buddy before he became a celebrity","author":"@HANAKINskywoker","author_id":"UC8bqqhyVqsvYEZU1lJahnPg","like_count":22,"published_time":"10 months ago"},{"id":"Ugz4tyg8IfPX030_Jwp4AaABAg","text":"2:56 HOLY SH$T IT'S ME\ni feel like hunter s. thompson seeing hunter s. thompson","author":"@hhhsp951","author_id":"UCtFdXg48m9LaaIoopN2wUHg","like_count":48,"published_time":"10 months ago (edited)"},{"id":"Ugx1LPcNq5mx09cnP-l4AaABAg","text":"Heads up! The point of this video was not to criticize game code, it's to give some insight on how these games were made. I see quite a few comments taking this the wrong way. Rest assured, I am not trying to discredit the quality or gameplay merit of these titles. Perhaps I didn't make that clear enough - that's my bad, I'll be more careful next time.\n\nFrequently Asked Questions:\n\nQ: How are you sure that this is the real code? Isn't decompilation a lossy process?\nA: Flash's ActionScript often decompiles relatively cleanly, maintaining the original control flow almost completely unmodified. Symbols aren't stripped by default, and functions don't seem to be inlined. The usual suspects of decompilation noise are minimal at worst. Even if things were moved around, inlined or restructured by the decompiler, that wouldn't explain the quirks I highlight here. For example, \"Portal: The Flash Version\" must be using duplicated code for its portals, as a modular solution would never decompile to hard angles. \"Sugar, sugar\" also undoubtedly contains duplicated code - the sugar logic is copied once for the menu, and once for gameplay, with nearly inconsequential changes in-between.\n\nQ: How can you know that the code was written in one huge file?\nA: I can't, but it's likely. ActionScript 3 structures its code into classes, and it'd be a bit unusual for a class to span multiple files. Since the logic of \"Sugar, sugar\" is almost entirely contained within a single class, I'm pretty confident that the code was also written as one big blob. For ActionScript 2, I'm less confident, as that stuff is tied to frames on a timeline. In the video, I do mention that I'm not sure whether the \"9200 lines\" metric is accurate. But... from vibes alone, the code of Interactive Buddy does feel like it was written in one file.\n\nQ: Aren't you being a bit harsh?\nA: Possibly, but I think this criticism still qualifies as constructive. I admit that these games have huge merit past their source code, and the creativity that went into them is what got me to talk about them in the first place, but that won't bias my honest review of the code. I do highlight the cool stuff, and I do highlight the mess.\n\nQ: Okay, but who cares about the code? The games are fun as-is.\nA: I agree, code quality should not be the top priority for an indie Flash game. However, by following best practices, developers can preemptively avoid bugs and inconsistencies. Consider the example at 5:28 - the typo is surrounded by checks for specific angles and code that's nearly identical in each condition. That's textbook code duplication, which ended up causing some behavior to be inconsistent depending on which wall holds your portal. If the portals were instead implemented modularly, this issue would've been way easier to spot and avoid. Again, I agree that it ultimately doesn't matter - the game is polished enough, it's fun to play, that's the important part. But cleaner code is undeniably linked to less bugs.","author":"@PortalRunner","author_id":"UCx-PpwbajI5ToAY0WwJO2Kg","like_count":1,"published_time":"10 months ago (edited)"},{"id":"UgxkEw88lbZ266B63WB4AaABAg","text":"\"Don't bother cleaning the code nobody will look into it anyway\" ...","author":"@lllloyd","author_id":"UCvW0S4Ut4CamvLwOspb5ixw","like_count":4,"published_time":"10 months ago"},{"id":"UgxfMvQ973I6fBssenJ4AaABAg","text":"If the code sucks, but it works, it doesn't suck\n\n\n...until you want to expand on it","author":"@nodrance","author_id":"UC1eSvpuz-hLv2WfUi2GkHNw","like_count":1,"published_time":"10 months ago"},{"id":"UgxdtqEqkNf3qvjbHOV4AaABAg","text":"PortalRunner covered code of games called \"Portal\" and \"Run\"","author":"@SMVery","author_id":"UC5GnE1S33hEsqDp2Z5AH8Gg","like_count":2,"published_time":"10 months ago"},{"id":"UgwgdksKtgVVC-_xbW54AaABAg","text":"At this point the main reason anyone cleans up their code is in case someone decompiles it in 20 years","author":"@hbomberguy","author_id":"UClt01z1wHHT7c5lKcU8pxRQ","like_count":661,"published_time":"10 months ago"},{"id":"UgzUEdJlWqi0-UgwDeZ4AaABAg","text":"I knew the developers of Portal: The Flash Version in real life back when it was developed. It had to be rushed A LOT in order to release ahead of Portal. Also, it was made by just two people, one of which was still in highschool.\n\nNo promises, but if you want I can try to connect you with them for an interview!","author":"@NeatNit","author_id":"UCjM2OgFmEWzL_6Yvef7I4fA","like_count":694,"published_time":"10 months ago"},{"id":"UgyJESWL8haDa5e70Bt4AaABAg","text":"Fun fact: all of Portal TFV was written by a 14-year-old. Another fun little tidbit about it's development is that The Living Tombstone also worked on it before he started making music under that name.","author":"@glassys42","author_id":"UCppbviYF9Fpv6gvqMlHLHLA","like_count":541,"published_time":"10 months ago"},{"id":"UgwfCZwyhSzsw_mvu1B4AaABAg","text":"Good explanations!\n\nHere's some more facts about Run. I think you've earned them.\n\nFirst, a correction. Run 1 and 2 were made in Flash Pro, not Haxe. The reason they're obfuscated is simple: I used an obfuscator to make decompilation harder.\n\nThe 3D effect is exactly as you described. A software renderer calculates where the four corners appear onscreen, then draws a quadrilateral using Flash's 2D Graphics API.\n\nSince I made the projection code from scratch, it has several quirks. Obviously, faraway shapes get distorted (at the time I thought they looked squished without that effect). Less obviously, the camera is hard-coded to look down the Z axis, and can't rotate to look in another direction. Technically, it can't even rotate around Z; I just drew the image unrotated and then told Flash to rotate the 2D display object. Actually, the two display objects: one for tiles that should appear in front of the Runner, and one for the tiles that appear behind.\n\nThe physics have similar quirks. The tiles must be grid-aligned, for starters. In the original release, it only knew how to hit-test against the floor, so when you got close enough to a wall, I made it rotate (turning the wall into floor) before actually hit testing. Later, I back-ported Run 2's physics engine, which means the tiles are secretly handled as cubes. The only reason you don't collide with invisible blocks is, it moves the collision up by one full space when it detects you're falling outside.\n\nI'll leave it at that, but trust me, there was a lot more ridiculousness.","author":"@player03","author_id":"UCM-zYOyBX3nSve9-vOjOwPQ","like_count":2,"published_time":"10 months ago (edited)"},{"id":"UgwI1J3GbWXXWgpdm494AaABAg","text":"great to see the former home sheep home record holder going back to their roots","author":"@dustyhob0","author_id":"UCLyl6fxntedTEYTxno2S9Tw","like_count":443,"published_time":"10 months ago"},{"id":"Ugy7i5IpNp0JqeT-H6d4AaABAg","text":"So effectively Run 1 just has a custom software graphics renderer that uses quads instead of tris.","author":"@plantelo","author_id":"UCNql47OTgdswD1aJedtpM2g","like_count":451,"published_time":"10 months ago"},{"id":"UgxlaIBHtwwjpLK-kmd4AaABAg","text":"Sugar, Sugar, Raze, Bloxorz, The Impossible Game... We didn't know how good we had it","author":"@nathanpotter1334","author_id":"UC256yixp9EzQF5OG_IOgSYw","like_count":299,"published_time":"10 months ago"},{"id":"UgzWg3IEGibEv5WMWWx4AaABAg","text":"ok but what if you made a flash emulator in portal","author":"@deepsky-r9v","author_id":"UC0rPicsNlPppYqGd7M0qs1w","like_count":365,"published_time":"10 months ago"},{"id":"UgzT1aQPQ6PN-LvHGNd4AaABAg","text":"I am the Cave Story finder.\nAt 9:58, the Cave Story song \"White\" plays in the background.\nUntil next time...","author":"@hatenathing","author_id":"UC82X4h0it6cTx3xK9U-WedQ","like_count":225,"published_time":"10 months ago"},{"id":"UgwqyhTj15dHv4NRCfx4AaABAg","text":"My instincts said that iterating over 3000 objects is definitely reasonable, considering that those objects appear to be operating at the pixel scale, meaning there is only a few operations for each object, and I'm already used to having to iterate over millions of pixels to render to 4K screen in real time (on the CPU obviously)","author":"@jhgvvetyjj6589","author_id":"UC5-Cz_78xMqsEGtEjinhQsg","like_count":158,"published_time":"10 months ago"},{"id":"UgyJz7v2Ubre9oghlsJ4AaABAg","text":"how did the customers in the papa’s pizzeria games rate your food? that seems like it would be semi complicated","author":"@ThatAnimatronicPerson","author_id":"UCsAGxefpeU-iun4fK1N77mw","like_count":161,"published_time":"10 months ago (edited)"},{"id":"UgwN3ATu4oWZzezXpy14AaABAg","text":"12:23 the rendering code IS NOT faking the 3rd dimension. This is actually how GPUs work, projecting the 3D world onto a 2D plane of the camera","author":"@BenMorse0","author_id":"UCtUdfgusz7tx12PSoSEcSKQ","like_count":14,"published_time":"10 months ago"},{"id":"UgwPlIYdf_4Yvy3HuNx4AaABAg","text":"If you ever made another one of these, I'd love to see Fancy Pants Adventure dissected specifically to see how its physics work. It's one of the most unique and fun feeling platformers I've ever played and I'm intrigued what's happening under the hood","author":"@hyperventalated","author_id":"UCj0vLXXpR2_WgRoSwy7Vjww","like_count":19,"published_time":"10 months ago"},{"id":"Ugz89MACUJr9zGbsZ3t4AaABAg","text":"If there's any decrease in quality today, it's less to do with artistry and 100% to do with time and budget constraints. As in, artists just aren't given the time to animate those sequences as they used to, so corners get cut and \"good enough\" has to make do to get things released on time. \n\nIt's almost never the artists at fault and almost always the budgetary big wigs who haven't drawn a picture since primary school.","author":"@Respectable_Username","author_id":"UCO5Wbxfw1zmzdcrd5vxzmxw","like_count":10,"published_time":"10 months ago"},{"id":"Ugx6uhvozvee7-mwBdJ4AaABAg","text":"12:54 kick the buddy before he became a celebrity","author":"@HANAKINskywoker","author_id":"UC8bqqhyVqsvYEZU1lJahnPg","like_count":22,"published_time":"10 months ago"},{"id":"Ugz4tyg8IfPX030_Jwp4AaABAg","text":"2:56 HOLY SH$T IT'S ME\ni feel like hunter s. thompson seeing hunter s. thompson","author":"@hhhsp951","author_id":"UCtFdXg48m9LaaIoopN2wUHg","like_count":48,"published_time":"10 months ago (edited)"},{"id":"Ugx1LPcNq5mx09cnP-l4AaABAg","text":"Heads up! The point of this video was not to criticize game code, it's to give some insight on how these games were made. I see quite a few comments taking this the wrong way. Rest assured, I am not trying to discredit the quality or gameplay merit of these titles. Perhaps I didn't make that clear enough - that's my bad, I'll be more careful next time.\n\nFrequently Asked Questions:\n\nQ: How are you sure that this is the real code? Isn't decompilation a lossy process?\nA: Flash's ActionScript often decompiles relatively cleanly, maintaining the original control flow almost completely unmodified. Symbols aren't stripped by default, and functions don't seem to be inlined. The usual suspects of decompilation noise are minimal at worst. Even if things were moved around, inlined or restructured by the decompiler, that wouldn't explain the quirks I highlight here. For example, \"Portal: The Flash Version\" must be using duplicated code for its portals, as a modular solution would never decompile to hard angles. \"Sugar, sugar\" also undoubtedly contains duplicated code - the sugar logic is copied once for the menu, and once for gameplay, with nearly inconsequential changes in-between.\n\nQ: How can you know that the code was written in one huge file?\nA: I can't, but it's likely. ActionScript 3 structures its code into classes, and it'd be a bit unusual for a class to span multiple files. Since the logic of \"Sugar, sugar\" is almost entirely contained within a single class, I'm pretty confident that the code was also written as one big blob. For ActionScript 2, I'm less confident, as that stuff is tied to frames on a timeline. In the video, I do mention that I'm not sure whether the \"9200 lines\" metric is accurate. But... from vibes alone, the code of Interactive Buddy does feel like it was written in one file.\n\nQ: Aren't you being a bit harsh?\nA: Possibly, but I think this criticism still qualifies as constructive. I admit that these games have huge merit past their source code, and the creativity that went into them is what got me to talk about them in the first place, but that won't bias my honest review of the code. I do highlight the cool stuff, and I do highlight the mess.\n\nQ: Okay, but who cares about the code? The games are fun as-is.\nA: I agree, code quality should not be the top priority for an indie Flash game. However, by following best practices, developers can preemptively avoid bugs and inconsistencies. Consider the example at 5:28 - the typo is surrounded by checks for specific angles and code that's nearly identical in each condition. That's textbook code duplication, which ended up causing some behavior to be inconsistent depending on which wall holds your portal. If the portals were instead implemented modularly, this issue would've been way easier to spot and avoid. Again, I agree that it ultimately doesn't matter - the game is polished enough, it's fun to play, that's the important part. But cleaner code is undeniably linked to less bugs.","author":"@PortalRunner","author_id":"UCx-PpwbajI5ToAY0WwJO2Kg","like_count":1,"published_time":"10 months ago (edited)"},{"id":"UgwfCZwyhSzsw_mvu1B4AaABAg","text":"Good explanations!\n\nHere's some more facts about Run. I think you've earned them.\n\nFirst, a correction. Run 1 and 2 were made in Flash Pro, not Haxe. The reason they're obfuscated is simple: I used an obfuscator to make decompilation harder.\n\nThe 3D effect is exactly as you described. A software renderer calculates where the four corners appear onscreen, then draws a quadrilateral using Flash's 2D Graphics API.\n\nSince I made the projection code from scratch, it has several quirks. Obviously, faraway shapes get distorted (at the time I thought they looked squished without that effect). Less obviously, the camera is hard-coded to look down the Z axis, and can't rotate to look in another direction. Technically, it can't even rotate around Z; I just drew the image unrotated and then told Flash to rotate the 2D display object. Actually, the two display objects: one for tiles that should appear in front of the Runner, and one for the tiles that appear behind.\n\nThe physics have similar quirks. The tiles must be grid-aligned, for starters. In the original release, it only knew how to hit-test against the floor, so when you got close enough to a wall, I made it rotate (turning the wall into floor) before actually hit testing. Later, I back-ported Run 2's physics engine, which means the tiles are secretly handled as cubes. The only reason you don't collide with invisible blocks is, it moves the collision up by one full space when it detects you're falling outside.\n\nI'll leave it at that, but trust me, there was a lot more ridiculousness.","author":"@player03","author_id":"UCM-zYOyBX3nSve9-vOjOwPQ","like_count":2,"published_time":"10 months ago (edited)"},{"id":"UgxkEw88lbZ266B63WB4AaABAg","text":"\"Don't bother cleaning the code nobody will look into it anyway\" ...","author":"@lllloyd","author_id":"UCvW0S4Ut4CamvLwOspb5ixw","like_count":4,"published_time":"10 months ago"},{"id":"UgwgdksKtgVVC-_xbW54AaABAg","text":"At this point the main reason anyone cleans up their code is in case someone decompiles it in 20 years","author":"@hbomberguy","author_id":"UClt01z1wHHT7c5lKcU8pxRQ","like_count":661,"published_time":"10 months ago"},{"id":"Ugwb4Tx8IkIxfNedn0N4AaABAg","text":"Just a technicality: You called Run fake 3D but it isn't. It is 3D with a very limited software renderer.","author":"@ellion0815","author_id":"UCUnMIbYcJI1ZEEwdhgmztxg","like_count":115,"published_time":"10 months ago"},{"id":"UgxdtqEqkNf3qvjbHOV4AaABAg","text":"PortalRunner covered code of games called \"Portal\" and \"Run\"","author":"@SMVery","author_id":"UC5GnE1S33hEsqDp2Z5AH8Gg","like_count":2,"published_time":"10 months ago"},{"id":"UgzWg3IEGibEv5WMWWx4AaABAg","text":"ok but what if you made a flash emulator in portal","author":"@deepsky-r9v","author_id":"UC0rPicsNlPppYqGd7M0qs1w","like_count":365,"published_time":"10 months ago"},{"id":"Ugy2F7wKj1heuZN_2j94AaABAg","text":"11:43 wait how's that different from \"real\" 3d rendering?","author":"@HANAKINskywoker","author_id":"UC8bqqhyVqsvYEZU1lJahnPg","like_count":18,"published_time":"10 months ago"},{"id":"Ugw658fV5aFbPYXBKn14AaABAg","text":"video starts at 15:34","author":"@Perkonsmane","author_id":"UCTriR4oFLRDAC7Q2ASFRF-w","like_count":17,"published_time":"10 months ago"},{"id":"UgySQjLpaw2C5xh25V54AaABAg","text":"In regards to the sponsor, I am... skeptical. Especially since it mentions using generative AI to make \"endless lessons\"\n\nAre there actual lessons written by humans in Coddy? Or are ALL the lessons generative AI?\n\nI hate how so many companies shove generative AI into things nowadays.","author":"@wobbachustash","author_id":"UCIA3AUojScgDN9HDm3qEOag","like_count":39,"published_time":"10 months ago"},{"id":"UgyXIVFxUZj7Yhmh6Gh4AaABAg","text":"12:05 small correction: ALL 3d graphics is really just fake 3d with 2d shapes, because your monitor is 2d. a 3d renderer just uses math to render what that scene would look like if it were rotated, warped (to make lines converge), and then flattened onto a 2d surface. your GPU doesn't care about 3D, only 2D.","author":"@ThatJay283","author_id":"UC08HE2m1kR5ZXhAKvxg1nqA","like_count":28,"published_time":"10 months ago (edited)"},{"id":"Ugxjmw-tAazVnahrQCl4AaABAg","text":"meh I did it, just go grid based and o(1) on an image pixel render loop and modify things from there, important you must maintain this loop once so there should be no other huge loops inside.\nit will work even more than 3000 objects, you can even simulate those CRT tv noise at full fps.\n\nalso don't rant on spagetti code, what you're looking at is a decompiled code not the actual code used (which is probably cleaner)","author":"@planktonfun","author_id":"UCrAsF8h5te5pQYhm0-gdlKQ","like_count":0,"published_time":"10 months ago (edited)"},{"id":"UgxfMvQ973I6fBssenJ4AaABAg","text":"If the code sucks, but it works, it doesn't suck\n\n\n...until you want to expand on it","author":"@nodrance","author_id":"UC1eSvpuz-hLv2WfUi2GkHNw","like_count":1,"published_time":"10 months ago"},{"id":"Ugy7i5IpNp0JqeT-H6d4AaABAg","text":"So effectively Run 1 just has a custom software graphics renderer that uses quads instead of tris.","author":"@plantelo","author_id":"UCNql47OTgdswD1aJedtpM2g","like_count":451,"published_time":"10 months ago"},{"id":"UgwBhrfKL_Ccehrz2JJ4AaABAg","text":"I wonder if it's possible to port sugar sugar and run to gba","author":"@lenadams854","author_id":"UCkDSZMyMRBU4Agd4W5DTqsw","like_count":11,"published_time":"10 months ago (edited)"},{"id":"UgwqyhTj15dHv4NRCfx4AaABAg","text":"My instincts said that iterating over 3000 objects is definitely reasonable, considering that those objects appear to be operating at the pixel scale, meaning there is only a few operations for each object, and I'm already used to having to iterate over millions of pixels to render to 4K screen in real time (on the CPU obviously)","author":"@jhgvvetyjj6589","author_id":"UC5-Cz_78xMqsEGtEjinhQsg","like_count":158,"published_time":"10 months ago"},{"id":"UgyJESWL8haDa5e70Bt4AaABAg","text":"Fun fact: all of Portal TFV was written by a 14-year-old. Another fun little tidbit about it's development is that The Living Tombstone also worked on it before he started making music under that name.","author":"@glassys42","author_id":"UCppbviYF9Fpv6gvqMlHLHLA","like_count":541,"published_time":"10 months ago"},{"id":"UgyJz7v2Ubre9oghlsJ4AaABAg","text":"how did the customers in the papa’s pizzeria games rate your food? that seems like it would be semi complicated","author":"@ThatAnimatronicPerson","author_id":"UCsAGxefpeU-iun4fK1N77mw","like_count":161,"published_time":"10 months ago (edited)"},{"id":"UgzT1aQPQ6PN-LvHGNd4AaABAg","text":"I am the Cave Story finder.\nAt 9:58, the Cave Story song \"White\" plays in the background.\nUntil next time...","author":"@hatenathing","author_id":"UC82X4h0it6cTx3xK9U-WedQ","like_count":225,"published_time":"10 months ago"},{"id":"Ugzz74ELbX1h3pkH9pJ4AaABAg","text":"Compiled code does not keep the symbol names and functions. A lot of things have also been inline. This is why you see \"duplicate code\" and \"spaghetti code\".\n\nUnless I am wrong of course in which case, I'd be interested to learn.","author":"@godnyx117","author_id":"UC6-ZVg5Zb7fnkj5iEPMNL3Q","like_count":0,"published_time":"10 months ago"}]}