I am sure some of you are wondering what this ray casting thing I am talking about is. Essentially it is like ray tracing except with only one ray per column of pixels instead of one ray per pixel. So the next questions would have to be what is ray tracing and what are the advantages of ray casting over ray tracing.
Ray Tracing is one of the oldest forms of 3D graphics generation. The concept is simple. What we see is made up of light. This light comes from one or more light sources and bounces off objects that absorb some of the lights energy causing it to change color. Eventually the light reaches our eyes where we see the results. Some brilliant person came up with the idea of doing this process in reverse. If you start from the eyeball, you can mathematically work out the path of the light as it travels through the world and trace the route the ray of light took back to it's original light source. By doing this, you can generate incredibly realistic looking images. The down side to this is that there are an awful lot of calculations, and the more complex the objects in the scene the more calculations have to be performed.
The advantage ray casting has is that it is done in a much simpler environment. In fact, it is often done on two dimensional maps that get projected into three dimensions. Because the geometry being calculated is so much more predictable, the amount of calculations that have to be performed are drastically reduced. In fact, ray casting can be done fast enough that it can be used for a game without requiring any 3D hardware support. When you are using Flash, at least as of Flash 9, you don't have 3D hardware support or for that matter any type of standard 3D library. The popularity of open source Flash 3D libraries is growing so eventually Adobe may finally add 3D support. I know for a fact this is a feature that a lot of developers have asked for. Until there is proper 3D support in Flash, all 3D will have to be done in software which means that the speed will be significantly slower meaning that the experience won't be anything like you could achieve if you had hardware 3D support.
Tuesday, September 11, 2007
Monday, September 10, 2007
Cruel Weekend
The weekend was a failure for my work on Dozen Days of Dice. While I easily finished the original game I conceived, it just wasn't fun enough. Meanwhile, my plans for Coffee Quest Revenge have changed and progress is finally being made.
I really need to write a proper explanation about what I am doing with Dozen Days of dice. The detailed explanation can wait for another day, but the short summary is that I am doing a series of Game in a Day challenges. I am doing one challenge on every weekend I don't have other plans for. While ideally all twelve games in a series should be done over a block of 12 days, right now that isn't practical, so weekends will have to do. While I could release the game I did finish, I instead am going to cheat and declare it a bonus game. It will be used as filler for when I don't have a game ready to release.
The story behind Coffee Quest Revenge is quite interesting. While I was going to do the 3D stuff using Papervision 3D, I was having too much problems getting what I needed to do working. It is certainly possible that what I wanted to do could be done, I don't know the library well enough yet. I keep running into culling issues for which I suspect the solution would be to write a new camera that automatically subdivides partially culled triangles instead of removing them. Of course I would have to familiarize myself with the source code before undertaking such a task, so instead I opted to port my existing ray casting code over to flash.
The existing ray casting code is designed for a step based game not for 360 degrees of freedom. Still, I had started making a 360 degree ray caster for the ultimate retro project so I figured if I could fix the issues I was having with that version it would be simple to port that code over to flash. When I started looking at the code, my mind lead me to a potentially better way of doing the casting. As this was a new algorithm I figured I would do the initial tests of this algorithm as part of the Coffee Quest Revenge. It has been a while since I released a build of CQR so if you go to http://blazinggames.com/games/coming/ you will see the 5th build which features a test over top of the auto map of the casting. I should point out that this is pre-alpha software and it is kind of fragile. The cursor key movement seems to work fine on Windows but the Mac doesn't seem to automatically repeat keys. Likewise, clicking on the auto map captures the keyboard causing the keyboard keys to stop working.
I really need to write a proper explanation about what I am doing with Dozen Days of dice. The detailed explanation can wait for another day, but the short summary is that I am doing a series of Game in a Day challenges. I am doing one challenge on every weekend I don't have other plans for. While ideally all twelve games in a series should be done over a block of 12 days, right now that isn't practical, so weekends will have to do. While I could release the game I did finish, I instead am going to cheat and declare it a bonus game. It will be used as filler for when I don't have a game ready to release.
The story behind Coffee Quest Revenge is quite interesting. While I was going to do the 3D stuff using Papervision 3D, I was having too much problems getting what I needed to do working. It is certainly possible that what I wanted to do could be done, I don't know the library well enough yet. I keep running into culling issues for which I suspect the solution would be to write a new camera that automatically subdivides partially culled triangles instead of removing them. Of course I would have to familiarize myself with the source code before undertaking such a task, so instead I opted to port my existing ray casting code over to flash.
The existing ray casting code is designed for a step based game not for 360 degrees of freedom. Still, I had started making a 360 degree ray caster for the ultimate retro project so I figured if I could fix the issues I was having with that version it would be simple to port that code over to flash. When I started looking at the code, my mind lead me to a potentially better way of doing the casting. As this was a new algorithm I figured I would do the initial tests of this algorithm as part of the Coffee Quest Revenge. It has been a while since I released a build of CQR so if you go to http://blazinggames.com/games/coming/ you will see the 5th build which features a test over top of the auto map of the casting. I should point out that this is pre-alpha software and it is kind of fragile. The cursor key movement seems to work fine on Windows but the Mac doesn't seem to automatically repeat keys. Likewise, clicking on the auto map captures the keyboard causing the keyboard keys to stop working.
Friday, September 7, 2007
One of those Weeks episode 17: The Puzzle solution
Once you have picked up all the pieces, the next step is to assemble the pieces. On the beach you will notice a spot in the middle of the screen. This is where the pieces are assembled. You have a fairly simple jig-saw puzzle. All the pieces are in their final orientation so no rotation of the pieces are necessary. Picking up and placing the pieces is fairly easy, though the program can occasionally be fussy about the exact placement of the pieces.
The whole purpose of a puzzle is to figure out how to assemble the puzzle yourself. That being said, for the sake of completeness here is the official solution to the puzzle.

