Monthly Archive for July, 2007

Where is my as2 remoting in Flash 9?

Just great! I installed Flash 9 and was happy I could finally throw out the old Flash 8 version only to find out that I couldn’t  compile my old as2 remoting projects in Flash 9. At Adobe they were smart enough to include remoting in as3 but they totally forgot to add it for as2 as well. Checking the (Flash 9) help led me to the site where I can only download the Flash 8 remoting installer which can’t be installed for Flash 9…

Very smart Adobe! :|

Fortunately I thought of an easy way to get this problem solved; simply copy the remoting classes from Flash 8 to some other directory and set this directory as one of your default Flash 9 – as2 – classpaths. (Copying it into the default classpath with all other default classes didn’t work for me somehow.)

To make it easy for you I extracted the remoting classes and put them in a zip: as2RemotingPackage.zip

PS: I coudn’t find any info about this on the internet so either nobody ever needed it, nobody ever bothered to try and find a solution or this solution is so simple nobody ever bothered to write about it.
Anyway I bother to write about it for those of you who couldn’t find a solution or just didn’t bother to find one.

Hope this will help you… :idea:

Game Physics here I come…

Just great! After years I finally found the book I was looking for all the time…

Game Physics – Engine Development

I’m not really a book person, but when I tried to create a physics engine a while back I ran into a couple of major problems which stopped me from going on with it. I tried it a couple of times ever since but I always found myself stuck on the same problems (complicated collision detection etc.). Back then I searched for decent books to help me but there wern’t any. Either they were way too easy (coming with all kinds of crappy solutions) or way too hard (most of them all about theoretical physics).

I ran into this book by accident as I was actually looking for an all picture book with cool and stylish web design (Web design index by content).

I haven’t read any of it yet, but looking at the pics inside it is exactly what I needed :D .
I tend to read it in my vacation so you might expect some nice experiments in the near future.

For those of you who are interested:

Game Physics – Engine Development by Ian Millington
isbn: 978-0-12-369471-3

Web design index by content
isbn: 90-5768-069-6 | http://webdesignindex.org

PS: I saw this Ian dude also has a book on AI which sounds interesting too, but that something for the future. (God, where am I gonna find the time…)

Simple terrain generator experiment

Just great how easy it is to make a simple terrain generator :D

This evening I started an experiment to try and create a terrain generator (like the one in my all-time favourite SimCity2000). So far I don’t really have use for it but it might come in handy in the future.

I managed to work out the basics in just 3 to 4 hours. Now I need to find a way to get smoother edges and get rid of all the really small islands. I recon that’s gonna take a bit more work.

 I used an enterFrame event to get the animated effect. Just to see what happens.

Check the first results here:
http://labs.justgreat.nl/exp070702.htm

PS: this is the first time I used actual flash components since I don’t have a slider or spinner ready in as3; boy do those things SUCK!!! :roll:

UPDATE (2007-07-09):
I managed to remove the majority of the small (one or two px) islands by tweaking the algorithm a little. The result is now a bit more realistic.

Also I increased the max world size to 960×960 (to illustrate: SimCity2000 has a mapsize of 128×128).

Finally I added the world wrap option (because it took me just 2 minutes to add :D ).

UPDATE (2008-03-09):
Here is a short explanation of how the code works:

The general trick is to place a first pixel somewhere on the map and than check each of its neighbours to see if they need to be filled with the same “terrain-type”. You can do this by checking a random value against a fixed limit value (in this case represented by the “spread”).
When a certain pixel on the map is filled you place it in an array so you can always check if a pixel is already occupied and you can also use it to check if the maximum number of a certain type is reached (in this case represented by the “pct”).
After this whole sequence you repeat the same process for the newly generated pixels (there is your recursion). If there are no more pixels left to check and the maximum is not reached yet, you just place a new pixel somewhere on the map and start again.

I hope this will help you along.

Flash experiments

justGREAT! I organized some of my flash experiments for you to play with…

ribbon #1 (2003?)
soap (2005)
particles #1 (2005)
particles #2 (2006)
particles #3 (2006)
mouse #1 (2006)

Let me know what you think of them…

I hope to convert some older experiments in to as3 in the near future. I’ll keep you posted!

Update (2007-12-05)
I moved my experiments to a new domain and I renamed them because their numbers became too overwhelming :P
You can find these and other experiments on http://labs.justgreat.nl

I want actual sizes!

Just great! yet another weird Flash “feature”. When I tried to get the width of a rotating MovieClip I got wildly variating values. This surprised me because the MovieClip only contained exact round shape. The circle was 25 px in diameter, but when I started to trace the width in an interval I got values ranging from 25 to 35.4px.

As it turned out, the width and height of the MovieClip only represent the bounding box of the original shape (when it still had a rotation of 0). The only way to get the actual width and height of the MovieClip was to use the getBoundsmethod. This method calculates the boundingbox according to the current shape and orientation of the MovieClip giving the trrue width and height.

To test this create a movieclip width a circle in it and place the code below on the first frame (I’m no fan of timeline-code but it’s ideal for testing purpose :D ).

1
2
3
4
this.onEnterFrame = function(){ 
	this._rotation += 15; 
	trace("boundingbox-width: "+(this.getBounds().xMax-this.getBounds().xMin)+"\t\twidth: "+this._width); 
}

The sample is as2 but the problem and solution are the same in as3.

I hope this helps some of you who were wondering why a 25px circel suddenly had a 35.4px width :| .




-->