XBOX

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
BoltonBeedz
Posts: 45
Joined: Fri Dec 07, 2007 12:58 am

XBOX

Post by BoltonBeedz »

i can't seem to deploy this to the XBOX (1st time i've tried it). is there a different DLL file for XBOX? :?
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: XBOX

Post by Norbo »

Hmm, this is problematic. I haven't yet tested it (no Xbox360), so I'm not sure where the incompatibility could be. I'm heading out now to grab one (I need to do this regardless), and I'll do some research as fast as I can to see what needs to be done.

As I get everything set up on this end, could it be anything but the library itself, like the rendering system? There's most likely something that the Xbox360 doesn't much care for in the demos, if you're using them (other than just input methods).
BoltonBeedz
Posts: 45
Joined: Fri Dec 07, 2007 12:58 am

Re: XBOX

Post by BoltonBeedz »

that's ok. don't rush on my account.
now i could easily be wrong. looks to me like theres a Microsoft.Xna.FrameWork reference that is different for XBOX but it should be a case of right clicking the Project node in the Solution tree and selecting 'Create Copy of Project for Xbox 360...'
hey, i could test the file if you want to try it - its 23:20 so maybe tomorrow. cheers matey
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: XBOX

Post by Norbo »

Yup, just a problem with the references. I've gotten it running on my shiny new Xbox360; the downloads section has the new .dll.

The Xbox360 was a necessary investment for future development anyway, I was being a bit lax by not already having one. :D
BoltonBeedz
Posts: 45
Joined: Fri Dec 07, 2007 12:58 am

Re: XBOX

Post by BoltonBeedz »

that was quick. im interested, did you / could you use the create copy feature i mentioned?
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: XBOX

Post by Norbo »

Yup, though the references still had to be manually switched out. It's a pretty handy tool!
BoltonBeedz
Posts: 45
Joined: Fri Dec 07, 2007 12:58 am

Re: XBOX

Post by BoltonBeedz »

nice one. i thought that feature might be only on the game projects.
have you done any testing on XBOX since? i don't know about you but i found it soul destroying. i ran my game on the XBOX and i got 1 frame per second. i've since reorganised things: combining vertex buffers and putting the physics on a thread. i now get theoretically 60fps refreshing the screen and the physics is working at about 20fps but the 'crappy' garbage collecting ruins everything. looking at Remote Performance Monitor dump i see theres a lot of memory in BEPU. reducing the dynamic memory usage in bepu by 75% might solve the problem, who knows. how are you doing?
BoltonBeedz
Posts: 45
Joined: Fri Dec 07, 2007 12:58 am

Re: XBOX

Post by BoltonBeedz »

Forget it. i think its my fault i have some data that wasn't collected
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: XBOX

Post by Norbo »

Had me worried there! But, if you'd like, I could give you the roughly expected speed given your physics setup (number of objects, how much interaction between them , etc.)- running the demos on my xbox, there is quite a significant difference in performance.

For comparison, my Q6600 versus the Xbox360:
Pyramid (220 blocks), stable ~5 seconds after start: 40 fps vs. 7 fps
Jenga, stable ~5 seconds after start: 40-60 fps vs. 7 fps, rising to 15 before going to sleep and hitting 60
Sleep mode stress test, 1100 or so blocks: 60 fps at all times vs. 22 fps while in the air, 13-18 while hitting the ground
Broadphase stress test, 3375 blocks: 55 fps versus 10 fps initially

Less intensive simulations range from 30 to 60 fps in general on the xbox. While some of this is simply the single core of the q6600 being significantly faster than the equivalent space alotted to it on the xbox360 currently, I have yet to make a concerted effort to optimize specifically for the Xbox360, instead choosing general improvements. There's still quite a lot of room for performance increase in the future, most notably with the planned internal multithreading support.
BoltonBeedz
Posts: 45
Joined: Fri Dec 07, 2007 12:58 am

Re: XBOX

Post by BoltonBeedz »

I'll tell you what it is, right? when i call space.update() it would be ideal if it didnt allocate new memory at all. The test cases probably work alright because theres hardly any memory allocated and it rides over the GC. After researching a load i have concluded that the idea behind XNA on the XBox is to use as much memory as you need but not allocate any new memory while the game runs (at 60fps) as even the occasional small GC screws your steady framerate. This might be especially difficult to achieve with recursive algorithms but surely not imposible. I'm serious man.
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: XBOX

Post by Norbo »

Yup, I've already got such optimizations in the queue for v0.5.0.
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: XBOX

Post by Norbo »

Figured I'd pop in and provide an update- fortunately, the vast majority of the garbage seemed to originate in a very fixable location (the rapidly called collision detection algorithms). Most of the garbage was simply due to prototyping code. It's now properly working off of a resource pool and the number of garbage collections has been massively reduced. I've subsequently gotten the vast majority of the rest of the code working cleanly, except for a problem area regarding dictionaries and presumed boxing.

As of right now, the number of collections run on the PC has dropped from something like one a second or similarly horrible to closer to every 20 seconds or so; the remainder is generally due to the demos and not the library itself. I'll be polishing up the demos and trying to work out a solution for the remaining dictionary allocation in the near future.

Update: The dictionaries no longer cause issues, but there is a bit of controller allocation still going on that is proving extremely difficult to get rid of safely. Fortunately, such allocation only takes place when there are many, many collisions occuring and changing (an exploding broad phase stress test simulation, for example), and even then, it still amounts to a tiny amount- about .6% of the total with the still-unoptimized demos.
BoltonBeedz
Posts: 45
Joined: Fri Dec 07, 2007 12:58 am

Re: XBOX

Post by BoltonBeedz »

sounds like just the job :D
Post Reply