As I know the official solution to the puzzle I never bothered trying other solutions. The game determines if the puzzle is compete not by looking at piece location but by checking to see if the surface area is entirely covered so it may be possible to solve the puzzle other ways than the above solution. If you have an alternative solution, I would love to hear about it.
The whole purpose of a puzzle is to figure out how to assemble the puzzle yourself. That being said, for the sake of completeness here is the official solution to the puzzle.

As I know the official solution to the puzzle I never bothered trying other solutions. The game determines if the puzzle is compete not by looking at piece location but by checking to see if the surface area is entirely covered so it may be possible to solve the puzzle other ways than the above solution. If you have an alternative solution, I would love to hear about it.
Wednesday, September 5, 2007
FLOSS - The GPL
The GPL (General Public License) is one of the longer licenses though all this legalize is needed in order to enforce the one primary purpose of this license. This license is designed to force people to share the source code. If you use GPL code in one of your projects then unless you have permission from the original owner of that code you need to release your source code under the GPL. Why should you have to release your source code? That is the cost of using the GPL licensed code. If you don't want to release your code don't use GPL licensed code in your program. Very simple, I don't see any issues. After all, if you are building your program on top of potentially hundreds of thousands of hours worth of other people's time, you have no right to expect them to let you use their work without any compensation. The compensation for their time is that any changes get released to the community.
If you have no intentions of changing the source code, then you have no problem at all. If you are just tinkering with the code and have no plans to release your experiments then you also don't have to worry about the license. If you are a huge corporation who want source code but don't want to pay programmers to write that source code for you, then you are going to either have to release your source code or find some BSD-like licensed program and make your changes to that as then you can keep your improvements to yourself.
One of the arguments against the GPL that boggles my mind is that it is a viral license. While it is true that any source code I release under the GPL stays under the GPL until the copyrights expire, I am still the copyright holder of any code that I write. If I want to then use my code in a non GPL project I am certainly within my rights to do so and nothing in the GPL prevents me from doing so. In fact, if I own all the code within a GPL project, I can decide to change the license of the project for any future release. While the source code for the last release is still available and under the GPL and can be forked by other people who may not like the new license I am moving my project to, the official version would be under the new license. So the only time GPL is viral is when you are using other people's GPL code and if you are using other people's work you have no right to complain.
If you have no intentions of changing the source code, then you have no problem at all. If you are just tinkering with the code and have no plans to release your experiments then you also don't have to worry about the license. If you are a huge corporation who want source code but don't want to pay programmers to write that source code for you, then you are going to either have to release your source code or find some BSD-like licensed program and make your changes to that as then you can keep your improvements to yourself.
One of the arguments against the GPL that boggles my mind is that it is a viral license. While it is true that any source code I release under the GPL stays under the GPL until the copyrights expire, I am still the copyright holder of any code that I write. If I want to then use my code in a non GPL project I am certainly within my rights to do so and nothing in the GPL prevents me from doing so. In fact, if I own all the code within a GPL project, I can decide to change the license of the project for any future release. While the source code for the last release is still available and under the GPL and can be forked by other people who may not like the new license I am moving my project to, the official version would be under the new license. So the only time GPL is viral is when you are using other people's GPL code and if you are using other people's work you have no right to complain.
Tuesday, September 4, 2007
One of those Weeks Episode 17 Beach Map
There are not too many people who read this blog, which probably is not that surprising considering that I don't do any type of promotion at all. The thing is that the people who do bother reading this must either be very interested in game development or in Blazing Games. For that reason, I have decided that from now on all of my articles will be released here before they make their way to Blazing Games. Many of them will be written here as well. Because most visitors to Blazing Games don't really like the articles, I am going to start combining the articles with other releases whenever possible. Let's start off the trend by starting writing chapter 17 of Making of One of those Weeks.
As this episode is the first episode of a new day, the episode is a dream sequence. This sequence is really broken into two different segments. The first half of the episode is finding the pieces necessary to assemble the second part of the game. The map is a very logical and simple map. What is tricky is that the pieces are all protected by Mr. Puck's Former Guardian. If anybody reading this doesn't know what I am talking about, you should either play through the previous day's episodes or read through the chapters of the book related to day two.
What may not be apparent is that there is one piece that is not protected by the guardian. Once you have picked up that piece (which moves the piece to the starting room) the guardian for the next piece disappears allowing you to gather another piece. This simply means that the pieces have to be gathered in a particular order. The map above shows you the proper order that you need to follow in order to gather all of the pieces.
As this episode is the first episode of a new day, the episode is a dream sequence. This sequence is really broken into two different segments. The first half of the episode is finding the pieces necessary to assemble the second part of the game. The map is a very logical and simple map. What is tricky is that the pieces are all protected by Mr. Puck's Former Guardian. If anybody reading this doesn't know what I am talking about, you should either play through the previous day's episodes or read through the chapters of the book related to day two.
What may not be apparent is that there is one piece that is not protected by the guardian. Once you have picked up that piece (which moves the piece to the starting room) the guardian for the next piece disappears allowing you to gather another piece. This simply means that the pieces have to be gathered in a particular order. The map above shows you the proper order that you need to follow in order to gather all of the pieces.
Monday, September 3, 2007
Salsa
I spent my Labour day helping my mother make multiple batches of salsa. This was worth the effort as I got a dozen jars of salsa out of the deal. When you take my normal consulting rate into account, each jar is worth $12.5. While that may sound like a lot, when you consider how much superior the homemade salsa is to anything you can buy in a store it was a bargain. This got me to thinking about why our society had devolved into one that worries more about quantity over quality. Looking at how many projects I have on the go at the moment, I certainly am no better than anybody else, though I am trying to finish off all my outstanding projects so I can focus on only a couple of personal projects and whatever I am being paid to do.
Sunday, September 2, 2007
Article project thoughts
It is IPE time in Armstrong, not to mention the labour day long weekend. I am still trying to decide what my policy on posting chapters from Making of One of those Weeks on the blog should be. The one problem with the Making of One of those Weeks eBook is the simple fact that the chapters are written well after the work has been done. I have made notes for some of the newer episodes but for another project I am working on I decided to write a diary which was updated as I made changes to the project. I think it worked quite well and am thinking that I will release the diary at the same time as the open source release of that episode is done. Though I am also considering releasing it earlier here. I am not sure if it matters as not too many people read this, or for that matter read the making of articles. I really am considering combining my article project with this blog. If anybody has thoughts on this, feel free to email me or post a comment.
Subscribe to:
Posts (Atom)
