Live data from Hacker News

Ruffle – A Flash Player emulator written in Rust

ruffle.rs

81–90 of 94 posts

Re: Ruffle – A Flash Player emulator written in Rust

#81
post #25

Earlier quoted context omitted.

Back when Shumway was under development I remember using the first big Homestuck walkaround flash ( https://www.homestuck.com/story/1358?fl=1 ) to put it through its paces and found it to be unbearably slow to the point of unplayability. If Ruffle is capable of running those at any reasonable speed then that would demonstrate real progress over what Shumway achieved.

Looking at the code, Shumway seems amazingly complete vs. Ruffle. Ruffle has only a tiny skeleton of AS3 support (only the VM opcodes and some of the MovieClip class), while Shumway seems to implement a huge chunk of the library classes. Maybe using wasm Rust with WebGPU acceleration will make it faster than Shumway. Remarkable to me how much effort must have been put into Shumway, though..

DisplayObjectContainer support just landed a few days ago, but yes, our AS3 support is basically nothing right now. Most of our effort has gone into finding and implementing the bottomless pit of strangeness that is AVM1 and it's execution model. Adding AS3 support also means making sure we can leverage the same object hierarchy without breaking any of those fixes. For example, after figuring out how DisplayObjectContainer IDs and timeline depths interact, Toad06 and I went through several rounds of regression testing with AVM1 content because of how foundational the changes were.

Shumway used to be a Mozilla project with corporate backing; that would explain why their implementation was so complete. (Ruffle is all people working spare-time currently) The performance ceiling with Rust is way higher than JavaScript, but we're nowhere near that yet, much yet at the point where we'd have to start writing JIT compilers for AS2 or AS3. We are using GPUs to render polygonalized shapes where available, though that has some accuracy issues with stroke scaling. Ideally, we'd like to have some kind of low-level Flash-like vector drawing implementation, but that would be a significant performance loss unless we could either parallelize it or somehow convince a GPU to do it.

Furthermore, a lot of that is going to have to come after all the compatibility and implementation work we still need to do. Off the top of my head...

1. Core AS3 display object support - I'm working on this with somewhat-slow progress

2. Core AS3 data types (String, Number, int, uint, Vector., Point, Transform, JSON, etc) - I'll do this as-needed for other AS3 work or specific games that depend on these methods

3. Video decoding - I have an h263 decoder written but still need to tie it into the stage, and it'll probably be super-inefficient on web unless I port decoding over to GPU shaders

4. Remaining AS2 classes - Someone PR'd BitmapData support but it's incomplete. There's also some security-related and custom socket classes which expose the movie's origin, which is validated by some domain locks.

5. XML - I have a custom DOM and AS2 integration for it, but we need to write our own custom parser and also tie it into both legacy XML and E4X XML on AS3

Re: Ruffle – A Flash Player emulator written in Rust

#82
post #50
post #42

Earlier quoted context omitted.

SVG is much better at vector art use cases. Flash was horrible from user pov (constant os and browser compatibility problems, unending stream of weekly "ads can pwn your computer" level security holes, proprietary black box nature, ate your battery, hard to procedurally generate, didn't integrate with the web and dom, etc etc).

All true, but there’s such a massive library of content for Flash that they must have done _something_ right. Maybe it was just luck, maybe timing, but it’s amazing to me that so many games and videos are caught in this particular technical dead end. My understanding is that HTML5 just never offered the same primitives for content creation, but I’m unsure why there was no economic incentive to create them.

Adobe Flash/Animate provided a best-in-class animation and vector art package that still has little competition. Animate can actually export to HTML5, but they didn't bother using the SVG/SMIL animation model. Instead, they pre-render everything as a series of spritesheets and render them to a canvas.

I can see why they did this - the SVG and canvas vector rendering models are different enough to make blindly rendering SWF content to it cause rendering artifacts. (It's one of our biggest longstanding bugs in Ruffle - canvas masks just look weird.) However, Adobe could have ameliorated this either in the exporter, the authoring environment, or by pushing for Flash-style mask options in web standards that deal with vector rendering. Instead, they went with the far worse but quicker option of prerendering so they could say "hey we totally do HTML5 now".

Re: Ruffle – A Flash Player emulator written in Rust

#83

Earlier quoted context omitted.

Looking at the code, Shumway seems amazingly complete vs. Ruffle. Ruffle has only a tiny skeleton of AS3 support (only the VM opcodes and some of the MovieClip class), while Shumway seems to implement a huge chunk of the library classes. Maybe using wasm Rust with WebGPU acceleration will make it faster than Shumway. Remarkable to me how much effort must have been put into Shumway, though..

DisplayObjectContainer support just landed a few days ago, but yes, our AS3 support is basically nothing right now. Most of our effort has gone into finding and implementing the bottomless pit of strangeness that is AVM1 and it's execution model. Adding AS3 support also means making sure we can leverage the same object hierarchy without breaking any of those fixes. For example, after figuring out how DisplayObjectCon…

> or somehow convince a GPU to do it.

I'm about 90% sure this is possible using techniques broadly similar to piet-gpu. The problem is a lot less constrained if you have access to compute shaders (ie WebGPU), otherwise it looks a lot like RAVG (Nehab and Hoppe) and you have kinda nasty branching and memory access patterns in the fragment shader, plus still having to do coarse rasterization on CPU.

One of the operational challenges here is that the renderer would likely be a one-off, as the requirements are just so different than most other clients of a 2D rendering engine.

There's been a bit of discussion on #gpu on xi.zulipchat.com. I consider this an interesting problem but can't really justify spending time on Flash-specific features myself.

Re: Ruffle – A Flash Player emulator written in Rust

#84
post #14

Earlier quoted context omitted.

I think Mike from Newgrounds is the lead developer on the project, or at least the guy who created it.

Check ruffle githubpage for orginal creator. Mike is sponsoring this development, but not developing the project.

Mike started the project - I know this because I'm one of the developers (others include CUB3D and Dinnerbone) and his commits go back to 2016.

Re: Ruffle – A Flash Player emulator written in Rust

#85

If you need a Flash file to try this with, here you go. At least on Windows, you can paste the URL directly into the file name field of the "Open local file" on the demo page. https://github.com/claus/as3swf/blob/master/examples/dumps/A...

If you haven't seen it, GH has a non-querystring URL that will likely work in places that are not tolerant of either querystrings or special characters in "filenames":

https://github.com/claus/as3swf/raw/master/examples/dumps/AY...

Re: Ruffle – A Flash Player emulator written in Rust

#86
post #27

I see Ruffle a lot, but I hardly see a mention of AwayFL on here: https://news.ycombinator.com/item?id=25243958

I don't follow what that self post is promoting; only by searching for that term did the GitHub org show up -- a very odd thing to omit from a HN post: https://github.com/awayfl

Re: Ruffle – A Flash Player emulator written in Rust

#87

Earlier quoted context omitted.

It doesn't solve them. See https://github.com/ruffle-rs/ruffle/issues/26 Here's a flash style solution to the problem: https://github.com/jrmuizel/full-scene-rasterizer

Thanks, good to know. I am interested in a fully GPU-accelerated solution, but it is not easy, and I make no promises if or when I will get there. I would be interested in discussing my ideas.

And a self-followup: I wrote https://github.com/linebender/piet-gpu/issues/49 to track this in piet-gpu.

Re: Ruffle – A Flash Player emulator written in Rust

#88
post #41

Anyone know of any animation editing software similar to the original Flash MX ?

Is Adobe Animate insufficient?

Yeah that looks cool, hadn't heard of that one.

I just found an open-source alternative too: https://www.synfig.org/

Re: Ruffle – A Flash Player emulator written in Rust

#89
post #88

Earlier quoted context omitted.

Is Adobe Animate insufficient?

Yeah that looks cool, hadn't heard of that one. I just found an open-source alternative too: https://www.synfig.org/

I mentioned Adobe Animate because it’s actually a rebranded Adobe Flash.

Re: Ruffle – A Flash Player emulator written in Rust

#90
post #51
post #39

Earlier quoted context omitted.

I just curious couldn't someone just write down missing part of documentstion looking at something like Scaleform source code? So someone else can make clean room implementation using the doc. Scaleform impplementation of Flash player always looked really decent to me.

You can find some flash player source in Doom3 BFG edition source code! Apparently some people at ID wrote their internal flash player just for the menus! I don't know how good it is

Scaleform was just far more feature-complete and can run apps of almost any complexity. Still not 100% feature complete since you don't need many thing for game UI.
Post reply on HN