1 0 Archive | Open Source RSS feed for this section

WCK vs NAPE

Update:  The NAPE demo is updated for rotation as pointed out by a reader. However, I see that it made no difference to the benchmark. Let me know, how it works for you guys.

I don’t like to deliver useless speeches on current affairs and by that I definitely mean the Flash death fiasco that spawned a while back. Adobe announced that that they were making Alchemy a commercial product that rang my ears because we were using Alchemy in a project and it’s about to go into production. Adobe announced recently that older Alchemy products will not work in Flash Player 11.2+. This was definitely a painful decision to make but we had to look for alternatives, e.g. Apparat, Haxe etc.

I searched for alternatives to WCK and stumbled upon NAPE in the next search. It was surprising how many good reports I saw about Nape and the absence of a native Flash Physics engine. I know about APE but it’s outdated and isn’t in active development any more. I had to test NAPE before I could make a decision. So, I searched for a test and I found this. The test is good and shows the comparison between WCK and NAPE on Desktops and Mobile platforms. However, there is one thing missing from this test that I had to test myself. For 2D accelerated APIs, I had Starling and ND2D in the contender list but I chose the former for its better API. I’ll check Starling later as well. The test below was originally posted on ND2D site but doesn’t work anymore. I recreated it to work on current FP11 releases. For now, check out the two demos:

 

 

 

 

 

 

 

 

 

 

 

 

To test these demos, you must be on FP11.1 for WCK. FP11.2+ will not run WCK or any Alchemy SWF, so if you get a blank screen, it’s definitely because you’re running FP11.2. For me the results of these demos are somewhat strange. The demo has 1000 balls in it. The Machine I am running these demos on:

Processor: Intel Core i5 2500k 4.6Ghz
RAM: 16GB DDR3 1833Mhz RAM
GPU: GTX 560 Ti DF 1GHz 1280MB

WCK:

FPS:  Initial 25-26, Settling 33-36, Settled 52-60 (Note:  Messing with the settled balls brings the FPS down to 35FPS for 3-6 seconds)
Memory: Initial 23-28MB, Minimum 22MB, Maximum 36MB
GPU Load: Initial 12%, Movement 3%, Settled 26%
GPU Memory: 286MB
SWF Size: 361KB

NAPE:

FPS:   Initial 35-40, Settling 52-53, Settled 60 (Note:  Messing with the settled balls keeps the FPS at 60FPS, which is amazing)
Memory: Initial 15-16.1MB, Minimum 15MB, Maximum 33.4MB
GPU Load: Initial 1-3%, Movement 12%, Settled 26%
GPU Memory: 268MB
SWF Size: 309KB

NAPE is the definite winner. You may download the sources for yourself and test the demos. I’d be glad to know results in different browsers from users or mobile machines.

WCK Sources
NAPE Sources

Read full story »

PaperSteer Works

Throughout this time, I’ve been working on porting Opensteer to flash, I’ve learned so much about technologies.  This project gave me a lot of insight into the flash low level techniques. I left the project midway, but I’ve seen that people have always been interested in using it on flash. However, I felt that Flash does not have the proper “horse power” and “ability” to render Opensteer properly. I was wrong. Flash does a great job but needs proper drawing acceleration.

Papervision3D helped me a lot too. At first, I created a pure ActionScript 3 project, which didn’t even have an example. But now, I’ve almost completely ported the whole opensteer library to Actionscript 3. I did this because I’m waiting for the next Flash player ;) . More on that later.

For now, I’ve finished work on AS3Steer and I won’t be working on it anymore. Papersteer will be the only thing, I’ll be updating in the future.  I’ve uploaded massive updates to the papersteer google code repo. So do check it out. Here are some examples and a demo of Papersteer as well ;) .

Click to Focus then Press TAB to change demos. Press C to change camera views. Press A to toggle Annotation. Press F to change frame rates.

Here’s a demo of the AS3 branch, click on the image to load it:

Here’s a demo of a Predator and Fish, click to view:

Download PaperSteer here. AS3Steer here, (example1,example2). Alternatively, you can just head over to the repository to download and compile all of them yourself.

Read full story »

Filled Disk/Circle with TriangleFan in Papervision3D

Hey guys,

It has been so long since I wrote a technical or programming post. One reason is that I am busy with an awesome social game project at the company I’m working with right now, White Rabbit Online. I’m having a great time with the project but have also been working with Papersteer, more on that in another post.

While working with Papersteer, I created many solutions for the ActionScript world and I learned a lot as well. During this time, I came along a problem which required me to create filled circles using Papervision. Initially, I searched around the net and found Seb’s 3D Circle post. However, that did not solve my problem and I needed filled 3d circles/disks. I looked into Vectorvision for Pv3D as well but the absence of true 3D geometry forced me to trash that as well.

I missed TriangleFan because I’ve used in C# and other platforms. So, I went ahead and tried to simulate a TriangleFan algorithm.  It didn’t take me long and all I needed to do was create a rotated path for the common triangle vectors. Voila, see below:

Patterns? :D . Click on the snapshot below to view the original image. This one uses 500 segments to draw the circle.

There may be better ways to make this. If there are, do let me know. Download the source with demo here.

Read full story »
Page 1 of 612345...Last »