Game Development Community

iTGB - Ball Physics - Accelerometer - Chipmunk Engine

by Kevin Ryan · in iTorque 2D · 08/20/2009 (1:38 am) · 27 replies

I was playing around with the chipmunk physics engine and iTGB the last few days. Here is a short not real high quality video showing it running on my iTouch.


I am mapping the accelerometer x and y values to gravity each frame. Chipmunk handles the physics and iTGB handles the rendering. Each ball is composed of two bitmaps. A base ball bitmaps that can rotate and highlight bitmap that is fairly translucent and doesn't rotate.

It was running at roughly 60 fps on my 2nd gen iTouch. I was pretty happy with the frame rate because I wasn't sure if it was going to crawl at slow fps or not.

The bottom 320x48 of the screen is running AdMob ads. AdMob was pretty easy to integrate into iTGB.

I submitted this to the App Store this evening as a free app. It was a fun little experiment and its pretty cool to watch the balls move around correctly as you tilt the iPhone this way and that.
Page «Previous 1 2
#1
08/20/2009 (1:49 am)
Sweet :)

and disturbing at the same time as that means that one of iTGBS main performance problems might its physics from what it seems if I interpret this right
#2
08/20/2009 (2:00 am)
WOoooo....

Awesome !
#3
08/21/2009 (1:35 pm)
iTGB does have a lot of performance problems with physics. I've ended up going through the engine and disabling 99% of the physics calls for a project I'm doing, then wrote custom very math-light 'fake physics' for the objects that needed them.

Kevin, any chance of getting a code drop for Chipmunk in iTGB? This would be incredible for the community. I've personally got a number of physics-driven games that I've had to put on the back-burner because the physics engine needed some heavy tweaking / changing. I'm sure many people here would love you very much for it - like by sending you cases of beer and hammocks of cake.
#4
08/21/2009 (2:37 pm)
This is awesome!
Yes, I would love to be able to integrate chipmunk in my games.
is Admob pays by impressions or ppc?
Can't wait to download your app and check it out.
#5
08/21/2009 (3:21 pm)
Cool stuff. iT2D really flies with Chipmunk! Put me on the resource wish list :)

@Eyal: I've read Admob is PwP (Pay with Peanuts) :P
#6
08/21/2009 (3:29 pm)
that's funny :)
Are there any ad networks that pays per impression?
I'm thinking about releasing my next .99 peanut iPhone game as free with ads.
In theory, I only need to make about .70 peant from each user to be a happy monkey. I wonder if it's possible.
#7
08/21/2009 (3:31 pm)
we need a resource for this .. .
#8
08/22/2009 (12:06 pm)
I'll see if I can get together some sort of resource.
#9
08/22/2009 (12:59 pm)
Very cool, two more months and I should have time for iT(whatever it's called now). Also add me to the resource wish list. Think of the puppies Kevin :)
#10
08/22/2009 (1:26 pm)
@Eyal Erez: definitely. not initially but over time they offer a great opportunity for income.
I actually considered a twin model ... free with adds and one with fees without adds ...

And I agree, a resource for this or move of iTGBs physic to chipmunk to replace the long term trouble maker would be a great thing given that the chipmunk license would allow it, that would be a win win for all in the end as it means less maintenance work as chipmunk, unlike TGBs physics and collision, works (I know that might sound hard but we all know that the physics and collision side was a weak thing in TGB since day one and always had problems between small and completely game breaking so the opportunity that there is one for the iphone that does the job better should be seen as a chance to improve iTGB, not as a "master critics" against the system present)
#11
08/22/2009 (7:22 pm)
The dual-release model has worked for some. Annoying free version, or quiet paid version. It seems to sell some quiet versions :)

I agree that the current physics model should be removed. Defaulting to the friendly Chipmunk (licence-wise) won't harm the games. All we need then is a compile-time option to completely remove networking ;)
#12
08/22/2009 (11:27 pm)
I would love to try the dual model. What r the options as far as ad networks? Can u guys name other services besides admob?
As far as chipmunk ... Sign me up.
#13
08/23/2009 (5:56 am)
AdWhirl SDK lets you use anything *but* AdMob - they're still working on a solution to that.

*tries to slip a second vote for a Chipmunk resource in*
#14
08/23/2009 (11:15 am)
Yes I'd very much like to see chipmunk physics integrated into iTGB. Anything we can do to lower the iTGB usage of the primary CPU would be a good thing. It's very hard to put much game "intelligence" because there isn't much cpu left for game logic after iTGB's engine's usage.
#15
08/24/2009 (1:37 am)
I just want to make it clear that what I have running is not anything close to a true integration of Chipmunk with iTGB, but more like tacking it onto the side of iTGB (with duct tape). It accomplished what I wanted in seeing what the performance would be having chipmunk running with iTGB and also is set up so that I can ship a game with it if I want. Basically I'm hooking into the code base a certain points to let chipmunk run the physics and then using those values to let iTGB handle and display the sprites.
#16
08/24/2009 (2:19 am)
Last fall, another developer and I were actually working on implementing Chipmunk into regular Torque2D. We ended up stopping before we were done due to some other work coming along (and this was just for us), however we determined that replacing the Torque physics engine was a bad solution. What we actually ended up starting to implement was the ability to use one physics engine or the other for your scene. The fact that you also came to a similar conclusion makes me think it's the right one. So sounds like Chipmunk should have a side by side integration, then allow the developer to choose Chupmunk or Legacy physics engines. I would also vote this make it into the official head.
#17
08/24/2009 (12:53 pm)
I'm guessing there's room for someone to make some money on this if they did a downloadable content pack for something like $19.99 or so. I'd easily pay $20 if I could download it and do a simple switch flip and have my FPS go up 30-50%. Ideally GG would do it for free, but if someone did it and put it up for sale like the cart kit etc I'd purchase it in a heartbeat.

I'd pay significantly more if it was tightly integrated into iTGB.
#18
08/24/2009 (7:26 pm)
I second Bret's idea, as I would easily pay for a decent increase in performance.

However, I'm concerned about this place mutating into a Add-On/Plug-In Store with everyone selling their code snippets and tips/tricks. We've all appreciated the efforts and input that everyone here in the community has provided, and there are a few notable individuals who do deserve the extra padding in the wallet, but I've yet to see my TGB+TGB Pro+iTGB investment be paid off (Archangel is selling, but not well enough yet, and it's only a few weeks old...)
#19
08/25/2009 (10:40 am)
someone already integrated the Box2D physics engine into regular Torque2D (allows you to choose if you want to use Box2D or Torque as well) - haven't really looked much into it to see what it would take to get it working on the iPhone.
#20
08/25/2009 (2:11 pm)
BeyondtheTech: If you hope for the big bang or short time pay back, then that won't happen.
The majority of users start to see the real payback over time, the larger the portfolio gets and the larger the word on their games spread. Even with the iPhone around only a very small amount of devs see "fast bucks"
Page «Previous 1 2