Showing posts with label Flex. Show all posts
Showing posts with label Flex. Show all posts

Sunday, October 12, 2008

An annoying Flash issue

While I am doing a lot of Flex development, I plan on still using Flash for the creation of animations. More importantly, my One of those Weeks series is being developed in Flash. There are only a few episodes left so there really is no point in moving that series to Flex. Flash and Flex are very similar, which is not surprising as they both produce code that is run in the Flash Player. Flex, however, is entirely driven by text files. While FlexBuilder has a graphical editor that helps you layout stuff, all the GUI work ends up being turned into an MXML file which is a text file. Graphics and other assets are separate files and can come from any tool. Flash, on the other hand, uses a binary format which embeds all the graphics. ActionScript code can be separate text files, which is what I have been doing.

When I was finishing up One of those Weeks episode 44, I came across a rather interesting bug. This was not really a bug in my code, but more of a quirk in the way that Flash handles animation. I had come across this quirk before so it didn't take me long to figure out what was going on. You see, when the player has solved the episode, there is a brief animation sequence that starts by zooming in on the background. Unfortunately, the background in this episode is scrollable by the user so the position of the background movie clip is changed by code. Flash, for some reason, does not handle hard-coded animations with symbols if that symbols location has been changed by ActionScript. The results were rather interesting, but not the ending sequence that I wanted.

Sadly, the only solutions were to use a different symbol for the animation or to do the animated sequence using ActionScript. If I was using Flex, the later approach probably would have been my approach from the outset. In Flash, though, it is easier to just create another symbol of the background and use that for the animated sequence. Actually, if I was doing this in Flex, I would have probably created a Flash .swf file that held all the assets and the end animation sequence would have just happened to be one of the assets as while Flex is much nicer for coding, Flash is way better at animation.

Thursday, August 7, 2008

Shut the Box is open for play

The final version of Shut the Box has been posted on Blazing Games. This posting includes the development diary that regular readers have had a sneak preview of. It also includes downloadable source code for anybody who wants to play around with the code. It was written in Flex so anybody who has a copy of the freely available Flex SDK can play around with my code.

There are still four games to go in the Dozen Days of Dice series and as with other games in this series, they will be completed in a day. That is to say that each game is finished in a single day, not that I will finish the last four games in a single day. I have no idea of when I will take a day to create episode 9 but it will probably be sometime this month. I will probably have early access to the design diary once I have written the game.

Thursday, June 12, 2008

Thirteen Spikes and the Flex decision

One of the nice things about this year's site format is the simple fact that most of the posting work for the weekly update is done on the first post of each month. This means that posting Thirteen Spikes Unlimited, which has just been posted, doesn't take too long. This is a good thing as this is one of the rare occasions when I was taken out for supper so I was late posting the site today. Because everything was ready to go, however, it only took minutes when I got home to post the update for this week.

While I know that you should never drink and blog, I am going to make an exception today as I do want to explain my Flex decision and think that since Thirteen Spikes Unlimited was created using only the freely available Flex3SDK and jEdit for editing. While the remainder of One of those Weeks will be created in Flash CS3 and the remainder of the Ultimate Retro Project will be finished using Java, future projects will be created using Flex. Flash will be used for asset creation but the projects themselves will be compilable using the freely available Flex3SDK. In a couple of years I will take another look at the browser landscape and possibly change my development direction, but right now I am going to be focusing on Flex development.

I have been playing around with a number of different languages and quite frankly am sick of having to shift my gears when switching between projects that are in different languages. Having all my work done in a single language makes my work easier. If a paying client wanted me to do some C++ or Java work for them then I would certainly do so but for Blazing Games and other programming I am doing in my spare time then the work will be done in Flex unless there is a very compelling reason to use a different language.

I really do not trust Microsoft, so even though Silverlight 2 has some really nice aspects to it unless I am being paid to use their platform I am not going to do so. Java still has a place in my heart but I feel that Sun just dropped the applet ball and FX is too little too late. Still, this is one case where I would like to be proven wrong. HTML 5 is no where near being a finalized standard so I might as well focus on Flex while I wait for it. Other browser based game development plug-ins simply do not have the installed base.

I have already pointed out numerous times that Flash CS3 is expensive, while Flex has a freely available SDK. Flex produces Flash output and I can still use Flash for the creation of assets and animation.

Thursday, June 5, 2008

June starts out with a dozen days of dice

