Box2d - Need to know
by Hitesh Patel · in iTorque 2D · 12/09/2011 (3:52 am) · 51 replies
First of all iTGB has been great. I created 2 games with it and found it really easy to use. But as mentioned by numerous other users there are some limitations which stops me from producing games with better physics. I have seen all threads about how to integrate Box2d in to TGB but nothing about seemless integration in iTGB.
Its been quite a while since the talks about this have been going on. Now I am at a stage where I need to know if this is ever going to happen. I am working on a project which needs a better physics engine in-built. I agree that iTGB is the only one which gives you access to the source code but honestly I dont htink I need that functionlaity. The other engines like Corona SDK dont give access to the source code but the enigne is really powerful and performs better.
I would really appreciate if someone could point me to a resource specifically written for implementing Box2d in iTG and that works 100% or if GG can give any indication if this will be integrated in the engine. If not then I think I will need to start spending some more time learning Corona SDK, I have been through a few tutorials/docs and it seems really powerful.
Its been quite a while since the talks about this have been going on. Now I am at a stage where I need to know if this is ever going to happen. I am working on a project which needs a better physics engine in-built. I agree that iTGB is the only one which gives you access to the source code but honestly I dont htink I need that functionlaity. The other engines like Corona SDK dont give access to the source code but the enigne is really powerful and performs better.
I would really appreciate if someone could point me to a resource specifically written for implementing Box2d in iTG and that works 100% or if GG can give any indication if this will be integrated in the engine. If not then I think I will need to start spending some more time learning Corona SDK, I have been through a few tutorials/docs and it seems really powerful.
#22
03/03/2012 (6:16 am)
Agree with Johnny. I'd love to be abel to build the one game and then press a button and generate a binary for the different platforms :)
#23
Has Apple approved Cannibal Cookout yet?
03/03/2012 (6:23 am)
@Scott - I just finished porting Are You Quick Enough to the Nook and Fire. Took quite a long time but its done. I'm going through the submission process now. If you decide to put games on those platforms I can help out with a few things that I learned.Has Apple approved Cannibal Cookout yet?
#24
Cannibal Cookout was finally approved by Apple - it was the optimisation settings that caused the crashes. Since then we've soft launched in Australia, Canada and New Zealand - I'm glad we did as we totally mis-understood the flurry event system!
If you would like an early preview (the app is free), or anyone else reading this, then let me know and I'll post a promo code - the codes are valid for all stores and allow access even though the app isn't live on that particular store.
03/03/2012 (6:41 am)
@Johnny, I'll certainly be interested in porting if we can get the sort of traction that Are You Quick Enough got.Cannibal Cookout was finally approved by Apple - it was the optimisation settings that caused the crashes. Since then we've soft launched in Australia, Canada and New Zealand - I'm glad we did as we totally mis-understood the flurry event system!
If you would like an early preview (the app is free), or anyone else reading this, then let me know and I'll post a promo code - the codes are valid for all stores and allow access even though the app isn't live on that particular store.
#25
The main technical hurdle is the architecture. As evident from my previous post, we are making heavy modifications to the engine. Before we can pile on more code, we have to put effort into fixing underlying issues that affect the longevity of the engine. Replacing the physics, writing a better memory architecture, implementing batched rendering, are all things that will ensure the engine will live longer and support more platforms.
03/03/2012 (7:15 am)
@Johnny - I recently had a change of heart regarding Android. After all the posts in this forum and talking to the other guys at GG, I am not as dismissive of the platform. I still have more interest in iOS than Android, but that's just on a personal level. However, the demand is undeniable and the numbers do not lie. I believe most everyone at GG wants our 2D tech to run on Android. It's just a matter of allocating enough resources to make it happen. QA will still be a very demanding, considering how many device variants there are. While our 2D tech is getting the biggest push it has ever had, we are still a small team. The main technical hurdle is the architecture. As evident from my previous post, we are making heavy modifications to the engine. Before we can pile on more code, we have to put effort into fixing underlying issues that affect the longevity of the engine. Replacing the physics, writing a better memory architecture, implementing batched rendering, are all things that will ensure the engine will live longer and support more platforms.
#26
@Michael - That was a very insightful post. I agree with you 100% and I'm very excited about it2d's future.
03/03/2012 (12:48 pm)
@Scott - Seems its close to getting a US release. I'll wait because I want to contribute to the success of the launch. Thanks for the promo code offer. Also look forward to a postmortem blog :)@Michael - That was a very insightful post. I agree with you 100% and I'm very excited about it2d's future.
#27
03/09/2012 (12:49 pm)
Anyone who can join us for Community Hour in our IRC channel next week will be privy to some very revealing tech specs and performance stats.
#28
It will definitely be significantly less ugly to maintain that technology than trying to keep iT2D and aT2D in sync, given that already keeping the trivial platforms (Win/OSX and iOS, which at least all run fully on native code) has been proofen to be close to impossible
03/15/2012 (9:56 am)
I brought this up before and I hope you guys don't mind me bringing it up again: Why waste the time doing iT2D and a seperate aT2D if you could build T2D on top of marmelade (I called it mT2D back then as a letter joke) and target both + RIM / Playbook + WebOS + KindleFire + Symbian (+ win + osx) from a single basically unified codebase and have an integrate emulator that allows your Windows and your OSX customers to test and develop? ( actually I considered contacting you guys on that to potentially work out a way to do this for myself, be it for fun or to really get it going)It will definitely be significantly less ugly to maintain that technology than trying to keep iT2D and aT2D in sync, given that already keeping the trivial platforms (Win/OSX and iOS, which at least all run fully on native code) has been proofen to be close to impossible
#29
@All - Back on topic, I will be posting performance stats and tech info on the following scenarios:
T2D scene running 500 active objects with physics cranked up
T2D scene running a tilemap with 56,000 animated tiles
iT2D scene running 1,000 active objects with physics cranked up (running on iPad)
iT2D scene running 1,000 active objects, with a 56,000 animated tilemap (about 5,600 on screen at once, running on an iPad)
For those of you who have used the two 2D engines, take a moment to think about how those levels would run on the current systems. You'll be shocked when I post our results.
03/16/2012 (6:58 am)
@Marc - I think unifying the 2D tech is the way to go this year. The choice is not up to me, since it crosses into business and licensing. However, we could unify both engines at the tech level in less than a week. I will continue to push for it.@All - Back on topic, I will be posting performance stats and tech info on the following scenarios:
T2D scene running 500 active objects with physics cranked up
T2D scene running a tilemap with 56,000 animated tiles
iT2D scene running 1,000 active objects with physics cranked up (running on iPad)
iT2D scene running 1,000 active objects, with a 56,000 animated tilemap (about 5,600 on screen at once, running on an iPad)
For those of you who have used the two 2D engines, take a moment to think about how those levels would run on the current systems. You'll be shocked when I post our results.
#30
03/16/2012 (11:38 am)
@Michael, you got a "new iPad" ;-)
#31
03/16/2012 (11:39 am)
Seriously, those figures would be truly amazing on an iPad 1, can't wait :)
#32
Torque 2D (PC) rendering 500 sprites with Box 2D physics turned on:

