English 中文(简体)
Farseer or Box2D? Top-down shooter physics implementation
原标题:

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

最佳回答

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 :-)

问题回答

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

I definitely suggest using Farseer, it has been in development for long (>3 years) and I think its major flaws have been corrected.





相关问题
copying a texture in xna into another texture

I am loading a Texture2D that contains multiple sprite textures. I would like to pull the individual textures out when I load the initial Texture to store into separate Texture2D objects, but can t ...

XNA Antialias question!

I ve got problems with XNA and antialiasing. I can activate it using graphics.PreferMultiSampling = true; graphics.ApplyChanges(); however - it s only 2x antialiasing. Even if I set ...

Take screen shot in XNA

How can I take a screen shot of the screen in XNA? Is it possible without System.Drawing.Graphics.CopyFromScreen or Win32API? If it s not possible, Is there any way to draw a System.Drawing.Bitmap to ...

XNA .Fbx textures

I m using the standard .fbx importer with custom shaders in XNA. The .fbx model is UV wrapped properly and is textured appropriately when I use BasicEffect. However when I use my custom effect I have ...

Can t install XNA

I m trying to install XNA. When the installation starts I got an error that says "XNA GSE 1.0 refresh requires Visual C# 2005 express edition sp1..." I use Windows 7 and I have Visual Studio 2008 &...

Is there a 3D equivalant to clamp in XNA?

I m building a 3D game but i only plan on using a 2D perspective thus not taking the z axis into the equasion, i want to be able to limit the movement of one of my models so it doesn t move out of the ...

Fetching the vertices from the backbuffer (HLSL) on XNA

Hello and sorry for the obscure title :} I`ll try to explain the best i can. First of all, i am new to HLSL but i understand about the pipeline and stuff that are from the fairy world. What i`m ...

Simple XNA 2d physics library

Working on a 2D project and wanted some recommendations on a simple 2d physics library for use in C# with the XNA framework. I was looking at Farseer or physics2d. Anyone have any other suggestions? ...

热门标签