Flash Ports

Our client GameDuell had a big library of Flash games. We helped them port this library to HTML5 using Haxe and the OpenFL framework. The ports had to be 100% accurate in gameplay and graphics. The games were both offline and online games.
Developed for Web

Our job was to replicate the existing catalogue of games 100% accurately. This was very important because the games on GameDuell involve playing with money. We can’t have gameplay bugs due to a new implementation, or timing differences between the original games and the ports.

For this reason, we chose to port the games using Haxe and OpenFL. Using this technique we would be able to convert the existing sources from AS1, AS2 and AS3 to Haxe easily, the languages have similar syntax. We can also use the existing SWF files containing all graphics and animations, and read those out.

OpenFL was a great start, but it was not designed for 100% accurate ports. Therefor we forked the library and made a lot of modifications to it. This involved understanding the SWF file format specification guide and creating a lot of graphics tests to compare visuals between OpenFL and Flash.

OpenFL supports multiple rendering backends, since Haxe can be used to transpile to a multitude of platforms. We were only interested in HTML5, so we dropped the backends we didn’t need and improved upon the canvas API.

In total we delivered roughly 20 fully functional games to the client in 2.5 years, with a team of 3 developers.

Worth noting, one of the tools we used the most was FFDec. Without this FOSS tool, we would not have been able to deliver the ports with this amount of quality.

Our contributions

  • Reimplemented event handler in openFL to be 100% compliant with Flash. This includes bubbling up and down of events
  • Implemented postprocessing effects and layer blend modes
  • (Many) Performance optimizations
  • Subpixel precision for animations and fonts
  • Text rendering features: content alignment, word wrapping, kerning and spacing
  • Game canvas resizing (fullscreen)
  • AS1/2/3 to Haxe convertor (regular expressions)

Acquired skills

This project was very educational for me. The quality expected by the GameDuell team was very high. I learned to improve my eye for detail. This was my first experience with Haxe. Haxe is a fun language and it is extremely powerful, while being surprisingly easy to use.

© 2020. All rights reserved.