Farseer 还是 Box2D?自上而下的射击游戏物理实现
其中哪一款更适合自上而下的射击游戏?
我听说 Box2D 执行速度更快,但我也注意到它缺乏对 XNA 的更广泛的社区支持(它似乎用于 flash - 出于我不知道的原因)。
然而 Farseer 是为 XNA 构建的,并且似乎适合它并且性能非常好。在我看来,Farseer 的优势还在于它干净、易于使用的 API(而且它非常适合我的游戏引擎的结构)。然而,我担心如果我使用它,我会遇到一些缺点(子弹和高速物体?奇怪的是没有数字崩溃?)
总的来说,如果您能指出哪一个更适合 XNA/PC 开发,我将不胜感激。
我需要这个的原因:
- 它不会只用于一款自上而下的射击游戏,它旨在与游戏框架集成。
- 即使是自上而下的射击游戏,在碰撞更好、物理效果更真实的环境中也会更有吸引力——例如,你可以移动一个盒子进入掩体?
- 以像素完美的方式手动控制碰撞会太昂贵(我没有时间优化它 - 如果存在具有先进碰撞检测算法的高性能物理引擎,我也不需要它),而边界框碰撞是一种方法不切实际。
我现在应该得到你的意见吗?请说清楚并告诉我使用 Farseer 而不是 Box2D 是否犯了错误的步骤? (我必须在等待答案的同时开始工作。)
提前致谢
Which one of these would fit a top down shooter better?
I've heard that Box2D performs faster, but I've also noticed that it lacks wider community support for XNA (it rather seems to be used for flash - for a reason unknown to me).
Farseer is however built for XNA, and seems to fit it and perform pretty fine. Farseer's advantage in my opinion is also it's clean, easy to use API (also it'd fit my game-engine's structure perfectly). However I'm affraid I'll have some drawbacks if I use it (bullets and high speed bodies? strange not a number crashes?)
Overall I'd appreciate if you'd point out which one fits better XNA/PC development.
Reasons why I need this:
- It is not going to be used only in one top-down shooter, it's meant for integration with game framework.
- Even a top-down shooter would be more appealing in an environment with better collisions, realistic physics - for example you could move a box to get into cover?
- Manual control of collisions in an pixel perfect manner would be too expensive (I don't have time to optimize it - nor I need it if high-performance physics engines with advanced collision detection algorithms exist out there), whilst bounding box collision is way to unrealistic.
Do I deserve an answer with your opinion now? Please keep it straight and tell me did I make a wrong step by using Farseer instead of Box2D? (I had to start working while waiting for an answer.)
Thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
为什么在自上而下的射击游戏中使用物理库?
我认为您所需要的只是一些基本的碰撞检测/处理。
运行完整的物理模拟似乎有点过头了。
编辑:
我个人认为我会选择 Farseer,我听说过有关它的好消息,而且它似乎得到了很好的支持。关键是,对于基于参数的决策,首先需要确切地知道它将用于和不会用于什么,您对它在功能、速度和支持平台方面的期望,您对它的期望支持等等。仅仅询问“我应该为自上而下的射击游戏使用什么物理库”是不够的信息。特别是如果你稍后编辑它,说它实际上不是用于自上而下的射击游戏,而是用于游戏引擎中的一般用途:-)
Why use a physics-library in a top-down shooter ?
I think all you need is some basic collision-detection / handling.
Running a complete physics simulation seems a bit over the top.
Edit:
Personally I think I'd go for Farseer, I've heard good things about it and it seems to be well supported. The point is that for a decision based on arguments, one would first need to know exactly what it will and won't be used for, what you expect of it in terms of functionality, speed and supported platforms, what you expect in terms of support, etcetera. Just asking "What physics-lib should I use for a topdown shooter" is not enough information. Especially if you edit it later on to say it's actually not for a topdown-shooter but for general use in a game-engine :-)
我肯定会选择 Farseer(尽管我以前使用过它,所以我有偏见)。它有很多示例,甚至对 .Net Compact FX 有一些特定的优化。在内部,它基于 Box2D(是的,它是一个稍微旧的版本),但它正在积极开发,Box2D 的所有新功能都被引入。该 API 成熟、干净且比 Box2D 更易于使用。如果这一切都没有影响您,那么这应该: http: //ianqvist.blogspot.com/2010/12/benchmarking-box2d-based-physical.html
I'd go with Farseer for sure (although I've used it previously so I am biased). It has a lot of examples and even has some specific optimisations for the .Net compact FX. Internally it is based on Box2D (yes it is a slightly old build) but it is being actively developed all the newer features of Box2D are pulled across. The API is mature, clean and easier to use than Box2D. If all that doesn't sway you, then this should: http://ianqvist.blogspot.com/2010/12/benchmarking-box2d-based-physics.html
我绝对建议使用 Farseer,它已经开发了很长时间(>3 年),我认为它的主要缺陷已经得到纠正。
I definitely suggest using Farseer, it has been in development for long (>3 years) and I think its major flaws have been corrected.