The Blazing Games site has been updated and the schedule for the month has now officially been posted. The first game to be posted this month is actually two. Episodes 5 and 6 of the Dozen Days of Dice are being released as open source. More importantly, all future episodes, which will return to a monthly release schedule, will be open source from the outset. The games will be shifting from being developed in Flash CS3 to being developed in Flex and being compilable with the freely available Flex3SDK. The reason for this shift is the simple reasons that a free tool (that is also open source) is available to everyone who wants to use it while Flash CS3+ is an expensive package that not everyone can afford. In addition, Flex is entirely text based which is much nicer to work with for open source projects.

The second week of the month is the release of Thirteen Spikes Unlimited. This game is also going to be released as open source from the onset. It is also going to be developed over more than one release. In fact, the version being released is the 0.2.0 release, and simply consists of the playable unlimited mode of the game. Future releases will add skinable graphics, campaigns, and a construction set. In case you didn't guess, all the future releases have a Friday the 13th release date.

The third game for June is episode 39 of One of those Weeks. It is my last Flash CS3 project, with all my future projects being developed in Flex using Flash for asset and animation.

The final game for June is the classic version of Monster Hunt. It is part of my Ultimate Retro project which is my last Java project. That being said, JavaFX is suppose to be released this fall so it is always possible that I will choose Java for some future projects. CQ Fans should note that CQ5, as it currently stands, is being developed in Flex but that is all I will say about it until this fall.

Sunday, May 4, 2008

Spiking mxmlc

First, the ultimate retro project repository has just been updated and now contains a playable version of Classic Monster Hunt. I still haven't wrote the instructions and I still want to clean up the code a bit but it is fully playable at this point. That being said, I didn't spend that much time today working on it but instead spent my time playing with mxmlc.

For those of you who don't know what mxmlc is, it is the command line compiler that is included with the freely available Flex 3 SDK. While it is certainly much nicer to use Flash CS3 or FlexBuilder to create swf files, both those options cost money and since I want my open source releases to be usable without the requirement of expensive tools I wanted to see how much work it would be to create a game without the expensive tools. I have taken some baby steps by trying to keep my source code outside of my flash file. With 13 Spikes, however, I am creating the entire game using the command line compiler and a text editor. For those who are curious, I am using jEdit for my editor.

Using the command line compiler and debugger is not that difficult, so anybody who wants to create flash applications but don't have any money certainly could handle it. The thing that is not made as clear as it should be is the fact that you do not need to create a flex program to use mxmlc but can instead write your program entirely in ActionScript 3. In fact, if you do not need the flex library you might be better off without using mxml as there is a bit of an overhead for the flex libraries.

I can't say that my first few hours of only using a text editor and command line tools was not as productive as it should have been as I had a lot of problems getting my Spike sprite class to work properly. This was my first attempt at overriding the Sprite class as I normally use the MovieClip class but sprites are suppose to be much more efficient. My problem was that I was trying to set the width and height of the sprite. Why that would stop the sprite from drawing itself is beyond me, but once I removed the code that set the width and height of the sprite it started working fine. It appears that width and height are internally used, as once the sprite was drawing, printing out the sprites width and height came back with the size of the object that I was drawing.

Thursday, May 1, 2008

Open Screen Project

