tag:blogger.com,1999:blog-90362490953619475192024-03-12T19:56:50.318-07:00YAAB - Yet Another Actionscript Blogrjehttp://www.blogger.com/profile/14584591955841728614noreply@blogger.comBlogger26125tag:blogger.com,1999:blog-9036249095361947519.post-31314554878951388862008-08-21T02:11:00.000-07:002008-08-21T03:27:51.570-07:00Remoting with BlazeDS from plain vanilla Actionscript 3 class<span style="font-family:arial;">I wanted to use BlazeDS from within my plain AS3 project (no mxml or Flex, well of course I need to use the Flex remoting and rpc classes on the client). I found a number solutions on the web, unfortunatly none of them worked. After much effort I got a example </span><span style="font-style: italic;font-family:arial;" >almost</span><span style="font-family:arial;"> working but I kept getting this error on the client:</span><br /><br /><span style="font-family:arial;">TypeError: Error #1034: Type Coercion failed: cannot convert Object@13e9921 to mx.messaging.messages.ErrorMessage. </span><br /><br /><span style="font-family:arial;">and this error on the server:</span><br /><br /><span style="font-family:arial;">No destination with id 'null' is registered with any service.</span><br /><br /><span style="font-family:arial;">Fortunally Peter Farland over at the Adobe product forums gave me a (rather obscure) solution:</span><br /><a style="font-family: arial;" href="http://www.adobeforums.com/webx/?13@618.wIQPiTpvUo4@.59b6384e/0">http://www.adobeforums.com/webx/?13@618.wIQPiTpvUo4@.59b6384e/0</a><br /><br /><span style="font-family:arial;">I thought I'd document the full solution here in case anybody else ran into the same problem.</span><br /><br /><span style="font-weight: bold;font-family:arial;font-size:130%;" >Environment</span><br /><ol><li>BlazeDS, the recommended turnkey installation (my file was blazeds_turnkey_3-0-0-544.zip)</li><li>Flex 3 SDK</li><li>Flash Develop 3</li></ol><span style="font-family:arial;">Setup</span><br /><br /><ol><li>Unzip the BlazeDS zip file and start the sample DB and then Tomcat as the standard instructions say.</li><li>Check the sample 3 in the "Take the test run", you should get a grid up with a load of camera data.</li><li>Go to the [BlazeDS install directory]\tomcat\webapps\ROOT\ and copy the crossdomain.xml file there</li><li>Now open you AS3 dev enviroment, I used Flash Develope, but Flex builder, Flash IDE or FDT will do.</li><li>Create a project and copy the Main.as source file at the end of this post as the main class.</li><li>Check the url in the code is correct for you</li><li>Run it, you should see a load of trace. In that trace there you should see the same information as when you ran example.</li></ol>My next post will be about configuring your own services and classes on the server, and maybe a more general solution...<br /><br />Files<br /><a href="http://home.planet.nl/%7Eborst595/flexexamples/Main.as.txt">Main.as</a><br /><a href="http://home.planet.nl/%7Eborst595/flexexamples/crossdomain.xml">crossdomain.xml</a><br /><br /><span style="text-decoration: underline;font-family:arial;" ><span style="font-weight: bold;"></span></span><span style="font-family:arial;"><b><a href="http://www.adobeforums.com/webx?224@@2cddb668@.59b6384e/0"><span style="font-size:100%;"><br /></span></a></b></span>rjehttp://www.blogger.com/profile/14584591955841728614noreply@blogger.com77tag:blogger.com,1999:blog-9036249095361947519.post-53180055072579284882008-02-06T11:26:00.000-08:002008-02-08T00:47:50.923-08:00glaze Physics engine code releasedWhat had a working title of pEngine is now part of the <span style="font-weight: bold;">glaze engine</span>. It now only comprises of the rigid body dynamics engine, I'm going to now slowly port over the other features such as tile support, AI, line of sight etc. I was going to wait with this release until the code was complete and I was happy - which was probably going to be never so I though I'd get it out there a see what people might make with it.<br /><br />The source is available at <a href="http://code.google.com/p/glaze/">http://code.google.com/p/glaze/</a><br /><br />The latest demos can now be found at <a href="http://home.planet.nl/%7Eborst595/glaze.html">http://home.planet.nl/~borst595/glaze.html</a><br /><br />Good luck with it, post any questions, comments of links to anything you make on the group: <a href="http://groups.google.com/group/glaze-engine">http://groups.google.com/group/glaze-engine</a>rjehttp://www.blogger.com/profile/14584591955841728614noreply@blogger.com19tag:blogger.com,1999:blog-9036249095361947519.post-28928375398129165402008-01-23T07:09:00.000-08:002008-01-23T08:05:26.716-08:00Broadphase now added...I was a little skeptical about broadphase with tightly packed bodies. After some playing around with Sweep&Sort I came up with a very efficient version that Actionscript likes. I also implemented my own inline Insertion Sort on the shape list to take advantage of spacial coherence (anybody know that the built in AS3 Array sort algorithm is?).<br /><br />Result? A bump to 425 bodies - not all that stable sometimes. The stack just disintegrates at various points sometimes - I'll have to take a look, maybe bump up the iterations of the solver...<br /><br />Find it here: <a href="http://home.planet.nl/%7Eborst595/pEngineStressDemo.swf">http://home.planet.nl/~borst595/pEngineStressDemo.swf</a><br /><br />or through the link at the bottom of the main page:<br /><br /><a href="http://home.planet.nl/%7Eborst595/pEngine.html">http://home.planet.nl/~borst595/pEngine.html</a><br /><br />Now I really need to start fixing stuff for a release rather than seeing how fast I can make it....rjehttp://www.blogger.com/profile/14584591955841728614noreply@blogger.com2tag:blogger.com,1999:blog-9036249095361947519.post-44861617810058441172008-01-16T13:43:00.001-08:002008-01-17T12:48:57.189-08:00Showing off...Same demos as the other version of pEngine, only this time demo 1 (press 4) is a tower of 246 individual blocks.<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ZIm6kXBmd1U/R489yQ2CocI/AAAAAAAABR4/7Ty_pHMPgy0/s1600-h/stack1.bmp"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://1.bp.blogspot.com/_ZIm6kXBmd1U/R489yQ2CocI/AAAAAAAABR4/7Ty_pHMPgy0/s400/stack1.bmp" alt="" id="BLOGGER_PHOTO_ID_5156408032086892994" border="0" /></a><br />Don't forget, you can aim and fire a block by clicking the left mouse button...<br /><br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ZIm6kXBmd1U/R48-NQ2CodI/AAAAAAAABSA/iggC_Hi-IZk/s1600-h/stack2.bmp"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://1.bp.blogspot.com/_ZIm6kXBmd1U/R48-NQ2CodI/AAAAAAAABSA/iggC_Hi-IZk/s400/stack2.bmp" alt="" id="BLOGGER_PHOTO_ID_5156408495943360978" border="0" /></a><br />Play here:<a href="http://home.planet.nl/%7Eborst595/pEngine246.swf">http://home.planet.nl/~borst595/pEngine246.swf</a><br /><br />A reasonably decent computer required as well as the latest flash player - <a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash">get it now!</a>rjehttp://www.blogger.com/profile/14584591955841728614noreply@blogger.com5tag:blogger.com,1999:blog-9036249095361947519.post-14101816133943923652008-01-15T01:57:00.000-08:002008-01-18T02:51:18.449-08:00New Actionsctipt 3 Physics / Game Dynamics Engine - Port of ChipmunkAfter trying to a number of ideas for my tile engine, I decided I really wanted rigid body dynamics - my existing glaze engine is really only a particle dynamics engine. The trick with rigid body dynamics is to get it stable (aka no jitter). Fortunately there is a solution for this (SI) as shown in the <a href="http://www.box2d.org/">Box2D </a>physics engine (also ported to Actionscript 3) and the <a href="http://lab.polygonal.de/2007/12/31/motor-physics-released/">Motor2</a> engine. There is also a rather elegant implementation in C called <a href="http://wiki.slembcke.net/main/published/Chipmunk">Chipmunk</a>.<br /><br />After a few marathon coding sessions I ported the bulk of the code to Actionscript 3, and once working rewrote large chunks so that it was more optimized for the AVM.<br /><br />The initial result can be seen here: <a href="http://home.planet.nl/%7Eborst595/pEngine.html">Chipmunk Port - pEngine Alpha</a><br /><br />I've still got a long way to go - I'm working a very simple API at the moment that allows you to describe a scene using tiles. I'll be updating this blog more frequently as I progress.rjehttp://www.blogger.com/profile/14584591955841728614noreply@blogger.com1tag:blogger.com,1999:blog-9036249095361947519.post-31439129454346342312007-11-30T06:42:00.000-08:002007-11-30T07:28:33.903-08:00ICKAfter some playing around with various physics engines I decided to write a Verlet/Particle Physics Construction kit. Let people play around with building things out of not-so-steady materials. Anyway after some experimentation I ended up with something that played not unlike Tower of Goo (<a href="http://www.experimentalgameplay.com/game.php?g=17">http://www.experimentalgameplay.com/game.php?g=17</a>).<br /><br />For some reason or other I decided to recreate the look and feel of Tower - mainly for the challenge of creating a native game into Flash/Actionscript.<br /><br />The result is here:<br /><br /><a href="http://www.100percentcode.com/ICK.html">http://www.100percentcode.com/ICK.html</a><br /><br />See how high you can get!<br /><br />If you like it the guys a 2D Boy are making a full games out their original - It also been entered into the IGF 2008 - good luck guys...rjehttp://www.blogger.com/profile/14584591955841728614noreply@blogger.com2tag:blogger.com,1999:blog-9036249095361947519.post-89669255901572891292007-09-26T04:39:00.000-07:002007-09-26T04:42:41.921-07:00Exile Remake UpdateThe latest demo of the engine & game can now always be found here:<br /><br /><a href="http://home.planet.nl/%7Eborst595/Exile.html">http://home.planet.nl/%7Eborst595/Exile.html</a><br /><br />Controls and Instructions can be found on the page. Its worth noting that this engine runs much faster with the latest Flash 9 Beta found here:<br /><br /><a href="http://labs.adobe.com/technologies/flashplayer9/">http://labs.adobe.com/technologies/flashplayer9/</a><br /><br />This demo is running at 30fps.rjehttp://www.blogger.com/profile/14584591955841728614noreply@blogger.com0tag:blogger.com,1999:blog-9036249095361947519.post-79873041519410829902007-09-14T07:20:00.000-07:002007-09-14T07:27:25.178-07:00More of a game...Everything is the engine can now be destroyed (not the landscape thought) - some things are just tougher than others. At the moment the turrets and some of the doors only take a few hits - for test purposes.<br /><br />Other improvements:<br /><ul><li>New Weapon system + light rocket launcher implemented.</li><li>Multi sampling between game objects (not landscape at the moment). This ensures high speed collisions always impact (the rocket should never tunnel through a door).</li><li>Massive internal restructure. The code is now halfway into its release form.</li><li>Improved Aiming<br /></li></ul><br />Additional keys:<br />1: Default blaster<br />4: Light rockets<br /><br /><a href="http://home.planet.nl/%7Eborst595/GlazeEngine.swf">Demo</a>rjehttp://www.blogger.com/profile/14584591955841728614noreply@blogger.com0tag:blogger.com,1999:blog-9036249095361947519.post-61731566867486788552007-09-11T12:59:00.001-07:002007-09-12T06:56:16.798-07:00Why am I writing this Engine?It is after all, quite distinct in its capabilities. Well the answer is a game called <a href="http://en.wikipedia.org/wiki/Exile_%28arcade_adventure%29">Exile</a>, originally written of the <a href="http://en.wikipedia.org/wiki/BBC_Micro">BBC Micro</a> in the 80's.<br /><br />I wont repeat what is already written about this game, probably the best summary is this fantastic tribute site: <a href="http://exile.acornarcade.com/">http://exile.acornarcade.com/</a><br /><br />The Game Development page is a great read.<br /><br />This engine is my attempt to re-create this game, 20 years on, in the browser.<br /><br /><a href="http://home.planet.nl/%7Eborst595/Exile.swf">Exile Engine Demo</a><br /><br />Note: This <a href="http://home.planet.nl/%7Eborst595/Exile.exe">version </a>(the .exe) uses the latest player + hardware accelerated full screen<br /><br />WASD : Thrust<br />Mouse : Aim<br />Left Click : Fire<br />R : Remember Teleport Location<br />T : Teleport to last remembered location<br />Cursor : Pan map<br /><br />There are two types of enemy turrets here. The one the surface to the right is a heat seeker, the other 3 are standard ballistics. I have plans for over 10 different ammunition types (that's the fun part to write!)rjehttp://www.blogger.com/profile/14584591955841728614noreply@blogger.com2tag:blogger.com,1999:blog-9036249095361947519.post-47797310969512943502007-09-09T06:26:00.000-07:002007-09-09T06:32:27.655-07:00Latest Demo - Large Level with doors & swich systemLatest demo is available <a href="http://home.planet.nl/%7Eborst595/Large_Level_Demo.swf">here</a>. Controls are WASD, mouse to aim, click to fire. The door and switch system are in place and working. This level is 100x100 but its been tested with 2000x2000, with a 48x48 pixel tile that's a level of 96,000 x 96,000 pixels....<br /><br />This demo, with a 100x100 level (the bitmap data is generated in code) is only 23Kbrjehttp://www.blogger.com/profile/14584591955841728614noreply@blogger.com0tag:blogger.com,1999:blog-9036249095361947519.post-18511976941220756502007-09-04T13:33:00.000-07:002007-09-05T06:54:27.387-07:00Line of sight demoI've switched track for a bit. This time working on the AI. This demo shows some line of sight testing. The code calculates 3 rays from an eye that intersect with the two limits and centre of an AABB. If the object is visible the the turret calculates a firing solution and fire. At the moment this is all done every frame (30fps). I'll spread this calculation out over a series of frames. The current enemy AI plan is:<br /><ol><li>Create a list of target candidates within range (1.5x the firing range of the turret)<br /></li><li>Prioritize list</li><li>Lock target</li><li>Check visibility</li><li>Calculate firing solution and fire.</li><li>Reload</li><li>Goto 4</li></ol><br />The controls are the same. WASD to move the player, click to fire in the direction of the mouse.<br /><br /><a href="http://home.planet.nl/%7Eborst595/SeperationAxis_LineOfSight.swf">Demo</a>rjehttp://www.blogger.com/profile/14584591955841728614noreply@blogger.com0tag:blogger.com,1999:blog-9036249095361947519.post-77397176294246669622007-09-02T13:27:00.001-07:002007-09-03T01:08:14.342-07:00Almost there...I wanted to get a version with source ready this weekend - unfortunately I didn't make that target. I did however fully incorporate the grid object cache (tested with 1000x1000 tiles), a new map definition method and a physics constraints system into the code base.<br /><br /><a href="http://home.planet.nl/%7Eborst595/SeperationAxis.swf">Demo</a>rjehttp://www.blogger.com/profile/14584591955841728614noreply@blogger.com0tag:blogger.com,1999:blog-9036249095361947519.post-62058618543751843272007-09-01T02:50:00.000-07:002007-09-01T04:38:39.336-07:00New Demo - Refactored Tile Engine + Rotating GridWhilst graphicly nothing new this demo shows the rotating grid concept in the tile engine. First I'll summarize the how the engine works with regard to level layout and design.<br /><br />The Engine itself is a Sprite that has 3 Sprite Children.<br /><ul><li>Lowest Sprite - the particle engine</li><li>Middle Sprite - the world object sprite, this contains the player, enemies, the demo 'boxes'</li><li>Top Sprite - the level itself</li></ul>I use the scrollRect method on the Engine sprite to scroll the entire display list. One of my requirements was very large levels > 1000x1000 tiles. Whilst this can be draw a series of bitmaps and displayed at once I would not recommend it: I tested a 500x100 level with 48x48 pixel bitmaps merged into 8x8 super tiles ( 576Kb bitmap ) = 63x13 super tiles = >471Mb of bitmap data. It actually did work but I would not recommend it...<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://home.planet.nl/%7Eborst595/images/memory_hog.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px;" src="http://home.planet.nl/%7Eborst595/images/memory_hog.JPG" alt="" border="0" /></a><br />Another option would have been to iterate over my map array, and use copyPixels to draw the level. This is probably the most common method of scrolling bitmap level. However, you still need to efficiently manage your Bitmap & BitmapData objects - that's where the grid comes in. In the example (link at the end of this entry), there is only ever the same 9x9 Bitmaps on the sprite ever. As the grid is rotated, the bitmap object is repositioned and its bitmapData member set to a new values based on an update. You could think of it as a recycling object cache.<br /><br /><a href="http://home.planet.nl/%7Eborst595/Scrolling_Data_Grid_Demo.swf">Demo</a>rjehttp://www.blogger.com/profile/14584591955841728614noreply@blogger.com0tag:blogger.com,1999:blog-9036249095361947519.post-21423540399079661752007-08-30T12:12:00.000-07:002007-08-30T12:58:38.065-07:002D Circular Linked List Data GridIn order to manage the visible bitmap data in the tile engine, I wrote this 2D Circular Linked List Data Grid. Once initialized the grid can hold n x n data items. The grid can be shifted left, right, up and down. As the grid is shifted, the items that fall off once side are added to the other, and automatically updated with new information. This <a href="http://home.planet.nl/%7Eborst595/DataGrid.swf">demo</a> illustrates the code. The red rectangle simulates the scroll window of the Tile Engine. The black/grey 4x4 grid represents the Bitmap Data Grid (Each smaller square would be a super tile of, say 5x5 normal tiles). As you move the red rectangle around with the cursor keys, the grid updates correspondingly. The important thing here is that there is only ever 4x4 Bitmap and BitmapData objects that get rotated around, updated and recycled.<br /><br /><a href="http://home.planet.nl/%7Eborst595/DataGrid.zip">Source.</a>rjehttp://www.blogger.com/profile/14584591955841728614noreply@blogger.com0tag:blogger.com,1999:blog-9036249095361947519.post-39492894368476927752007-08-28T06:14:00.000-07:002007-08-29T01:57:13.416-07:00Tile Engine Update v0.1Big update:<br /><ul><li>Completely new collision resolution code, much more stable.</li><li>The physics system in much more flexible, it also includes mass in the calculations now.</li><li>Projectile system improved. Projectiles die out after a certain time (with various effects). The system allows a great variety of weapons to be implemented using one class.</li><li>Projectile explosions impart force on surrounding object (you can have fun with this and the boxes)<br /></li><li>First attempt at an Enemy AI gun turret. The turret uses a ballistics solver to calculate the two angles it can hit the player with, and then fires. I'll write an entry on this, I'm going to extend this to take into account relative velocities.</li><li>The projector (.exe) version now uses the latest beta flash player.</li></ul><br />Controls (focus window first):<br /><ul><li>A,W,S,D : Thrust Player</li><li>Left Click : Fire weapon in direction on mouse cursor</li><li>CTRL Left CLick : Shoot ray</li><li>SPACE : Add non-player 'boxes' to interact with</li><li>ENTER : Add random force to boxes</li></ul>Available here as:<br /><br /><a href="http://home.planet.nl/%7Eborst595/SeperationAxis.swf">.SWF</a><br /><a href="http://home.planet.nl/%7Eborst595/Demo.exe">.EXE</a>rjehttp://www.blogger.com/profile/14584591955841728614noreply@blogger.com0tag:blogger.com,1999:blog-9036249095361947519.post-90312447127080062402007-08-27T11:20:00.000-07:002007-08-27T11:24:41.990-07:00Flash Player Beta update 9.0.60.120Get the latest and greatest at <a href="http://labs.adobe.com/technologies/flashplayer9/">http://labs.adobe.com/technologies/flashplayer9/</a><br /><br />If your looking for the debug player, grab the latest Flex 3 SDK nightly build from the bottom of this <a href="http://labs.adobe.com/technologies/flex/sdk/flex3sdk.html">page </a>(you have to check the box agreeing to the T&C)rjehttp://www.blogger.com/profile/14584591955841728614noreply@blogger.com0tag:blogger.com,1999:blog-9036249095361947519.post-63758246502375526532007-08-26T04:15:00.001-07:002007-08-26T04:24:31.018-07:00AS3 Performance Test FrameworkThis is an extension of something I found (I wish I could remember where) to quickly run performance tests in controlled, repeatable environment. To run your own tests just write a class that implements the ITests interface, see the VectorTests.as as an example. All the functions in the array returned by getRegisteredTests() will get exectued. You can change the number of iterations, test cycles etc by modifying the TestRunner.as<br /><br />Also if you do build a new test class, dont forget to change this line in TestRunner.as:<br /><br />public var tests:ITests = new BasicLoopTests();<br /><br />Replacing the BasicLoopTests() with your class name.<br /><br />The code can be found here: <a href="http://home.planet.nl/%7Eborst595/BenchmarkAS3.zip">http://home.planet.nl/%7Eborst595/BenchmarkAS3.zip</a>rjehttp://www.blogger.com/profile/14584591955841728614noreply@blogger.com0tag:blogger.com,1999:blog-9036249095361947519.post-89134223204755113122007-08-25T11:20:00.001-07:002007-08-26T06:58:32.621-07:00Tile Engine UpdateUpdate:<br /><ul><li>Particle system added<br /></li><li>Projectile system added</li></ul>The controls have changes a little:<br /><ul><li>A,W,S,D : Thrust Player</li><li>Left Click : Fire weapon in directon on mouse cursor</li><li>CTRL Left CLick : Shoot ray</li><li>SPACE : Add non-player 'boxes' to interact with</li><li>ENTER : Add random force to boxes<br /></li></ul>You can download a play the demo with the previous links. I've still not updated the source code, again its still in a bit of the mess.<br /><br />If you try it out please let me know how it performs (cpu).<br /><br />Thxrjehttp://www.blogger.com/profile/14584591955841728614noreply@blogger.com0tag:blogger.com,1999:blog-9036249095361947519.post-47185386867765192172007-08-23T11:59:00.000-07:002007-08-23T12:34:43.108-07:00AS3/N Tile Engine UpdateMajor update:<br /><ul><li>All AABB/Tile collision code done</li><li>All ray/Tile/AABB code done (see keyboard instructions below)</li><li>Scrolling! Level can be as big as you like (bound by the length of array). Because each tile in the map is only a reference to a single instance of that type the engine is very memory efficient.</li></ul>The .SWF can be downloaded <a href="http://home.planet.nl/%7Eborst595/SeperationAxis.swf">here</a>.<br /><br />The .EXE player version (incorporated the latest beta player) can be downloaded <a href="http://home.planet.nl/%7Eborst595/Demo.exe">here</a>.<br /><br />The source can be found in a previous post.<br /><br />Controls:<br /><ul><li>Cursor: Move Player</li><li>Space: Add/Reset boxes</li><li>Enter: Apply random energy to boxes</li><li>Left click: Shoot ray, intersects with tiles, affects boxes</li><li>CTRL Left click: Place move player to mouse</li></ul><br />To do:<br /><ul><li>Some serious physics engine improvements</li><li>Projectiles</li><li>AI (pathfinding, flocking etc)</li><li>Particle engine</li></ul>rjehttp://www.blogger.com/profile/14584591955841728614noreply@blogger.com2tag:blogger.com,1999:blog-9036249095361947519.post-4809400865634498302007-08-14T05:59:00.000-07:002007-08-14T06:05:21.136-07:00Tile Engine Redesign - NHaving played around with a few of my own ideas, I'm going to pursue a geometry based tile +physics engine initially based on the fabulous N tutorials found <a href="http://www.harveycartel.org/metanet/n.html">here</a>. I'm currently working on porting the tutorials to AS3, and then adding the scrolling engine on top. A zip of the current build will be available here.<br /><br /><a href="http://home.planet.nl/%7Eborst595/SeperationAxis.zip">http://home.planet.nl/%7Eborst595/SeperationAxis.zip</a>rjehttp://www.blogger.com/profile/14584591955841728614noreply@blogger.com3tag:blogger.com,1999:blog-9036249095361947519.post-3374039694568270092007-08-09T11:18:00.000-07:002007-08-29T01:56:02.018-07:00AS3 2D Tile Scroll Game Engine - Glaze EngineThis is the first <a href="http://home.planet.nl/%7Eborst595/ScrollEngine.zip">demo</a> of my new project - A 2D Tile Game Engine for AS3 - Glaze.<br /><br />Features:<br />- Unlimited level size, the level builds as you transverse it<br />- Efficient pixel perfect collision detection between tiles and game objects<br />- Basic fast physics engine for a 2D sprite world<br />- Particle engine/effects<br />- Full level editor/sprite editor thanks to Tile Studio - an open source project that provides just that.<br /><br />Planed features:<br />- Enhanced physics system (either Verlet or RK4 integrator)<br />- Line of sight functionality<br />- Common NPC AI (Pathfinding, flocking, communication)<br /><br />If anybody tries the demo please let me know how it runs (outside a browser) - I'm interested in the spec of you machine a som idea of CPU usage.rjehttp://www.blogger.com/profile/14584591955841728614noreply@blogger.com30tag:blogger.com,1999:blog-9036249095361947519.post-9084390736971897102007-07-05T12:38:00.000-07:002007-07-07T11:41:14.641-07:00V0.2.1 ReleasedTidied up a few things and started adding some better test examples. On test 3 you can now step through examples of how a real time monitored process could affect the diagram in a browser.<br /><br /><ul><li>Embedded all the correct fonts for normal, <span style="font-style: italic;">italic</span>, <span style="font-weight: bold;">bold </span>and <span style="font-weight: bold; font-style: italic;">bold italic</span></li><li>Embedded just the Latin range (reduced .swf file by a third). I'll write a entry on this.</li><li>Enabled html formatting on all the reliant items (messages, info box and columns).</li><li>Turned up font anti-aliasing to full on everything.</li></ul><br />You can find it <a href="http://home.planet.nl/%7Eborst595/">here</a>.rjehttp://www.blogger.com/profile/14584591955841728614noreply@blogger.com0tag:blogger.com,1999:blog-9036249095361947519.post-27204955207367326092007-06-28T02:22:00.000-07:002007-07-01T11:36:06.310-07:00Dynamic Sequence Diagram Viewer released<span style=";font-family:arial;font-size:100%;" >My day job is EAI/SOA design & implementation. I often run into the need to write something to monitor short/long running processes for testing or monitoring purposes. I've written a sequence diagram generator for this purpose <a href="http://rjeeai.blogspot.com/">before</a> but it suffered a number of shortcomings:<br /></span><ol style="font-family:arial;"><li><span style="font-size:100%;">It was a Java API that needed to be hosted somewhere and executed on the server</span></li><li><span style="font-size:100%;">Each time the diagram changed or the status of a message changed, the diagram needed to be regenerated. This also lead to caching problems.</span></li><li><span style="font-size:100%;">The diagram is very static.<br /></span></li></ol><span style=";font-family:arial;font-size:100%;" >To solve these issues I decided to use this project as a reason to learn Actionscript 3 and write the whole thing as a Flash Control. I'll be finishing it up over the next few weeks:<br /><br />Features:<br /></span><ol><li>Self contained .SWF file that generates sequence diagrams from and XML description.</li><li>The diagram is explorable. Mouse over items to see if any further information is available. Items can be minimized to improve readability of large diagrams.</li><li>Columns can be dragged to re-order them.</li><li>Comments can be added,dragged and linked to items.<br /></li><li>Integrates (via STOMP) with JMS message brokers to recieve diagrams and dynamic updates via queues and topics. The diagram is dynamicly updated on the users page with no further server action.<br /></li></ol><span style=";font-family:arial;font-size:100%;" >Development Environment/Tools:<br /></span><ul><li><a href="http://labs.adobe.com/technologies/flex/sdk/">Flex SDK 3 Beta</a></li><li><a href="http://www.flashdevelop.org/">Flash Develop 3 Beta</a> (highly highly recommended)<br /></li><li><a href="http://www.inkscape.org/">Inkscape</a> (for SVG icons)</li></ul>Seeing as this was developed with all open source tools, I'll also publish the source, probably on Goggle Code.<br /><br />You can find it <a href="http://home.planet.nl/%7Eborst595/">here</a>.rjehttp://www.blogger.com/profile/14584591955841728614noreply@blogger.com5tag:blogger.com,1999:blog-9036249095361947519.post-14386488456140203082007-06-21T01:50:00.000-07:002007-06-21T01:54:02.380-07:00UML ToolingI found out the other day that Enterprise Architect from <a href="http://www.sparxsystems.com.au/">Sparx</a> now supports Actionscript 3. You can - amongst other things - design your class model in it and generate Actionscript 3 code. There really seems to be some decent 3rd party tooling for AS3 these days.rjehttp://www.blogger.com/profile/14584591955841728614noreply@blogger.com0tag:blogger.com,1999:blog-9036249095361947519.post-48410702307790696272007-06-15T01:50:00.000-07:002007-06-20T07:29:09.084-07:00Actionscript 3 Dashed LineSome code to draw dashed lines.<br /><br /><pre><span style="color: rgb(255, 0, 0);">public static function</span> dashLine<b><span style="color: rgb(102, 0, 153);">(</span></b>g<b><span style="color: rgb(102, 0, 153);">:</span></b>Graphics<b><span style="color: rgb(102, 0, 153);">,</span></b>x1<b><span style="color: rgb(102, 0, 153);">:</span></b><span style="color: rgb(0, 0, 255);">Number</span><b><span style="color: rgb(102, 0, 153);">,</span></b>y1<b><span style="color: rgb(102, 0, 153);">:</span></b><span style="color: rgb(0, 0, 255);">Number</span><b><span style="color: rgb(102, 0, 153);">,</span></b>x2<b><span style="color: rgb(102, 0, 153);">:</span></b><span style="color: rgb(0, 0, 255);">Number</span><b><span style="color: rgb(102, 0, 153);">,</span></b>y2<b><span style="color: rgb(102, 0, 153);">:</span></b><span style="color: rgb(0, 0, 255);">Number</span><b><span style="color: rgb(102, 0, 153);">,</span></b>onLength<b><span style="color: rgb(102, 0, 153);">:</span></b><span style="color: rgb(0, 0, 255);">Number</span><b><span style="color: rgb(102, 0, 153);"> =</span></b><span style="color: rgb(255, 102, 0);"> 0</span><b><span style="color: rgb(102, 0, 153);">,</span></b>offLength<b><span style="color: rgb(102, 0, 153);">:</span></b><span style="color: rgb(0, 0, 255);">Number</span><b><span style="color: rgb(102, 0, 153);"> =</span></b><span style="color: rgb(255, 102, 0);"> 0</span><b><span style="color: rgb(102, 0, 153);">):</span></b><span style="color: rgb(255, 0, 0);">void</span><b><span style="color: rgb(102, 0, 153);"> {</span></b><br />g<b><span style="color: rgb(102, 0, 153);">.</span></b><span style="color: rgb(0, 0, 255);">moveTo</span><b><span style="color: rgb(102, 0, 153);">(</span></b>x1<b><span style="color: rgb(102, 0, 153);">,</span></b>y1<b><span style="color: rgb(102, 0, 153);">);</span></b><span style="color: rgb(255, 0, 0);"><br />if</span><b><span style="color: rgb(102, 0, 153);"> (</span></b>offLength<b><span style="color: rgb(102, 0, 153);">==</span></b><span style="color: rgb(255, 102, 0);">0</span><b><span style="color: rgb(102, 0, 153);">) {</span></b><br /> g<b><span style="color: rgb(102, 0, 153);">.</span></b><span style="color: rgb(0, 0, 255);">lineTo</span><b><span style="color: rgb(102, 0, 153);">(</span></b>x2<b><span style="color: rgb(102, 0, 153);">,</span></b>y2<b><span style="color: rgb(102, 0, 153);">);</span></b><span style="color: rgb(255, 0, 0);"><br /> return</span><b><span style="color: rgb(102, 0, 153);">;<br />}</span></b><span style="color: rgb(255, 0, 0);"><br /><br />var</span> dx<b><span style="color: rgb(102, 0, 153);">:</span></b><span style="color: rgb(0, 0, 255);">Number</span><b><span style="color: rgb(102, 0, 153);"> =</span></b> x2<b><span style="color: rgb(102, 0, 153);">-</span></b>x1<b><span style="color: rgb(102, 0, 153);">,</span></b><br /> dy<b><span style="color: rgb(102, 0, 153);">:</span></b><span style="color: rgb(0, 0, 255);">Number</span><b><span style="color: rgb(102, 0, 153);"> =</span></b> y2<b><span style="color: rgb(102, 0, 153);">-</span></b>y1<b><span style="color: rgb(102, 0, 153);">,</span></b><br /> lineLen<b><span style="color: rgb(102, 0, 153);">:</span></b><span style="color: rgb(0, 0, 255);">Number</span><b><span style="color: rgb(102, 0, 153);"> =</span></b><span style="color: rgb(0, 0, 255);"> Math</span><b><span style="color: rgb(102, 0, 153);">.</span></b><span style="color: rgb(0, 0, 255);">sqrt</span><b><span style="color: rgb(102, 0, 153);">(</span></b>dx<b><span style="color: rgb(102, 0, 153);">*</span></b>dx<b><span style="color: rgb(102, 0, 153);"> +</span></b> dy<b><span style="color: rgb(102, 0, 153);">*</span></b>dy<b><span style="color: rgb(102, 0, 153);">),</span></b><br /> angle<b><span style="color: rgb(102, 0, 153);">:</span></b><span style="color: rgb(0, 0, 255);">Number</span><b><span style="color: rgb(102, 0, 153);"> =</span></b><span style="color: rgb(0, 0, 255);"> Math</span><b><span style="color: rgb(102, 0, 153);">.</span></b><span style="color: rgb(0, 0, 255);">atan2</span><b><span style="color: rgb(102, 0, 153);">(</span></b>dy<b><span style="color: rgb(102, 0, 153);">,</span></b> dx<b><span style="color: rgb(102, 0, 153);">),</span></b><br /> cosAngle<b><span style="color: rgb(102, 0, 153);">:</span></b><span style="color: rgb(0, 0, 255);">Number</span><b><span style="color: rgb(102, 0, 153);"> =</span></b><span style="color: rgb(0, 0, 255);"> Math</span><b><span style="color: rgb(102, 0, 153);">.</span></b><span style="color: rgb(0, 0, 255);">cos</span><b><span style="color: rgb(102, 0, 153);">(</span></b>angle<b><span style="color: rgb(102, 0, 153);">),</span></b><br /> sinAngle<b><span style="color: rgb(102, 0, 153);">:</span></b><span style="color: rgb(0, 0, 255);">Number</span><b><span style="color: rgb(102, 0, 153);"> =</span></b><span style="color: rgb(0, 0, 255);"> Math</span><b><span style="color: rgb(102, 0, 153);">.</span></b><span style="color: rgb(0, 0, 255);">sin</span><b><span style="color: rgb(102, 0, 153);">(</span></b>angle<b><span style="color: rgb(102, 0, 153);">),</span></b><br /> ondx<b><span style="color: rgb(102, 0, 153);">:</span></b><span style="color: rgb(0, 0, 255);">Number</span><b><span style="color: rgb(102, 0, 153);"> =</span></b> cosAngle<b><span style="color: rgb(102, 0, 153);">*</span></b>onLength<b><span style="color: rgb(102, 0, 153);">,</span></b><br /> ondy<b><span style="color: rgb(102, 0, 153);">:</span></b><span style="color: rgb(0, 0, 255);">Number</span><b><span style="color: rgb(102, 0, 153);"> =</span></b> sinAngle<b><span style="color: rgb(102, 0, 153);">*</span></b>onLength<b><span style="color: rgb(102, 0, 153);">,</span></b><br /> offdx<b><span style="color: rgb(102, 0, 153);">:</span></b><span style="color: rgb(0, 0, 255);">Number</span><b><span style="color: rgb(102, 0, 153);"> =</span></b> cosAngle<b><span style="color: rgb(102, 0, 153);">*</span></b>offLength<b><span style="color: rgb(102, 0, 153);">,</span></b><br /> offdy<b><span style="color: rgb(102, 0, 153);">:</span></b><span style="color: rgb(0, 0, 255);">Number</span><b><span style="color: rgb(102, 0, 153);"> =</span></b> sinAngle<b><span style="color: rgb(102, 0, 153);">*</span></b>offLength<b><span style="color: rgb(102, 0, 153);">,</span></b><br /><br /> x<b><span style="color: rgb(102, 0, 153);">:</span></b><span style="color: rgb(0, 0, 255);">Number</span><b><span style="color: rgb(102, 0, 153);"> =</span></b> x1<b><span style="color: rgb(102, 0, 153);">,</span></b><br /> y<b><span style="color: rgb(102, 0, 153);">:</span></b><span style="color: rgb(0, 0, 255);">Number</span><b><span style="color: rgb(102, 0, 153);"> =</span></b> y1<b><span style="color: rgb(102, 0, 153);">;</span></b><span style="color: rgb(255, 0, 0);"><br /><br /><br />var</span> fullDashCountNumber<b><span style="color: rgb(102, 0, 153);">:</span></b><span style="color: rgb(0, 0, 255);">int</span><b><span style="color: rgb(102, 0, 153);"> =</span></b><span style="color: rgb(0, 0, 255);"> Math</span><b><span style="color: rgb(102, 0, 153);">.</span></b><span style="color: rgb(0, 0, 255);">floor</span><b><span style="color: rgb(102, 0, 153);">(</span></b>lineLen<b><span style="color: rgb(102, 0, 153);">/(</span></b>onLength<b><span style="color: rgb(102, 0, 153);">+</span></b>offLength<b><span style="color: rgb(102, 0, 153);">));</span></b><span style="color: rgb(255, 0, 0);"><br /><br />for</span><b><span style="color: rgb(102, 0, 153);"> (</span></b><span style="color: rgb(255, 0, 0);">var</span> i<b><span style="color: rgb(102, 0, 153);">:</span></b><span style="color: rgb(0, 0, 255);">int</span><b><span style="color: rgb(102, 0, 153);">=</span></b><span style="color: rgb(255, 102, 0);">0</span><b><span style="color: rgb(102, 0, 153);">;</span></b> i<b><span style="color: rgb(102, 0, 153);"><</span></b>fullDashCountNumber<b><span style="color: rgb(102, 0, 153);">;</span></b> i<b><span style="color: rgb(102, 0, 153);">++){</span></b><br /><span><span style="color: rgb(255, 0, 0);"> </span></span><span><span style="color: rgb(255, 0, 0);"> </span></span>g<b><span style="color: rgb(102, 0, 153);">.</span></b><span style="color: rgb(0, 0, 255);">lineTo</span><b><span style="color: rgb(102, 0, 153);">(</span></b>x<b><span style="color: rgb(102, 0, 153);">+=</span></b>ondx<b><span style="color: rgb(102, 0, 153);">,</span></b>y<b><span style="color: rgb(102, 0, 153);">+=</span></b>ondy<b><span style="color: rgb(102, 0, 153);">);</span></b><br /><span><span style="color: rgb(255, 0, 0);"> </span></span>g<b><span style="color: rgb(102, 0, 153);">.</span></b><span style="color: rgb(0, 0, 255);">moveTo</span><b><span style="color: rgb(102, 0, 153);">(</span></b>x<b><span style="color: rgb(102, 0, 153);">+=</span></b>offdx<b><span style="color: rgb(102, 0, 153);">,</span></b>y<b><span style="color: rgb(102, 0, 153);">+=</span></b>offdy<b><span style="color: rgb(102, 0, 153);">);<br /></span></b><span><span style="color: rgb(255, 0, 0);"> </span></span><b><span style="color: rgb(102, 0, 153);">}</span></b><span style="color: rgb(255, 0, 0);"><br /><br /></span><span><span style="color: rgb(255, 0, 0);"> </span></span><span style="color: rgb(255, 0, 0);">var</span> remainder<b><span style="color: rgb(102, 0, 153);">:</span></b><span style="color: rgb(0, 0, 255);">Number</span><b><span style="color: rgb(102, 0, 153);"> =</span></b> lineLen<b><span style="color: rgb(102, 0, 153);"> - ((</span></b>onLength<b><span style="color: rgb(102, 0, 153);">+</span></b>offLength<b><span style="color: rgb(102, 0, 153);">)*</span></b>fullDashCountNumber<b><span style="color: rgb(102, 0, 153);">);</span></b><span style="color: rgb(255, 0, 0);"><br /><br /></span><span><span style="color: rgb(255, 0, 0);"> </span></span><span style="color: rgb(255, 0, 0);">if</span><b><span style="color: rgb(102, 0, 153);"> (</span></b>remainder<b><span style="color: rgb(102, 0, 153);">>=</span></b>onLength<b><span style="color: rgb(102, 0, 153);">) {</span></b><br /><span><span style="color: rgb(255, 0, 0);"> </span></span>g<b><span style="color: rgb(102, 0, 153);">.</span></b><span style="color: rgb(0, 0, 255);">lineTo</span><b><span style="color: rgb(102, 0, 153);">(</span></b>x<b><span style="color: rgb(102, 0, 153);">+=</span></b>ondx<b><span style="color: rgb(102, 0, 153);">,</span></b>y<b><span style="color: rgb(102, 0, 153);">+=</span></b>ondy<b><span style="color: rgb(102, 0, 153);">);<br /></span></b><span><span style="color: rgb(255, 0, 0);"> </span></span><b><span style="color: rgb(102, 0, 153);">}</span></b><span style="color: rgb(255, 0, 0);"> else</span><b><span style="color: rgb(102, 0, 153);"> {</span></b><br /><span><span style="color: rgb(255, 0, 0);"> </span></span><span><span style="color: rgb(255, 0, 0);"> </span></span>g<b><span style="color: rgb(102, 0, 153);">.</span></b><span style="color: rgb(0, 0, 255);">lineTo</span><b><span style="color: rgb(102, 0, 153);">(</span></b>x2<b><span style="color: rgb(102, 0, 153);">,</span></b>y2<b><span style="color: rgb(102, 0, 153);">);<br /></span></b><span><span style="color: rgb(255, 0, 0);"> </span></span><b><span style="color: rgb(102, 0, 153);">}<br />}</span></b><br /></pre>rjehttp://www.blogger.com/profile/14584591955841728614noreply@blogger.com11