Torque 2D (PC) rendering a tilemap with 56,000 animated tiles:

iTorque 2D (iPad 2) running 1,000 sprites with Box 2D physics turned on:

*iTorque 2D (iPad 2) running 1,000 sprites and a tile map with 56,000 animated tiles:

*Only 5,600 of the tiles are visible in that camera view. That means 10 times the amount of visible tiles are being culled out properly.
03/16/2012 (12:11 pm)
I'll be talking about this more heavily in the IRC channel today, but for those of you who cannot be there I will just leave these images here. They kind of speak for themselves:Torque 2D (PC) rendering 500 sprites with Box 2D physics turned on:

Torque 2D (PC) rendering a tilemap with 56,000 animated tiles:

iTorque 2D (iPad 2) running 1,000 sprites with Box 2D physics turned on:

*iTorque 2D (iPad 2) running 1,000 sprites and a tile map with 56,000 animated tiles:
*Only 5,600 of the tiles are visible in that camera view. That means 10 times the amount of visible tiles are being culled out properly.
#33
03/16/2012 (12:12 pm)
Take some time to look at the debug banner to see FPS, draw calls, texture flushes, etc.
#34
03/17/2012 (10:07 am)
Hm, expected some kind of reaction out of posting these screen shots. Either the e-mail notification broke right when I posted or you guys were just kidding about wanting Box 2D.
#35
Can you share the figures that were discussed on the IRC, perhaps start a new thread?
Me, I can't wait to get my hands on it :)
03/17/2012 (12:01 pm)
@Michael, it's possible not everybody realises the implication for box2d in the Torque engine?Can you share the figures that were discussed on the IRC, perhaps start a new thread?
Me, I can't wait to get my hands on it :)
#36
Performance is good but for me, stability, good features, and getting tech early are higher on the priority list than performance. Torque members seem to be doing fine with performance on their games.
Also my excitement was when Melv May showed the tech demo of this (without numbers) over a year ago!
Tech is great but what's important is what you can create with it and how easy it is to do it and iT2d has always excelled at that. If people see that truck level... now that's exciting.
03/17/2012 (12:06 pm)
@Michael - this is great news but since you didn't give a date when this will be available, it's hard to get excited. iPad 3 just came out and who knows what Apple comes out next, the point is in the iphone world, things move fast and we've been waiting for box2d for a very long time. Again still great news, but can you give us an ETA when this will come out for iOS and hopefully a stable version.Performance is good but for me, stability, good features, and getting tech early are higher on the priority list than performance. Torque members seem to be doing fine with performance on their games.
Also my excitement was when Melv May showed the tech demo of this (without numbers) over a year ago!
Tech is great but what's important is what you can create with it and how easy it is to do it and iT2d has always excelled at that. If people see that truck level... now that's exciting.
#37
With 1,000 static sprites, the game ran at a capped 60 FPS (can't run any faster on iOS). Number of triangles to render was 2002 triangles (+2 is for the background). The number of triangles in a single draw call was 2000, which meant there were only 2 draw calls. In iTorque 2D 1.5 there would be 2,002 draw calls and this would run at less than 1fps.
Then, we added a tile-layer of 1000x56 tiles (5600 on screen at any one time) but 56,000 in total. The tile-layer is moving left so it shows culling 10% of the tiles for rendering. Total of 13,314 triangles on-screen (the extra are because slightly more than 5600 tiles are being rendered due to it scrolling). This causes 3 draw calls. It runs at
27 FPS (It actually increasing the size of the tiles even slightly causes it to shoot back up to the capped 60 FPS). In stock iTorque 2D v1.5, this would not even load...much less render or update.
You can get more stats when you look at the debug banner. It talks about FPS, draw calls, triangles, texture flushes, etc.
03/17/2012 (12:18 pm)
@Scott - Here are some numbers for the iPad screens:With 1,000 static sprites, the game ran at a capped 60 FPS (can't run any faster on iOS). Number of triangles to render was 2002 triangles (+2 is for the background). The number of triangles in a single draw call was 2000, which meant there were only 2 draw calls. In iTorque 2D 1.5 there would be 2,002 draw calls and this would run at less than 1fps.
Then, we added a tile-layer of 1000x56 tiles (5600 on screen at any one time) but 56,000 in total. The tile-layer is moving left so it shows culling 10% of the tiles for rendering. Total of 13,314 triangles on-screen (the extra are because slightly more than 5600 tiles are being rendered due to it scrolling). This causes 3 draw calls. It runs at
27 FPS (It actually increasing the size of the tiles even slightly causes it to shoot back up to the capped 60 FPS). In stock iTorque 2D v1.5, this would not even load...much less render or update.
You can get more stats when you look at the debug banner. It talks about FPS, draw calls, triangles, texture flushes, etc.
#38
03/17/2012 (12:24 pm)
@Johnny - I think your comment is fair and warranted. I do not have a date to provide, but I think it is safe to say it is within months (less than 5). We have two releases to get out the door before we destabilize our repository trunk with Melv's code. The main delay is the task of updating the editor. Some tools we have to rewrite from scratch, mainly the tilemap tool since the old tile map system has been replaced completely. Others include the collision editor, the entire physics/collision rollout and the camera tool.Quote:. . .stability, good features, and getting tech early are higher on the priority list than performanceThe good news is that you get one for free by doing the other. My meaning is that in order to implement a proper Box 2D solution, Melv had to scrap a lot of broken and hacked code. The entire engine is a lot more stable because we have eliminated several deficiencies to make sure Box 2D worked.
Quote:Also my excitement was when Melv May showed the tech demo of this (without numbers) over a year ago. If people see that truck level... now that's exciting.That's a good idea. I'll see what I can do.
#39
03/17/2012 (12:26 pm)
@Michael - Thanks for the update. Performance do look great though, maybe I can support iphone 3g and ipod 2g again. :)
#40
03/17/2012 (12:28 pm)
@Michael, those figures are excellent. Congrats to everybody at Torque on pulling this together!
Torque Owner Johnny Vo