I am writing and posting this early so Blazing Games has not been updated yet though I will be doing that this evening. I am going to be delaying my Light Box strategy guide again as there has been a rather interesting announcement today from Adobe. The Open Screen Project ( http://www.adobe.com/openscreenproject/ ) is the continuation of Adobe's open sourcing of Flash. The biggest part of the announcement, at least to me, is the removal of restrictions on the use of the SWF specification. SWF is the binary format that Flash and Flex compile into. The specifications for this format have been available for a long time (since Flash 3 if my memory serves me correctly) but the licensing agreement in order to use this specification did not allow the licensor to create their own player. This meant that an open source player, such as Gnash, were not able to use the official specifications but instead had to create their players using reverse engineering techniques making the work take significantly longer and reducing compatibility.

The reason that I am using flash for a good number of my games, and once the Ultimate Retro project is finished will probably develop all of my client side games in Flash/Flex, is because it is currently the best solution for rich internet applications. My biggest concern with Flash has always been the fact that it was controlled by a single company. Now that the specifications no longer have restrictions, this is no longer a fear. I know that some people will argue that Microsoft Silverlight is technically superior, I really do not trust Microsoft with a cross-platform standard as they tend to want to force people to use their Windows operating system. Sure they are supporting Macs right now and not threatening the Moonlight project, but that could change if Silverlight no longer had viable competition.

By having the open specification for SWF, I no longer have to worry about Adobe abandoning Flash/Flex (not that it was that likely at this point) so can develop my games without having to worry too much about them suddenly not working in the future. My only complaint at this time is the lack of proper 3D hardware support in Flash. While projects like Papervision 3D are quite impressive with what they can do using software 3D, support for an open 3D standard like OpenGL ES would greatly increase the power of Flash. That, of course, is a different rant which I have made before.

I should also probably point out that in addition to removing the restrictions from the SWF format, the FLV format was also released as was the Flash Cast protocol and the AMF protocol. Finally, Adobe is going to be removing licensing fees in the next major release of Flash Player and Adobe AIR for devices meaning that Flash should be appearing on a lot more mobile platforms. From a Flash/Flex game developer's perspective, this is indeed great news today.

Thursday, April 10, 2008

Dozen Day Plans

Before I get to the bulk of this post, I'll just let you know that Classic Light Box has been posted on Blazing Games. I don't know if I would consider this entry as an article, more like an update on the plans for Blazing Games. In particular, I am going to give some heads up details on what I am planning on doing with my Dozen Days series.

At the start of 2008 I was going to use the dozen days project as a monthly game release that would be developed live on the site. Two episodes were developed live on the site, but there seemed to be very little interest in the live aspects of the release. When you add the fact that developing the game live adds addition stress to an already stressful development the lack of interest makes doing the episodes live not worth the effort. More to the point, when I did the second live game, I did so when I was sick and had a really hard time doing it with the easy game taking twice as long to write as it should have. Had there not been a live aspect to the development, I could have simply put off the development by a week or two and done the proper thing by taking the day off.

As regular visitors already know, I am currently spending Sunday afternoon working on Ultimate Retro Project and at the moment development on those episodes are on fire! This means that I am filling up all of my Friday release slots at a rapid rate so don't really need to have any Dozen Days episodes. I have also decided that keeping the source code closed for a game in a day project does not make that much sense and all future releases of Dozen Days episodes will have the source code as part of the release. That being said, for the next three months I am going to be releasing the source code and diaries for the first 6 episodes!

The first six episodes were developed using Flash CS3, which is not the most open source format to use due to the fact that Flash CS3 is an expensive tool. That is why I am going to be making a transition from Flash over to writing pure ActionScript 3 games that can be compiled using the freely available Flex 3 SDK. Vector graphics and animations will probably still be created in Flash CS3 but because those assets are strictly artwork resources it would be easy for somebody to replace them without needing an expensive tool.

Before I make the switch for Dozen Days work (which will happen with the development of the official seventh episode even though technically it is the eighth episode created for Dozen Days of Dice) I am going to first create a different game using the Flex 3 SDK for compiling the game. This game is going to be an updated version of Thirteen Spikes. Obviously, I have great hope that this game will be finished before June 13 for reasons obvious to anybody who owns a calendar.

After June I am hoping to release new episodes of Dozen Days every month or so and will probably have sneak previews of those games available for readers of this blog.

Monday, February 25, 2008

AIR has finally been released.

While this may not be an important thing to most people, Adobe's AIR has been released. I found out about it from http://www.mikechambers.com/blog/2008/02/24/adobe-air-10-thank-you/ as I was following the development. AIR lets you create flash/flex/ajax/html applications that will run on the desktop without the need to run in a browser or be connected to the internet. The best part is that the software development kit is being released for free so anybody can create air applications without a large cost. Obviously, tools such as FlexBuilder, DreamWeaver, and Flash will greatly aid in the development of AIR applications. I am currently developing One of those Weeks in flash for the web, but it would not be inconceivable for me to later create a downloadable AIR version of the entire game. Flex 3 also was released today. It too has a free SDK and it allows you to create flex/flash applets.

Wednesday, June 20, 2007

One of those Weeks

Tomorrow evening I put together the final tally of the One of those Weeks related site poll. This poll is actually going to be more important than voters expect, and is a really close vote so if you haven't voted yet go to BlazingGames.com and cast your vote. At the same time as the results are announced, you will be able to play the final episode of Day 4.

Episode 28 is a special episode as it is the last episode that is going to be compiled for the Flash 7 player. Day 5 is going to be using ActionScript 3 and will require Flash Player 9. While it would certainly be possible to keep the rest of the series in Flash 7, ActionScript 3 is different enough from ActionScript 2 that I really don't want to have to worry about which version of Flash I am working on so all my Flash projects are going to be written in ActionScript 3 and therefore will require Flash Player 9. I don't think this is a big deal as most people can run Flash 9. The few of you who can't, well, I apologize but it is the logical path to take.

I suspect that future entries will cover a bunch of the migration issues and some of the nice features that Flash 9 has. I actually like Flash CS3, though still wish that the code editor was better. If Adobe were to drop the price of FlexBuilder when version 3 was released, I would really consider getting it and using it for my code editing while using Flash CS3 for all my animation work. At the current price level, however, I really can't justify the cost. I should also point out that FlexBuilder is different from Flex SDK (which is free).

Monday, June 11, 2007

Airing out my thoughts

I was going to talk about how tiles work, but the final episode of the Sopranos pissed me off so much that I will talk about that instead. Just kidding. Though I am not going to talk about tiles today, it is because of Adobe, not HBO. There are two things released today that should be of interest to game developers. These are Apollo and Flex 3.

Apollo, which has now been renamed AIR (Adobe Integrated Runtime) is a way of developing internet content that can also be used off line. You can create applications that run on the desktop but are built using Flash (or Flex) HTML and Acrobat. For me this is a great move forward as I would be able to have games that are entirely playable online (for people who don't like downloading things) while having extended versions of the same game that the player can download. The nice thing is that the air program would have (with the user's permission) access to the file system so game saves would be possible. Writing a level editor would also be possible. More information about AIR can be found at http://labs.adobe.com/technologies/air/.

The other interesting thing that was released is the beta version of Flex 3. While I am sure that FlexBuilder3 will remain the overpriced tool that FlexBuilder2 is, The Flex3SDK will be open source. This effectively means that you will still be able to create Flash files for free, though you obviously will have a more difficult time doing so than people using the FlexBuilder3 or Flash CS3 tools would have. One of the key points is that it will be compatible with air. If you want to get into Flash development but don't have money then this is probably a really good option. The link for this is http://labs.adobe.com/technologies/flex/ .

Friday, April 27, 2007

Flex SDK now Open Source

Yesterday Adobe released their Flex SDK under an open source license. The license they chose was the Mozilla Public License (MPL), which is a fairly common license but is not GPL compatible. The license is more corporate-freindly than GPL, which is probably the reason for this choice. As the Flex SDK has been free since Flex 2 was released, this may not seem like that big of deal. What it does do is confirm that the Flex SDK will always remain free.

For those of you who are not familiar with what Flex is, it is a pure code-oriented way of creating Flash content. Flex projects consist of MXML files which is an XML-based layout language. Putting together a flex application is done in a similar way to creating a web page. That being said, flex supports ActionScript 3, so you can also use the SDK to compile ActionScript files. All of this code can be created in a text editor, though Adobe has a commercial tool called FlexBuilder that gives you a graphical way of putting together Flex applications.

Now that I own a copy of Flash CS3, I really don't need to use the SDK to create ActionScript 3 programs anymore, but I do still plan on keeping my code in separate files so that when I do Open Source my projects, people will be able to use the free Flex SDK to build and modify my code. Having the SDK free gives me added security as I know that if Microsoft does somehow manage to kill Adobe, Flash could still survive without them.

The Flash 9 player is still closed source. As the output of the Flex SDK is a file that requires the Flash player, some people may argue that open sourcing the Flex SDK is nothing more than a gesture. While I personally would like the Flash player to be released as open source as well, I know from my Java experiences that having multiple vendors creating versions of a platform leads to incompatibility problems so I personally don't mind that there is only one official source for the Flash player. That being said, there are open source alternatives to the Flash player, with the biggest one being Gnash which is aiming to be compatible with Flash 7, though I suspect they will eventually support Flash 9.

Monday, April 16, 2007

CS3

I am now waiting for notice that my pre-ordered copy of Adobe's Creative Suite 3 Web Premium to ship now that it has been released. I am hoping that it arrives before the weekend so I can get the next episode of One of those Weeks finished. I am going to strictly work on ActionScript 3 from now on, though may make an exception for OotW if I don't have CS3 by the end of the week.

CS3 is a very expensive program which is why I an glad that I am eligible for the upgrade. The best part of the new suite, at least from my perspective, is going to be Flash CS3. This will allow the development of Flash Player 9 content without all the hassle of using the free Flex SDK. People using the FlexBuilder have a much easier time of building Flash 9 programs, but with my small budget, I held off on getting it, and may decide to forgo getting it if Flash CS3 meets my programming needs adequately.

My thoughts is to use .fla files only as a container for artwork and animations, while having all the code in external text files. Ideally, I would want it compilable with the free Flex 2 SDK so the open source release can be modified without needing expensive tools, but we will see how feasible this is once I have CS3.