如何将 Mac OSX 游戏移植到 Linux

发布于 2024-10-20 22:18:33 字数 228 浏览 0 评论 0原文

对于移植初学者如何开始这样的项目,有专家建议吗?有任何可能有用的移植指南或资源吗?常用的战术?

我的想法是帮助游戏跨平台兼容,但我不知道如何开始。该代码是开源的(任何感兴趣的人: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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

差↓一点笑了 2024-10-27 22:18:33

我打算建议使用 SDL(简单的 DirectMedia 层),它是一个很棒的跨平台开发库帮助您处理输入事件、图形、音频等的游戏。但是,看起来您要移植的游戏已经通过名为“Apollo”的游戏引擎基于 SDL,该引擎的设计目的是跨平台:

Apollo 使用 SDL 和 OpenGL 来实现图形和跨平台兼容性,这意味着任何基于 Apollo 构建的游戏都可以在 Windows、Mac OS X 和 Linux 上运行。

您是否尝试过联系作者询问 Linux 移植的进展情况,以及是否有什么特别的工作可以帮助您?听起来来自常见问题解答似乎正在进行一些此类努力,但您并没有这样做不想不必要地重复工作。

在假设的更困难的情况下,你只有一堆源代码,而这些源代码是在不考虑其可能的可移植性的情况下编写的,我想说,将游戏从一个平台移植到另一个平台往往是一个读取源代码的迭代过程并不断地刺激它,直到它完成您想要的操作,包括:

  • 理解代码的某些部分(关键部分!)
  • 尝试让它编译
  • #ifdef 去掉您不需要的部分目前
  • 用一些瘦跨平台库的低级功能替换
  • 定期提交
  • 尝试避免破坏现有支持平台上的任何内容

...最好是一开始就尝试获取一些东西 工作,这意味着甚至要建立一个基本的构建系统,等等。

然而,由于原作者显然希望将这款游戏移植到 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:

Apollo uses SDL and OpenGL for graphics and cross-platform compatibility, meaning that any game built on Apollo can run on Windows, Mac OS X, and Linux.

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:

  • Understanding some part of the code (the crucial bit!)
  • Trying to get it to compile
  • #ifdefing out parts that you won't need right at the moment
  • Replacing low-level functionality with that from some thin cross-platform library
  • Committing regularly
  • Trying to avoid breaking anything on the existing supported platform

... 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文