如何将 Mac OSX 游戏移植到 Linux
对于移植初学者如何开始这样的项目,有专家建议吗?有任何可能有用的移植指南或资源吗?常用的战术?
我的想法是帮助游戏跨平台兼容,但我不知道如何开始。该代码是开源的(任何感兴趣的人:https://github.com/prophile/xsera)。看起来它是用 C++ 编写的,并使用 Lua 脚本。
Any expert advice on how a beginner to porting might go about starting a project like this? Any porting guides or resources that might be helpful? Commonly used tactics?
My idea is to help make a game cross-platform compatible, but I don't know how to start going about it. The code is open source (anyone interested: https://github.com/prophile/xsera). It looks like it's written in C++ and uses Lua scripting.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我打算建议使用 SDL(简单的 DirectMedia 层),它是一个很棒的跨平台开发库帮助您处理输入事件、图形、音频等的游戏。但是,看起来您要移植的游戏已经通过名为“Apollo”的游戏引擎基于 SDL,该引擎的设计目的是跨平台:
您是否尝试过联系作者询问 Linux 移植的进展情况,以及是否有什么特别的工作可以帮助您?听起来来自常见问题解答似乎正在进行一些此类努力,但您并没有这样做不想不必要地重复工作。
在假设的更困难的情况下,你只有一堆源代码,而这些源代码是在不考虑其可能的可移植性的情况下编写的,我想说,将游戏从一个平台移植到另一个平台往往是一个读取源代码的迭代过程并不断地刺激它,直到它完成您想要的操作,包括:
...最好是一开始就尝试获取一些东西 工作,这意味着甚至要建立一个基本的构建系统,等等。
然而,由于原作者显然希望将这款游戏移植到 Linux 上,所以它应该比这容易得多 - 容易程度很大程度上取决于您的经验和对掌握您不了解的系统的热情。
I was going to suggest using SDL (the Simple DirectMedia Layer), which is a great cross-platform library for developing games that helps you with input events, graphics, audio, etc. However, it looks as if the game you're porting is already based on SDL via a game engine called "Apollo", which is designed to be cross-platform:
Have you tried contacting the authors to ask about the progress of a Linux port, and whether there's something in particular you can work on to help? It sounds from the FAQ as if there is some such effort under way, and you don't want to be duplicating effort needlessly.
In a hypothetical more difficult case, where you just have a pile of source code that was written with no eye on its possible portability, I'd say that porting a game from one platform to another tends to be an iterative process of reading the source and prodding at it until it does what you want, involving:
#ifdef
ing out parts that you won't need right at the moment... and it's best if you at first try to just get something to work, which means putting even a basic build system in place, and so on.
However, since the original authors clearly intend this game to portable to Linux, it's should be much easier than that - how easy largely depends on your experience and enthusiasm for getting to grips with systems that you don't know.