Box2D Forums

It is currently Sat May 18, 2013 8:12 pm

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 57 posts ]  Go to page 1, 2, 3, 4, 5, 6  Next
Author Message
 Post subject: Box2D Nintendo DS
PostPosted: Sat Nov 24, 2007 10:10 am 
Offline

Joined: Sat Nov 24, 2007 10:07 am
Posts: 1
I've been playing with Box2d for a while on the DS. Up until now, using the floating point emulation code in the compiler.

This week, I sat down and wrote a FixedPoint Floating point class, which I now use instead of float's in the engine.

The good news is that the I have successfully gotten a large number of objects to be simulated at 30fps.

Anyway if anyone needs help for the FixedPoint Floating point class, let me know and I can share the code.



Phil


Top
 Profile  
 
 Post subject: Re: Box2D Nintendo DS
PostPosted: Tue Nov 27, 2007 10:34 am 
Offline

Joined: Sun Sep 23, 2007 2:35 pm
Posts: 803
I was actually thinking of putting together a J2ME/Android version of Box2D, which would require some fixed point stuff, so I would definitely be curious to see your code. Unfortunately with Java on phones, it tends to be necessary to inline all fixed point stuff to have any shot at it running well, however I was considering writing a preprocessing step to handle this instead of doing it by hand, so I'd love to take a look at your code and see if it provides a good place to start that process from.

30 fps, huh? That actually gives me a bit of hope, the DS is comparable to the coming generation of phones, apart from graphics.


Top
 Profile  
 
 Post subject: Re: Box2D Nintendo DS
PostPosted: Wed Nov 28, 2007 6:51 am 
Offline

Joined: Wed Nov 28, 2007 6:42 am
Posts: 1
filharvey wrote:
I've been playing with Box2d for a while on the DS. Up until now, using the floating point emulation code in the compiler.

This week, I sat down and wrote a FixedPoint Floating point class, which I now use instead of float's in the engine.

The good news is that the I have successfully gotten a large number of objects to be simulated at 30fps.

Anyway if anyone needs help for the FixedPoint Floating point class, let me know and I can share the code.



Phil


Hi Phil,

We are working on a casual AS3 game with Box2DFlash. We would like to port it to Nintendo DS. Could you share your "Box2DDS" code with us.
Thanks in advance!

Jozsef Trencsenyi
CEO
http://www.CasualGameStore.com
Mahjong Zodiac, Happy Melodies


Top
 Profile  
 
 Post subject: Re: Box2D Nintendo DS
PostPosted: Wed Nov 28, 2007 9:57 am 
Offline

Joined: Fri Sep 28, 2007 7:49 am
Posts: 61
You should really get in touch with the Crayon Physics author since this seems like the perfect use of Box2D on DS..


Top
 Profile  
 
 Post subject: Re: Box2D Nintendo DS
PostPosted: Sun Dec 02, 2007 4:00 am 
Offline

Joined: Wed Oct 24, 2007 12:14 pm
Posts: 38
filharvey wrote:
I've been playing with Box2d for a while on the DS. Up until now, using the floating point emulation code in the compiler.

This week, I sat down and wrote a FixedPoint Floating point class, which I now use instead of float's in the engine.

The good news is that the I have successfully gotten a large number of objects to be simulated at 30fps.

Anyway if anyone needs help for the FixedPoint Floating point class, let me know and I can share the code.



Phil


Would be really useful as I want to port Box2D to Symbian as a project to school:)

EDIT: Oh and a question...have you expirienced some overflow or low precision issues?


Last edited by Hardwire on Sun Dec 02, 2007 4:15 am, edited 2 times in total.

Top
 Profile  
 
 Post subject: Re: Box2D Nintendo DS
PostPosted: Sun Dec 02, 2007 4:12 am 
Offline

Joined: Wed Oct 24, 2007 12:14 pm
Posts: 38
ewjordan wrote:
I was actually thinking of putting together a J2ME/Android version of Box2D, which would require some fixed point stuff, so I would definitely be curious to see your code. Unfortunately with Java on phones, it tends to be necessary to inline all fixed point stuff to have any shot at it running well, however I was considering writing a preprocessing step to handle this instead of doing it by hand, so I'd love to take a look at your code and see if it provides a good place to start that process from.

30 fps, huh? That actually gives me a bit of hope, the DS is comparable to the coming generation of phones, apart from graphics.


I am playing with physics on mobile phones for some time. I implemented very simple rigid body engine in J2ME (dymix.hardwire.cz), however for some reasons I can't make it opensource (yet...I am working on a game using it and the company does not want to open it's source until the game is out). However, there are really not many things to see. My aim was to make it as fast as possible, so I didn't care about accurancy.
It uses uniform grids for broad phase, SAT for narrow phase, impulse based collision reaction (only one "iteration", so it is not iterative at all:D).
It runs on CX65 and N6600, but it's the limit.

I was really thinking about porting Box2D to J2ME before I made my engine, but from my expiriences the "average" mobil phone is currently still not able to run it.
However, if your target phones are N70 or better it will be no problem.


Top
 Profile  
 
 Post subject: Re: Box2D Nintendo DS
PostPosted: Sat Dec 22, 2007 10:42 am 
Offline

Joined: Sat Dec 22, 2007 10:35 am
Posts: 2
I too would be interested in this code for some stuff I'm playing around with.


Top
 Profile  
 
 Post subject: Re: Box2D Nintendo DS
PostPosted: Sun Dec 23, 2007 12:21 pm 
Offline

Joined: Thu Dec 06, 2007 7:36 am
Posts: 13
I also ported Box2D to the DS. The modified library (which also includes the new convex decomposition code by ewjordan) is available from here:

http://blog.dev-scene.com/0xtob/2007/12/23/box2d-for-the-ds/

I'd still be interested in your code, since it would be interesting to see how you overcame some of the problems that porting to fixed point causes.


Top
 Profile  
 
 Post subject: Re: Box2D Nintendo DS
PostPosted: Fri Jan 04, 2008 3:54 am 
Offline

Joined: Wed Jan 02, 2008 3:19 am
Posts: 67
0xtob,

I took your fixed point code and tried to apply it to the current SVN code. I may have missed some stuff though.

I took a slightly different approach in that I redefined float32 to be either float or Fixed, depending on the compile time flag TARGET_FLOAT32_IS_FIXED. The result requires minimal changes to the existing SVN code. Compile the code with -DTARGET_FLOAT32_IS_FIXED and it should workl, although I did see a ball go through a wall in CCDTest!

I'm hoping that this code, or something like it, can be permanently added to the SVN code but I don't have write permission to do it.

BTW, I don't really know C++, so I may have made some subtle errors in adapting your Fixed.{h,cpp} code to the SVN code.


Attachments:
box2d_fixed_svn_80.tgz [8.1 KiB]
Downloaded 311 times
Top
 Profile  
 
 Post subject: Re: Box2D Nintendo DS
PostPosted: Fri Jan 04, 2008 2:19 pm 
Offline

Joined: Wed Jan 02, 2008 3:19 am
Posts: 67
I have an updated version of the patch and Fixed definitions from my previous post. I also included 5 Makefiles that will build lots of stuff including float, fixed and nds versions of the library and float and fixed versions of the TestBed.


Attachments:
box2d_fixed_svn_80a.tgz [9.62 KiB]
Downloaded 398 times
Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 57 posts ]  Go to page 1, 2, 3, 4, 5, 6  Next

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group