PDA

View Full Version : Pocket Physics v0.6



wraggster
March 15th, 2008, 20:37
News/release from Oxtob (http://forum.gbadev.org/viewtopic.php?t=14712&start=270&sid=7dec003f2302b237476687e94f1f578b)


I really like the idea of the popular mini game Crayon Physics: You draw an object on the screen and it instantly becomes physical and interacts with other objects. The first thing that sprung to my mind when seeing it was "This would be awesome on the DS!" And Pocket Physics is what I came up with after two weeks. It isn't really a game, but more of a physical construction kit for your pocket. You can design scenes freely by drawing things with the stylus. Things can be solid, like ramps and floors, or dynamic, like balls or boxes. Like in The Incredible Machine, you can reset the scene, change it, and start the simulation again. It's even more fun if you have a DS Motion, which can be used to control gravity!


This version was quite a lot of debugging work, but I'm really satistied with the result. There's good and bad news about the changes.
I'll tell you the bad news first:

There are no new features, except for deleting sketches.

Many of your existing sketches will no longer load in this version and if they do they will behave differently. This is due to changed in the new version of Box2D and also due to my optimizations. If you want to "rescue" a sketch, open the pp file in a text editor and check that all boxes are at least 6 pixels wide and that there are no extremely small or thin polygon shapes in there.

The PP file format has changed because I introduced a root node to make the XML compliant. The old files will still load, but those of you who have written parser code for websites will have to update their code.

Certain changes led to heavy objects being "restless" when lying on a flat surface.

And the good news is:

Simulation is now incredibly fast! I optimized the hell out of it and it still runs at acceptable speed with 50 circles on the screen. This is probably as fast as it will get.

Box2D now officially supports fixed point math and the DS target! Erin Catto has added the patches by Kavaler and me to the official SVN! Yay! Thanks a lot to Kavaler for his help with the fixed point port!

I fixed the "explosion" bug. In case you're interested in what caused it: I'm using the DS's hardware div and sqrt functions both in the physics and in the drawing code. Usually the physics code gets interrupted by the drawing code. Now if the physics code was just waiting for a division result while being interrupted by the graphics, the result will be overwritten by the graphics code. When execution of the physics code in continued it will read back the wrong division result, which can have dramatic consequences. This also caused a lot of randomness and probably crashes. I fixed it by remembering the division/sqrt register values at the beginning of the vblank interrupt handler and writing them back at the end. Also, because of this fix:

The randomness is gone! Everything is 100% deterministic now.

There are no more crashes! Really, I can't get it to crash any more. If you can, please show me the pp file!

Download and Give Feedback Via Comments

iofthestorm
March 15th, 2008, 22:34
This is awesome! The only bad thing about this before was the occasional crashes, and hopefully now that's a thing of the past.

mr game porter
March 15th, 2008, 22:50
i tried to get it to crash for about 15 mins. it's stabil. great update! and full speed.

aztekkid
March 15th, 2008, 23:18
very nicely done dude. i hate to say it, but this makes science fun. lol.
EDIT: not that this app is bad. i just hate science. lol

Penguinator
March 16th, 2008, 00:54
Great job!
Runs very fast indeed. And i could load my old works, too!

robman84
March 18th, 2008, 20:33
Hot dang this version is good. Seriously good. I've quite literally spent about 4 hours solid with it last night and no crashes. I just got totally hooked!

I've created a "playroom" with red borders on each wall and the following "toys" to play with: see-saw, spinning line, bucket, car, ragdoll man, a stick, some balls and blocks, a "basketball" basket and a shelf to put the toys on when you aren't using them. Your software is truly a masterpiece (well, sharing the credit with whoever else is involved!).

A suggestion might be to have the *option* of "solid" screen walls so things stay within the boundary.

adhdyoshi
March 18th, 2008, 22:15
I'm very much enjoying this, but there is one way to get it to crash...

Create a GIGANTIC blue circle then move it around while it's playing. Certain crash.

However, it's incredibly stable otherwise! And I can finally save! Thanks a million.

kurosakinaruto-
March 19th, 2008, 15:52
nope you could also get it to crash by drawing an extremely long red line

123Waffle101
March 19th, 2008, 22:52
it crashes whenever i save my sketch, and actually does not save it. i am currently using a GnM.

kurosakinaruto-
March 20th, 2008, 00:57
did u dldi patch it?

robman84
March 20th, 2008, 20:02
Actually, I have had two crashes now. As someone else said, the scrolling still works with the d-pad, but no stylus movements are registered (it has a looping sound as if I am drawing).

Jan-H
March 21st, 2008, 21:09
I love this Homebrew... It so... realistic...
Maybe someone should create a homepage for user-created sketches.

Sir_Voe
March 21st, 2008, 21:27
I love this Homebrew... It so... realistic...
Maybe someone should create a homepage for user-created sketches.

There's already these two..

www.pp.mnfu.com
www.return1.net/site/pp.

Jan-H
March 22nd, 2008, 10:30
Oh... I didn't know that... Thanks!

mafta
March 26th, 2008, 03:45
man this is a great game i could play it for hours and i already have the only thing i dont like is some of the 0.5 stuff i have done on 0.6 the outcome is different but i will just make new things but still great game

supercrusher777
July 11th, 2008, 10:47
i dldi patched it, and it dont work.

*WHENEVER I ATTEMPT TO PLAY A GAME I REALLYWANT TO PLAY IT DONT WORK!!!*

jaybud4
July 11th, 2008, 17:16
This thread was four months old. You really gotta look at the dates before you post.