
移植 Flash 游戏
把 Flash 游戏移植到今天还存在的网页上
Adobe 在 2020 年 12 月 31 日结束了 Flash Player 支持。移植 Flash 游戏,意思是重建一款你拥有的作品,让它在现代浏览器里运行。
移植 Flash 游戏,意思是把一款你拥有的游戏重建到不再运行 Flash 的浏览器上。Adobe 在 2020 年 12 月 31 日结束了 Flash Player 支持,并在 2021 年 1 月阻止内容运行。每一个依赖该插件的 SWF 都在那天停止工作。
你需要这款游戏的权利。移植你自己做的 Flash 游戏,或你持有重制许可的游戏。反编译别人的 SWF、提取它的资源再重新发布,不在本页范围内。
只要重建得当,Flash 游戏很适合现代目标。它本来就为鼠标输入、矢量美术和短时段游玩而做。Summer Engine 把它重建成归你所有的项目,并导出到网页、桌面和移动端,不收分成。
旧 Flash 项目里能留下来的东西
如果你还留着 FLA 文件,矢量美术就是你手上最值钱的东西。矢量图形能按任意分辨率重新导出,也就是说一款按 550x400 舞台制作的游戏,可以在 4K 下重建得依然锐利。时间轴动画需要重做成动画轨道或精灵表,因为没有引擎能读取 Flash 时间轴。ActionScript 属于参考资料:逻辑能迁移,语法不能。
从 ActionScript 到现代语言
ActionScript 3 和 GDScript 都是对动态特性友好、基于类的脚本语言,所以这种转写往往是机械性的。事件监听器变成信号。enterFrame 处理函数变成一个处理回调。MovieClip 变成带精灵和动画播放器的节点。ActionScript 2 的代码更松散,通常需要重构而不是翻译。你也可以在桌面上用 C# 重建,不过 C# 在网页导出上不可用。
基于帧的计时必须改成时间增量
Flash 跑在舞台帧率上,常见是每秒 24 或 30 帧,而大量游戏逻辑数的是帧而不是秒。在以 60、120 或 144 Hz 运行的现代显示器上,数帧会让游戏速度失控。重建过程中要把每一个帧计数器换成基于时间的数值。这是 Flash 移植里最常见的 bug 来源,而且边重建边修,比事后再修便宜得多。
鼠标优先的设计,如今要上触摸
Flash 游戏是为鼠标光标做的,有悬停状态、点击拖拽和精确指向。触摸屏没有悬停,指尖也比光标大得多。基于悬停的提示需要一个点按替代,小按钮需要更大的点击区域,拖拽交互还要考虑手指会盖住被拖的东西。用键盘操作的 Flash 游戏,需要为这款游戏专门设计的屏幕控件布局,而不是一层通用叠层。
重建后的游戏去哪里
网页导出把游戏放回开放的互联网,可以嵌在你自己的网站或门户上。从同一个项目,你还能得到给 Steam 和 itch.io 的桌面构建,以及给 iOS 和 Android 的移动构建。很多 Flash 时代的游戏天然适合手机,因为单局很短。注意语言限制:C++ 和 GDScript 处处能跑,C# 除了网页之外处处能跑。
常见问题
为什么 Flash 游戏现在打不开了?
Adobe 在 2020 年 12 月 31 日结束了 Flash Player 支持,并在 2021 年 1 月 12 日阻止 Flash 内容运行。浏览器彻底移除了该插件。任何以 SWF 形式分发、依赖插件的游戏,对普通玩家来说都跑不起来了。
SWF 文件能转换成现代游戏吗?
不能转换成你可以维护的可编辑项目。反编译器能提取一部分资源和字节码,但结果不是另一个引擎里能跑的项目。Flash 移植是重建,最好从你原来的 FLA 文件和 ActionScript 源码开始。
FLA 文件丢了,我还能移植这款 Flash 游戏吗?
能,只要你拥有权利。你可以用手上还剩的东西重建:导出过的美术、截图、游玩录像和设计笔记。有矢量源文件会让重建便宜很多,但它们不是必需的。
ActionScript 代码能迁移吗?
逻辑能迁移,语法不能。ActionScript 3 相当直接地对应到 GDScript:监听器变成信号,enterFrame 变成处理回调,MovieClip 变成带动画播放器的节点。ActionScript 2 通常需要重构。
Flash 移植里最常见的 bug 是什么?
基于帧的计时。Flash 跑在固定的舞台帧率上,常见是 24 或 30,而游戏逻辑经常在数帧。在 60 或 144 Hz 显示器上,这套逻辑速度就错了。重建时把每一个帧计数器换成时间增量。
重建后的游戏还能在浏览器里跑吗?
能。网页是受支持的导出目标,桌面、移动和主机也是。记住 C++ 和 GDScript 在每个目标上都能跑,而 C# 除了网页之外处处受支持。
继续探索
用 Summer Engine 创作的更多方式
AI 游戏制作器
用语言描述就能制作完整 2D 和 3D 游戏的中心。
打开Make a game from a picture and the idea it holds
Bring a picture and Summer Engine builds a game inspired by its look and concept: scenes, gameplay, and matching art in one project you own.
打开Port a 3DS game by rebuilding it, not converting it
Porting a 3DS game means rebuilding a game you own as a new project that runs on platforms that still sell games. There is no file converter for this.
打开Port a Nintendo DS game to platforms that still sell games
A Nintendo DS port is a rebuild of a game you own. The stylus design is the asset worth keeping, because touch is native on every phone.
打开Port a Wii game and decide what happens to motion control
Porting a Wii game means rebuilding a title you own for hardware without a Wii Remote. The pointer and the motion gestures need a new input design.
打开Port a Wii U game off the smallest console audience
Porting a Wii U game means rebuilding a title you own for platforms with a single screen. The GamePad layer is the part that has to be redesigned.
打开Port a PSP game and give it a second analog stick
Porting a PSP game means rebuilding a title you own. The camera design is the biggest change, because the PSP had one analog nub and no right stick.
打开Port a PS Vita game before the platform disappears entirely
Porting a PS Vita game means rebuilding a title you own. The rear touch pad is the one input with no modern equivalent.
打开Port a GameCube game from 480p to a modern project
Porting a GameCube game means rebuilding a title you own. The analog triggers and fixed camera design are the parts that need deliberate decisions.
打开平台游戏模板
从现成的项目开始,描述你想要的改动即可。
浏览浏览所有游戏模板
从现成的项目开始,描述你想要的改动即可。
浏览