Post subject: Flash Emulator
Player (146)
Joined: 7/16/2009
Posts: 686
Just something I was wondering about. Considering there's plenty of programs capable of emulating Flash games out there (most of them called browsers), how hard could it be to make a Flash-running program with TASing tools? Most browser allow stuff like "play", "rewind" and "stop" already when you right-click the Flash object... I don't have the programming capabilities to extend this to "Frame Advance" and "Savestate" but hey, it should be possible, right?
creaothceann
He/Him
Editor
Joined: 4/7/2005
Posts: 1874
Location: Germany
Flash isn't emulated, it's running as a plugin (probably a DLL file) directly on the CPU.
Joined: 8/15/2008
Posts: 19
Flash has a "frames"metaphor but this is for flash animation, not interactive games. Stepping through frames is not analogous to stepping through game logic, as most flash games spend the whole game "stopped" on only a handful of "frames" (if you rightclick and choose "stop" it will usually not stop a game) I believe there are existing flash emulators but I don't think any of them are complete or accurate at the level a TAS would need them.
Joined: 9/17/2009
Posts: 18
Location: Hungary
I'm working on something like this, it's in a very early stage and it can only play toy examples (no interactivity either). Details: http://people.inf.elte.hu/gyorokp/download/freesf/freesf.html Unfortunately I can't work on it right now, don't expect progress on it until mid summer at best.
Banned User
Joined: 3/10/2004
Posts: 7698
Location: Finland
Nitpicking, but "flash emulator" is a misnomer. What one emulates is hardware. Programs are run either natively, interpreted or by a runtime system (which is often a bytecode interpreter, but with some languages and runtimes could have a JIT compiler in order to run the code natively). I don't know about the technical details of Flash, but I have the understanding that it's byte-compiled, after which the flash player/plugin interprets this byte code (in which case "flash interpreter" or "flash runtime" would be more accurate).
Post subject: Re: Flash Emulator
sgrunt
He/Him
Emulator Coder, Former player
Joined: 10/28/2007
Posts: 1360
Location: The dark horror in the back of your mind
Scepheo wrote:
Considering there's plenty of programs capable of emulating Flash games out there (most of them called browsers), how hard could it be to make a Flash-running program with TASing tools?
Something of the nature you describe would, in my view require a reliable alternative (preferably open-sourced) implementation of Flash to which rerecording tools could be added. Since such an implementation does not to the best of my knowledge exist (as yet, if ever), this sounds like a pipe dream to me.
Player (121)
Joined: 2/11/2007
Posts: 1522
I make a comic with no image files and you should read it. While there is a lower class, I am in it, and while there is a criminal element I am of it, and while there is a soul in prison, I am not free. -Eugene Debs
Post subject: Re: Flash Emulator
Joined: 11/22/2004
Posts: 1468
Location: Rotterdam, The Netherlands
sgrunt wrote:
Scepheo wrote:
Considering there's plenty of programs capable of emulating Flash games out there (most of them called browsers), how hard could it be to make a Flash-running program with TASing tools?
Something of the nature you describe would, in my view require a reliable alternative (preferably open-sourced) implementation of Flash to which rerecording tools could be added. Since such an implementation does not to the best of my knowledge exist (as yet, if ever), this sounds like a pipe dream to me.
It would be magnificently difficult to get this to work, I'd bet, even if you used Gnash as base. As said before, "frame advance" is different from the one we know from hardware like the NES in that it steps through a user-defined timeline that doesn't have anything to do with the program logic. It's used almost exclusively for animation. Even if you force the movie's frame rate to be lower than it normally is, you'd run into all kinds of problems (this can be easily done, for example by making an SWF that runs at 1 FPS and then loading the other SWF into it). Flash games usually run parts of their code on a frame update-based event, including animation, meaning you'd most likely introduce visual disparities by messing with it.
Joined: 4/11/2010
Posts: 16
your emulator can't find the DLL's can you upload a workin beta, gyorokpeter?
arflech
He/Him
Joined: 5/3/2008
Posts: 1120
gyorokpeter wrote:
I'm working on something like this, it's in a very early stage and it can only play toy examples (no interactivity either). Details: http://people.inf.elte.hu/gyorokp/download/freesf/freesf.html Unfortunately I can't work on it right now, don't expect progress on it until mid summer at best.
have you considered contributing to gnash or swfdec
i imgur com/QiCaaH8 png
Joined: 9/17/2009
Posts: 18
Location: Hungary
arflech wrote:
have you considered contributing to gnash or swfdec
Maybe in the future. I tried using Gnash but it's not quite compatible with current games. I haven't tried swfdec yet. There's also a third contender for the title: Lightspark. Right now, I think the best way to learn about the inner works of Flash is by doing and writing the player myself. However I might also borrow some things from the other projects such as visuals and audio, which are secondary importance in my case.
your emulator can't find the DLL's can you upload a workin beta, gyorokpeter?
Currently it needs the Qt4 Core/GUI DLLs and OpenAL. I have uploaded a zip with all of these (it's at the Win32 link on the downloads page). Windows has a serious disability in this regard, lacking a decent package manager.
arflech
He/Him
Joined: 5/3/2008
Posts: 1120
gyorokpeter wrote:
There's also a third contender for the title: Lightspark.
so it looks like the powers of Lightspark and Gnash could combine to make an open-source solution for playing SWF files: Lightspark for the new stuff and Gnash for the dinosaurs.
i imgur com/QiCaaH8 png