Box2D Forums

It is currently Mon May 20, 2013 9:54 pm

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Fri Dec 17, 2010 1:42 pm 
Offline

Joined: Tue Nov 09, 2010 1:26 am
Posts: 92
I'd really love to see someone's implementation of WCK in Flash Builder. I've just hit a ceiling in the IDE where Flash will not compile my file as the overhead is too much for it to be troubled to handle. This is the error I am getting http://flashvoodoo.blogspot.com/2008/02/errors-5003-5005.html I had never seen that before today after using Flash for almost 6 years.

I've been racking my brain on how to segment things to delay some of the load. The only one that I have at this time that I feel would help is loading the art assets at runtime based on a component property in a "world" that corresponds to the art asset's export class in another swf. I'd just pop the visuals into the file, then probably run create

I'd love to load certain box2d items separately, but as far as I can tell, I have to pay the Box2d (CLibInit) price of admission in every file that would relate to that system. My CLibInit call is currently at 582,058 and has been relatively constant at that size for a few weeks despite the size of my game world system has increased around it considerably.

I could really use the help figuring out anything I can do minimize my file size or load things in a smarter manner.

Thanks.

UPDATE: I found this tip to increase the heap size of the JVM for the IDE which helped to fix the no-compile issue. It also reduced my compile time, so I would make the recommendation to you guys that you check it out as well. I'd still love to see the workflow for Eclipse-based WCK work and any optimizations tips


Top
 Profile  
 
PostPosted: Mon Dec 20, 2010 4:51 pm 
Offline

Joined: Fri Dec 14, 2007 8:07 pm
Posts: 913
I had to do exactly that (increase the heap size for the JVM) a couple months ago. Despite essentially having a project larger than vanilla flash can apparently compile, my final SWF is still only 2.8 MB. That's like the size of a large image. This is why I haven't bothered looking seriously into the "load assets separately" problem.

I suppose you could implement the ShapeBase class and build some asset loading logic into that. ShapeBase is a placeholder class that extends BodyShape and all the shapes.* classes extend. You can just drop a "ShapeBase.as" file into your project and Flash will compile against that rather than the placeholder. It's a way to "inject" functionality into all the core BodyShape classes. So if ShapeBase contains the core asset loading functionality and your custom symbols somehow indicate what assets they should load... that might work.


Top
 Profile  
 
PostPosted: Mon Dec 20, 2010 11:40 pm 
Offline

Joined: Tue Nov 09, 2010 1:26 am
Posts: 92
Yea, one thing I'm currently working on to help ease the size load slightly (taking a break from it as I write this) is a modification of your decompose polygon script and a runtime parser of the output to create multiple shapes as opposed to one per class definition.

It has some requirements in terms of basic organization, but in the end, here's what it does. You can draw collision shapes in a holder movieclip. When you run the script, it goes into a movieclip on a "customShapes" layer. Once inside, it iterates through all layers (skips empty ones) and traces the geometry information out along with the center point for each shape. The goal is to put this information in a component (maybe the holder movieclip) and iterate through all of the information at runtime, creating CustomShape (extends ShapeBase) classes at each the center point with each set of polygon data. I'm thinking as of right now and as I intended, all instantiated objects will be set as Static since I'm using this to build solid level geometry only.

This way a designer can go into an art rich project and work some simpler collision over top of what they've done, see the collision shapes at once, tweak as needed, then it will all work without them needing to copy and paste the information anywhere.

This is honestly my first day writing JSFL, but I'm really encouraged by what it can do.

Is there any interest in working this into WCK? I tried to invoke vanilla "Decompose Polygons.jsfl" from my script. It loads fine, but when your file, as worded, goes to get the current dom selection, for some reason it doesn't see the selection in my script, so it tells me I need to select something to work. Ultimately I have your code invoked in my routines in one file. I had to move the drawing logic anyways so I can see all of the shape previews at once in that movieclip.


Top
 Profile  
 
PostPosted: Wed Dec 22, 2010 3:37 am 
Offline

Joined: Tue Nov 09, 2010 1:26 am
Posts: 92
I finished my custom shape JSFL script/*.as stuff tonight. It's awesome and is going to provide a lot of flexibility for level geometry creation. I'll try to get it in a demo file and cleaned up in the coming weeks.

It basically lets you author custom shapes in the IDE, run a script (based of mayo's Decompose Polygon JSFL) and it will iterate through all of the shape layers of a movieclip, storing ALL of the shapes' geometry in a component property Array. That gets read in at runtime, no copy and pasting involved, and creates static level geometry (which I keep separate from the art assets so asset art designers don't get too close to the settings they should be touching).

I'd be gushing with pictures and a file, but the codebase it's in is under NDA, so I'll need to pull it out.
Stay tuned.


Top
 Profile  
 
PostPosted: Wed Dec 22, 2010 3:37 am 
Offline

Joined: Tue Nov 09, 2010 1:26 am
Posts: 92
I finished my custom shape JSFL script/*.as stuff tonight. It's awesome and is going to provide a lot of flexibility for level geometry creation. I'll try to get it in a demo file and cleaned up in the coming weeks.

It basically lets you author custom shapes in the IDE, run a script (based of mayo's Decompose Polygon JSFL) and it will iterate through all of the shape layers of a movieclip, storing ALL of the shapes' geometry in a component property Array. That gets read in at runtime, no copy and pasting involved, and creates static level geometry (which I keep separate from the art assets so asset art designers don't get too close to the settings they should be touching).

I'd be gushing with pictures and a file, but the codebase it's in is under NDA, so I'll need to pull it out.
Stay tuned.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


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